1 {% extends "base.html" %}
2 {% load url from future %}
11 <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/note_course_pages.css">
12 <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/annotator.min.css" />
16 {% block pagescripts %}
17 <script type="text/javascript">
18 var note_id = {{ note.id }};
19 var note_thank_url = "{% url 'thank_note' note.id %}"
20 var note_flag_url = "{% url 'flag_note' note.id %}"
21 var edit_note_tags_url = "{% url 'edit_note_tags' note.id %}"
22 var note_downloaded_url = "{% url 'downloaded_note' note.id %}"
23 var note_contents_url = "{{ S3_URL }}{{ note.get_relative_s3_path }}"
24 var pdfControls = {% if pdf_controls %} true {% else %} false {% endif %};
25 var csrf_token = "{{ csrf_token }}";
26 var annotator_js_url = "{{ STATIC_URL }}js/annotator-full.min.js";
27 var annotator_css_url = "{{ STATIC_URL }}css/annotator.min.css";
28 var setup_ajax_url = "{{ STATIC_URL }}js/setup-ajax.js";
29 var user_authenticated = {% if user.is_authenticated %}true{% else %}false{% endif %};
32 <script src="{{ STATIC_URL }}js/setup-ajax.js"></script>
33 <script src="{{ STATIC_URL }}js/note-detail.js" ></script>
34 <script src="{{ STATIC_URL }}js/pxem.jQuery.js"></script>
35 <script src="{{ STATIC_URL }}js/marked.js" ></script>
36 <script src="{{ STATIC_URL }}js/annotator-full.min.js"></script>
39 {% if show_note_container %}
41 $(document).foundation('joyride', 'start');
42 initNoteContentPage();
46 {% if show_keywords %}
48 initNoteKeywordsPage();
60 {% block raw_content %}
61 <section id="note_content">
63 <div class="return-to-course show-for-large-up">
65 <div class="small-12 columns">
66 <a href="{{ note.course.get_absolute_url }}" class="inherit-color">
67 <i class="fa fa-angle-double-left"></i> See all notes for {{ note.course.name }}
73 <div id="note_header">
75 <div class="row header-byline">
76 <div class="small-12 columns">
77 <strong>Lecture note for {{ note.course.name }} </strong>
79 {% if note.course.department.school %}
80 {{ note.course.department.school.name }}
82 {{ note.course.school.name }}
85 <span style="display: inline;"><span class="show-for-large-up"><i class="fa fa-thumbs-up"></i> <span id="thank-number">{{ note.thanks }}</span> Thank{{ note.thanks|pluralize }}</span></span>
89 <div class="row museo700">
90 <div class="small-12 columns header-title-row">
91 <span class="header-title">{{ note.name }} </span>
92 <span style="display: inline;">
93 <span class="show-for-large-up">
94 {% if user.is_authenticated %}
95 {% if already_thanked %}
96 <button id="thank-button-disabled" class="modify-button disabled opentip"
97 data-ot="You've already thanked this note"
98 {% include 'partial/opentip_settings.html' %}>
99 <i class="fa fa-thumbs-up"></i> Thank Note</button>
101 <button id="thank-button" class="modify-button"><i class="fa fa-thumbs-up"></i> Thank Note</button>
102 <button id="thank-button-disabled" class="modify-button disabled opentip hide"
103 data-ot="You've already thanked this note"
104 {% include 'partial/opentip_settings.html' %}>
105 <i class="fa fa-thumbs-up"></i> Thank Note</button>
108 <button id="thank-button-disabled" class="modify-button disabled opentip"
109 data-ot="Log in to thank this note"
110 {% include 'partial/opentip_settings.html' %}>
111 <i class="fa fa-thumbs-up"></i> Thank Note</button>
114 {% if user.is_authenticated %}
115 {% if already_flagged %}
116 <button id="flag-button-disabled" class="modify-button disabled opentip"
117 data-ot="You've already reported this note"
118 {% include 'partial/opentip_settings.html' %}>
119 <i class="fa fa-flag"></i> Report Note</button>
121 <button id="flag-button" class="modify-button"><i class="fa fa-flag"></i> Report Note</button>
122 <button id="flag-button-disabled" class="modify-button disabled opentip hide"
123 data-ot="You've already reported this note"
124 {% include 'partial/opentip_settings.html' %}>
125 <i class="fa fa-flag"></i> Report Note</button>
128 <button id="flag-button-disabled" class="modify-button disabled opentip"
129 data-ot="Log in to report this note"
130 {% include 'partial/opentip_settings.html' %}>
131 <i class="fa fa-flag"></i> Report Note</button>
134 {% if user.is_authenticated %}
135 <a href="{{ note.get_fp_url }}">
136 <button id="note-download-button" class="modify-button opentip"
137 data-ot="It costs 2 karma points to download a note"
138 {% include 'partial/opentip_settings.html' %}>
139 <i class="fa fa-download"></i> Download Note</button></a>
141 <button id="note-download-button-disabled" class="modify-button disabled opentip"
142 data-ot="Log in to download this note"
143 {% include 'partial/opentip_settings.html' %}>
144 <i class="fa fa-download"></i> Download Note</button>
147 {% if user.get_profile.can_edit_items and note.user != user %}
148 <button id="edit-note-tags" class="modify-button" data-reveal-id="note-tag-dialog">
149 <i class="fa fa-pencil-square-o"></i> Edit Tags
153 {% if note.user == request.user %}
154 <button id="edit-button" data-reveal-id="note-edit-dialog" class="modify-button"> <i class="fa fa-edit"></i> Edit This Note</button>
157 {% if note.license %}
158 {{ note.license.html|safe }} {% if note.upstream_link %}<a href="{{ note.upstream_link }}" target="_blank">{{ note.upstream_link|slice:":80" }}</a>{% endif %}
165 {% if note.category %}
166 <div id="note-category" class="row show-for-large-up">
167 <div class="small-12 columns">
168 <em>{{ note.get_category_display }}</em>
173 <div id="note-tags" class="row show-for-large-up">
174 <div class="small-12 columns">
175 <strong>Tags: </strong>
177 {% if note.tags.all %}
178 {% for tag in note.tags.all %}
179 <span class="tag-span">
180 {{ tag.name }}{% if not forloop.last %}, {% endif %}
184 <em class="light">(none defined yet)</em>
187 </div><!-- /note_tags -->
190 <div id="note-tag-dialog" class="reveal-modal" data-reveal>
191 <a class="close-reveal-modal">×</a>
193 <div class="small-12 columns">
194 <h3>Edit this note's tags</h3>
195 <input id="note_tags_input" type="text" value="{% for tag in note.tags.all %}{{ tag.name }}{% if not forloop.last %}, {% endif %}{% endfor %}">
196 <button id="save_note_tags" type="submit" value="tags-form"><i class="fa fa-save"></i> Save</button>
201 <div id="note-edit-dialog" class="reveal-modal" data-reveal>
202 <a class="close-reveal-modal">×</a>
204 <div class="small-8 columns">
205 <h3>Edit Your Note</h3>
207 <div class="small-4 columns text-right">
208 <form method="POST" action="{% url 'note_delete' %}">
210 {{ note_delete_form }}
211 <button id="delete-note-button" type="submit" class="scary"><i class="fa fa-trash-o"></i> Delete Note</button>
216 <form method="POST" action="{{ note.get_absolute_url }}">
218 <div class="small-12 large-6 columns">
219 {% with note_edit_form.name as field %}
220 {{ field.errors|safe }}
221 <label for="{{ field.id_for_label }}">{{ field.label }}:</label>
223 <p>{{ field.help_text }}</p>
226 <div class="small-12 large-6 columns">
227 {% with note_edit_form.tags as field %}
228 {{ field.errors|safe }}
229 <label for="{{ field.id_for_label }}">{{ field.label }}:</label>
231 <p>{{ field.help_text }}</p>
234 <div class="small-12 columns text-center">
235 <button type="submit"><i class="fa fa-save"></i> Save</button>
241 </div><!-- /note header -->
244 <div id="tabs" class="small-12 columns">
246 <dd id="note-tab-button" class="{% if show_note_container %}active{% endif %}">
247 <a href="{{ note.get_absolute_url }}">Note</a>
249 <dd id="keywords-tab-button" class="{% if show_keywords %}active{% endif %}">
250 <a href="{{ note.get_absolute_keywords_url }}">Key Terms & Definitions</a>
252 <dd id="quiz-tab-button" class="{% if show_quiz %}active{% endif %}">
253 <a href="{{ note.get_absolute_quiz_url }}">Quiz Questions</a>
256 <div class="tabs-content">
258 {% if show_note_container %}
259 {% include 'notes/note_detail.html' %}
261 {% if show_keywords %}
262 {% include 'notes/note_keywords.html' %}
265 {% include 'notes/note_quiz.html' %}
270 </section><!--/note_content-->
272 <ol class="joyride-list" data-joyride
273 data-options="cookie_monster: true; cookie_name: note_detail_joyride">
274 <li data-id="note-content-wrapper" data-text="Awesome!" data-options="tip_location: top">
275 <p>You can highlight important words or phrases in this note to add definitions for them.</p>
277 <li data-id="keywords-tab-button" data-text="Awesome!" data-options="tip_location: top">
278 <p>Keywords you define will appear here, and you can define new ones here too.</p>
280 {% if note.thanks < 3 %}
281 <li data-id="thank-number" data-text="Awesome!" data-options="tip_location: top">
282 <p>Keywords and quizzes are automatically generated when a note gets {{ note.total_thanks_for_mturk }} thanks. This note needs {{ note.remaining_thanks_for_mturk }} more!</p>