From 8dd0feb44ae2375f3c3973c1630fc830074406ea Mon Sep 17 00:00:00 2001
From: Lyla Fischer
Date: Tue, 25 Sep 2012 13:47:45 -0400
Subject: [PATCH] basic templates for video, html, discussion, and sequential
---
.../lib/xmodule/xmodule/discussion_module.py | 1 +
common/lib/xmodule/xmodule/html_module.py | 1 +
common/lib/xmodule/xmodule/seq_module.py | 2 +-
.../xmodule/templates/discussion/default.yaml | 6 ++++
.../xmodule/templates/html/announcement.yaml | 25 +++++++++++++++++
.../xmodule/templates/html/everything.yaml | 28 +++++++++++++++++++
.../{sequential => sequence}/with_video.yaml | 2 +-
.../xmodule/templates/video/default.yaml | 6 ++++
common/lib/xmodule/xmodule/video_module.py | 1 +
9 files changed, 70 insertions(+), 2 deletions(-)
create mode 100644 common/lib/xmodule/xmodule/templates/discussion/default.yaml
create mode 100644 common/lib/xmodule/xmodule/templates/html/announcement.yaml
create mode 100644 common/lib/xmodule/xmodule/templates/html/everything.yaml
rename common/lib/xmodule/xmodule/templates/{sequential => sequence}/with_video.yaml (62%)
create mode 100644 common/lib/xmodule/xmodule/templates/video/default.yaml
diff --git a/common/lib/xmodule/xmodule/discussion_module.py b/common/lib/xmodule/xmodule/discussion_module.py
index 4bfaeee183..1deceac5d0 100644
--- a/common/lib/xmodule/xmodule/discussion_module.py
+++ b/common/lib/xmodule/xmodule/discussion_module.py
@@ -30,3 +30,4 @@ class DiscussionModule(XModule):
class DiscussionDescriptor(RawDescriptor):
module_class = DiscussionModule
+ template_dir_name = "discussion"
diff --git a/common/lib/xmodule/xmodule/html_module.py b/common/lib/xmodule/xmodule/html_module.py
index 798febfc1d..0cc336755d 100644
--- a/common/lib/xmodule/xmodule/html_module.py
+++ b/common/lib/xmodule/xmodule/html_module.py
@@ -33,6 +33,7 @@ class HtmlDescriptor(XmlDescriptor, EditingDescriptor):
mako_template = "widgets/html-edit.html"
module_class = HtmlModule
filename_extension = "xml"
+ template_dir_name = "html"
# VS[compat] TODO (cpennington): Delete this method once all fall 2012 course
# are being edited in the cms
diff --git a/common/lib/xmodule/xmodule/seq_module.py b/common/lib/xmodule/xmodule/seq_module.py
index 51a24010fc..9a40aee305 100644
--- a/common/lib/xmodule/xmodule/seq_module.py
+++ b/common/lib/xmodule/xmodule/seq_module.py
@@ -118,7 +118,7 @@ class SequenceDescriptor(MakoModuleDescriptor, XmlDescriptor):
stores_state = True # For remembering where in the sequence the student is
- template_dir_name = 'sequential'
+ template_dir_name = 'sequence'
@classmethod
def definition_from_xml(cls, xml_object, system):
diff --git a/common/lib/xmodule/xmodule/templates/discussion/default.yaml b/common/lib/xmodule/xmodule/templates/discussion/default.yaml
new file mode 100644
index 0000000000..fa6dcbff54
--- /dev/null
+++ b/common/lib/xmodule/xmodule/templates/discussion/default.yaml
@@ -0,0 +1,6 @@
+---
+metadata:
+ display_name: Discussion Tag
+data: |
+
+children: []
diff --git a/common/lib/xmodule/xmodule/templates/html/announcement.yaml b/common/lib/xmodule/xmodule/templates/html/announcement.yaml
new file mode 100644
index 0000000000..ae89c3890e
--- /dev/null
+++ b/common/lib/xmodule/xmodule/templates/html/announcement.yaml
@@ -0,0 +1,25 @@
+---
+metadata:
+ display_name: Announcement
+
+data: |
+
+ -
+
September 21
+
+
+ Words of encouragement! This is a short note that most students will read.
+ — Anant Agarwal (6.002x Principle Instructor)
+
+ Primary versus Secondary Updates:
Unfortunately, the internet throws a lot of text at students, and they
+ do not read everything that they are given. However, many students do read all that they are
+ given, and so detailed explainations in this section will benefit the most concientious.
+ Any essential information should be extremely quickly summarized in the primary section for skimmers.
+ Star Forum Poster
+ Students appriciate knowing that the course staff is reading what they post, and one of several ways
+ that you can do this is by acknowledging the start posters in your announcements.
+
+
+
+
+children: []
diff --git a/common/lib/xmodule/xmodule/templates/html/everything.yaml b/common/lib/xmodule/xmodule/templates/html/everything.yaml
new file mode 100644
index 0000000000..e7c9ff86b1
--- /dev/null
+++ b/common/lib/xmodule/xmodule/templates/html/everything.yaml
@@ -0,0 +1,28 @@
+Heading of document
+First subheading
+This is a paragraph. It will take care of line breaks for you.
HTML only parses the location
+
+of tags for inserting line breaks into your doc, not
+line
+breaks
+you
+add
+yourself.
+
+
+Links
+You can refer to other parts of the internet with a link, to other parts of your course by prepending your link with /course/
+Now a list:
+
+- An item
+- Another item
+- And yet another
+
+This list has an ordering
+
+- An item
+- Another item
+- Yet another item
+
+ Note, we have a lot of standard edX styles, so please try to avoid any custom styling, and make sure that you make a note of any custom styling that you do yourself so that we can incorporate it into
+tools that other people can use.
\ No newline at end of file
diff --git a/common/lib/xmodule/xmodule/templates/sequential/with_video.yaml b/common/lib/xmodule/xmodule/templates/sequence/with_video.yaml
similarity index 62%
rename from common/lib/xmodule/xmodule/templates/sequential/with_video.yaml
rename to common/lib/xmodule/xmodule/templates/sequence/with_video.yaml
index 2aed4594c1..c2fdc2dc1c 100644
--- a/common/lib/xmodule/xmodule/templates/sequential/with_video.yaml
+++ b/common/lib/xmodule/xmodule/templates/sequence/with_video.yaml
@@ -3,4 +3,4 @@ metadata:
display_name: Sequence with Video
data: ''
children:
- - 'i4x://edx/templates/video/Empty'
+ - 'i4x://edx/templates/video/default'
diff --git a/common/lib/xmodule/xmodule/templates/video/default.yaml b/common/lib/xmodule/xmodule/templates/video/default.yaml
new file mode 100644
index 0000000000..484618584c
--- /dev/null
+++ b/common/lib/xmodule/xmodule/templates/video/default.yaml
@@ -0,0 +1,6 @@
+---
+metadata:
+ display_name: edX Intro
+data: |
+
+children: []
diff --git a/common/lib/xmodule/xmodule/video_module.py b/common/lib/xmodule/xmodule/video_module.py
index a18a470272..792e570fb4 100644
--- a/common/lib/xmodule/xmodule/video_module.py
+++ b/common/lib/xmodule/xmodule/video_module.py
@@ -84,3 +84,4 @@ class VideoDescriptor(RawDescriptor):
module_class = VideoModule
stores_state = True
+ template_dir_name = "video"