From 7d699583ef64b0d657892f826f0ff901dee959fd Mon Sep 17 00:00:00 2001 From: JP Bulman Date: Sat, 9 Feb 2019 23:49:25 -0500 Subject: [PATCH 1/5] Set up blank page for the announcments --- cubingusa.py | 4 ++++ src/common.py | 1 + src/templates/admin/announcement.html | 11 +++++++++++ 3 files changed, 16 insertions(+) create mode 100644 src/templates/admin/announcement.html diff --git a/cubingusa.py b/cubingusa.py index 12793c94..93501468 100644 --- a/cubingusa.py +++ b/cubingusa.py @@ -72,6 +72,10 @@ webapp2.Route('/async/championship_psych//', handler=ChampionshipPsychAsyncHandler), # Admin + webapp2.Route('/admin/edit_announcements', + handler=BasicHandler('/admin/announcement.html', + permitted_roles=Roles.AllRoles()), + name='admin_edit_announcement'), webapp2.Route('/admin/edit_users', handler=BasicHandler('admin/edit_users.html', permitted_roles=Roles.AllRoles()), diff --git a/src/common.py b/src/common.py index 27707962..306d3b9b 100644 --- a/src/common.py +++ b/src/common.py @@ -101,6 +101,7 @@ def get_nav_items(self): if self.user and self.user.HasAnyRole(Roles.AdminRoles()): admin_list = [('Edit Users', '/admin/edit_users'), ('Edit Championships', '/admin/edit_championships'), + ('Edit Announcements','/admin/edit_announcements') ] items.append(('Admin', admin_list)) return items diff --git a/src/templates/admin/announcement.html b/src/templates/admin/announcement.html new file mode 100644 index 00000000..2c792bb4 --- /dev/null +++ b/src/templates/admin/announcement.html @@ -0,0 +1,11 @@ +{% import "components/css.html" as css %} +{% extends "base.html" %} +{% block title %}Announcements{% endblock %} + +{% block content %} + +

CubingUSA Announcements

+ +{% endblock %} \ No newline at end of file From 6ecf6448b38f230430098974a2fb7b42edf10c17 Mon Sep 17 00:00:00 2001 From: JP Bulman Date: Sun, 10 Feb 2019 01:06:04 -0500 Subject: [PATCH 2/5] Started basic layout with textboxes --- src/templates/admin/announcement.html | 29 +++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/src/templates/admin/announcement.html b/src/templates/admin/announcement.html index 2c792bb4..6146edcc 100644 --- a/src/templates/admin/announcement.html +++ b/src/templates/admin/announcement.html @@ -1,11 +1,32 @@ {% import "components/css.html" as css %} {% extends "base.html" %} -{% block title %}Announcements{% endblock %} - +{% block title%}Public Documents{% endblock %} +{% block style %} + {{ css.css(c, 'base') }} +{% endblock %} {% block content %}

CubingUSA Announcements

+
+

Make A New Announcement

+
+
+ +
+ +
+
+ +
+ +
+ + +
+ +
+
+
+ {% endblock %} \ No newline at end of file From bd81ccab6a131b0d1572dc1e22e91f662ad5824d Mon Sep 17 00:00:00 2001 From: JP Bulman Date: Tue, 12 Feb 2019 23:27:10 -0500 Subject: [PATCH 3/5] Made basic front page card to hold posts --- src/templates/admin/announcement.html | 6 +++++- src/templates/index.html | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/templates/admin/announcement.html b/src/templates/admin/announcement.html index 6146edcc..c9120681 100644 --- a/src/templates/admin/announcement.html +++ b/src/templates/admin/announcement.html @@ -22,10 +22,14 @@

Make A New Announcement

- +
+ + + + diff --git a/src/templates/index.html b/src/templates/index.html index 8aea5363..4cbbb4d8 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -44,12 +44,18 @@

CubingUSA Nationals

- Regional Championships + +

Recent Posts

+ + +
From 48cf48977baba9e5d0f5c2e7434ffd9a849cedbe Mon Sep 17 00:00:00 2001 From: JP Bulman Date: Wed, 13 Feb 2019 00:09:05 -0500 Subject: [PATCH 4/5] Added test posts and made section for current announcements --- src/handlers/documents.py | 2 ++ src/templates/admin/announcement.html | 16 ++++++++++++---- src/templates/index.html | 8 ++++++-- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/handlers/documents.py b/src/handlers/documents.py index bec001cb..aaa6e4cd 100644 --- a/src/handlers/documents.py +++ b/src/handlers/documents.py @@ -25,6 +25,8 @@ def get(self): for documents in documents_by_section.values(): documents.sort(key=lambda x: x.upload_time, reverse=True) + print(documents_by_section) + template_dict = { 'c': common.Common(self), 'documents_by_section': diff --git a/src/templates/admin/announcement.html b/src/templates/admin/announcement.html index c9120681..f5cb8d4f 100644 --- a/src/templates/admin/announcement.html +++ b/src/templates/admin/announcement.html @@ -8,7 +8,7 @@

CubingUSA Announcements

-
+

Make A New Announcement

@@ -25,12 +25,20 @@

Make A New Announcement

- -
- + + + +

Current Announcements

+ + +
    +
  • Posts will appear here
  • +
  • Examples to test the look
  • +
+
{% endblock %} \ No newline at end of file diff --git a/src/templates/index.html b/src/templates/index.html index 4cbbb4d8..4f7b2dda 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -50,10 +50,14 @@

Regional Championships

Each year, we host seven Regional Championships across the country, allowing lots of different cubers a chance to compete for a title.

Learn More
--> -

Recent Posts

+
    -
  • Blah Blskdhfsdlfhklkbbsdf Read More
  • +
  • Recent Posts

  • +
  • Test Posts Read More
  • +
  • Will Appear Here Read More
  • +
  • Regional Championships Announced! Read More
  • +
  • Make sure to check out our new logo!
From f2e60a920fac7b57bf821141d4ca8bbd377c50ae Mon Sep 17 00:00:00 2001 From: JP Bulman Date: Wed, 13 Feb 2019 00:13:57 -0500 Subject: [PATCH 5/5] Got rid of print debug Sorry, forgot to take this out on the last commit. --- src/handlers/documents.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/handlers/documents.py b/src/handlers/documents.py index aaa6e4cd..bec001cb 100644 --- a/src/handlers/documents.py +++ b/src/handlers/documents.py @@ -25,8 +25,6 @@ def get(self): for documents in documents_by_section.values(): documents.sort(key=lambda x: x.upload_time, reverse=True) - print(documents_by_section) - template_dict = { 'c': common.Common(self), 'documents_by_section':