Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx-platform
Commits
68581610
Commit
68581610
authored
May 31, 2013
by
Peter Fogg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow single-click creation of course components that only have one template.
parent
56ed47b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
+18
-8
cms/static/coffee/src/views/unit.coffee
+2
-1
cms/templates/unit.html
+16
-7
No files found.
cms/static/coffee/src/views/unit.coffee
View file @
68581610
class
CMS
.
Views
.
UnitEdit
extends
Backbone
.
View
events
:
'click .new-component .new-component-type a'
:
'showComponentTemplates'
'click .new-component .new-component-type a.multiple_templates'
:
'showComponentTemplates'
'click .new-component .new-component-type a.single_template'
:
'saveNewComponent'
'click .new-component .cancel-button'
:
'closeNewComponent'
'click .new-component-templates .new-component-template a'
:
'saveNewComponent'
'click .new-component-templates .cancel-button'
:
'closeNewComponent'
...
...
cms/templates/unit.html
View file @
68581610
...
...
@@ -53,13 +53,22 @@
<div
class=
"new-component"
>
<h5>
Add New Component
</h5>
<ul
class=
"new-component-type"
>
% for type in sorted(component_templates.keys()):
<li>
<a
href=
"#"
data-type=
"${type}"
>
<span
class=
"large-template-icon large-${type}-icon"
></span>
<span
class=
"name"
>
${type}
</span>
</a>
</li>
% for type, templates in sorted(component_templates.items()):
% if len(templates) == 1:
<li>
<a
href=
"#"
class=
"single_template"
data-type=
"${type}"
data-location=
"${templates[0][1]}"
>
<span
class=
"large-template-icon large-${type}-icon"
></span>
<span
class=
"name"
>
${type}
</span>
</a>
</li>
% else:
<li>
<a
href=
"#"
class=
"multiple_templates"
data-type=
"${type}"
>
<span
class=
"large-template-icon large-${type}-icon"
></span>
<span
class=
"name"
>
${type}
</span>
</a>
</li>
% endif
% endfor
</ul>
</div>
...
...
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