_new_post.html 3.22 KB
Newer Older
Arjun Singh committed
1 2 3 4 5 6 7 8 9 10 11
<%def name="render_form_filter_dropdown(map)">
    % for child in map["children"]:
        % if child in map["entries"]:
            ${render_entry(map["entries"], child)}
        %else:
            ${render_category(map["subcategories"], child)}
        %endif
    %endfor
</%def>

<%def name="render_entry(entries, entry)">
Arjun Singh committed
12
    <li><a href="#" class="topic" data-discussion_id="${entries[entry]['id']}">${entry}</a></li>
Arjun Singh committed
13 14 15 16 17 18 19 20 21 22 23
</%def>

<%def name="render_category(categories, category)">
    <li>
        <a href="#">${category}</a>
        <ul>
            ${render_form_filter_dropdown(categories[category])}
        </ul>
    </li>
</%def>

24
<article class="new-post-article">
25
    <div class="inner-wrapper">        
26 27
        <form class="new-post-form">
            <div class="left-column">
Arjun Singh committed
28
                <label>Create new post about:</label>
29
                <div class="form-topic-drop">
30
                    <a href="#" class="topic_dropdown_button">All<span class="drop-arrow"></span></a>
Arjun Singh committed
31 32
                    <div class="topic_menu_wrapper">
                        <div class="topic_menu_search">
33 34
                            <input type="text" class="form-topic-drop-search-input" placeholder="filter topics">
                        </div>
Arjun Singh committed
35
                        <ul class="topic_menu">
Arjun Singh committed
36
                            ${render_form_filter_dropdown(category_map)}
37 38 39 40
                        </ul>
                    </div>
                </div>
                <div class="options">
Arjun Singh committed
41
                    <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>
42
                    <br>
43 44 45 46 47
                    % if course.metadata.get("allow_anonymous", True):
                        <input type="checkbox" name="anonymous" class="discussion-anonymous" id="new-post-anonymous"><label for="new-post-anonymous">post anonymously</label>
                    %elif course.metadata.get("allow_anonymous_to_peers", False):
                        <input type="checkbox" name="anonymous_to_peers" class="discussion-anonymous-to-peers" id="new-post-anonymous-to-peers"><label for="new-post-anonymous-to-peers">post anonymously to classmates</label>
                    %endif
48 49 50
                </div>
            </div>
            <div class="right-column">
51
                <ul class="new-post-form-errors"></ul>
52 53 54 55
                <div class="form-row">
                    <input type="text" class="new-post-title" name="title" placeholder="Title">
                </div>
                <div class="form-row">
56 57
                    <div class="new-post-body" name="body" placeholder="Enter your question or comment…"></div>
                    <!---<div class="new-post-preview"><span class="new-post-preview-label">Preview</span></div>-->
58
                </div>
59 60 61 62
                ## TODO tags commenting out til we figure out what to do w/ tags
                ##<div class="form-row">
                ##    <input type="text" class="new-post-tags" name="tags" placeholder="Tags">
                ##</div>
63 64 65 66 67
                <input type="submit" class="submit" value="Add post">
                <a href="#" class="new-post-cancel">Cancel</a>
            </div>
        </form>
    </div>
Arjun Singh committed
68
</article>