{
font-family: "MuseoSlab-300";
font-size: 22px;
- line-height: .4em;
+ line-height: 1.4em;
+}
+
+.note_name, .note_name a
+{
+ font-family: "MuseoSlab-300";
+ font-size: 22px;
+ line-height: 1.4em;
}
a.activity_actor, a.activity_actor:hover
text-transform: uppercase;
}
-#upload_button, #add-course
+#add-note-btn, #add-course-btn
{
+ color: #f05a28;
+ cursor: pointer;
+ font: 30px/1.2em "MuseoSlab-300", serif;
margin: 1px;
- font-family: "MuseoSlab-300";
- font-size: 30px;
text-align: center;
- color: #f05a28;
text-transform: uppercase;
+ /* transition: ease-out ? ? ? */
+}
+
+#add-note-form, #add-course
+{
+ display: none;
}
/* COPY */
width: 140px;
margin: 2em auto;
}
+
+legend
+{
+ font: 12px/2em "MuseoSlab-300";
+}
+
$(function(){
+
+ // Show the 'add note' form
+ // first, instantiate the fileuploader on page load
+ // TODO: connect it to the '^ save' form submit
// Show the upload lightbox on upload button click
- $('#upload_button_container').click(function(){
- $('#lightbox_upload').show()
+
+ $('#add-note-btn').click(function(){
+ // TODO: rewrite to .show the form with a slide transition
+ $('#add-note-form').show();
});
// Dismiss x click
element: $('#file-uploader')[0],
multiple: true,
onComplete: function( id, fileName, responseJSON ) {
- if( responseJSON.success )
- console.log( "success!" ) ;
+ if( responseJSON.success ) {
+ //console.log( "success!" ) ;
$('form#upload_form').attr('action', responseJSON.note_url);
$('input.submit_upload').show();
+ }
},
onAllComplete: function( uploads ) {
// uploads is an array of maps
// the maps look like this: { file: FileObject, response: JSONServerResponse }
console.log( "All complete!" ) ;
+ // TODO: set a success state
},
params: {
'csrf_token': csrf_token,
<div class="ten columns offset-by-one"> <hr/> </div>
</div>
+ {% include 'partial/add_note.html' %}
+
<div class="row">
<div class="three columns centered">
- <div id="upload_button" data-id="{{ course.id }}">
+ <div id="add-note-btn" data-id="{{ course.id }}">
<i class=icon-upload></i> add a note
</div>
</div>
</div>
+
<div class="row">
<div class="ten columns offset-by-one"> <hr/> </div>
</div>
<div class="row notes_result_container wide">
<div class="twelve columns notes_result">
- <div class="activity_details_action">
+ <div class="note_name">
<a href="{{ note.get_absolute_url }}" class="activity_target">{{ note.name }}</a>
</div>
<div class="row">
<div class="ten columns offset-by-one">
- <div id="add-course">
+ <div id="add-course-btn">
<i class=icon-upload></i> add a course
</div>
</div><!-- .ten columns -->
--- /dev/null
+{% load url from future %}
+<section id=add-note-form class="extend-form">
+ <script>
+ var ajax_upload_url = "{% url 'ajax_upload' %}";
+ var csrf_token = "{{ csrf_token }}";
+ </script>
+
+ <form id=upload_form method="POST">
+ {% csrf_token %}
+ <div class="row">
+ <div class="eight columns offset-by-one">
+ <legend>Title of Note</legend>
+ <input type="text" class="" id="id_name" name="name">
+ </div>
+ <div class="two columns end">
+ <legend>Academic Year</legend>
+ <input type="text" class="" id="id_year" name="year">
+ </div>
+ </div>
+ <div class="row">
+ <div class="ten columns offset-by-one end">
+ <legend>Tags (comma seperated)</legend>
+ <input type="text" id="id_tags" name="tags" class="taggit-tags">
+ </div>
+ </div>
+
+
+ <div class="row">
+ <div class="three columns centered">
+ <div id="upload_button" data-id="{{ course.id }}">
+ <i class=icon-upload></i> add a note
+ <input class="submit_upload" type="submit" value="save">
+ </div>
+ </div>
+ </div>
+
+
+ </form> <!-- #upload_form -->
+</section>