Skip to content

Commit be8ebfe

Browse files
committed
Misc. small fixes.
1 parent fafa524 commit be8ebfe

12 files changed

Lines changed: 68 additions & 34 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
node_modules
22
bower_components
33
js/vendors.js
4+
js/ui-models/doc/
45
dist/vendors.js
56
js/models
67
js/ui-models/chinook

demo/demo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function showUIModel(uiModel){
4747
if(_.isString(uiModel)){
4848
uiModel=uiModels[uiModel];
4949
}
50-
$('#uimodel').html(Evol.UI.input.textMJSON('uimodel2', uiModel, 10, true))
50+
$('#uimodel').html(Evol.UI.input.textMJSON('uimodel2', uiModel, 12))
5151
.slideDown();
5252
$('#hide_def').show();
5353
}

js/app.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ Evol.App = Backbone.View.extend({
190190
if(options && tb.cardinality==='1'){
191191
tb.setModelById(options);
192192
}
193-
that._tbs[uiModel.id] = tb;
193+
if(that._tbs){
194+
that._tbs[uiModel.id] = tb;
195+
}
194196
if(cb){
195197
cb(tb);
196198
}

js/dico.js

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ return {
192192
}
193193
},
194194

195+
clearCacheLOV: function(){
196+
Evol.hashLov={};
197+
},
198+
195199
viewIsOne: function(viewName){
196200
return viewName==='new' || viewName==='edit' || viewName==='view' || viewName==='json';
197201
},
@@ -200,8 +204,10 @@ return {
200204
},
201205

202206
fieldInCharts: function (f) {
203-
return (_.isUndefined(f.viewcharts) || f.viewcharts) &&
204-
(f.type===fts.lov || f.type===fts.bool || f.type===fts.int || f.type===fts.money);
207+
return (_.isUndefined(f.viewcharts) || f.viewcharts) && Evol.Dico.fieldChartable(f);
208+
},
209+
fieldChartable: function (f) {
210+
return f.type===fts.lov || f.type===fts.bool || f.type===fts.int || f.type===fts.money;
205211
},
206212

207213
isNumberType: function(fType){
@@ -537,8 +543,7 @@ return {
537543
};
538544
},
539545

540-
sortingText: function(fid){
541-
//return (modelA.get(fid)||'').localeCompare(modelB.get(fid)||'');
546+
sortingNumber: function(fid){
542547
return function(modelA, modelB) {
543548
if(modelA[fid]<modelB[fid]){
544549
return 1;
@@ -549,6 +554,22 @@ return {
549554
return 0;
550555
};
551556
},
557+
sortingNumberDesc: function(fid){
558+
return function(modelA, modelB) {
559+
if(modelA[fid]>modelB[fid]){
560+
return 1;
561+
}
562+
if(modelB[fid]>modelA[fid]){
563+
return -1;
564+
}
565+
return 0;
566+
};
567+
},
568+
569+
sortingText: function(fid){
570+
//return (modelA.get(fid)||'').localeCompare(modelB.get(fid)||'');
571+
return this.sortingNumber(fid);
572+
},
552573

553574
getRoute: function(){
554575
var cURL=window.location.href,

js/one.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ return Backbone.View.extend({
128128

129129
getTitle: function(){
130130
if(this.model){
131-
if(this.model.isNew()){
131+
if(this.model.isNew && this.model.isNew()){
132132
return i18n.getLabel('NewEntity', this.uiModel.entity);
133133
}
134134
var lf=this.uiModel.leadfield;

js/ui-models/apps/comics.js

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ var uiModels = uiModels || {};
33
uiModels.comics = {
44
id: 'comics',
55
label: 'Graphic Novels',
6-
entity: 'graphic novel',
7-
entities: 'graphic novels',
6+
entity: 'graphic novel serie',
7+
entities: 'graphic novel series',
88
//icon: 'serie.gif',
99
leadfield:'title',
1010
badge:function(m){
@@ -24,19 +24,18 @@ uiModels.comics = {
2424
{
2525
id: 'genre', attribute: 'genre', type: 'lov', label: 'Genre', width: 38, viewmany: true,
2626
list: [
27-
{id: 'adv', text: 'Aventure'},
28-
{id: 'conte', text: 'Conte'},
29-
{id: 'eros', text: 'Erotique'},
30-
{id: 'fantasy', text: 'Fantastique'},
27+
{id: 'adv', text: 'Adventure'},
28+
{id: 'conte', text: 'Fairy tale'},
29+
{id: 'eros', text: 'Erotic'},
30+
{id: 'fantasy', text: 'Fantastic'},
3131
{id: 'hf', text: 'Heroic Fantasy'},
32-
{id: 'hist', text: 'Historique'},
33-
{id: 'humor', text: 'Humour'},
34-
{id: 'nocat', text: 'Inclassable'},
35-
{id: 'youth', text: 'Jeunesse'},
36-
{id: 'pol', text: 'Policier / Thriller'},
37-
{id: 'rg', text: 'Roman graphique'},
32+
{id: 'hist', text: 'Historic'},
33+
{id: 'humor', text: 'Humor'},
34+
{id: 'nocat', text: 'One of a kind'},
35+
{id: 'youth', text: 'Youth'},
36+
{id: 'pol', text: 'Thriller'},
3837
{id: 'sf', text: 'Science-fiction'},
39-
{id: 'sh', text: 'Super Héros'},
38+
{id: 'sh', text: 'Super Heros'},
4039
{id: 'wwest', text: 'Western'}
4140
]
4241
},
@@ -51,16 +50,6 @@ uiModels.comics = {
5150
{id: 'EN', text: 'English'}
5251
]
5352
},
54-
{
55-
id:'amazon', label:'Amazon', type:'formula', width:100, css:'evol-ellipsis',
56-
formula:function(m){
57-
var link=m.get('language')=='FR' ?
58-
'http://www.amazon.fr/s/ref=sr_nr_n_1?keywords='
59-
:'http://www.amazon.com/s/ref=nb_sb_noss?field-keywords=';
60-
link+=encodeURI(m.get('title')+' '+m.get('authors'));
61-
return '<a target="a" href="'+link+'">'+link+'</a>';
62-
}
63-
},
6453
{
6554
id: 'serieNb', attribute: 'serieNb', type: 'integer', width: 15, viewmany: false,
6655
label: 'Albums', viewcharts:false
@@ -81,6 +70,16 @@ uiModels.comics = {
8170
id: 'finished', attribute: 'finished', type: 'boolean', width: 19, viewmany: true,
8271
label: 'Finished', labeltrue:'Finished', labelfalse:'Unfinished'
8372
},
73+
{
74+
id:'amazon', label:'Amazon', type:'formula', width:100, css:'evol-ellipsis',
75+
formula:function(m){
76+
var link=m.get('language')=='FR' ?
77+
'http://www.amazon.fr/s/ref=sr_nr_n_1?keywords='
78+
:'http://www.amazon.com/s/ref=nb_sb_noss?field-keywords=';
79+
link+=encodeURI(m.get('title')+' '+m.get('authors'));
80+
return '<a target="a" href="'+link+'">'+link+'</a>';
81+
}
82+
},
8483
{
8584
id: 'notes', attribute: 'notes', type: 'textmultiline', label: 'Notes', maxlength: 1000,
8685
width: 100, height: 6, viewmany: false

js/ui-models/apps/contacts.data.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ uiModels.contact_data = [{
8181
phone: '45 456 414 45',
8282
url: 'http://aubonpain.fr',
8383
city: 'Paris',
84+
state: '',
8485
country: 'FR',
8586
category: '1'
8687
}, {
@@ -89,6 +90,7 @@ uiModels.contact_data = [{
8990
firstname: 'Olivier',
9091
company: 'Evolutility',
9192
city: 'San Mateo',
93+
state: '',
9294
email: 'olivier@evolutility.org',
9395
url: 'http://www.evol-utility.org'
9496
}, {
@@ -152,6 +154,7 @@ uiModels.contact_data = [{
152154
phonecell: '7325 8245',
153155
address1: '434 Cool Place',
154156
city: 'Bengaluru',
157+
state: '',
155158
country: 'IN',
156159
category: '4'
157160
}, {
@@ -163,6 +166,7 @@ uiModels.contact_data = [{
163166
email: 'ccheng@MyGreatCorporation.com',
164167
phonecell: '650 234 8245',
165168
city: 'Sunnyvalle',
166-
country: 'CA',
169+
state: 'CA',
170+
country: 'US',
167171
category: '4'
168172
}];

js/ui-models/apps/todo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ uiModels.todo = {
1313
elements: [
1414
{
1515
id: 'title', attribute: 'title', type: 'text', label: 'Title', required: true,
16-
placeholder: 'Call John',
16+
//placeholder: 'Call John',
1717
maxlength: 255,
1818
width: 100, viewmany: true
1919
},

less/demo.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ body{
1010
font-size: 15px !important;
1111
font-weight: 300;
1212
}
13+
a{
14+
color: #0099cc;
15+
}
1316
.demo-links{
1417
>div {
1518
display: inline-block;

less/many-cards.less

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@
1717

1818
>div>label{
1919
vertical-align: top;
20+
//text-align: right;
21+
//min-width:80px;
2022
}
2123
}

0 commit comments

Comments
 (0)