From dafd95fe6dc9ff05d63b35f5c5e4ece00ab887fb Mon Sep 17 00:00:00 2001 From: Vaibhav Jayaraman Date: Sat, 23 Dec 2017 01:49:05 -0800 Subject: [PATCH 1/6] about to change a line of html in staff-hours.html --- ocfweb/main/staff_hours.py | 2 ++ ocfweb/main/templates/main/staff-hours.html | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ocfweb/main/staff_hours.py b/ocfweb/main/staff_hours.py index 915827ca9..32d9998b7 100644 --- a/ocfweb/main/staff_hours.py +++ b/ocfweb/main/staff_hours.py @@ -21,5 +21,7 @@ def staff_hours(request): 'staff_hours': get_staff_hours(), 'today': time.strftime('%A'), 'lab_status': get_lab_status(), + 'days_of_the_week':['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday',\ + 'Saturday', 'Sunday'], }, ) diff --git a/ocfweb/main/templates/main/staff-hours.html b/ocfweb/main/templates/main/staff-hours.html index 0288e4ac9..2fb8375a9 100644 --- a/ocfweb/main/templates/main/staff-hours.html +++ b/ocfweb/main/templates/main/staff-hours.html @@ -8,14 +8,12 @@

Have questions? Drop by for help from a friendly volunteer staffer!

OCF staff members hold regular drop-in staff hours to provide assistance with account issues or with OCF services. We're always happy to help troubleshoot account or service issues!

Keep in mind the OCF volunteers sometimes have last-minute conflicts, so it's a good idea to check this page before coming in for cancellations.

+ {% for day_in_week in days_of_the_week %} {% for staff_hour in staff_hours %} + {% if staff_hour.day == day_in_week %}
{{staff_hour.day}} - {{staff_hour.time}} - {% if staff_hour.cancelled or staff_hour.day == today and lab_status.force_lab_closed %} - cancelled this week - {% endif %}
    @@ -24,12 +22,18 @@

    Have questions? Drop by for help from a friendly volunteer staffer!

    {{staffer.user_name}}

    {{staffer.real_name}}

    {{staffer.position}}
    +
    {{staff_hour.time}}
    + {% if staff_hour.cancelled or staff_hour.day == today and lab_status.force_lab_closed %} + cancelled this week + {% endif %} {% endfor %}
+ {% endif %} {% endfor %} + {% endfor %}
From 37ea86b880d68408f172bba8a52cd253f4100d11 Mon Sep 17 00:00:00 2001 From: Vaibhav Jayaraman Date: Sat, 23 Dec 2017 02:18:29 -0800 Subject: [PATCH 2/6] Staff hours now changed to be per day-functionally working hours for staff hours are above each staff member staff-hours grouped by hour functionally working added reason for why ason for why staff hours are cancelled to header of staff hours removed print statementint statements and reason for cancellation is next to staff hours got rid of borders in individual days in staff hours
added around each hour in staff hours changed hr tag added comment changed weekdays to days in the week functionally working, need to delete last hr tag got rid of hr tag Fixed some formatting issues readded gray out feature to staff hours hours adds if holiday will cancel jan 17 some yaml changes made changed some of staff_hours.html to adhere to ocflib Altering home.py for staff_hours column in it tuesday made changes to staff_hours.html font size for different days worked on staff_hours.html and staff_hours css changed home.html staff hours and related css got rid of cancelled staff hours from each day added metabase graphs to mirrors.html finished adding staff bios width for staff-faces set to 175px changed staff-hour spacing to 165px and can handle multiple lines of staff per hour in staff hours --- ocfweb/main/home.py | 2 +- ocfweb/main/staff_hours.py | 2 - ocfweb/main/templates/main/home.html | 5 +- ocfweb/main/templates/main/staff-hours.html | 54 +++++----- ocfweb/main/templatetags/staff_hours.py | 12 +++ ocfweb/static/js/site.js | 2 + ocfweb/static/scss/pages/_home.scss | 11 ++ ocfweb/static/scss/pages/_staff-hours.scss | 105 ++++++++++++-------- ocfweb/static/scss/site.scss | 1 + ocfweb/stats/templates/stats/mirrors.html | 16 ++- 10 files changed, 133 insertions(+), 77 deletions(-) diff --git a/ocfweb/main/home.py b/ocfweb/main/home.py index 81d182d29..66b2af1c1 100644 --- a/ocfweb/main/home.py +++ b/ocfweb/main/home.py @@ -12,7 +12,7 @@ from ocfweb.component.lab_status import get_lab_status -@periodic(60, ttl=86400) +@periodic(60) def get_staff_hours(): return get_staff_hours_soonest_first()[:2] diff --git a/ocfweb/main/staff_hours.py b/ocfweb/main/staff_hours.py index 32d9998b7..915827ca9 100644 --- a/ocfweb/main/staff_hours.py +++ b/ocfweb/main/staff_hours.py @@ -21,7 +21,5 @@ def staff_hours(request): 'staff_hours': get_staff_hours(), 'today': time.strftime('%A'), 'lab_status': get_lab_status(), - 'days_of_the_week':['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday',\ - 'Saturday', 'Sunday'], }, ) diff --git a/ocfweb/main/templates/main/home.html b/ocfweb/main/templates/main/home.html index c3b9ecba8..7dc2beabe 100644 --- a/ocfweb/main/templates/main/home.html +++ b/ocfweb/main/templates/main/home.html @@ -108,8 +108,11 @@

OCF Computer Lab

+ + Staff Hours + {% for staff_hour in staff_hours %} -

Staff Hours {{staff_hour.day}}

+

{{staff_hour.day}}

{{staff_hour.time}} diff --git a/ocfweb/main/templates/main/staff-hours.html b/ocfweb/main/templates/main/staff-hours.html index 2fb8375a9..bada92e8a 100644 --- a/ocfweb/main/templates/main/staff-hours.html +++ b/ocfweb/main/templates/main/staff-hours.html @@ -8,34 +8,38 @@

Have questions? Drop by for help from a friendly volunteer staffer!

OCF staff members hold regular drop-in staff hours to provide assistance with account issues or with OCF services. We're always happy to help troubleshoot account or service issues!

Keep in mind the OCF volunteers sometimes have last-minute conflicts, so it's a good idea to check this page before coming in for cancellations.

- {% for day_in_week in days_of_the_week %} - {% for staff_hour in staff_hours %} - {% if staff_hour.day == day_in_week %} -
-
- {{staff_hour.day}} -
-
-
    - {% for staffer in staff_hour.staff %} -
  • - {{staffer.user_name}} -

    {{staffer.real_name}}

    -
    {{staffer.position}}
    -
    {{staff_hour.time}}
    - {% if staff_hour.cancelled or staff_hour.day == today and lab_status.force_lab_closed %} - cancelled this week + {% for day_in in days_of_the_week %} + {% with day_in.weekday as day_in_week %} +
    +
    + {{day_in_week}} +
    + {% for staff_hour in staff_hours %} + {%if staff_hour.day == day_in_week %} +
    +
      +
      + {{staff_hour.time}} + {%if staff_hour.cancelled or day_in.holiday != None or staff_hour.day == today and lab_status.force_lab_closed %} + cancelled this week + {{day_in | lab_holidays}} + {% endif %} +
      + {% for staffer in staff_hour.staff %} +
    • + {{staffer.user_name}} +

      {{staffer.real_name}}

      +
      {{staffer.position}}
      +
    • + {% endfor %} +
    +
    {% endif %} -
  • - {% endfor %} -
-
-
- {% endif %} - {% endfor %} + {% endfor %} +
+ {% endwith %} {% endfor %}
-

Open Computing Facility Lab

{% google_map '100%' '250px' %}

diff --git a/ocfweb/main/templatetags/staff_hours.py b/ocfweb/main/templatetags/staff_hours.py index 08180c2b4..f2dfb0c13 100644 --- a/ocfweb/main/templatetags/staff_hours.py +++ b/ocfweb/main/templatetags/staff_hours.py @@ -1,8 +1,20 @@ from django import template +from ocfweb.templatetags.lab_hours import lab_hours_holiday as holiday_hours + register = template.Library() @register.filter def gravatar(staffer, size): return staffer.gravatar(size) + + +@register.filter +def lab_holidays(hours): + return holiday_hours(hours) + + +@register.filter +def get_bio(staffer): + return staffer.get_bio() diff --git a/ocfweb/static/js/site.js b/ocfweb/static/js/site.js index 4e48734f7..325550c95 100644 --- a/ocfweb/static/js/site.js +++ b/ocfweb/static/js/site.js @@ -6,6 +6,8 @@ $(document).ready(function() { $('body').css('margin-bottom', height); }; + $('[data-toogle="tooltip"]').tooltip(); + $(window).resize(function() { clearTimeout(resizeTimeout); setTimeout(updateFooterHeight, 10); diff --git a/ocfweb/static/scss/pages/_home.scss b/ocfweb/static/scss/pages/_home.scss index f054bc3dc..c502b4d8d 100644 --- a/ocfweb/static/scss/pages/_home.scss +++ b/ocfweb/static/scss/pages/_home.scss @@ -58,12 +58,23 @@ } .ocf-staffhours { + border-width: thin; + font-size: 18px; + + .title { + margin-bottom: 0; + font-size: 28px; + font-weight: bold; + } + p { margin: 0; } h3 { + margin-top: 0; margin-bottom: 0; + font-size: 20px; } .cancelled p { diff --git a/ocfweb/static/scss/pages/_staff-hours.scss b/ocfweb/static/scss/pages/_staff-hours.scss index 75cd93942..2fc2a05cd 100644 --- a/ocfweb/static/scss/pages/_staff-hours.scss +++ b/ocfweb/static/scss/pages/_staff-hours.scss @@ -1,25 +1,13 @@ .page-staff-hours { - .hour { - border: solid 1px #ddd; - margin-bottom: 15px; + .day { + border-width: thin; + padding: 20px; - .title { - font-size: 16px; - padding: 7px 10px 5px; - border-bottom: solid 1px #ddd; + .daytitle { + font-size: 22px; + padding: 0 10px 5px; background-color: #eee; - - strong { - margin-right: 3px; - } - - span { - margin-left: 3px; - } - } - - .content { - padding: 13px; + border: solid 1px #ddd; } &.cancelled .title { @@ -31,39 +19,68 @@ font-weight: bold; } - .ocf-staffhours-faces { - @extend .list-inline; - margin-bottom: 0; + .hour { + margin-bottom: 15px; + border-width: thin; - li { - h4, - h5 { - text-align: center; - } + .title { + font-size: 16px; + padding: 7px 10px 5px; + border-bottom: solid 2px #eee; - h4 { - margin-top: 5px; - margin-bottom: 4px; - font-size: 16px; + strong { + margin-right: 3px; } - h5 { - margin-top: 0; - margin-bottom: 0; - font-size: 14px; - font-weight: normal; + span { + margin-left: 3px; } + } - img { - display: block; - margin-left: auto; - margin-right: auto; + .content { + padding: 13px; + } + + .ocf-staffhours-faces { + @extend .list-inline; + margin-bottom: 0; + + li { + width: 165px; + display: inline-block; + margin-bottom: 20px; + + h4, + h5 { + text-align: center; + } + + h4 { + text-align: center; + margin-top: 5px; + margin-bottom: 4px; + font-size: 16px; + } + + h5 { + text-align: center; + margin-top: 0; + margin-bottom: 0; + font-size: 14px; + font-weight: normal; + } + + img { + display: block; + margin-left: auto; + margin-right: auto; + } } } - } - &.cancelled .ocf-staffhours-faces { - opacity: 0.6; + &.cancelled .ocf-staffhours-faces { + opacity: 0.6; + } } - } + } } diff --git a/ocfweb/static/scss/site.scss b/ocfweb/static/scss/site.scss index e0190e7e0..0147845bf 100644 --- a/ocfweb/static/scss/site.scss +++ b/ocfweb/static/scss/site.scss @@ -277,3 +277,4 @@ h6 { @import 'pages/staff-hours'; @import 'pages/printing-announcement'; @import 'pages/tv'; +@import 'pages/mirrors'; diff --git a/ocfweb/stats/templates/stats/mirrors.html b/ocfweb/stats/templates/stats/mirrors.html index 1553e1cf6..10c0819de 100644 --- a/ocfweb/stats/templates/stats/mirrors.html +++ b/ocfweb/stats/templates/stats/mirrors.html @@ -2,14 +2,22 @@ {% load common %} {% load stats %} + {% block content %}
- {% stats_navbar %} -

Bandwidth usage per mirrored project

-
+ {% stats_navbar %} +

Bandwidth usage per mirrored project

+
+ +
+
+ +
+

Bandwidth Usage Since {{ start_date }}

-
+
From af6fde9a98437725537068e7e52fd7490271f6bc Mon Sep 17 00:00:00 2001 From: Vaibhav Jayaraman Date: Fri, 2 Mar 2018 17:13:42 -0800 Subject: [PATCH 3/6] ready to pull --- ocfweb/static/scss/pages/_mirrors.scss | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 ocfweb/static/scss/pages/_mirrors.scss diff --git a/ocfweb/static/scss/pages/_mirrors.scss b/ocfweb/static/scss/pages/_mirrors.scss new file mode 100644 index 000000000..f12d75f5b --- /dev/null +++ b/ocfweb/static/scss/pages/_mirrors.scss @@ -0,0 +1,13 @@ +.mirrors-pie-chart { + width: 1100px; + height: 500px; + padding: 10px; + margin: 0; +} + +.mirrors-mirror-usage { + width: 1100px; + height: 500px; + padding: 10px; + margin: 0; +} From cf1bedefe78e4875ef9273244dc745c6b1609ea7 Mon Sep 17 00:00:00 2001 From: Vaibhav Jayaraman Date: Sun, 4 Mar 2018 00:57:19 -0800 Subject: [PATCH 4/6] fixed merge conflict that came from squashing --- ocfweb/main/templates/main/staff-hours.html | 63 +++++++++++---------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/ocfweb/main/templates/main/staff-hours.html b/ocfweb/main/templates/main/staff-hours.html index bada92e8a..9cd864591 100644 --- a/ocfweb/main/templates/main/staff-hours.html +++ b/ocfweb/main/templates/main/staff-hours.html @@ -8,38 +8,39 @@

Have questions? Drop by for help from a friendly volunteer staffer!

OCF staff members hold regular drop-in staff hours to provide assistance with account issues or with OCF services. We're always happy to help troubleshoot account or service issues!

Keep in mind the OCF volunteers sometimes have last-minute conflicts, so it's a good idea to check this page before coming in for cancellations.

- {% for day_in in days_of_the_week %} - {% with day_in.weekday as day_in_week %} -
-
- {{day_in_week}} -
- {% for staff_hour in staff_hours %} - {%if staff_hour.day == day_in_week %} -
-
    -
    - {{staff_hour.time}} - {%if staff_hour.cancelled or day_in.holiday != None or staff_hour.day == today and lab_status.force_lab_closed %} - cancelled this week - {{day_in | lab_holidays}} - {% endif %} -
    - {% for staffer in staff_hour.staff %} -
  • - {{staffer.user_name}} -

    {{staffer.real_name}}

    -
    {{staffer.position}}
    -
  • - {% endfor %} -
-
- {% endif %} - {% endfor %} -
- {% endwith %} - {% endfor %} + {% for staff_day in staff_hours %} +
+
+ {{staff_day.day}} + {%if staff_day.holiday != None %} + {{staff_day.holiday}} + {% endif %} +
+ {% for staff_hour in staff_day.hours %} +
+
+ {{staff_hour.time}} + {% if staff_hour.cancelled or lab_status.force_lab_closed and staff_day == today%} + cancelled this week + {% endif %} +
+
+
    + {%for staffer in staff_hour.staff %} +
  • + {{staffer.user_name}} +

    {{staffer.real_name}}

    +
    {{staffer.position}}
    +
  • + {% endfor %} +
+
+
+ {% endfor %} +
+ {% endfor %} +

Open Computing Facility Lab

{% google_map '100%' '250px' %}

From 88a5082680d0b5190a23f83af5e39fd4a9117b93 Mon Sep 17 00:00:00 2001 From: Vaibhav Jayaraman Date: Thu, 12 Apr 2018 18:03:57 -0700 Subject: [PATCH 5/6] addressed review comments --- ocfweb/main/home.py | 2 +- ocfweb/main/templates/main/staff-hours.html | 5 ++--- ocfweb/main/templatetags/staff_hours.py | 12 ----------- ocfweb/static/js/site.js | 2 -- ocfweb/static/scss/pages/_mirrors.scss | 24 +++++++++++---------- ocfweb/stats/templates/stats/mirrors.html | 7 +++--- 6 files changed, 19 insertions(+), 33 deletions(-) diff --git a/ocfweb/main/home.py b/ocfweb/main/home.py index 66b2af1c1..81d182d29 100644 --- a/ocfweb/main/home.py +++ b/ocfweb/main/home.py @@ -12,7 +12,7 @@ from ocfweb.component.lab_status import get_lab_status -@periodic(60) +@periodic(60, ttl=86400) def get_staff_hours(): return get_staff_hours_soonest_first()[:2] diff --git a/ocfweb/main/templates/main/staff-hours.html b/ocfweb/main/templates/main/staff-hours.html index 9cd864591..07906af35 100644 --- a/ocfweb/main/templates/main/staff-hours.html +++ b/ocfweb/main/templates/main/staff-hours.html @@ -12,8 +12,8 @@

Have questions? Drop by for help from a friendly volunteer staffer!

{{staff_day.day}} - {%if staff_day.holiday != None %} - {{staff_day.holiday}} + {%if staff_day.holiday is not None %} + {{staff_day.holiday}} {% endif %}
{% for staff_hour in staff_day.hours %} @@ -40,7 +40,6 @@
{{staffer.position}}
{% endfor %}
-

Open Computing Facility Lab

{% google_map '100%' '250px' %}

diff --git a/ocfweb/main/templatetags/staff_hours.py b/ocfweb/main/templatetags/staff_hours.py index f2dfb0c13..08180c2b4 100644 --- a/ocfweb/main/templatetags/staff_hours.py +++ b/ocfweb/main/templatetags/staff_hours.py @@ -1,20 +1,8 @@ from django import template -from ocfweb.templatetags.lab_hours import lab_hours_holiday as holiday_hours - register = template.Library() @register.filter def gravatar(staffer, size): return staffer.gravatar(size) - - -@register.filter -def lab_holidays(hours): - return holiday_hours(hours) - - -@register.filter -def get_bio(staffer): - return staffer.get_bio() diff --git a/ocfweb/static/js/site.js b/ocfweb/static/js/site.js index 325550c95..4e48734f7 100644 --- a/ocfweb/static/js/site.js +++ b/ocfweb/static/js/site.js @@ -6,8 +6,6 @@ $(document).ready(function() { $('body').css('margin-bottom', height); }; - $('[data-toogle="tooltip"]').tooltip(); - $(window).resize(function() { clearTimeout(resizeTimeout); setTimeout(updateFooterHeight, 10); diff --git a/ocfweb/static/scss/pages/_mirrors.scss b/ocfweb/static/scss/pages/_mirrors.scss index f12d75f5b..e0606ae1c 100644 --- a/ocfweb/static/scss/pages/_mirrors.scss +++ b/ocfweb/static/scss/pages/_mirrors.scss @@ -1,13 +1,15 @@ -.mirrors-pie-chart { - width: 1100px; - height: 500px; - padding: 10px; - margin: 0; -} +.page-stats_mirrors { + .mirrors-pie-chart { + width: 1100px; + height: 500px; + padding: 10px; + margin: 0; + } -.mirrors-mirror-usage { - width: 1100px; - height: 500px; - padding: 10px; - margin: 0; + .mirrors-mirror-usage { + width: 1100px; + height: 500px; + padding: 10px; + margin: 0; + } } diff --git a/ocfweb/stats/templates/stats/mirrors.html b/ocfweb/stats/templates/stats/mirrors.html index 10c0819de..6abac313a 100644 --- a/ocfweb/stats/templates/stats/mirrors.html +++ b/ocfweb/stats/templates/stats/mirrors.html @@ -8,16 +8,15 @@ {% stats_navbar %}

Bandwidth usage per mirrored project

- +
- +

Bandwidth Usage Since {{ start_date }}

-
+
Mirrored Project
From 6db1533c93b8e1cc7f958a75dda3f57f17aa0257 Mon Sep 17 00:00:00 2001 From: Vaibhav Jayaraman Date: Thu, 12 Apr 2018 19:03:25 -0700 Subject: [PATCH 6/6] removed changes from mirrors.html --- ocfweb/stats/templates/stats/mirrors.html | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ocfweb/stats/templates/stats/mirrors.html b/ocfweb/stats/templates/stats/mirrors.html index 6abac313a..6240bea86 100644 --- a/ocfweb/stats/templates/stats/mirrors.html +++ b/ocfweb/stats/templates/stats/mirrors.html @@ -7,12 +7,6 @@
{% stats_navbar %}

Bandwidth usage per mirrored project

-
- -
-
- -

Bandwidth Usage Since {{ start_date }}

Mirrored Project