Pull out discussion-thread-list-template into its own file.

This commit is contained in:
Ibrahim Awwal
2012-09-02 15:13:02 -07:00
parent 81bfdddccc
commit 722ce53e61
5 changed files with 29 additions and 29 deletions

View File

@@ -6,7 +6,6 @@ class @DiscussionThreadView extends Backbone.View
template: _.template($("#thread-template").html())
render: ->
console.log(@model)
@$el.html(@template(@model.toJSON()))
@model.bind "change", @updateModelDetails
if window.user.following(@model)

View File

@@ -0,0 +1,26 @@
<script type="text/template" id="thread-list-template">
<div class="browse-search">
<div class="browse is-open">
<a href="#" class="browse-topic-drop-icon"></a>
<a href="#" class="browse-topic-drop-btn"><span class="current-board">Homework / Week 1</span> <span class="drop-arrow"></span></a>
</div>
<%include file="_filter_dropdown.html" />
<div class="search">
<form class="post-search">
<input type="text" placeholder="Search all discussions" class="post-search-field">
</form>
</div>
</div>
<div class="sort-bar">
<span class="sort-label">Sort by:</span>
<ul>
<li><a href="#" class="active" data-sort="date">date</a></li>
<li><a href="#" data-sort="votes">votes</a></li>
<li><a href="#" data-sort="comments">comments</a></li>
</ul>
</div>
<div class="post-list-wrapper">
<ul class="post-list">
</ul>
</div>
</script>

View File

@@ -1,30 +1,3 @@
<script type="text/template" id="thread-list-template">
<div class="browse-search">
<div class="browse is-open">
<a href="#" class="browse-topic-drop-icon"></a>
<a href="#" class="browse-topic-drop-btn"><span class="current-board">Homework / Week 1</span> <span class="drop-arrow"></span></a>
</div>
<%include file="_filter_dropdown.html" />
<div class="search">
<form class="post-search">
<input type="text" placeholder="Search all discussions" class="post-search-field">
</form>
</div>
</div>
<div class="sort-bar">
<span class="sort-label">Sort by:</span>
<ul>
<li><a href="#" class="active" data-sort="date">date</a></li>
<li><a href="#" data-sort="votes">votes</a></li>
<li><a href="#" data-sort="comments">comments</a></li>
</ul>
</div>
<div class="post-list-wrapper">
<ul class="post-list">
</ul>
</div>
</script>
<script type="text/template" id="thread-template">
<article class="discussion-article" data-id="${'<%- id %>'}">
<a href="#" class="dogear"></a>

View File

@@ -30,4 +30,5 @@
</div>
</section>
<%include file="_underscore_templates.html" />
<%include file="_underscore_templates.html" />
<%include file="_thread_list_template.html" />

View File

@@ -32,3 +32,4 @@
</section>
<%include file="_underscore_templates.html" />
<%include file="_thread_list_template.html" />