lecture list working w/1page
authorec2-user <ec2-user@fcdev4.finalsclub.org>
Sun, 13 Nov 2011 20:54:50 +0000 (20:54 +0000)
committerec2-user <ec2-user@fcdev4.finalsclub.org>
Sun, 13 Nov 2011 20:54:50 +0000 (20:54 +0000)
public/index.html
public/javascripts/main.js
public/stylesheets/fc2.css

index b2dde817a5c453bde6d85b63fa41ed54ea56810b..9e64cb70896cf03f820fdd09ee47d5d9563f056d 100644 (file)
                                <div class=course id=PROTO_course>
                                        <div class=dept>__department__</div>
                                        <div class=name>
-                                               <a href="javascript:goLectures('___id__')">__number__: __name__</a>
+                                               <a href="javascript:goPage('/course/___id__')">__number__: __name__</a>
                                        </div>
                                </div>
                        </div>
 
 
                        <div class=page id=pg_lectures>
-                               <h1>Lectures for <span id=course_name></span></h1>
+                               <div class=lectures_head id=PROTO_lectures_head>
+                                       <h1>Lectures for Course __number__ : __name__</h1>
+                                       Subject: __subject__<br>
+                                       Department: __department__<br>
+                               </div>
+                               <div class=lectures_instructor id=PROTO_lectures_instructor>
+                                       Instructor: __name__ (__email__)<br>
+                               </div>
                                <div class=lecture id=PROTO_lecture>
                                        <div class=name>
-                                               <a href="javascript:goPads('___id__')">__name__</a>
+                                               <a href="javascript:goPage('/note/___id__')">__name__</a><br>
+                                               Created: __date__<br>
                                        </div>
                                </div>
                        </div>
index 47ee28389e1047bf8fbb5c983a8aaa8f902400fc..294427ecdd7253be116c0fb7d060f5a960546f5c 100644 (file)
@@ -71,29 +71,35 @@ function showCourses(matches, cb) {
 
 
 // go to the page that lists the lectures for a specific course
-var lectures = []
-function goLectures(courseId) {
+function showLectures(matches, cb) {
+
+       var courseId = matches[1]
+
        ProtoDiv.reset("PROTO_lecture");
-       hideAllPages();
+       
        $.get("/course/"+courseId, {}, function(response) {
 
-response = {
-       course: {
-               name: "FooCourse",
-               lectures: [
-                       { _id: 1, name: "lecture 1" },
-                       { _id: 2, name: "lecture 2" },
-               ]
-       }
-}
-               lectures = []
+               ProtoDiv.reset("PROTO_lectures_head")
+               ProtoDiv.reset("PROTO_lectures_instructor")
+               ProtoDiv.reset("PROTO_lecture")
+
                if(typeof response == 'object') {
+
                        var course = response.course
-                       $("#course_name").html(course.name);
-                       lectures = course.lectures
+                       if(course)
+                               ProtoDiv.replicate("PROTO_lectures_head", [course])
+
+                       var instructor = response.instructor
+                       if(instructor)
+                               ProtoDiv.replicate("PROTO_lectures_instructor", [instructor])
+
+                       var lectures = response.lectures
+                       if(lectures)
+                               ProtoDiv.replicate("PROTO_lecture", lectures);
+
                }
-               ProtoDiv.replicate("PROTO_lecture", lectures);
-               goPage("lectures")
+
+               cb("lectures")
        });
 }
 
@@ -189,6 +195,7 @@ var pageVectors = [
        { regex: /^\/(index.html)?$/, func: showHome },
        { regex: /^\/schools/, func: showSchools },
        { regex: /^\/school\/([a-f0-9]{24})/, func: showCourses },
+       { regex: /^\/course\/([a-f0-9]{24})/, func: showLectures },
        { regex: /^\/login/, func: showLogin },
        { regex: /^\/register/, func: showRegister },
        { regex: /^\/press/, func: showPress },
index 6ae1b86b1cf1da1a0549a03ce3ce16b56eca6663..44bd112a13597361524cf4307d89ded9469bdc39 100644 (file)
@@ -872,5 +872,15 @@ div.conduct p.vague {
        color: #888;
 }
 
+.lectures_instructor, .lectures_head {
+}
+
+.lecture {
+       margin: 0.5em 0;
+       padding: 0.5em 1em;
+       border: solid 1px #888;
+       -moz-border-radius: 0.20em;
+       -webkit-border-radius: 0.20em;
+}