Commit 322c4c0b by Chris Dodge

Merge branch 'feature/cale/cms-master' of github.com:MITx/mitx into…

Merge branch 'feature/cale/cms-master' of github.com:MITx/mitx into feature/cdodge/subsection-edit-page

Conflicts:
	cms/djangoapps/contentstore/views.py
	cms/templates/widgets/units.html
parents 45b82f3a ab7377dc
......@@ -155,8 +155,8 @@ def edit_subsection(request, location):
# code. We should probably refactor
template = modulestore().get_item(Location('i4x', 'edx', 'templates', 'vertical', 'Empty'))
return render_to_response('edit_subsection.html',
{'subsection':item,
return render_to_response('edit_subsection.html',
{'subsection': item,
'create_new_unit_template' : template.location
})
......@@ -179,7 +179,7 @@ def edit_unit(request, location):
lms_link = "{lms_base}/courses/{course_id}/jump_to/{location}".format(
lms_base=settings.LMS_BASE,
# TODO: These will need to be changed to point to the particular instance of this problem in the particular course
course_id= modulestore().get_containing_courses(item.location)[0].id,
course_id = modulestore().get_containing_courses(item.location)[0].id,
location=item.location,
)
else:
......@@ -201,10 +201,22 @@ def edit_unit(request, location):
in item.get_children()
]
# TODO (cpennington): If we share units between courses,
# this will need to change to check permissions correctly so as
# to pick the correct parent subsection
containing_subsection_locs = modulestore().get_parent_locations(location)
containing_subsection = modulestore().get_item(containing_subsection_locs[0])
containing_section_locs = modulestore().get_parent_locations(containing_subsection.location)
containing_section = modulestore().get_item(containing_section_locs[0])
return render_to_response('unit.html', {
'unit': item,
'components': components,
'component_templates': component_templates,
'lms_link': lms_link,
'subsection': containing_subsection,
'section': containing_section,
})
......@@ -673,4 +685,7 @@ def remove_user(request, org, course, name):
@ensure_csrf_cookie
def asset_index(request, location):
return render_to_response('asset_index.html',{})
# points to the temporary course landing page with log in and sign up
def landing(request, org, course, coursename):
return render_to_response('temp-course-landing.html', {})
......@@ -194,4 +194,4 @@
margin-left: 96px;
}
}
}
\ No newline at end of file
}
body.no-header {
.primary-header {
display: none;
}
}
.primary-header {
width: 100%;
height: 36px;
......
// This is a temporary page, which will be replaced once we have a more extensive course catalog and marketing site for edX labs.
.class-landing {
.main-wrapper {
width: 700px !important;
margin: 100px auto;
}
.class-info {
padding: 30px 40px 40px;
@extend .window;
hgroup {
padding-bottom: 26px;
border-bottom: 1px solid $mediumGrey;
}
h1 {
float: none;
font-size: 30px;
font-weight: 300;
margin: 0;
}
h2 {
color: #5d6779;
}
.class-actions {
@include clearfix;
padding: 15px 0;
margin-bottom: 18px;
border-bottom: 1px solid $mediumGrey;
}
.log-in-form {
@include clearfix;
padding: 15px 0 20px;
margin-bottom: 18px;
border-bottom: 1px solid $mediumGrey;
.log-in-submit-button {
@include blue-button;
padding: 6px 20px 8px;
margin: 24px 0 0;
}
.column {
float: left;
width: 41%;
margin-right: 1%;
&.submit {
width: 16%;
margin-right: 0;
}
label {
float: left;
}
}
input {
width: 100%;
font-family: $sans-serif;
font-size: 13px;
}
.forgot-button {
float: right;
margin-bottom: 6px;
font-size: 12px;
}
}
.sign-up-button {
@include blue-button;
display: block;
width: 250px;
margin: auto;
}
.log-in-button {
@include white-button;
float: right;
}
.sign-up-button,
.log-in-button {
padding: 8px 0 12px;
font-size: 18px;
font-weight: 300;
text-align: center;
}
.class-description {
margin-top: 30px;
font-size: 14px;
}
p + p {
margin-top: 22px;
}
}
.edx-labs-logo-small {
display: block;
width: 124px;
height: 30px;
margin: auto;
background: url(../img/edx-labs-logo-small.png) no-repeat;
text-indent: -9999px;
overflow: hidden;
}
}
\ No newline at end of file
.sign-up-box,
.log-in-box {
width: 500px;
margin: 200px auto;
margin: 100px auto;
border-radius: 3px;
header {
......@@ -19,7 +20,7 @@
}
}
.log-in-form {
form {
padding: 40px;
border: 1px solid $darkGrey;
border-top-width: 0;
......@@ -34,22 +35,33 @@
font-weight: 700;
}
.email-field,
.password-field {
input[type="text"],
input[type="email"],
input[type="password"] {
width: 100%;
font-size: 20px;
font-weight: 300;
}
.row {
@include clearfix;
margin-bottom: 24px;
.split {
float: left;
width: 48%;
&:first-child {
margin-right: 4%;
}
}
}
.form-actions {
margin-bottom: 0;
}
.log-in-button {
input[type="submit"] {
@include blue-button;
margin-right: 10px;
padding: 8px 20px 10px;
......@@ -63,6 +75,5 @@
margin-top: 10px;
text-align: right;
font-size: 13px;
border-top: 1px solid $lightGrey;
}
}
\ No newline at end of file
......@@ -15,6 +15,7 @@
@import "unit";
@import "assets";
@import "course-info";
@import "landing";
@import "graphics";
@import "modal";
@import "alerts";
......
<%inherit file="base.html" />
<%! from django.core.urlresolvers import reverse %>
<%block name="title">Log in</%block>
<%block name="bodyclass">no-header</%block>
<%block name="content">
......@@ -10,11 +11,11 @@
</header>
<form class="log-in-form" id="login_form" action="login_post" method="post">
<div class="row">
<label>Email:</label>
<label>Email</label>
<input name="email" type="email" class="email-field">
</div>
<div class="row">
<label>Password:</label>
<label>Password</label>
<input name="password" type="password" class="password-field">
</div>
<div class="row form-actions">
......
<%inherit file="base.html" />
<%block name="title">Sign up</%block>
<%block name="bodyclass">no-header</%block>
<%block name="content">
<section class="main-container">
<section class="main-content">
<header>
<h3>Sign Up for edX</h3>
<hr>
</header>
<div id="register">
<form id="register_form" method="post">
<div id="register_error" name="register_error"></div>
<label>E-mail</label>
<input name="email" type="email" placeholder="E-mail">
<label>Password</label>
<input name="password" type="password" placeholder="Password">
<label>Public Username</label>
<input name="username" type="text" placeholder="Public Username">
<label>Full Name</label>
<input name="name" type="text" placeholder="Full Name">
<article class="sign-up-box">
<header>
<h1>Register for edX Labs</h1>
</header>
<form id="register_form" method="post">
<div id="register_error" name="register_error"></div>
<div class="row">
<label>Email</label>
<input name="email" type="email">
</div>
<div class="row">
<label>Password</label>
<input name="password" type="password">
</div>
<div class="row">
<label>Public Username</label>
<input name="username" type="text">
</div>
<div class="row">
<label>Full Name</label>
<input name="name" type="text">
</div>
<div class="row">
<div class="split">
<label>Your Location</label>
<input name="location" type="text" placeholder="Your Location">
<input name="location" type="text">
</div>
<div class="split">
<label>Preferred Language</label>
<input name="language" type="text" placeholder="Preferred Language">
<label class="terms-of-service">
<input name="terms_of_service" type="checkbox" value="true">
I agree to the
<a href="#">Terms of Service</a>
</label>
<!-- no honor code for CMS, but need it because we're using the lms student object -->
<input name="honor_code" type="checkbox" value="true" checked="true" hidden="true">
<div class="submit">
<input name="submit" type="submit" value="Create My Account">
</div>
</form>
<section class="login-extra">
<p>
<span>Already have an account? <a href="#">Login.</a></span>
</p>
</section>
<input name="language" type="text">
</div>
</div>
<div class="row">
<label class="terms-of-service">
<input name="terms_of_service" type="checkbox" value="true">
I agree to the
<a href="#">Terms of Service</a>
</label>
</div>
<!-- no honor code for CMS, but need it because we're using the lms student object -->
<input name="honor_code" type="checkbox" value="true" checked="true" hidden="true">
<div class="row form-actions submit">
<input name="submit" type="submit" value="Create My Account">
</div>
</form>
<div class="log-in-extra">
<p>Not enrolled? <a href="/">Sign up.</a></p>
</div>
</article>
<script type="text/javascript">
(function() {
......@@ -81,8 +88,4 @@
});
})(this)
</script>
</section>
</section>
</%block>
</%block>
\ No newline at end of file
<%inherit file="base.html" />
<%! from django.core.urlresolvers import reverse %>
<%block name="title">Landing</%block>
<%block name="bodyclass">no-header class-landing</%block>
<%block name="content">
<div class="main-wrapper">
<article class="class-info">
<hgroup>
<h1>Circuits and Electronics</h1>
<h2>Massachusetts Institute of Technology</h2>
</hgroup>
<div class="log-in-form">
<form>
<div class="column">
<label>Email</label>
<input name="email" type="email" class="email-field" tabindex="1">
</div>
<div class="column">
<label>Password</label><a href="#" class="forgot-button">Forgot?</a>
<input name="password" type="password" class="password-field" tabindex="2">
</div>
<div class="column submit">
<input name="submit" type="submit" value="Log In" class="log-in-submit-button" tabindex="3">
</div>
</form>
</div>
<div class="class-description">
<p>Ut laoreet dolore magna aliquam erat volutpat ut wisi enim ad minim veniam quis nostrud. Est usus legentis in iis qui, facit eorum claritatem Investigationes demonstraverunt lectores. Vel illum dolore eu feugiat nulla facilisis at vero eros, et accumsan et iusto? Te feugait nulla facilisi nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming! Et quinta decima eodem modo typi qui nunc nobis, videntur parum clari fiant sollemnes in? Diam nonummy nibh euismod tincidunt exerci tation ullamcorper, suscipit lobortis nisl ut aliquip ex? Nunc putamus parum, claram anteposuerit litterarum formas humanitatis per seacula quarta decima.</p>
<p>Gothica quam nunc putamus parum claram anteposuerit litterarum formas humanitatis per seacula. Facilisi nam liber tempor cum soluta nobis eleifend.</p>
<p><a href="#" class="sign-up-button">Sign Up</a></p>
</div>
</article>
<footer>
<a href="#" class="edx-labs-logo-small">edX Labs</a>
</footer>
</div>
</%block>
\ No newline at end of file
<%inherit file="base.html" />
<%! from django.core.urlresolvers import reverse %>
<%namespace name="units" file="widgets/units.html" />
<%block name="bodyclass">unit</%block>
<%block name="title">CMS Unit</%block>
<%block name="jsextra">
......@@ -83,37 +84,36 @@
</div>
<div class="row unit-actions">
<a href="#" class="save-button">Save</a>
<a href="preview.html" target="_blank" class="preview-button">Preview</a>
<a href="${lms_link}" target="_blank" class="preview-button">Preview</a>
</div>
</div>
</div>
<div class="window unit-location">
<h4>Unit Location</h4>
<div class="window-contents">
<div><input type="text" class="url" value="/courseware/Week_1/My_Unit" disabled /></div>
<ol>
<li>
<a href="#" class="section-item">Week 1</a>
<div><input type="text" class="url" value="/courseware/${section.url_name}/${subsection.url_name}" disabled /></div>
<section class="courseware-section branch">
<header>
<div class="item-details">
<h3>${section.display_name}</h3>
</div>
</header>
<div class="unit-list">
<ol>
<li>
<a href="#" class="section-item"><span class="folder-icon"></span>Administrivia and Circuit Elements</a>
<ol>
<li><a href="#" class="section-item"><span class="file-icon"></span>Motiviation for 6.002</a></li>
<li><a href="#" class="section-item"><span class="file-icon"></span>Administrivia</a></li>
<li><a href="#" class="section-item"><span class="file-icon"></span>Course Overview</a></li>
<li><a href="#" class="section-item"><span class="file-icon"></span>Lumped Element Abstraction</a></li>
<li><a href="#" class="section-item"><span class="file-icon"></span>Simple Power</a></li>
<li><a href="#" class="current section-item"><span class="file-icon"></span>New Unit</a></li>
<li>
<a href="unit.html" class="new-unit-item">
<span class="new-unit-icon"></span>New Unit
<li class="branch">
<div class="section-item">
<div>
<a href="${reverse('edit_subsection', args=[subsection.location])}">
<span class="folder-icon"></span>
<span class="subsection-name"><span class="subsection-name-value">${subsection.display_name}</span></span>
</a>
</li>
</ol>
</div>
</div>
${units.enum_units(subsection, actions=False, selected=unit.location)}
</li>
</ol>
</li>
</ol>
</div>
</section>
</div>
</div>
</div>
......
......@@ -3,18 +3,28 @@
<!--
This def will enumerate through a passed in subsection and list all of the units
-->
<%def name="enum_units(subsection)">
<%def name="enum_units(subsection, actions=True, selected=None)">
<ol>
% for unit in subsection.get_children():
<li class="leaf unit" data-id="${unit.location}">
<div class="section-item">
<%
if unit.location == selected:
selected_class = 'editing'
else:
selected_class = ''
%>
<div class="section-item ${selected_class}">
<a href="${reverse('edit_unit', args=[unit.location])}" class="private-item">
<span class="${unit.category}-icon"></span>${unit.display_name} <span class="private-tag">- private</span>
<span class="${unit.category}-icon"></span>
${unit.display_name}
<span class="private-tag">- private</span>
</a>
% if actions:
<div class="item-actions">
<a href="#" class="delete-button" data-id="${unit.location}"><span class="delete-icon"></span></a>
<a href="#" class="drag-handle wip"></a>
</div>
% endif
</div>
</li>
% endfor
......
......@@ -29,8 +29,10 @@ urlpatterns = ('',
'contentstore.views.add_user', name='add_user'),
url(r'^(?P<org>[^/]+)/(?P<course>[^/]+)/course/(?P<name>[^/]+)/remove_user$',
'contentstore.views.remove_user', name='remove_user'),
url(r'^assets/(?P<location>.*?)$', 'contentstore.views.asset_index', name='asset_index')
url(r'^assets/(?P<location>.*?)$', 'contentstore.views.asset_index', name='asset_index'),
# temporary landing page for a course
url(r'^landing/(?P<org>[^/]+)/(?P<course>[^/]+)/course/(?P<coursename>[^/]+)$', 'contentstore.views.landing', name='landing')
)
......
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