Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course-discovery
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
course-discovery
Commits
5b628816
Commit
5b628816
authored
Feb 01, 2017
by
tasawernawaz
Committed by
Tasawer Nawaz
Feb 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
diff implemented
parent
0d557a56
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
12 deletions
+69
-12
bower.json
+2
-1
course_discovery/static/js/publisher/comparing-objects.js
+22
-0
course_discovery/static/sass/publisher/publisher.scss
+4
-0
course_discovery/templates/publisher/course_revision_history.html
+41
-11
No files found.
bower.json
View file @
5b628816
...
...
@@ -18,6 +18,7 @@
"js-cookie"
:
"2.1.2"
,
"moment"
:
"~2.13.0"
,
"pikaday"
:
"https://github.com/owenmead/Pikaday.git#1.4.0"
,
"underscore"
:
"~1.8.3"
"underscore"
:
"~1.8.3"
,
"google-diff-match-patch"
:
"0.1.0"
}
}
course_discovery/static/js/publisher/comparing-objects.js
0 → 100644
View file @
5b628816
$
(
document
).
on
(
'click'
,
'.btn-show-changes'
,
function
(
e
)
{
if
(
$
(
this
).
text
()
===
'Show changes'
)
{
$
(
'.field-container'
).
each
(
function
()
{
showDiff
(
$
(
this
).
find
(
'span.object'
),
$
(
this
).
find
(
'span.history-object'
),
$
(
this
).
find
(
'span.show-diff'
));
});
$
(
this
).
text
(
'Hide changes'
);
}
else
{
$
(
'.object'
).
show
();
$
(
'.show-diff'
).
hide
();
$
(
this
).
text
(
'Show changes'
);
}
});
var
dmp
=
new
diff_match_patch
();
function
showDiff
(
$object
,
$historyObject
,
$outputDiv
)
{
var
d
=
dmp
.
diff_main
(
$object
.
text
(),
$historyObject
.
text
());
$outputDiv
.
html
(
dmp
.
diff_prettyHtml
(
d
));
$object
.
hide
();
}
course_discovery/static/sass/publisher/publisher.scss
View file @
5b628816
...
...
@@ -930,6 +930,10 @@ select {
font-weight
:
600
;
}
.history-object
{
display
:
none
;
}
span
{
font-size
:
14px
;
font-weight
:
400
;
...
...
course_discovery/templates/publisher/course_revision_history.html
View file @
5b628816
{% extends 'base.html' %}
{% load i18n %}
{% load staticfiles %}
{% block title %}
{% trans "Revision History" %}
{% endblock title %}
{% block content %}
<div
class=
"parent-course-history"
>
<div
class=
"parent-course-history"
xmlns=
"http://www.w3.org/1999/html"
>
<div
class=
"title"
>
{% trans "Revision History" %}
</div>
<div>
...
...
@@ -25,55 +26,84 @@
<div
class=
"field-container"
>
<div
class=
"field-title"
>
{% trans "Course Title" %}
</div>
<span>
{{ history_object.title }}
</span>
<span
class=
"object"
>
{{ history_object.title }}
</span>
<span
class=
"history-object"
>
{{ object.title }}
</span>
<span
class=
"show-diff"
></span>
</div>
<div
class=
"field-container"
>
<div
class=
"field-title"
>
{% trans "Course Number" %}
</div>
<span>
{{ history_object.number }}
</span>
<span
class=
"object"
>
{{ history_object.number }}
</span>
<span
class=
"history-object"
>
{{ object.number }}
</span>
<span
class=
"show-diff"
></span>
</div>
<div
class=
"field-container"
>
<div
class=
"field-title"
>
{% trans "Brief Description" %}
</div>
<span>
{{ history_object.short_description }}
</span>
<span
class=
"object"
>
{{ history_object.short_description }}
</span>
<span
class=
"history-object"
>
{{ object.short_description }}
</span>
<span
class=
"show-diff"
></span>
</div>
<div
class=
"field-container"
>
<div
class=
"field-title"
>
{% trans "Full Description" %}
</div>
<span>
{{ history_object.full_description }}
</span>
<span
class=
"object"
>
{{ history_object.full_description }}
</span>
<span
class=
"history-object"
>
{{ object.full_description }}
</span>
<span
class=
"show-diff"
></span>
</div>
<div
class=
"field-container"
>
<div
class=
"field-title"
>
{% trans "Expected Learnings" %}
</div>
<span>
{{ history_object.expected_learnings }}
</span>
<span
class=
"object"
>
{{ history_object.expected_learnings }}
</span>
<span
class=
"history-object"
>
{{ object.expected_learnings }}
</span>
<span
class=
"show-diff"
></span>
</div>
<div
class=
"field-container"
>
<div
class=
"field-title"
>
{% trans "Primary Subject" %}
</div>
<span>
{{ history_object.primary_subject }}
</span>
<span
class=
"object"
>
{{ history_object.primary_subject }}
</span>
<span
class=
"history-object"
>
{{ object.primary_subject }}
</span>
<span
class=
"show-diff"
></span>
</div>
<div
class=
"field-container"
>
<div
class=
"field-title"
>
{% trans "Secondary Subject" %}
</div>
<span>
{{ history_object.secondary_subject }}
</span>
<span
class=
"object"
>
{{ history_object.secondary_subject }}
</span>
<span
class=
"history-object"
>
{{ object.secondary_subject }}
</span>
<span
class=
"show-diff"
></span>
</div>
<div
class=
"field-container"
>
<div
class=
"field-title"
>
{% trans "Tertiary Subject" %}
</div>
<span>
{{ history_object.tertiary_subject }}
</span>
<span
class=
"object"
>
{{ history_object.tertiary_subject }}
</span>
<span
class=
"history-object"
>
{{ object.tertiary_subject }}
</span>
<span
class=
"show-diff"
></span>
</div>
<div
class=
"field-container"
>
<div
class=
"field-title"
>
{% trans "Prerequisites" %}
</div>
<span>
{{ history_object.prerequisites }}
</span>
<span
class=
"object"
>
{{ history_object.prerequisites }}
</span>
<span
class=
"history-object"
>
{{ object.prerequisites }}
</span>
<span
class=
"show-diff"
></span>
</div>
<div
class=
"field-container"
>
<div
class=
"field-title"
>
{% trans "Course Level" %}
</div>
<span>
{{ history_object.level_type }}
</span>
<span
class=
"object"
>
{{ history_object.level_type }}
</span>
<span
class=
"history-object"
>
{{ object.level_type }}
</span>
<span
class=
"show-diff"
></span>
</div>
</div>
{% endblock %}
{% block js %}
{% compress js %}
<script
src=
"{% static 'bower_components/jquery/dist/jquery.js' %}"
></script>
<script
src=
"{% static 'bower_components/google-diff-match-patch/diff_match_patch.js' %}"
></script>
<script
src=
"{% static 'js/publisher/comparing-objects.js' %}"
></script>
{% endcompress %}
{% endblock %}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment