aboutsummaryrefslogtreecommitdiffstats
path: root/schedule/static
diff options
context:
space:
mode:
authorWeitian LI <liweitianux@gmail.com>2014-06-24 23:09:43 +0800
committerWeitian LI <liweitianux@gmail.com>2014-06-24 23:09:43 +0800
commit88c4fa2c87138d9f4707ad7193662953f9de725f (patch)
tree0185998a92184d0c5b76513d0c94774a06274432 /schedule/static
parentaf609a29bee3bc17800cf061c66b6eabcf18234f (diff)
downloaddjango-skaschool-88c4fa2c87138d9f4707ad7193662953f9de725f.tar.bz2
Added schedule.html template for app 'schedule'.
* added 'schedule.views.ScheduleView' * added 'schedule.html' template, with 'schedule.css' and 'schedule.js' * added 'schedule.urls', updated django_skaschool.urls * added tools/templatetags/dict_utils.py * converted schedule models to south-based * removed original 'page/templates/page/program.html', related urls * updated navbar.html
Diffstat (limited to 'schedule/static')
-rw-r--r--schedule/static/css/schedule.css41
-rw-r--r--schedule/static/js/schedule.js58
2 files changed, 99 insertions, 0 deletions
diff --git a/schedule/static/css/schedule.css b/schedule/static/css/schedule.css
new file mode 100644
index 0000000..82cdccd
--- /dev/null
+++ b/schedule/static/css/schedule.css
@@ -0,0 +1,41 @@
+/*
+ * schedule.css
+ * used with 'schedule.html' page
+ *
+ * 2014/06/24
+ */
+
+/* bootstrap panel */
+.panel .panel-heading {
+ font-size: 180%;
+ font-weight: bold;
+}
+
+/* event-contents */
+.event-contents p {
+ margin: 0px 0px 5px;
+}
+.event-contents .panel-heading {
+ font-size: 100%;
+ font-weight: normal;
+ padding: 5px 5px;
+ cursor: pointer;
+}
+.event-contents .panel-body {
+ padding: 5px 5px;
+}
+
+/* event-attachments */
+.event-attachments p {
+ margin: 0px 0px 5px;
+}
+.event-attachments .panel-heading {
+ font-size: 100%;
+ font-weight: normal;
+ padding: 5px 5px;
+ cursor: pointer;
+}
+.event-attachments .panel-body {
+ padding: 5px 5px;
+}
+
diff --git a/schedule/static/js/schedule.js b/schedule/static/js/schedule.js
new file mode 100644
index 0000000..3714b19
--- /dev/null
+++ b/schedule/static/js/schedule.js
@@ -0,0 +1,58 @@
+/*
+ * schedule.js
+ * used with 'schedule.html' page
+ *
+ * 2014/06/24
+ */
+
+/* animated slidedown and slideup div */
+$(document).ready(function() {
+ /* hide() all .event-contents and .event-attchments body */
+ $(".event-contents .panel-body").hide().removeClass('shown').addClass('hidden');
+ $(".event-attachments .panel-body").hide().removeClass('shown').addClass('hidden');
+
+ /* click .event-contents heading to toggle its body contents */
+ $(".event-contents .panel-heading").on("click", function(e) {
+ e.stopPropagation();
+ ec_body = $(this).siblings(".panel-body");
+ if ($(ec_body).hasClass('hidden')) {
+ $(ec_body).show().removeClass('hidden').addClass('shown');
+ // update heading icon and text
+ span_icon = $(this).children("span.glyphicon");
+ $(span_icon).removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up');
+ span_action = $(this).children("span.action");
+ $(span_action).html('隐藏');
+ }
+ else {
+ $(ec_body).hide().removeClass('shown').addClass('hidden');
+ // update heading icon and text
+ span_icon = $(this).children("span.glyphicon");
+ $(span_icon).removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down');
+ span_action = $(this).children("span.action");
+ $(span_action).html('显示');
+ }
+ });
+
+ /* click .event-attachments heading to toggle its body attachments */
+ $(".event-attachments .panel-heading").on("click", function(e) {
+ e.stopPropagation();
+ ec_body = $(this).siblings(".panel-body");
+ if ($(ec_body).hasClass('hidden')) {
+ $(ec_body).show().removeClass('hidden').addClass('shown');
+ // update heading icon and text
+ span_icon = $(this).children("span.glyphicon");
+ $(span_icon).removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up');
+ span_action = $(this).children("span.action");
+ $(span_action).html('隐藏');
+ }
+ else {
+ $(ec_body).hide().removeClass('shown').addClass('hidden');
+ // update heading icon and text
+ span_icon = $(this).children("span.glyphicon");
+ $(span_icon).removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down');
+ span_action = $(this).children("span.action");
+ $(span_action).html('显示');
+ }
+ });
+});
+