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
9dffb63c
Commit
9dffb63c
authored
Sep 19, 2017
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added button to publish data to external services
LEARNER-2473
parent
22589de7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
2 deletions
+71
-2
course_discovery/apps/publisher/templates/publisher/course_run_detail/course_run_detail.html
+49
-0
course_discovery/conf/locale/en/LC_MESSAGES/django.mo
+0
-0
course_discovery/conf/locale/en/LC_MESSAGES/django.po
+10
-1
course_discovery/conf/locale/eo/LC_MESSAGES/django.mo
+0
-0
course_discovery/conf/locale/eo/LC_MESSAGES/django.po
+12
-1
No files found.
course_discovery/apps/publisher/templates/publisher/course_run_detail/course_run_detail.html
View file @
9dffb63c
...
...
@@ -49,6 +49,17 @@
</h2>
</div>
<button
class=
"btn btn-primary"
onclick=
"publish('{% url 'publisher:api:v1:course_run-publish' pk=object.pk %}');"
>
{% trans "Publish" %}
</button>
<div
class=
"alert hidden"
role=
"alert"
aria-labelledby=
"alertTitle"
tabindex=
"-1"
id=
"alertContainer"
style=
"margin:15px 0;"
>
<span
class=
"icon alert-icon fa"
aria-hidden=
"true"
></span>
<div
class=
"alert-message-with-action"
>
<h3
class=
"sr-only alert-title"
id=
"alertTitle"
></h3>
<p
class=
"alert-copy"
></p>
</div>
</div>
{% include 'alert_messages.html' %}
<div
id=
"stateChangeAlert"
class=
"alert-messages hidden"
>
...
...
@@ -107,10 +118,48 @@
<script
src=
"{% static 'js/publisher/change-state.js' %}"
></script>
<script
src=
"{% static 'js/publisher/modal-screen.js' %}"
></script>
<script>
'use strict'
;
new
Clipboard
(
".btn-copy"
,
{
text
:
function
(
trigger
)
{
return
$
(
trigger
).
parent
().
next
(
'.copy'
).
html
().
trim
();
}
});
function
updateAlert
(
msg
,
isError
)
{
var
$alertContainer
=
$
(
'#alertContainer'
),
alertClassToAdd
=
isError
?
'alert-error'
:
'alert-success'
,
alertClassToRemove
=
isError
?
'alert-success'
:
'alert-error'
,
iconClassToAdd
=
isError
?
'fa-warning'
:
'fa-check'
,
iconClassToRemove
=
isError
?
'fa-check'
:
'fa-warning'
;
$alertContainer
.
removeClass
(
'hidden'
).
removeClass
(
alertClassToRemove
).
addClass
(
alertClassToAdd
);
$
(
'.alert-icon'
,
$alertContainer
).
removeClass
(
iconClassToRemove
).
addClass
(
iconClassToAdd
);
$
(
'.alert-title'
,
$alertContainer
).
text
(
msg
);
$
(
'.alert-copy'
,
$alertContainer
).
text
(
msg
);
}
function
showSuccessAlert
(
msg
)
{
updateAlert
(
msg
,
false
);
}
function
showFailureAlert
(
msg
)
{
updateAlert
(
msg
,
true
);
}
function
publish
(
url
)
{
$
.
ajax
({
type
:
'POST'
,
url
:
url
,
contentType
:
'application/json'
})
.
done
(
function
(
data
,
textStatus
,
jqXHR
)
{
showSuccessAlert
(
'{% trans '
Successfully
published
to
Studio
,
E
-
Commerce
,
and
Discovery
.
' %}'
);
})
.
fail
(
function
(
jqXHR
,
textStatus
,
errorThrown
)
{
debugger
;
showFailureAlert
(
'{% trans '
Publication
failed
.
' %}'
);
});
}
</script>
{% endblock %}
course_discovery/conf/locale/en/LC_MESSAGES/django.mo
View file @
9dffb63c
No preview for this file type
course_discovery/conf/locale/en/LC_MESSAGES/django.po
View file @
9dffb63c
...
...
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-09-19 01:
02
-0400\n"
"POT-Creation-Date: 2017-09-19 01:
14
-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
...
...
@@ -1050,6 +1050,7 @@ msgid "Accepted"
msgstr ""
#: apps/publisher/templates/publisher/_approval_widget.html
#: apps/publisher/templates/publisher/course_run_detail/course_run_detail.html
msgid "Publish"
msgstr ""
...
...
@@ -2467,6 +2468,14 @@ msgstr ""
msgid "DRUPAL"
msgstr ""
#: apps/publisher/templates/publisher/course_run_detail/course_run_detail.html
msgid "Successfully published to Studio, E-Commerce, and Discovery."
msgstr ""
#: apps/publisher/templates/publisher/course_run_detail/course_run_detail.html
msgid "Publication failed."
msgstr ""
#: apps/publisher/templates/publisher/courses.html
msgid "Runs"
msgstr ""
...
...
course_discovery/conf/locale/eo/LC_MESSAGES/django.mo
View file @
9dffb63c
No preview for this file type
course_discovery/conf/locale/eo/LC_MESSAGES/django.po
View file @
9dffb63c
...
...
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-09-19 01:
02
-0400\n"
"POT-Creation-Date: 2017-09-19 01:
14
-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
...
...
@@ -1218,6 +1218,7 @@ msgid "Accepted"
msgstr "Àççéptéd Ⱡ'σяєм ιρѕυм ∂#"
#: apps/publisher/templates/publisher/_approval_widget.html
#: apps/publisher/templates/publisher/course_run_detail/course_run_detail.html
msgid "Publish"
msgstr "Püßlïsh Ⱡ'σяєм ιρѕυм #"
...
...
@@ -2907,6 +2908,16 @@ msgstr "ÇÀT Ⱡ'σяєм#"
msgid "DRUPAL"
msgstr "DRÛPÀL Ⱡ'σяєм ιρѕυ#"
#: apps/publisher/templates/publisher/course_run_detail/course_run_detail.html
msgid "Successfully published to Studio, E-Commerce, and Discovery."
msgstr ""
"Süççéssfüllý püßlïshéd tö Stüdïö, É-Çömmérçé, änd Dïsçövérý. Ⱡ'σяєм ιρѕυм "
"∂σłσя ѕιт αмєт, ¢σηѕє¢тєтυя α#"
#: apps/publisher/templates/publisher/course_run_detail/course_run_detail.html
msgid "Publication failed."
msgstr "Püßlïçätïön fäïléd. Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт,#"
#: apps/publisher/templates/publisher/courses.html
msgid "Runs"
msgstr "Rüns Ⱡ'σяєм ι#"
...
...
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