showing create course if auth\'ed and moving it to the right
authorSeth Woodworth <seth@sethish.com>
Fri, 16 Dec 2011 10:43:14 +0000 (10:43 +0000)
committerSeth Woodworth <seth@sethish.com>
Fri, 16 Dec 2011 10:43:14 +0000 (10:43 +0000)
public/assets/css/screen.css
public/index.html
public/javascripts/main.js

index ca4a2fbae7323bcc07537ad8c036059ac85c677f..56d10d7686448cf0cdaad44dd3e9c47c06b40351 100755 (executable)
@@ -704,6 +704,14 @@ div.content h1 {
        margin-bottom: 1em;
 }
 
+#pg_courses {
+  min-height:700px;
+}
+#pg_courses #right {
+  float:right;
+  width:500px;
+}
+
 .note, .notes_instructor, .notes_head {
        margin: 1.0em 0;
 }
index 178991124f0736514460332f9d90ce0fa8fb50bc..b0503e7820c32e259735fe224ddadb16dd9c79a5 100644 (file)
       <!--================================================================= -->
                        <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>
index bae30c0c4525e39e1ed8dcf9c2585e5ff3b32cae..0aafffeb78b5ffad636b63196ea6d5fbd78bed87 100644 (file)
@@ -136,7 +136,7 @@ router.add('schools', function(data, cb) {
 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',
@@ -147,27 +147,23 @@ router.add('school', function(data, cb) {
 
   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)
 });