The home page is pretty close now
authorCharles Connell <charles@connells.org>
Sat, 8 Mar 2014 00:13:29 +0000 (19:13 -0500)
committerCharles Connell <charles@connells.org>
Sat, 8 Mar 2014 00:13:29 +0000 (19:13 -0500)
karmaworld/assets/css/global.css
karmaworld/assets/css/home.css
karmaworld/assets/js/add-course.js
karmaworld/assets/js/course-list.js
karmaworld/templates/base.html
karmaworld/templates/courses/course_list.html
karmaworld/templates/courses/course_list_entry.html
karmaworld/templates/partial/add_course.html

index 990b651350fee36bf2666be25bb292a582677d7a..66a2de94cd45d55320fb13fc0fc8a053271694cb 100644 (file)
 
 #global_footer {
   line-height: 1.5em;
-  margin: 10px 0 20px 0;
-}
-
-#footer-links-container {
-  border-top: 1px dashed grey;
+  margin: 20px 0 20px 0;
 }
 
index 6dff10940964a8c6d461920167d77826182b79d9..42a7550fddd393d477a69b731bca086bd1c3ab95 100644 (file)
@@ -45,22 +45,16 @@ span.table-thanks-count {
 }
 
 span.table-course-name {
-  font-size: 2em;
-  font-weight: bold;
+  font-size: 1.8em;
 }
 
-table.dataTable tbody tr {
-  height: 8em;
+div.table-entry-third-line {
   border-bottom: 1px solid grey;
+  padding-bottom: 10px;
 }
 
-td.last-td {
-  border-bottom: 1px solid grey;
+div.table-entry-first-line {
+  padding-top: 10px;
 }
 
-#add-course-btn {
-  text-transform: uppercase;
-  font-size: 2.5em;
-  text-align: center;
-}
 
index a25928a48fa6fb947dadbde2a44bc34bb278eead..7be82b02920ac1366b1c07a600a2090467c25d74 100644 (file)
@@ -21,11 +21,7 @@ $(function() {
 
   addCourse = function() {
     // Show the add a course form
-    $('#add-course-form').show();
-    // Hide the add a course button
-    $('#add-course-btn').hide();
-    // Scroll the user's page to here
-    $('#add-course-divider').ScrollTo();
+    $('#add-course-form').dialog("open");
     // Put focus in first input field
     $('#str_school').focus();
   };
@@ -34,9 +30,16 @@ $(function() {
   // of page
   $('#add-course-btn').click(addCourse);
 
-  // Set up the "Add Course" button in the
-  // page header
-  $('#add_course_header_button').click(addCourse);
+  $('#add-course-form').dialog({
+    autoOpen: false,
+    modal: true,
+    show: { effect: 'fade', duration: 500 },
+    width: 700
+  });
+
+  if (jump_to_form) {
+    $("#add-course-form").dialog("open");
+  }
 
   $("#str_school").autocomplete({
     source: function(request, response){
index 9e2d077c7499c18036747127422a448dbbdaed40..3d4642a710834910aca6dbf3af8e4403653c8105 100644 (file)
@@ -1,11 +1,5 @@
 $(function() {
 
-  if (jump_to_form) {
-    $("#add-course-form").show();
-    $('#add-course-btn').hide();
-    document.getElementById('add-course-form').scrollIntoView(true);
-  }
-
   // load dataTable for course data
   var dataTable = $('#data_table_list').dataTable({
     // we will set column widths explicitly
index aa91fad554c3ce888be2f0515d2b0393f7885940..df9af8a46985815eac17d71903aa4ca8cb061a4e 100644 (file)
@@ -52,7 +52,6 @@
 {% block bodyscripts %}
 {% endblock %}
 <!-- end block bodyscripts -->
-<script src="{{ STATIC_URL }}js/jquery-scrollto.min.js" ></script>
 <script src="{{ STATIC_URL }}js/opentip-jquery-excanvas.min.js"></script>
 
 </body>
index 45ac916f2a6b9a3ca1603a543b69d1e3fa07df5a..ea32c20fd30e3f3ec5b0034a4eca64f459f6f7d9 100644 (file)
 {% block pagescripts %}
   <script>
     // If there were form errors, open the form and jump to it
-    var jump_to_form = {% if jump_to_form %} true {% else%} false {% endif %};
+    var jump_to_form = {% if jump_to_form %}true{% else%}false{% endif %};
+    var json_school_list = "{% url 'json_school_list' %}"
+    var json_school_course_list = "{% url 'json_school_course_list' %}"
+    var json_school_course_instructor_list = "{% url 'json_school_course_instructor_list' %}"
+    var csrf_token = "{{ csrf_token }}";
   </script>
-  <script src="{{ STATIC_URL }}js/jquery.dataTables.min.js"></script>
+  <script src="{{ STATIC_URL }}js/setup-ajax.js"></script>
+  <script src="{{ STATIC_URL }}js/course.js"></script>
+  <script src="{{ STATIC_URL }}js/add-course.js"></script>
   <script src="{{ STATIC_URL }}js/course-list.js"></script>
 {% endblock %}
 
+{% block bodyscripts %}
+  <script src="{{ STATIC_URL }}js/jquery.dataTables.min.js"></script>
+{% endblock %}
+
 {% block content %}
 <section id="home_content">
   <div id="page_header" class="">
@@ -32,7 +42,7 @@
 
   <div id="course-search-bar" class="row">
     <div class="small-12 columns">
-      <button class="add-course" onclick="$('#add-course-btn').click();">Add a Course</button>
+      <button id="add-course-btn" class="add-course">Add a Course</button>
       <input class="search-courses" type="text" placeholder="Search Courses" />
       <div id="course-sort-wrapper">
         Sort By
     </div><!-- .ten columns -->
   </div> <!-- .row -->
 
-  <div class="row">
-    <div id="add-course-divider" class="small-10 columns small-offset-1"> <hr/> </div>
-  </div>
-
-  <div class="row">
-    <div class="small-12 columns large-10 large-offset-1">
-      <div id="add-course-btn">
-        <i class="fa fa-arrow-circle-o-up"></i> add a course
-      </div>
-      {% include 'partial/add_course.html' %}
-    </div><!-- .ten columns -->
-  </div> <!-- .row -->
-
-  <div class="row">
-    <div class="small-10 columns small-offset-1"> <hr/> </div>
-  </div>
+  {% include 'partial/add_course.html' %}
 
 </section> <!-- #results_content -->
 
 {% endblock %}
 
-{% block bodyscripts %}
-{% endblock bodyscripts %}
index 39c2c42408404ad8568362f7c540b300eee05b6e..4d28c51ddff7816195bda4ac41cb64869ceb2c28 100644 (file)
@@ -4,20 +4,26 @@
   <td class="hide">{{ course.get_popularity }}</td>
 
   <td class="small-12 columns">
-    <span class="table-school">{{ course.school.name }}</span>&nbsp;&nbsp;&bull;&nbsp;&nbsp;
-    {% if course.department %}<span class="table-department">{{ course.department.name }}</span>&nbsp;&nbsp;&bull;&nbsp;&nbsp;{% endif %}
-    <span class="table-instructor">{{ course.instructor_name }}</span>
+    <div class="table-entry-first-line">
+      <span class="table-school">{{ course.school.name }}</span>&nbsp;&nbsp;&bull;&nbsp;&nbsp;
+      {% if course.department %}<span class="table-department">{{ course.department.name }}</span>&nbsp;&nbsp;&bull;&nbsp;&nbsp;{% endif %}
+      <span class="table-instructor">{{ course.instructor_name }}</span>
+    </div>
   </td>
 
   <td class="small-12 columns">
-    <span class="table-course-name"><a href="{{ course.get_absolute_url }}">{{ course.name }}</a></span>
+    <div class="table-entry-second-line">
+      <span class="table-course-name"><a href="{{ course.get_absolute_url }}">{{ course.name }}</a></span>
+    </div>
   </td>
 
-  <td class="small-12 columns last-td">
-    <span class="table-note-count">{{ course.file_count }} Notes</span>&nbsp;&nbsp;&bull;&nbsp;&nbsp;
-    <span class="table-quiz-count">{{ course.quiz_count }} Quizzes </span>&nbsp;&nbsp;&bull;&nbsp;&nbsp;
-    <span class="table-thanks-count">{{ course.get_popularity }} Thanks </span>&nbsp;&nbsp;&bull;&nbsp;&nbsp;
-    <span>Updated {{ course.updated_at|date:"b d, o"|capfirst }}</span>
+  <td class="small-12 columns">
+    <div class="table-entry-third-line">
+      <span class="table-note-count">{{ course.file_count }} Notes</span>&nbsp;&nbsp;&bull;&nbsp;&nbsp;
+      <span class="table-quiz-count">{{ course.quiz_count }} Quizzes </span>&nbsp;&nbsp;&bull;&nbsp;&nbsp;
+      <span class="table-thanks-count">{{ course.get_popularity }} Thanks </span>&nbsp;&nbsp;&bull;&nbsp;&nbsp;
+      <span>Updated {{ course.updated_at|date:"b d, o"|capfirst }}</span>
+    </div>
   </td>
 
 </tr>
index 8a924e8f83a4b0c01776dddc94aa99702545ca82..ed560e0b5e598628631a03d26ae4cecd31d72539 100644 (file)
@@ -1,13 +1,4 @@
 {% load url from future %}
-<script>
-  var json_school_list = "{% url 'json_school_list' %}"
-  var json_school_course_list = "{% url 'json_school_course_list' %}"
-  var json_school_course_instructor_list = "{% url 'json_school_course_instructor_list' %}"
-  var csrf_token = "{{ csrf_token }}";
-</script>
-<script src="{{ STATIC_URL }}js/setup-ajax.js"></script>
-<script src="{{ STATIC_URL }}js/course.js"></script>
-<script src="{{ STATIC_URL }}js/add-course.js"></script>
 
 <section id="add-course-form" class="hide">
   <form method="POST" action="{% url 'home' %}">