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 note_edit_url = "{% url 'edit_note' note.id %}";
30 var user_authenticated = {% if user.is_authenticated %}true{% else %}false{% endif %};
33 <script src="{{ STATIC_URL }}js/setup-ajax.js"></script>
34 <script src="{{ STATIC_URL }}js/note-detail.js" ></script>
35 <script src="{{ STATIC_URL }}js/pxem.jQuery.js"></script>
36 <script src="{{ STATIC_URL }}js/marked.js" ></script>
37 <script src="{{ STATIC_URL }}js/annotator-full.min.js"></script>
40 {% if show_note_container %}
42 $(document).foundation('joyride', 'start');
43 initNoteContentPage();
47 {% if show_keywords %}
49 initNoteKeywordsPage();
55 {% block raw_content %}
56 <section id="note_content">
58 <div class="return-to-course show-for-large-up">
60 <div class="small-12 columns">
61 <a href="{{ note.course.get_absolute_url }}" class="inherit-color">
62 <i class="fa fa-angle-double-left"></i> See all notes for {{ note.course.name }}
68 <div id="note_header">
70 <div class="row header-byline">
71 <div class="small-12 columns">
72 <strong>Lecture note for {{ note.course.name }} </strong>
74 {% if note.course.department.school %}
75 {{ note.course.department.school.name }}
77 {{ note.course.school.name }}
80 <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>
84 <div class="row museo700">
85 <div class="small-12 columns header-title-row">
86 <span class="header-title">{{ note.name }} </span>
87 <span style="display: inline;">
88 <span class="show-for-large-up">
89 {% if user.is_authenticated %}
90 {% if already_thanked %}
91 <button id="thank-button-disabled" class="modify-button disabled opentip"
92 data-ot="You've already thanked this note"
93 {% include 'partial/opentip_settings.html' %}>
94 <i class="fa fa-thumbs-up"></i> Thank Note</button>
96 <button id="thank-button" class="modify-button"><i class="fa fa-thumbs-up"></i> Thank Note</button>
97 <button id="thank-button-disabled" class="modify-button disabled opentip hide"
98 data-ot="You've already thanked this note"
99 {% include 'partial/opentip_settings.html' %}>
100 <i class="fa fa-thumbs-up"></i> Thank Note</button>
103 <button id="thank-button-disabled" class="modify-button disabled opentip"
104 data-ot="Log in to thank this note"
105 {% include 'partial/opentip_settings.html' %}>
106 <i class="fa fa-thumbs-up"></i> Thank Note</button>
109 {% if user.is_authenticated %}
110 {% if already_flagged %}
111 <button id="flag-button-disabled" class="modify-button disabled opentip"
112 data-ot="You've already reported this note"
113 {% include 'partial/opentip_settings.html' %}>
114 <i class="fa fa-flag"></i> Report Note</button>
116 <button id="flag-button" class="modify-button"><i class="fa fa-flag"></i> Report Note</button>
117 <button id="flag-button-disabled" class="modify-button disabled opentip hide"
118 data-ot="You've already reported this note"
119 {% include 'partial/opentip_settings.html' %}>
120 <i class="fa fa-flag"></i> Report Note</button>
123 <button id="flag-button-disabled" class="modify-button disabled opentip"
124 data-ot="Log in to report this note"
125 {% include 'partial/opentip_settings.html' %}>
126 <i class="fa fa-flag"></i> Report Note</button>
129 {% if user.is_authenticated %}
130 <a href="{{ note.get_fp_url }}">
131 <button id="note-download-button" class="modify-button opentip"
132 data-ot="It costs 2 karma points to download a note"
133 {% include 'partial/opentip_settings.html' %}>
134 <i class="fa fa-download"></i> Download Note</button></a>
136 <button id="note-download-button-disabled" class="modify-button disabled opentip"
137 data-ot="Log in to download this note"
138 {% include 'partial/opentip_settings.html' %}>
139 <i class="fa fa-download"></i> Download Note</button>
142 {% if user.get_profile.can_edit_items and note.user != user %}
143 <button id="edit-note-tags" class="modify-button" data-reveal-id="note-tag-dialog">
144 <i class="fa fa-pencil-square-o"></i> Edit Tags
148 {% if note.user == request.user %}
149 <button id="edit-button" data-reveal-id="note-edit-dialog" class="modify-button"> <i class="fa fa-edit"></i> Edit This Note</button>
152 {% if note.license %}
153 {{ note.license.html|safe }} {% if note.upstream_link %}<a href="{{ note.upstream_link }}" target="_blank">{{ note.upstream_link|slice:":80" }}</a>{% endif %}
160 <div id="note-tags" class="row show-for-large-up">
161 <div class="small-12 columns">
162 <strong>Tags: </strong>
164 {% for tag in note.tags.all %}
165 <span class="tag-span">
166 {{ tag.name }}{% if not forloop.last %}, {% endif %}
170 </div><!-- /note_tags -->
173 <div id="note-tag-dialog" class="reveal-modal" data-reveal>
174 <a class="close-reveal-modal">×</a>
176 <div class="small-12 columns">
177 <h3>Edit this note's tags</h3>
178 <input id="note_tags_input" type="text" value="{% for tag in note.tags.all %}{{ tag.name }}{% if not forloop.last %}, {% endif %}{% endfor %}">
179 <button id="save_note_tags" type="submit" value="tags-form"><i class="fa fa-save"></i> Save</button>
184 <div id="note-edit-dialog" class="reveal-modal" data-reveal>
185 <a class="close-reveal-modal">×</a>
187 <div class="small-8 columns">
188 <h3>Edit Your Note</h3>
190 <div class="small-4 columns text-right">
191 <form method="POST" action="{% url 'note_delete' %}">
193 {{ note_delete_form }}
194 <button id="delete-note-button" type="submit" class="scary"><i class="fa fa-trash-o"></i> Delete Note</button>
199 <form method="POST" action="{{ note.get_absolute_url }}">
201 <div class="small-12 large-6 columns">
202 {% with note_edit_form.name as field %}
203 {{ field.errors|safe }}
204 <label for="{{ field.id_for_label }}">{{ field.label }}:</label>
206 <p>{{ field.help_text }}</p>
209 <div class="small-12 large-6 columns">
210 {% with note_edit_form.tags as field %}
211 {{ field.errors|safe }}
212 <label for="{{ field.id_for_label }}">{{ field.label }}:</label>
214 <p>{{ field.help_text }}</p>
217 <div class="small-12 columns text-center">
218 <button type="submit"><i class="fa fa-save"></i> Save</button>
224 </div><!-- /note header -->
227 <div id="tabs" class="small-12 columns">
229 <dd id="note-tab-button" class="{% if show_note_container %}active{% endif %}">
230 <a href="{{ note.get_absolute_url }}">Note</a>
232 <dd id="keywords-tab-button" class="{% if show_keywords %}active{% endif %}">
233 <a href="{{ note.get_absolute_keywords_url }}">Key Terms & Definitions</a>
236 <div class="tabs-content">
238 {% if show_note_container %}
239 <div id="note_container" class="">
240 {% if pdf_controls %}
241 <div id="zoom-buttons" class="row show-for-medium-up">
242 <div id="outline-btn-wrapper" class="small-1 columns hide show-for-medium-up">
243 <i id="outline-btn" class="zoom-button fa fa-bars fa-2x"></i>
245 <div class="small-4 columns">
247 <input id="scroll-to" type="text" style="width: 3em; display: inline" /></span>
249 <div class="small-2 small-centered columns center">
250 <i id="minus-btn" class="zoom-button fa fa-search-minus fa-2x"></i>
251 <i id="plus-btn" class="zoom-button fa fa-search-plus fa-2x"></i>
257 <div class="small-12 small-centered columns medium-12 large-12 body_copy">
258 {% if note.static_html %}
259 <div id="note-content-wrapper" class="note-text">
260 {% if note.has_markdown %}
261 <span id="note-markdown" data-markdown="{{note.notemarkdown.markdown}}"></span>
263 <iframe style="border:none; width:100%; min-height: 1000px;"
264 id="noteframe"></iframe>
269 </div> <!-- .note-text -->
271 {% else %} {# note.static_html #}
272 <div class="note-error">
273 This document's content is currently unavailable. Please try again later.
275 {% endif %} {# note.static_html #}
276 </div><!-- /body_copy -->
278 </div><!-- /note_container -->
280 {% if show_keywords %}
281 <div id="keywords" class="content">
283 <div class="small-12 columns">
284 {% if user.is_authenticated %}
285 <p id="keyword-intro">These key terms and definitions have been defined by KarmaNotes users.
286 You can edit them for accuracy and add more if you like.</p>
287 <p><button id="edit-keywords-button" class="museo700"><i class="fa fa-edit"></i> Edit Key Terms & Definitions</button></p>
289 <p id="keyword-intro">These key terms and definitions have been defined by KarmaNotes users.</p>
291 <table id="keywords-data-table">
298 {% for keyword in keywords %}
300 <td>{{ keyword.word }}</td>
301 <td>{{ keyword.definition }}</td>
306 <form id="keyword-form" action="{{ note.get_absolute_keywords_url }}" method="post" class="hide">
308 {{ keyword_formset.management_form }}
309 <div class="hide" id="keyword-form-prototype">
310 <div class="row keyword-form-row">
311 <div class="small-12 large-4 columns">
312 {{ keyword_prototype_form.keyword }}
314 <div class="small-12 large-8 columns">
315 {{ keyword_prototype_form.definition }}
316 {{ keyword_prototype_form.id }}
319 <hr class="hide-for-large-up" />
321 <div id="keyword-form-rows">
322 {% for form_row in keyword_formset %}
323 <div class="row keyword-form-row" data-index="{{ forloop.counter0 }}">
324 <div class="small-12 large-4 columns">
325 {{ form_row.keyword }}
327 <div class="small-12 large-8 columns">
328 {{ form_row.definition }}
332 <hr class="hide-for-large-up" />
335 <div class="row hide-for-medium-down">
336 <div class="small-12 columns">
337 <p class="keywords-hint">(Click <i class="fa fa-plus"></i> or press TAB in the last definition for another row)</p>
341 <div class="small-2 columns">
342 <button type="submit" name="action" value="keyword-form">Save</button>
344 <div class="small-9 large-10 columns center">
345 <i id="add-row-btn" class="fa fa-plus fa-2x"></i>
351 </div> <!-- keywords -->
356 </section><!--/note_content-->
358 <ol class="joyride-list" data-joyride
359 data-options="cookie_monster: true; cookie_name: note_detail_joyride">
360 <li data-id="note-content-wrapper" data-text="Awesome!" data-options="tip_location: top">
361 <p>You can highlight important words or phrases in this note to add definitions for them.</p>
363 <li data-id="keywords-tab-button" data-text="Awesome!" data-options="tip_location: top">
364 <p>Keywords you define will appear here, and you can define new ones here too.</p>