Skip to content

Commit

Permalink
Implement #96
Browse files Browse the repository at this point in the history
  • Loading branch information
sapk committed Jul 11, 2016
1 parent 342572a commit e768d47
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
4 changes: 3 additions & 1 deletion www/assets/js/sofia.db.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ S.db.fiches = {
},
getDiffConflict : function(o,n) {
//return objectDiff.diff(o.patient, n.patient)
return objectDiff.diff($.extend({}, o, {events : []}), $.extend({}, n, {events : []})) //Create a shallow clone and overwrite events parts to not be big in term of data
return objectDiff.diff($.extend({}, o, {events : []}), $.extend({}, n, {events : []})) //Create a shallow clone and overwrite events parts to not be big in term of data
},
mergeConflict : function(o,n) { // o : obj in db, n: obj to commit
//This is never call normally because the vue and obj of the vue is instantly update when in localDB
Expand Down Expand Up @@ -313,6 +313,8 @@ S.db.fiches = {
return; //If it's a design doc
}
ret.fiches[ret.fiches.length] = value.doc;

value.doc.creation_date = moment(value.doc.events[0].timestamp).format("ddd, H:mm");
value.doc.last_update = value.doc.events[value.doc.events.length -1].timestamp;
var m = moment(value.doc.last_update);
value.doc.last_update_since = m.fromNow();
Expand Down
18 changes: 16 additions & 2 deletions www/assets/platform/android/less/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@
.birthdate{
float: right;
}
.timestamp{
.creation{
float: right;
position: absolute;
top: 0px;
right: 0px;
color: #FFF;
color: #444;
background: #CCC;
padding: 0 4px;
border-bottom-left-radius: 6px;
Expand All @@ -146,6 +146,20 @@
color: red;
}
}
.timestamp{
float: left;
position: absolute;
bottom: 0px;
right: 0px;
color: #FFF;
background: #CCC;
padding: 0 4px;
border-top-left-radius: 6px;
font-size: 60%;
&.old{
color: red;
}
}
.owner{
float: left;
position: absolute;
Expand Down
1 change: 1 addition & 0 deletions www/assets/platform/android/template/fiche.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</span>
</div>
<span class="owner" v-if="u.isAdmin()">{{f.owner_id}}</span>
<span class="creation">{{ f.creation_date }}</span>
<span class="timestamp {{f.last_update_is_old ? 'old':' '}}">{{ f.last_update_since }}</span>
</div>
</a>
Expand Down

0 comments on commit e768d47

Please sign in to comment.