border-top: 2px solid #f0f0f0;
border-bottom: 2px solid #f0f0f0;
}
+
+ul.ui-autocomplete {
+ z-index: 1000;
+}
+
-span.course-header-school
+#course-header-school
{
font-weight: bold;
}
};
addCourse = function() {
- // Show the add a course form
- $('#add-course-form').dialog("open");
// Put focus in first input field
$('#str_school').focus();
};
// of page
$('#add-course-btn').click(addCourse);
- $('#add-course-form').dialog({
- autoOpen: false,
- modal: true,
- show: { effect: 'fade', duration: 500 },
- width: dialogWidth()
- });
-
if (jump_to_form) {
- $("#add-course-form").dialog("open");
+ $("#add-course-form").foundation('reveal', 'open');
}
$("#str_school").autocomplete({
}
});
- $('#edit-course-form').dialog({
- autoOpen: false,
- modal: true,
- show: { effect: 'fade', duration: 500 },
- width: dialogWidth()
- });
-
- $('#edit-button').click(function(event) {
- $('#edit-course-form').dialog("open");
- });
-
$('#edit-save-btn').click(function(event) {
$.ajax({
url: course_edit_url,
// on both the client and server side
$('.validation_error').remove()
$('#course_form_errors').empty();
- $('#course_name').text(data.fields.name);
- $('#course_instructor_name').text(data.fields.instructor_name);
+ $('#course-header-name').text(data.fields.name);
+ $('#course-header-instructor').text(data.fields.instructor_name);
var $externalLinkSquare = $('<i>', {'class': 'fa fa-external-link-square'});
$('#course_url').text(data.fields.url.slice(0, 50) + ' ');
} else {
$('#course_link').parent().show();
}
+
+ $('#edit-course-form').foundation('reveal', 'close');
},
error: function(resp) {
var json;
}
});
- $('#note-tag-dialog').dialog({
- title: "Edit note tags",
- autoOpen: false,
- modal: true,
- show: { effect: 'fade', duration: 500 },
- width: dialogWidth()
- });
-
- $('#edit-note-tags').click(function(event) {
- $('#note-tag-dialog').dialog("open");
- });
-
$('#save_note_tags').click(function(event) {
$.ajax({
url: edit_note_tags_url,
$.each(data.fields.tags, function(index, tag) {
$('.tags').append($('<span>', { class: 'tag-span', text: tag }));
});
- $('#note-tag-dialog').dialog("close");
+ $('#note-tag-dialog').foundation('reveal', 'close');
}
});
});
+++ /dev/null
-
-function dialogWidth() {
- var bodyWidth = $('body').width();
- if (bodyWidth < 700) {
- return bodyWidth;
- } else {
- return 700;
- }
-}
{% block bodyscripts %}
{% endblock %}
<!-- end block bodyscripts -->
- <script src="{{ STATIC_URL }}js/utils.js"></script>
<script src="{{ STATIC_URL }}js/opentip-jquery-excanvas.min.js"></script>
<script src="{{ STATIC_URL }}js/foundation.min.js"></script>
<script src="{{ STATIC_URL }}js/foundation.offcanvas.js"></script>
<div id="course-header">
<div class="row header-byline">
<div class="small-12 columns">
- <span class="course-header-school">{{ course.school.name }}</span> •
+ <span id="course-header-school">{{ course.school.name }}</span> •
{% if course.department %}<span class="course-header-department">{{ course.department.name }}</span> • {% endif %}
- <span class="course-header-instructor">{{ course.instructor_name }}</span>
+ <span id="course-header-instructor">{{ course.instructor_name }}</span>
</div>
</div>
<span class="show-for-large-up">
{% if user.is_authenticated %}
{% if user.get_profile.can_edit_items %}
- <button id="edit-button" class="modify-button"> <i class="fa fa-edit"></i> Edit this course</button>
+ <button id="edit-button" data-reveal-id="edit-course-form" class="modify-button"> <i class="fa fa-edit"></i> Edit this course</button>
{% endif %}
{% if already_flagged %}
</div><!-- /course_header -->
{% if user.get_profile.can_edit_items %}
- <section id="edit-course-form" class="hide">
+ <section id="edit-course-form" class="reveal-modal" data-reveal>
+ <a class="close-reveal-modal">×</a>
<form>
{% csrf_token %}
{{ file_upload_form.fp_file }}
</div>
<div class="small-12 large-6 columns">
- <form class="search-notes" action="{% url 'note_search' %}" method="GET">
+ <form style="display: inline" class="search-notes" action="{% url 'note_search' %}" method="GET">
+ <span>
+ <input style="display: inline;" type="hidden" name="course_id" value="{{ course.id }}" />
<input name="query" class="search-notes" type="text" placeholder="Search Notes" />
- <input type="hidden" name="course_id" value="{{ course.id }}" />
- <button type="submit" class="inline-button"><i class="fa fa-search"></i></button>
+ </span>
</form>
</div>
<div class="large-4 columns show-for-large-up">
<div id="course-search-bar">
<div class="row">
<div class="large-2 columns show-for-large-up">
- <button id="add-course-btn" class="inline-button important">Add a Course</button>
+ <button id="add-course-btn" class="inline-button important" data-reveal-id="add-course-form">Add a Course</button>
</div>
<div class="small-12 large-6 columns">
<input class="search-courses" type="text" placeholder="Search Courses" />
{% endif %}
{% if user.get_profile.can_edit_items %}
- <button id="edit-note-tags" class="modify-button">
+ <button id="edit-note-tags" class="modify-button" data-reveal-id="note-tag-dialog">
<i class="fa fa-pencil-square-o"></i> Edit Tags
</button>
{% endif %}
</div><!-- /note_tags -->
</div>
- <div id="note-tag-dialog" class="row">
- <div class="small-12 columns">
- <input id="note_tags_input" type="text" value="{% for tag in note.tags.all %}{{ tag.name }}{% if not forloop.last %}, {% endif %}{% endfor %}">
- <button id="save_note_tags" type=button><i class="fa fa-save"></i> Save</button>
+ <div id="note-tag-dialog" class="reveal-modal" data-reveal>
+ <a class="close-reveal-modal">×</a>
+ <div class="row">
+ <div class="small-12 columns">
+ <p>Edit this note's tags:
+ <input id="note_tags_input" type="text" value="{% for tag in note.tags.all %}{{ tag.name }}{% if not forloop.last %}, {% endif %}{% endfor %}"></p>
+ <button id="save_note_tags" type=button><i class="fa fa-save"></i> Save</button>
+ </div>
</div>
</div>
{% load url from future %}
-<section id="add-course-form" class="hide">
+<section id="add-course-form" class="reveal-modal" data-reveal>
+ <a class="close-reveal-modal">×</a>
<form method="POST" action="{% url 'home' %}">
{% csrf_token %}