Commit d88587f5 by tasawernawaz Committed by Tasawer Nawaz

feedback addressed

parent e65ee54b
......@@ -7,7 +7,7 @@ $(document).on('click', '.btn-show-changes', function (e) {
$(this).text(gettext('Hide changes'));
$(this).removeClass('show');
} else {
$('.object').show();
$('.history-object').show();
$('.show-diff').hide();
$(this).text(gettext('Show changes'));
$(this).addClass('show');
......@@ -17,9 +17,9 @@ $(document).on('click', '.btn-show-changes', function (e) {
var dmp = new diff_match_patch();
function showDiff($object, $historyObject, $outputDiv) {
var d = dmp.diff_main($.trim($object.text()), $.trim($historyObject.text()));
var d = dmp.diff_main($historyObject.text(), $object.text());
$outputDiv.html(dmp.diff_prettyHtml(d));
$object.hide();
$historyObject.hide();
$outputDiv.show();
}
......
......@@ -930,7 +930,7 @@ select {
font-weight: 600;
}
.history-object {
.object {
display: none;
}
......
......@@ -28,74 +28,74 @@
<div class="field-container">
<div class="field-title">{% trans "Course Title" %}</div>
<span class="object">{{ history_object.title }}</span>
<span class="history-object">{{ object.title }}</span>
<span class="object">{{ object.title }}</span>
<span class="history-object">{{ history_object.title }}</span>
<span class="show-diff"></span>
</div>
<div class="field-container">
<div class="field-title">{% trans "Course Number" %}</div>
<span class="object">{{ history_object.number }}</span>
<span class="history-object">{{ object.number }}</span>
<span class="object">{{ object.number }}</span>
<span class="history-object">{{ history_object.number }}</span>
<span class="show-diff"></span>
</div>
<div class="field-container">
<div class="field-title">{% trans "Brief Description" %}</div>
<span class="object">{{ history_object.short_description }}</span>
<span class="history-object">{{ object.short_description }}</span>
<span class="object">{{ object.short_description }}</span>
<span class="history-object">{{ history_object.short_description }}</span>
<span class="show-diff"></span>
</div>
<div class="field-container">
<div class="field-title">{% trans "Full Description" %}</div>
<span class="object">{{ history_object.full_description }}</span>
<span class="history-object">{{ object.full_description }}</span>
<span class="object">{{ object.full_description }}</span>
<span class="history-object">{{ history_object.full_description }}</span>
<span class="show-diff"></span>
</div>
<div class="field-container">
<div class="field-title">{% trans "Expected Learnings" %}</div>
<span class="object">{{ history_object.expected_learnings }}</span>
<span class="history-object">{{ object.expected_learnings }}</span>
<span class="object">{{ object.expected_learnings }}</span>
<span class="history-object">{{ history_object.expected_learnings }}</span>
<span class="show-diff"></span>
</div>
<div class="field-container">
<div class="field-title">{% trans "Primary Subject" %}</div>
<span class="object">{{ history_object.primary_subject }}</span>
<span class="history-object">{{ object.primary_subject }}</span>
<span class="object">{{ object.primary_subject }}</span>
<span class="history-object">{{ history_object.primary_subject }}</span>
<span class="show-diff"></span>
</div>
<div class="field-container">
<div class="field-title">{% trans "Secondary Subject" %}</div>
<span class="object">{{ history_object.secondary_subject }}</span>
<span class="history-object">{{ object.secondary_subject }}</span>
<span class="object">{{ object.secondary_subject }}</span>
<span class="history-object">{{ history_object.secondary_subject }}</span>
<span class="show-diff"></span>
</div>
<div class="field-container">
<div class="field-title">{% trans "Tertiary Subject" %}</div>
<span class="object">{{ history_object.tertiary_subject }}</span>
<span class="history-object">{{ object.tertiary_subject }}</span>
<span class="object">{{ object.tertiary_subject }}</span>
<span class="history-object">{{ history_object.tertiary_subject }}</span>
<span class="show-diff"></span>
</div>
<div class="field-container">
<div class="field-title">{% trans "Prerequisites" %}</div>
<span class="object">{{ history_object.prerequisites }}</span>
<span class="history-object">{{ object.prerequisites }}</span>
<span class="object">{{ object.prerequisites }}</span>
<span class="history-object">{{ history_object.prerequisites }}</span>
<span class="show-diff"></span>
</div>
<div class="field-container">
<div class="field-title">{% trans "Course Level" %}</div>
<span class="object">{{ history_object.level_type }}</span>
<span class="history-object">{{ object.level_type }}</span>
<span class="object">{{ object.level_type }}</span>
<span class="history-object">{{ history_object.level_type }}</span>
<span class="show-diff"></span>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment