2014-04-09 19:09:35 -04:00
|
|
|
- var i = 0
|
2015-10-26 20:00:52 -04:00
|
|
|
- var counter = view.constructor.deltaCounter;
|
2014-04-12 00:11:52 -04:00
|
|
|
|
|
|
|
mixin deltaPanel(delta, conflict)
|
|
|
|
- delta.index = i++
|
|
|
|
.delta.panel.panel-default(class='delta-'+delta.action, data-index=i)
|
|
|
|
.panel-heading
|
|
|
|
if delta.action === 'added'
|
|
|
|
strong(data-i18n="delta.added") Added
|
|
|
|
if delta.action === 'modified'
|
|
|
|
strong(data-i18n="delta.modified") Modified
|
|
|
|
if delta.action === 'deleted'
|
|
|
|
strong(data-i18n="delta.deleted") Deleted
|
|
|
|
if delta.action === 'moved-index'
|
2015-07-23 12:35:22 -04:00
|
|
|
strong(data-i18n="delta.moved_index") Moved Index
|
2014-04-12 00:11:52 -04:00
|
|
|
if delta.action === 'text-diff'
|
|
|
|
strong(data-i18n="delta.text_diff") Text Diff
|
|
|
|
span
|
|
|
|
a(data-toggle="collapse" data-parent="#delta-accordion"+(counter) href="#collapse-"+(i+counter))
|
|
|
|
span= delta.humanPath
|
|
|
|
|
|
|
|
.panel-collapse.collapse(id="collapse-"+(i+counter))
|
|
|
|
.panel-body.row(class=conflict ? "conflict-details" : "details")
|
2014-04-09 19:09:35 -04:00
|
|
|
if delta.action === 'added'
|
2014-04-12 00:11:52 -04:00
|
|
|
.new-value.col-md-12= delta.right
|
2014-04-09 19:09:35 -04:00
|
|
|
if delta.action === 'modified'
|
2014-04-12 00:11:52 -04:00
|
|
|
.old-value.col-md-6= delta.left
|
|
|
|
.new-value.col-md-6= delta.right
|
2014-04-09 19:09:35 -04:00
|
|
|
if delta.action === 'deleted'
|
2014-04-12 00:11:52 -04:00
|
|
|
.col-md-12
|
|
|
|
div.old-value= delta.left
|
2014-04-09 19:09:35 -04:00
|
|
|
if delta.action === 'text-diff'
|
2014-04-12 00:11:52 -04:00
|
|
|
.col-md-12
|
|
|
|
div.text-diff
|
|
|
|
if delta.action === 'moved-index'
|
|
|
|
.col-md-12
|
|
|
|
span Moved array value #{JSON.stringify(delta.left)} to index #{delta.destinationIndex}
|
|
|
|
|
|
|
|
if delta.conflict && !conflict
|
|
|
|
.panel-body
|
2014-05-08 13:54:39 -04:00
|
|
|
strong(data-i18n="delta.merge_conflict_with") MERGE CONFLICT WITH
|
2014-04-12 00:11:52 -04:00
|
|
|
+deltaPanel(delta.conflict, true)
|
|
|
|
|
|
|
|
.panel-group(id='delta-accordion-'+(counter))
|
2015-10-26 20:00:52 -04:00
|
|
|
for delta in view.expandedDeltas
|
2014-04-12 00:11:52 -04:00
|
|
|
+deltaPanel(delta)
|
2015-10-26 20:00:52 -04:00
|
|
|
if !view.expandedDeltas.length
|
2014-05-08 13:54:39 -04:00
|
|
|
alert.alert-warning(data-i18n="delta.no_changes") No changes
|
2015-07-23 12:35:22 -04:00
|
|
|
|