<!--================================================================= -->
<div class=page id=pg_courses>
<h1>Courses for <span id=school_name></span></h1>
- <div class="proto course" id=PROTO_course>
- <div class=dept>__department__</div>
- <div class=name>
- <a href="/course/___id__">__number__: __name__</a>
- </div>
- </div>
<div>
<span class="sub_menu" style="display:none;">
- <a href="" id="new_course">New Course</a>
</span>
<form method="POST" id="form_course" style="display:none;">
<h1>Create New Course</h1>
</div>
</form>
</div>
+ <div class="proto course" id=PROTO_course>
+ <div class=dept>__department__</div>
+ <div class=name>
+ <a href="/course/___id__">__number__: __name__</a>
+ </div>
+ </div>
</div>
<!--================================================================= -->
<div class=page id=pg_lectures>
router.add('school', function(data, cb) {
$('#school_link').addClass('active');
$('.sub_menu').hide();
- $('#new_course').unbind();
+ //$('#new_course').unbind();
$('#form_course').hide().unbind();
var response = {
id: 'course',
if (data.school.authorized) {
$('.sub_menu').show();
- $('#new_course').click(function(e) {
- e.preventDefault();
-
- var form = $('#form_course');
+ var form = $('#form_course');
- form.toggle();
+ form.toggle();
- form.submit(function(e) {
- e.preventDefault();
+ form.submit(function(e) {
+ e.preventDefault();
- $.post(window.location.pathname, form.serialize(), function(data) {
- if (data.status === 'error') {
- message('error', data.message);
- } else if (data.status === 'ok') {
- form.hide();
- goPage(window.location.pathname);
- message('info', data.message);
- }
- });
- })
- });
+ $.post(window.location.pathname, form.serialize(), function(data) {
+ if (data.status === 'error') {
+ message('error', data.message);
+ } else if (data.status === 'ok') {
+ form.hide();
+ goPage(window.location.pathname);
+ message('info', data.message);
+ }
+ });
+ })
}
cb("courses", response)
});