Skip to content

Commit 7318628

Browse files
committed
Metamodel: added field attribute "labelCards".
+ centered image if no label (cards view and bubble view popover).
1 parent f6f104c commit 7318628

7 files changed

Lines changed: 38 additions & 16 deletions

File tree

doc/screenshots/many-bubbles.gif

-1.33 KB
Loading

doc/screenshots/many-cards.gif

-2.28 KB
Loading

doc/ui-model.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,12 @@ <h1>field</h1>
336336
<td>Image to display when the value (path to the picture) is empty or doesn't lead to a valid image (for fields of type &quot;image&quot;).
337337
</td>
338338
</tr>
339+
<tr>
340+
<td>labelCards
341+
</td>
342+
<td>Field label (in Cards view and tooltips). Can be set to an empty string ("") to remove the label.
343+
</td>
344+
</tr>
339345
<tr>
340346
<td>labelTrue, labelFalse
341347
</td>

js/ui-models/apps/comics.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ uiModels.comics = {
9494
elements: [
9595
{
9696
id: 'pix', attribute: 'pix', type: 'image', width: 100, inMany: true,
97-
label: 'Cover'
97+
label: 'Cover', labelCards:''
9898
}
9999
]
100100
}

js/ui-models/apps/winecellar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ uiModels.winecellar = {
270270
attribute:'label_img',
271271
type: 'image',
272272
label: 'Label',
273+
labelCards: '',
273274
maxLength: 200,
274275
width: 100,
275276
inMany: true

js/view-many/many-cards.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,17 @@ Evol.ViewMany.Cards = Evol.View_Many.extend({
7272
Evol.Dico.fieldLink(null, f, v, icon, !link, route?route+model.id:null)+
7373
'</h4></div>');
7474
}else{
75-
h.push('<div'+ (f.type==fts.email || f.type==fts.url?' class="evol-ellipsis"':'') +'><label>'+
76-
(f.labelcards?f.labelcards:f.label)+':</label> '+v+'</div>');
75+
var label2 = f.labelCards,
76+
css2=(f.type==fts.email || f.type==fts.url?'evol-ellipsis"':'');
77+
if(label2===''){
78+
css2 += (f.type==fts.pix?'evol-c-center"':'');
79+
h.push('<div'+ (css2?' class="'+css2+'"':'') +'>'+v+'</div>');
80+
}else {
81+
if(!label2){
82+
label2 = f.label;
83+
}
84+
h.push('<div class="'+ css2 +'"><label>'+label2+':</label> '+v+'</div>');
85+
}
7786
}
7887
});
7988
h.push('</div>');

less/many-cards.less

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,25 @@
55

66
/* --- cards --- */
77

8-
.evol-cards-body > div.panel {
9-
float:left;
10-
width:240px;
11-
min-width:140px;
12-
height:182px;
13-
margin: 5px;
14-
padding:2px 10px 10px;
15-
.border-radius(10px);
16-
overflow: auto;
8+
.evol-cards-body {
9+
> div.panel {
10+
float:left;
11+
width:240px;
12+
min-width:140px;
13+
height:182px;
14+
margin: 5px;
15+
padding:2px 10px 10px;
16+
.border-radius(10px);
17+
overflow: auto;
1718

18-
>div>label{
19-
vertical-align: top;
20-
//text-align: right;
21-
//min-width:80px;
19+
>div>label{
20+
vertical-align: top;
21+
//text-align: right;
22+
//min-width:80px;
23+
}
24+
}
25+
.evol-c-center{
26+
text-align: center;
27+
margin: 5px 2px;
2228
}
2329
}

0 commit comments

Comments
 (0)