Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clinicaltrials
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
david Chavalarias
clinicaltrials
Commits
dee9ef99
Commit
dee9ef99
authored
Feb 06, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
additional image display in profile/claim_profile in input zone
parent
52989318
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
27 deletions
+58
-27
comex_page_claim_profile_controllers.js
static/js/comex_page_claim_profile_controllers.js
+11
-0
comex_page_profile_controllers.js
static/js/comex_page_profile_controllers.js
+13
-0
comex_user_shared.js
static/js/comex_user_shared.js
+28
-24
profile.html
templates/profile.html
+6
-3
No files found.
static/js/comex_page_claim_profile_controllers.js
View file @
dee9ef99
...
@@ -47,6 +47,17 @@ function selectSavedMenus(uinfo) {
...
@@ -47,6 +47,17 @@ function selectSavedMenus(uinfo) {
}
}
}
}
// also pre-setup for images
var
picShow
=
document
.
getElementById
(
'show_pic'
)
if
(
uinfo
.
pic_url
||
uinfo
.
pic_fname
)
{
if
(
uinfo
.
pic_url
)
{
cmxClt
.
uform
.
showPic
(
uinfo
.
pic_url
)
}
if
(
uinfo
.
pic_fname
)
{
cmxClt
.
uform
.
showPic
(
'/data/shared_user_img/'
+
uinfo
.
pic_fname
)
}
}
// the contents are conditioned on what return_user had in his info
// the contents are conditioned on what return_user had in his info
var
presentMtis
=
[]
var
presentMtis
=
[]
...
...
static/js/comex_page_profile_controllers.js
View file @
dee9ef99
...
@@ -38,6 +38,19 @@ function selectSavedMenus(uinfo) {
...
@@ -38,6 +38,19 @@ function selectSavedMenus(uinfo) {
}
}
}
}
// also pre-setup for images
var
picShow
=
document
.
getElementById
(
'show_pic'
)
if
(
uinfo
.
pic_url
||
uinfo
.
pic_fname
)
{
if
(
uinfo
.
pic_url
)
{
cmxClt
.
uform
.
showPic
(
uinfo
.
pic_url
)
}
if
(
uinfo
.
pic_fname
)
{
cmxClt
.
uform
.
showPic
(
'/data/shared_user_img/'
+
uinfo
.
pic_fname
)
}
}
// initialize form controllers
// initialize form controllers
var
theUForm
=
cmxClt
.
uform
.
Form
(
var
theUForm
=
cmxClt
.
uform
.
Form
(
...
...
static/js/comex_user_shared.js
View file @
dee9ef99
...
@@ -612,6 +612,32 @@ var cmxClt = (function() {
...
@@ -612,6 +612,32 @@ var cmxClt = (function() {
var
picMsg
=
document
.
getElementById
(
'picture_message'
)
var
picMsg
=
document
.
getElementById
(
'picture_message'
)
var
imgReader
=
new
FileReader
();
var
imgReader
=
new
FileReader
();
cC
.
uform
.
showPic
=
function
(
aSrc
)
{
showPicImg
.
src
=
aSrc
// prepare max size while preserving ratio
var
realValues
=
window
.
getComputedStyle
(
showPicImg
)
var
imgW
=
realValues
.
getPropertyValue
(
"width"
)
var
imgH
=
realValues
.
getPropertyValue
(
"height"
)
// debug
// console.log("img wid", imgW)
// console.log("img hei", imgH)
if
(
imgW
>
imgH
)
{
showPicImg
.
style
.
width
=
"100%"
showPicImg
.
style
.
height
=
"auto"
}
else
{
showPicImg
.
style
.
width
=
"auto"
showPicImg
.
style
.
height
=
"100%"
}
// now show it
boxShowPicImg
.
style
.
display
=
'block'
// possible re-adjust outerbox ?
}
cC
.
uform
.
checkShowPic
=
function
(
aForm
,
doHighlight
)
{
cC
.
uform
.
checkShowPic
=
function
(
aForm
,
doHighlight
)
{
// TEMPORARY initial size already 200 kB, user has to do it himself
// TEMPORARY initial size already 200 kB, user has to do it himself
var
max_size
=
204800
var
max_size
=
204800
...
@@ -644,30 +670,8 @@ var cmxClt = (function() {
...
@@ -644,30 +670,8 @@ var cmxClt = (function() {
picMsg
.
style
.
color
=
cmxClt
.
colorGreen
picMsg
.
style
.
color
=
cmxClt
.
colorGreen
// to show the pic when readAsDataURL
// to show the pic when readAsDataURL
imgReader
.
onload
=
function
()
{
imgReader
.
onload
=
function
()
{
showPicImg
.
src
=
imgReader
.
result
;
cC
.
uform
.
showPic
(
imgReader
.
result
)
// prepare max size while preserving ratio
var
realValues
=
window
.
getComputedStyle
(
showPicImg
)
var
imgW
=
realValues
.
getPropertyValue
(
"width"
)
var
imgH
=
realValues
.
getPropertyValue
(
"height"
)
// debug
// console.log("img wid", imgW)
// console.log("img hei", imgH)
if
(
imgW
>
imgH
)
{
showPicImg
.
style
.
width
=
"100%"
showPicImg
.
style
.
height
=
"auto"
}
else
{
showPicImg
.
style
.
width
=
"auto"
showPicImg
.
style
.
height
=
"100%"
}
// now show it
boxShowPicImg
.
style
.
display
=
'block'
// possible re-adjust outerbox ?
}
}
// create fake src url & trigger the onload
// create fake src url & trigger the onload
imgReader
.
readAsDataURL
(
theFile
);
imgReader
.
readAsDataURL
(
theFile
);
...
...
templates/profile.html
View file @
dee9ef99
...
@@ -65,14 +65,16 @@
...
@@ -65,14 +65,16 @@
<h3
class=
"formcatfirst"
>
Carte de visite
</h3>
<h3
class=
"formcatfirst"
>
Carte de visite
</h3>
{% if not current_user.empty %}
{% if not current_user.empty %}
<div
id=
"information-example"
class=
"our-vcard"
>
<div
id=
"information-example"
class=
"our-vcard"
>
<!-- TODO if empty then click on image starts showPicImg -->
<img
src=
"{{ (current_user.pic_src | safe) if current_user.pic_src else ''}}"
class=
"our-vcard-img"
>
<ul>
<ul>
<!-- TODO if empty then click on image starts showPicImg -->
<li
class=
bigger
>
<img
src=
"{{ (current_user.pic_src | safe) if current_user.pic_src else ''}}"
width=
"80px"
style=
"float:left;margin:5px"
>
<li>
<b>
{{ current_user.info.hon_title }}
<b>
{{ current_user.info.hon_title }}
{{ current_user.info.first_name }}
{{ current_user.info.first_name }}
<!-- TODO mid initials -->
<!-- TODO mid initials -->
{{ current_user.info.last_name }}
</b>
{{ current_user.info.last_name }}
</b>
<br/>
<br/>
</li>
</li>
<li>
<li>
<b>
Country:
</b>
{{ current_user.info.country }}
<br>
<b>
Country:
</b>
{{ current_user.info.country }}
<br>
...
@@ -559,6 +561,7 @@
...
@@ -559,6 +561,7 @@
<!-- == S U B M I T == -->
<!-- == S U B M I T == -->
<div
style=
"text-align:center"
>
<div
style=
"text-align:center"
>
<br/><br/>
<!-- @type button to avoid ENTER submit -->
<!-- @type button to avoid ENTER submit -->
<button
class=
"btn btn-lg btn-success"
id=
"form_submit"
<button
class=
"btn btn-lg btn-success"
id=
"form_submit"
type=
"button"
onclick=
"theUForm.elForm.submit()"
>
type=
"button"
onclick=
"theUForm.elForm.submit()"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment