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
53572754
Commit
53572754
authored
Mar 09, 2017
by
Awais
Committed by
Awais Qureshi
Mar 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add compression.
Refactoring JS. ECOM-6466
parent
03914f54
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
83 additions
and
23 deletions
+83
-23
course_discovery/static/js/publisher/course-tabs.js
+20
-0
course_discovery/static/js/publisher/organizations.js
+45
-0
course_discovery/static/js/publisher/publisher.js
+0
-19
course_discovery/templates/publisher/add_courserun_form.html
+1
-0
course_discovery/templates/publisher/add_update_course_form.html
+6
-3
course_discovery/templates/publisher/base.html
+6
-1
course_discovery/templates/publisher/course_detail.html
+1
-0
course_discovery/templates/publisher/course_edit_form.html
+1
-0
course_discovery/templates/publisher/course_run_detail.html
+2
-0
course_discovery/templates/publisher/courses.html
+1
-0
No files found.
course_discovery/static/js/publisher/course-tabs.js
0 → 100644
View file @
53572754
$
(
document
).
ready
(
function
(){
$
(
".administration-nav .tab-container > button"
).
click
(
function
(
event
)
{
event
.
preventDefault
();
$
(
this
).
addClass
(
"selected"
);
$
(
this
).
siblings
().
removeClass
(
"selected"
);
var
tab
=
$
(
this
).
data
(
"tab"
);
$
(
".tab-content"
).
not
(
tab
).
css
(
"display"
,
"none"
);
$
(
tab
).
fadeIn
();
});
$
(
'ul.tabs .course-tabs'
).
click
(
function
(){
var
tab_id
=
$
(
this
).
attr
(
'data-tab'
),
$tabContent
=
$
(
this
).
closest
(
'.row'
).
siblings
(
"#"
+
tab_id
);
$
(
this
).
parent
().
find
(
'.course-tabs'
).
removeClass
(
'active'
);
$tabContent
.
siblings
(
'.content'
).
removeClass
(
'active'
);
$
(
this
).
addClass
(
'active'
);
$tabContent
.
addClass
(
'active'
);
});
});
course_discovery/static/js/publisher/organizations.js
0 → 100644
View file @
53572754
$
(
document
).
ready
(
function
(){
var
org_id
=
$
(
'#organization-name'
).
data
(
'org_id'
);
if
(
org_id
){
loadAdminUsers
(
org_id
);
}
});
$
(
document
).
on
(
'change'
,
'#id_organization'
,
function
(
e
)
{
var
org_id
=
this
.
value
;
// it will reset the select input
$
(
"#id_team_admin"
).
prop
(
"selectedIndex"
,
0
);
if
(
org_id
)
{
loadAdminUsers
(
org_id
);
}
});
function
loadAdminUsers
(
org_id
)
{
$
.
getJSON
({
url
:
'/publisher/api/admins/organizations/'
+
org_id
+
'/users/'
,
success
:
function
(
data
)
{
var
teamAdminDropDown
=
$
(
'#id_team_admin'
),
selectedTeamAdmin
=
$
(
'#id_team_admin option:selected'
).
val
(),
organizationInputType
=
$
(
'#id_organization'
).
attr
(
'type'
);
teamAdminDropDown
.
empty
();
if
(
organizationInputType
==
'hidden'
)
{
teamAdminDropDown
.
append
(
'<option>---------</option>'
);
}
else
{
// it will looks same like other django model choice fields
teamAdminDropDown
.
append
(
'<option selected="selected">---------</option>'
);
}
$
.
each
(
data
.
results
,
function
(
i
,
user
)
{
if
(
selectedTeamAdmin
==
user
.
id
&&
organizationInputType
===
'hidden'
)
{
teamAdminDropDown
.
append
(
$
(
'<option selected="selected"> </option>'
).
val
(
user
.
id
).
html
(
user
.
full_name
)
);
}
else
{
teamAdminDropDown
.
append
(
$
(
'<option> </option>'
).
val
(
user
.
id
).
html
(
user
.
full_name
));
}
});
}
});
}
course_discovery/static/js/publisher/publisher.js
View file @
53572754
$
(
document
).
ready
(
function
(){
$
(
".administration-nav .tab-container > button"
).
click
(
function
(
event
)
{
event
.
preventDefault
();
$
(
this
).
addClass
(
"selected"
);
$
(
this
).
siblings
().
removeClass
(
"selected"
);
var
tab
=
$
(
this
).
data
(
"tab"
);
$
(
".tab-content"
).
not
(
tab
).
css
(
"display"
,
"none"
);
$
(
tab
).
fadeIn
();
});
$
(
'ul.tabs .course-tabs'
).
click
(
function
(){
var
tab_id
=
$
(
this
).
attr
(
'data-tab'
),
$tabContent
=
$
(
this
).
closest
(
'.row'
).
siblings
(
"#"
+
tab_id
);
$
(
this
).
parent
().
find
(
'.course-tabs'
).
removeClass
(
'active'
);
$tabContent
.
siblings
(
'.content'
).
removeClass
(
'active'
);
$
(
this
).
addClass
(
'active'
);
$tabContent
.
addClass
(
'active'
);
});
$
(
"#change-admin"
).
click
(
function
(
e
)
{
e
.
preventDefault
();
$
(
".field-admin-name"
).
hide
();
...
...
course_discovery/templates/publisher/add_courserun_form.html
View file @
53572754
...
...
@@ -247,5 +247,6 @@
{% block extra_js %}
<script
src=
"{% static 'js/publisher/publisher.js' %}"
></script>
<script
src=
"{% static 'js/publisher/organizations.js' %}"
></script>
<script
src=
"{% static 'js/publisher/seat-type-change.js' %}"
></script>
{% endblock %}
course_discovery/templates/publisher/add_update_course_form.html
View file @
53572754
{% extends 'publisher/base.html' %}
{% load i18n %}
{% load staticfiles %}
...
...
@@ -636,7 +635,11 @@
{% endblock %}
{% block extra_js %}
<script
src=
"{% static 'js/publisher/publisher.js' %}"
></script>
<script
src=
"{% static 'js/publisher/seat-type-change.js' %}"
></script>
<script
src=
"{% static 'js/publisher/publisher.js' %}"
></script>
<script
src=
"{% static 'js/publisher/organizations.js' %}"
></script>
<script
src=
"{% static 'js/publisher/seat-type-change.js' %}"
></script>
{% endblock %}
{% block js_without_compress %}
{{ run_form.media }}
{% endblock %}
course_discovery/templates/publisher/base.html
View file @
53572754
...
...
@@ -69,5 +69,10 @@
});
</script>
{% block extra_js %}{% endblock %}
{% compress js %}
{% block extra_js %}
{% endblock %}
{% endcompress %}
{% block js_without_compress %}{% endblock %}
{% endblock %}
course_discovery/templates/publisher/course_detail.html
View file @
53572754
...
...
@@ -168,6 +168,7 @@
<script
src=
"{% static 'bower_components/google-diff-match-patch/diff_match_patch.js' %}"
></script>
<script
src=
"{% static 'js/publisher/views/course_detail.js' %}"
></script>
<script
src=
"{% static 'js/publisher/publisher.js' %}"
></script>
<script
src=
"{% static 'js/publisher/organizations.js' %}"
></script>
<script
src=
"{% static 'js/publisher/comparing-objects.js' %}"
></script>
<script
src=
"{% static 'js/publisher/jquery-dateFormat.min.js' %}"
></script>
<script
src=
"{% static 'js/publisher/comments.js' %}"
></script>
...
...
course_discovery/templates/publisher/course_edit_form.html
View file @
53572754
...
...
@@ -409,4 +409,5 @@
{% block extra_js %}
<script
src=
"{% static 'js/publisher/publisher.js' %}"
></script>
<script
src=
"{% static 'js/publisher/organizations.js' %}"
></script>
{% endblock %}
course_discovery/templates/publisher/course_run_detail.html
View file @
53572754
...
...
@@ -94,7 +94,9 @@
<script
src=
"{% static 'js/publisher/jquery-dateFormat.min.js' %}"
></script>
<script
src=
"{% static 'js/publisher/views/course_detail.js' %}"
></script>
<script
src=
"{% static 'js/publisher/publisher.js' %}"
></script>
<script
src=
"{% static 'js/publisher/organizations.js' %}"
></script>
<script
src=
"{% static 'js/publisher/comments.js' %}"
></script>
<script
src=
"{% static 'js/publisher/course-tabs.js' %}"
></script>
<script>
new
Clipboard
(
".btn-copy"
,
{
text
:
function
(
trigger
)
{
...
...
course_discovery/templates/publisher/courses.html
View file @
53572754
{% extends 'publisher/base.html' %}
{% load i18n %}
{% block title %}
...
...
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