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 %}";
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>
40 $(document).foundation('joyride', 'start');
45 {% block raw_content %}
46 <section id="note_content">
48 <div class="return-to-course show-for-large-up">
50 <div class="small-12 columns">
51 <a href="{{ note.course.get_absolute_url }}" class="inherit-color">
52 <i class="fa fa-angle-double-left"></i> See all notes for {{ note.course.name }}
58 <div id="note_header">
60 <div class="row header-byline">
61 <div class="small-12 columns">
62 <strong>Lecture note for {{ note.course.name }} </strong>
64 {% if note.course.department.school %}
65 {{ note.course.department.school.name }}
67 {{ note.course.school.name }}
70 <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>
74 <div class="row museo700">
75 <div class="small-12 columns header-title-row">
76 <span class="header-title">{{ note.name }} </span>
77 <span style="display: inline;">
78 <span class="show-for-large-up">
79 {% if user.is_authenticated %}
80 {% if already_thanked %}
81 <button id="thank-button-disabled" class="modify-button disabled opentip"
82 data-ot="You've already thanked this note"
83 {% include 'partial/opentip_settings.html' %}>
84 <i class="fa fa-thumbs-up"></i> Thank Note</button>
86 <button id="thank-button" class="modify-button"><i class="fa fa-thumbs-up"></i> Thank Note</button>
87 <button id="thank-button-disabled" class="modify-button disabled opentip hide"
88 data-ot="You've already thanked this note"
89 {% include 'partial/opentip_settings.html' %}>
90 <i class="fa fa-thumbs-up"></i> Thank Note</button>
93 <button id="thank-button-disabled" class="modify-button disabled opentip"
94 data-ot="Log in to thank this note"
95 {% include 'partial/opentip_settings.html' %}>
96 <i class="fa fa-thumbs-up"></i> Thank Note</button>
99 {% if user.is_authenticated %}
100 {% if already_flagged %}
101 <button id="flag-button-disabled" class="modify-button disabled opentip"
102 data-ot="You've already reported this note"
103 {% include 'partial/opentip_settings.html' %}>
104 <i class="fa fa-flag"></i> Report Note</button>
106 <button id="flag-button" class="modify-button"><i class="fa fa-flag"></i> Report Note</button>
107 <button id="flag-button-disabled" class="modify-button disabled opentip hide"
108 data-ot="You've already reported this note"
109 {% include 'partial/opentip_settings.html' %}>
110 <i class="fa fa-flag"></i> Report Note</button>
113 <button id="flag-button-disabled" class="modify-button disabled opentip"
114 data-ot="Log in to report this note"
115 {% include 'partial/opentip_settings.html' %}>
116 <i class="fa fa-flag"></i> Report Note</button>
119 {% if user.is_authenticated %}
120 <a href="{{ note.get_fp_url }}">
121 <button id="note-download-button" class="modify-button opentip"
122 data-ot="It costs 2 karma points to download a note"
123 {% include 'partial/opentip_settings.html' %}>
124 <i class="fa fa-download"></i> Download Note</button></a>
126 <button id="note-download-button-disabled" class="modify-button disabled opentip"
127 data-ot="Log in to download this note"
128 {% include 'partial/opentip_settings.html' %}>
129 <i class="fa fa-download"></i> Download Note</button>
132 {% if user.get_profile.can_edit_items and note.user != user %}
133 <button id="edit-note-tags" class="modify-button" data-reveal-id="note-tag-dialog">
134 <i class="fa fa-pencil-square-o"></i> Edit Tags
138 {% if note.user == request.user %}
139 <button id="edit-button" data-reveal-id="note-edit-dialog" class="modify-button"> <i class="fa fa-edit"></i> Edit This Note</button>
142 {% if note.license %}
143 {{ note.license.html|safe }} {% if note.upstream_link %}<a href="{{ note.upstream_link }}" target="_blank">{{ note.upstream_link|slice:":80" }}</a>{% endif %}
150 <div id="note-tags" class="row show-for-large-up">
151 <div class="small-12 columns">
152 <strong>Tags: </strong>
154 {% for tag in note.tags.all %}
155 <span class="tag-span">
156 {{ tag.name }}{% if not forloop.last %}, {% endif %}
160 </div><!-- /note_tags -->
163 <div id="note-tag-dialog" class="reveal-modal" data-reveal>
164 <a class="close-reveal-modal">×</a>
166 <div class="small-12 columns">
167 <h3>Edit this note's tags</h3>
168 <input id="note_tags_input" type="text" value="{% for tag in note.tags.all %}{{ tag.name }}{% if not forloop.last %}, {% endif %}{% endfor %}">
169 <button id="save_note_tags" type="submit" value="tags-form"><i class="fa fa-save"></i> Save</button>
174 <div id="note-edit-dialog" class="reveal-modal" data-reveal>
175 <a class="close-reveal-modal">×</a>
177 <div class="small-8 columns">
178 <h3>Edit Your Note</h3>
180 <div class="small-4 columns text-right">
181 <form method="POST" action="{% url 'note_delete' %}">
183 {{ note_delete_form }}
184 <button id="delete-note-button" type="submit" class="scary"><i class="fa fa-trash-o"></i> Delete Note</button>
189 <form method="POST" action="{{ note.get_absolute_url }}">
191 <div class="small-12 large-6 columns">
192 {% with note_edit_form.name as field %}
193 {{ field.errors|safe }}
194 <label for="{{ field.id_for_label }}">{{ field.label }}:</label>
196 <p>{{ field.help_text }}</p>
199 <div class="small-12 large-6 columns">
200 {% with note_edit_form.tags as field %}
201 {{ field.errors|safe }}
202 <label for="{{ field.id_for_label }}">{{ field.label }}:</label>
204 <p>{{ field.help_text }}</p>
207 <div class="small-12 columns text-center">
208 <button type="submit"><i class="fa fa-save"></i> Save</button>
214 </div><!-- /note header -->
217 <div id="tabs" class="small-12 columns">
218 <dl class="tabs show-for-large-up">
219 <dd id="note-tab-button" class="{% if show_note_container %}active{% endif %}">
220 <a href="{{ note.get_absolute_url }}">Note</a>
222 <dd id="keywords-tab-button" class="{% if show_keywords %}active{% endif %}">
223 <a href="{{ note.get_absolute_keywords_url }}">Key Terms & Definitions</a>
226 <div class="tabs-content">
228 {% if show_note_container %}
229 <div id="note_container" class="">
230 {% if pdf_controls %}
231 <div id="zoom-buttons" class="row show-for-medium-up">
232 <div id="outline-btn-wrapper" class="small-1 columns hide show-for-medium-up">
233 <i id="outline-btn" class="zoom-button fa fa-bars fa-2x"></i>
235 <div class="small-4 columns">
237 <input id="scroll-to" type="text" style="width: 3em; display: inline" /></span>
239 <div class="small-2 small-centered columns center">
240 <i id="minus-btn" class="zoom-button fa fa-search-minus fa-2x"></i>
241 <i id="plus-btn" class="zoom-button fa fa-search-plus fa-2x"></i>
247 <div class="small-12 small-centered columns medium-12 large-12 body_copy">
248 {% if note.static_html %}
249 <div id="note-content-wrapper" class="note-text">
250 {% if note.has_markdown %}
251 <span id="note-markdown" data-markdown="{{note.notemarkdown.markdown}}"></span>
253 <iframe style="border:none; width:100%; min-height: 1000px;"
254 id="noteframe"></iframe>
259 </div> <!-- .note-text -->
261 {% else %} {# note.static_html #}
262 <div class="note-error">
263 This document's content is currently unavailable. Please try again later.
265 {% endif %} {# note.static_html #}
266 </div><!-- /body_copy -->
268 </div><!-- /note_container -->
270 {% if show_keywords %}
271 <div id="keywords" class="content">
273 <div class="small-12 columns">
274 <p>These key terms and definitions have been defined by KarmaNotes users.
275 You can edit them for accuracy and add more if you like.</p>
276 <p><button id="edit-keywords-button" class="museo700"><i class="fa fa-edit"></i> Edit Key Terms & Definitions</button></p>
277 <table id="keywords-data-table">
284 {% for keyword in keywords %}
286 <td>{{ keyword.word }}</td>
287 <td>{{ keyword.definition }}</td>
292 <form id="keyword-form" action="{{ note.get_absolute_keywords_url }}" method="post" class="hide">
294 {{ keyword_formset.management_form }}
295 <div class="hide" id="keyword-form-prototype">
296 <div class="row keyword-form-row">
297 <div class="small-12 large-4 columns">
298 {{ keyword_prototype_form.keyword }}
300 <div class="small-12 large-8 columns">
301 {{ keyword_prototype_form.definition }}
302 {{ keyword_prototype_form.id }}
305 <hr class="hide-for-large-up" />
307 <div id="keyword-form-rows">
308 {% for form_row in keyword_formset %}
309 <div class="row keyword-form-row" data-index="{{ forloop.counter0 }}">
310 <div class="small-12 large-4 columns">
311 {{ form_row.keyword }}
313 <div class="small-12 large-8 columns">
314 {{ form_row.definition }}
318 <hr class="hide-for-large-up" />
321 <div class="row hide-for-medium-down">
322 <div class="small-12 columns">
323 <p class="keywords-hint">(Click <i class="fa fa-plus"></i> or press TAB in the last definition for another row)</p>
327 <div class="small-2 columns">
328 <button type="submit" name="action" value="keyword-form">Save</button>
330 <div class="small-9 large-10 columns center">
331 <i id="add-row-btn" class="fa fa-plus fa-2x"></i>
337 </div> <!-- keywords -->
342 </section><!--/note_content-->
344 <ol class="joyride-list" data-joyride
345 data-options="cookie_monster: true; cookie_name: note_detail_joyride">
346 <li data-id="note-content-wrapper" data-text="Awesome!" data-options="tip_location: top">
347 <p>You can highlight important words or phrases in this note to add definitions for them.</p>
349 <li data-id="keywords-tab-button" data-text="Awesome!" data-options="tip_location: top">
350 <p>Keywords you define will appear here, and you can define new ones here too.</p>