Basic architecture of Maintenance App - SUST-19, SUST-42. Implement Force Publish Course view. SUST-46
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
<div class="result">
|
||||
<div class="head-output">
|
||||
<%- gettext('You have done a dry run of force publishing the course. Nothing has changed. Had you run it, the following course versions would have been change.') %>
|
||||
</div>
|
||||
<div class="main-output">
|
||||
<%= StringUtils.interpolate(
|
||||
gettext('The published branch version, {published}, was reset to the draft branch version, {draft}.'),
|
||||
{
|
||||
published: current_versions['published-branch'],
|
||||
draft: current_versions['draft-branch']
|
||||
})
|
||||
%>
|
||||
</div>
|
||||
</div>
|
||||
33
cms/templates/maintenance/_force_publish_course.html
Normal file
33
cms/templates/maintenance/_force_publish_course.html
Normal file
@@ -0,0 +1,33 @@
|
||||
<%page expression_filter="h"/>
|
||||
<%namespace name='static' file='../static_content.html'/>
|
||||
<%!
|
||||
from django.utils.translation import ugettext as _
|
||||
from openedx.core.djangolib.markup import HTML, Text
|
||||
%>
|
||||
<div id="force-published-form" class="wrap-instructor-info studio-view maintenance-form">
|
||||
<form id="force_publish" class="form-create" method="post">
|
||||
<input type="hidden" name="csrfmiddlewaretoken" value="${csrf_token}"/>
|
||||
<div class="wrapper-form">
|
||||
<fieldset>
|
||||
<legend class="sr">${_("Required data to force publish course.")}</legend>
|
||||
<div class="list-input">
|
||||
<div id="course-id-container" class="field text required">
|
||||
<label for="course-id">${_('Course ID')}</label>
|
||||
<input id="course-id" type="text" name="course-id" aria-describedby="course-id-desc" required />
|
||||
<div id="course-id-desc" class="tip tip-stacked">${_('course-v1:edX+DemoX+Demo_Course')}</div>
|
||||
<div class="wrapper-error"></div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button type="submit" id="submit_force_publish" class="action action-primary">${_('Force Publish Course')}
|
||||
</button>
|
||||
<button id="reset-button" class="action action-secondary action-cancel"
|
||||
aria-describedby="reset-values-desc">${_('Reset')}</button>
|
||||
<span id="reset-values-desc" class="is-hidden">${_('Reset values')}</span>
|
||||
</div>
|
||||
</form>
|
||||
<div id="result-error"><div class="wrapper-error"></div></div>
|
||||
<div id="result-container" class="result-container"></div>
|
||||
</div>
|
||||
21
cms/templates/maintenance/base.html
Normal file
21
cms/templates/maintenance/base.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<%page expression_filter="h"/>
|
||||
<%inherit file="../base.html" />
|
||||
<%def name='online_help_token()'><% return 'maintenance' %></%def>
|
||||
<%namespace name='static' file='../static_content.html'/>
|
||||
<%!
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.translation import ugettext as _
|
||||
%>
|
||||
<%block name="content">
|
||||
<div class="wrapper-content wrapper">
|
||||
<div class="maintenance-header">
|
||||
<h2>
|
||||
<a href="${reverse('maintenance:maintenance_index')}">
|
||||
<span>${_('Maintenance Dashboard')}</span>
|
||||
</a>
|
||||
</h2>
|
||||
<%block name="viewtitle">
|
||||
</%block>
|
||||
</div>
|
||||
<%block name="viewcontent"></%block>
|
||||
</%block>
|
||||
28
cms/templates/maintenance/container.html
Normal file
28
cms/templates/maintenance/container.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<%page expression_filter="h"/>
|
||||
<%inherit file="base.html" />
|
||||
<%namespace name='static' file='../static_content.html'/>
|
||||
<%!
|
||||
from django.core.urlresolvers import reverse
|
||||
from openedx.core.djangolib.js_utils import js_escaped_string
|
||||
%>
|
||||
<%block name="title">${view['name']}</%block>
|
||||
<%block name="viewtitle">
|
||||
<h3 class="info-course">
|
||||
<span>${view['name']}</span>
|
||||
</h3>
|
||||
</%block>
|
||||
|
||||
<%block name="js_extra">
|
||||
<script src="${static.url('js/maintenance/force_publish.js')}"></script>
|
||||
</%block>
|
||||
|
||||
<%block name="viewcontent">
|
||||
<section class="container maintenance-content">
|
||||
<%include file="_${view['slug']}.html"/>
|
||||
<%block name="requirejs">
|
||||
require(["js/maintenance/${view['slug'] | n, js_escaped_string}"], function(MaintenanceFactory) {
|
||||
MaintenanceFactory("${reverse(view['url']) | n, js_escaped_string}");
|
||||
});
|
||||
</%block>
|
||||
</section>
|
||||
</%block>
|
||||
20
cms/templates/maintenance/index.html
Normal file
20
cms/templates/maintenance/index.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<%page expression_filter="h"/>
|
||||
<%inherit file="base.html" />
|
||||
<%namespace name='static' file='../static_content.html'/>
|
||||
<%!
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.core.urlresolvers import reverse
|
||||
%>
|
||||
<%block name="title">${_('Maintenance Dashboard')}</%block>
|
||||
<%block name="viewcontent">
|
||||
<div class="container maintenance-content">
|
||||
<ul class="maintenance-list">
|
||||
% for view in views.values():
|
||||
<li class="view-list-container">
|
||||
<a class="view-name" href='${reverse(view["url"])}'>${view['name']}</a>
|
||||
<span class="view-desc">${view['description']}</span>
|
||||
</li>
|
||||
% endfor
|
||||
</ul>
|
||||
</div>
|
||||
</%block>
|
||||
@@ -4,6 +4,7 @@
|
||||
from django.conf import settings
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.translation import ugettext as _
|
||||
from student.roles import GlobalStaff
|
||||
%>
|
||||
|
||||
% if uses_pattern_library:
|
||||
@@ -45,6 +46,11 @@
|
||||
<li class="nav-item nav-account-dashboard">
|
||||
<a href="/">${_("{studio_name} Home").format(studio_name=settings.STUDIO_SHORT_NAME)}</a>
|
||||
</li>
|
||||
% if GlobalStaff().has_user(user):
|
||||
<li class="nav-item">
|
||||
<a href="${reverse('maintenance:maintenance_index')}">${_("Maintenance")}</a>
|
||||
</li>
|
||||
% endif
|
||||
<li class="nav-item nav-account-signout">
|
||||
<a class="action action-signout" href="${reverse('logout')}">${_("Sign Out")}</a>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user