Commit 21c06c74 by Your Name

inline mustache working

parent c6bece86
0f446e9d6cbcb18b0982ff31a746ea770332324b
\ No newline at end of file
5fe5d57a2b8cb1229d5b41de5a604c405c911249
\ No newline at end of file
28751: Locked by 28751 at Fri Feb 08 14:14:21 -0500 2013
---
cursor_positions:
- :path: common/static/coffee/src/discussion/views/discussion_content_view.coffee
:cursor_offset: 0
:timestamp: 2013-01-29 15:05:38 -05:00
- :path: common/static/coffee/src/discussion/views/discussion_thread_view.coffee
:cursor_offset: 1383
:timestamp: 2013-01-29 15:05:38 -05:00
- :path: common/static/coffee/src/discussion/views/discussion_thread_list_view.coffee
:cursor_offset: 766
:timestamp: 2013-01-29 15:05:38 -05:00
- :path: lms/djangoapps/django_comment_client/base/views.py
:cursor_offset: 0
:timestamp: 2013-02-07 10:06:26 -05:00
- :path: common/static/coffee/src/discussion/models/discussion_user.coffee
:cursor_offset: 0
:timestamp: 2013-01-29 15:05:38 -05:00
- :path: lms/djangoapps/django_comment_client/utils.py
:cursor_offset: 811
:timestamp: 2013-02-07 10:06:27 -05:00
- :path: lms/templates/discussion/mustache/_new_post.mustache
:cursor_offset: 0
:timestamp: 2013-02-08 10:34:14 -05:00
- :path: common/static/coffee/src/discussion/views/new_post_inline_vew.coffee
:cursor_offset: 0
:timestamp: 2013-02-05 12:00:15 -05:00
- :path: lms/templates/discussion/mustache/_inline_discussion.mustache
:cursor_offset: 278
:timestamp: 2013-02-08 10:34:44 -05:00
- :path: common/static/coffee/src/discussion/discussion_module_view.coffee
:cursor_offset: 2546
:timestamp: 2013-02-08 12:47:34 -05:00
- :path: lms/templates/discussion/_new_post.html
:cursor_offset: 3183
:timestamp: 2013-02-07 10:06:27 -05:00
:selection_offset: 2424
:block_selection_mode: false
- :path: lms/templates/discussion/mustache/_inline_discussion_cohorted.mustache
:cursor_offset: 1099
:timestamp: 2013-02-08 12:44:34 -05:00
- :path: lms/djangoapps/django_comment_client/forum/views.py
:cursor_offset: 5507
:timestamp: 2013-02-08 12:42:07 -05:00
files_to_retain: 0
---
open_files:
- lms/templates/discussion/mustache/_inline_discussion.mustache
- common/static/coffee/src/discussion/discussion_module_view.coffee
- lms/templates/discussion/_new_post.html
- lms/templates/discussion/mustache/_inline_discussion_cohorted.mustache
- lms/djangoapps/django_comment_client/forum/views.py
---
bounds:
x: 65
y: 24
width: 1857
height: 1085
tree_width: 667
91fb8f5bb1f34326b4cb90f3d3770affcd1d7d58
\ No newline at end of file
...@@ -70,6 +70,7 @@ if Backbone? ...@@ -70,6 +70,7 @@ if Backbone?
DiscussionUtil.loadRoles(response.roles) DiscussionUtil.loadRoles(response.roles)
allow_anonymous = response.allow_anonymous allow_anonymous = response.allow_anonymous
allow_anonymous_to_peers = response.allow_anonymous_to_peers allow_anonymous_to_peers = response.allow_anonymous_to_peers
cohorts = response.cohorts
# $elem.html("Hide Discussion") # $elem.html("Hide Discussion")
@discussion = new Discussion() @discussion = new Discussion()
@discussion.reset(response.discussion_data, {silent: false}) @discussion.reset(response.discussion_data, {silent: false})
...@@ -78,8 +79,12 @@ if Backbone? ...@@ -78,8 +79,12 @@ if Backbone?
#determined in the coffeescript based on whether or not there's a #determined in the coffeescript based on whether or not there's a
#group id #group id
$discussion = $(Mustache.render $("script#_inline_discussion").html(), {'threads':response.discussion_data, 'discussionId': discussionId, 'allow_anonymous_to_peers': allow_anonymous_to_peers, 'allow_anonymous': allow_anonymous}) if response.is_cohorted
source = "script#_inline_discussion_cohorted"
else
source = "script#_inline_discussion"
$discussion = $(Mustache.render $(source).html(), {'threads':response.discussion_data, 'discussionId': discussionId, 'allow_anonymous_to_peers': allow_anonymous_to_peers, 'allow_anonymous': allow_anonymous, 'cohorts':cohorts})
if @$('section.discussion').length if @$('section.discussion').length
@$('section.discussion').replaceWith($discussion) @$('section.discussion').replaceWith($discussion)
else else
......
...@@ -137,6 +137,7 @@ def inline_discussion(request, course_id, discussion_id): ...@@ -137,6 +137,7 @@ def inline_discussion(request, course_id, discussion_id):
cohorts_list = list() cohorts_list = list()
if is_cohorted: if is_cohorted:
cohorts_list.append({'name':'All Groups','id':None})
#if you're a mod, send all cohorts and let you pick #if you're a mod, send all cohorts and let you pick
if cached_has_permission(request.user, "see_all_cohorts", course_id): if cached_has_permission(request.user, "see_all_cohorts", course_id):
...@@ -153,8 +154,6 @@ def inline_discussion(request, course_id, discussion_id): ...@@ -153,8 +154,6 @@ def inline_discussion(request, course_id, discussion_id):
else: else:
user_cohort_name = user_cohort_id = None user_cohort_name = user_cohort_id = None
cohorts_list.append({'name':'All Groups','id':None})
if user_cohort: if user_cohort:
cohorts_list.append({'name':user_cohort_name, 'id':user_cohort_id}) cohorts_list.append({'name':user_cohort_name, 'id':user_cohort_id})
else: else:
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
<div class="inner-wrapper"> <div class="inner-wrapper">
<div class="new-post-form-errors"> <div class="new-post-form-errors">
</div> </div>
AAAAAAA
<form class="new-post-form"> <form class="new-post-form">
<div class="form-row"> <div class="form-row">
<input type="text" class="new-post-title" name="title" placeholder="Title"> <input type="text" class="new-post-title" name="title" placeholder="Title">
......
<section class="discussion" data-discussion-id="{{discussionId}}">
<article class="new-post-article">
<span class="topic" data-discussion-id="{{discussionId}}" />
<div class="inner-wrapper">
<div class="new-post-form-errors">
</div>
<form class="new-post-form">
<div class="form-row">
<input type="text" class="new-post-title" name="title" placeholder="Title">
</div>
<div class="form-row">
<div class="new-post-body" name="body" placeholder="Enter your question or comment&hellip;"></div>
<!---<div class="new-post-preview"><span class="new-post-preview-label">Preview</span></div>-->
</div>
{{! TODO tags: Getting rid of tags for now. }}
{{!<div class="form-row">}}
{{! <input type="text" class="new-post-tags" name="tags" placeholder="Tags">}}
{{!</div>}}
<input type="submit" class="submit" value="Add post">
<a href="#" class="new-post-cancel">Cancel</a>
<div class="options">
<input type="checkbox" name="follow" class="discussion-follow" class="discussion-follow" id="new-post-follow" checked><label for="new-post-follow">follow this post</label>
<br>
{{#allow_anonymous}}
<input type="checkbox" name="anonymous" class="discussion-anonymous" id="new-post-anonymous"><label for="new-post-anonymous">post anonymously</label>
{{/allow_anonymous}}
{{#allow_anonymous_to_peers}}
<input type="checkbox" name="anonymous" class="discussion-anonymous-to-peers" id="new-post-anonymous-to-peers"><label for="new-post-anonymous-to-peers">post anonymously to classmates</label>
{{/allow_anonymous_to_peers}}
<div class="form-group-label choose-cohort">
Make visible to:
<select class="group-filter-select new-post-group" name = "group_id">
{{#cohorts}}
<option value="{{id}}">{{name}}</option>
{{/cohorts}}
</select>
</div>
</div>
</form>
</div>
</article>
<section class="threads">
{{#threads}}
<article class="discussion-thread" id="thread_{{id}}">
</article>
{{/threads}}
</section>
<section class="pagination">
</section>
</section>
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