From 51988d95249659c3ae4abc44b663b2d920ca76c4 Mon Sep 17 00:00:00 2001 From: Michael Madden Date: Thu, 7 May 2020 13:48:44 -0400 Subject: [PATCH 01/15] news articles edit publish date auto fills with last saved date --- project-templates/staff/news/news_article_edit.html | 1 + 1 file changed, 1 insertion(+) diff --git a/project-templates/staff/news/news_article_edit.html b/project-templates/staff/news/news_article_edit.html index 623e1aa55..bed21ac23 100644 --- a/project-templates/staff/news/news_article_edit.html +++ b/project-templates/staff/news/news_article_edit.html @@ -56,6 +56,7 @@ - - + {% block head %} PageName - {{ SITE_NAME }} {% endblock %} From b71666a3ee29482cb0a07d2d63d8f6d02ba38aa5 Mon Sep 17 00:00:00 2001 From: Michael Madden Date: Thu, 7 May 2020 14:14:09 -0400 Subject: [PATCH 05/15] fix template path from old multi tennant --- project-templates/profiles/registration_form.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project-templates/profiles/registration_form.html b/project-templates/profiles/registration_form.html index a0e49fbd0..73c14d855 100644 --- a/project-templates/profiles/registration_form.html +++ b/project-templates/profiles/registration_form.html @@ -8,8 +8,8 @@

Add a new account

{% csrf_token %} - {% include 'profiles/stock/registration_form_template.html' %} - {% include 'profiles/stock/captcha.html' %} + {% include 'profiles/registration_form_template.html' %} + {% include 'profiles/captcha.html' %}
{% endblock %} From a19d1dde4880bf7e74c6d74b989a880fc8cd1852 Mon Sep 17 00:00:00 2001 From: Michael Madden Date: Thu, 7 May 2020 14:18:47 -0400 Subject: [PATCH 06/15] delete user gear model --- profiles/migrations/0010_delete_usergear.py | 16 ++++++++++++++++ profiles/models.py | 15 --------------- 2 files changed, 16 insertions(+), 15 deletions(-) create mode 100644 profiles/migrations/0010_delete_usergear.py diff --git a/profiles/migrations/0010_delete_usergear.py b/profiles/migrations/0010_delete_usergear.py new file mode 100644 index 000000000..134da3b3c --- /dev/null +++ b/profiles/migrations/0010_delete_usergear.py @@ -0,0 +1,16 @@ +# Generated by Django 2.2.12 on 2020-05-07 18:18 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('profiles', '0009_auto_20190620_1725'), + ] + + operations = [ + migrations.DeleteModel( + name='UserGear', + ), + ] diff --git a/profiles/models.py b/profiles/models.py index 3189e4824..f31e8d0d5 100644 --- a/profiles/models.py +++ b/profiles/models.py @@ -4,21 +4,6 @@ from django_countries.fields import CountryField -# Create your models here. - - -class UserGear(models.Model): - user = models.ForeignKey(User, related_name='userspecs', on_delete=models.CASCADE) - # see if the guy actually owns a pc - ownpc = models.BooleanField(default=False) - - cpu = models.CharField(max_length=30, default='No CPU specified') - gpu = models.CharField(max_length=30, default='No GPU specified') - psu = models.CharField(max_length=30, default='No PSU specified') - case = models.CharField(max_length=30, default='No Case specified') - os = models.CharField(max_length=30, default='No OS specified') - - class UserProfile(models.Model): def __str__(self): return str(self.user) From 421128b8ae2eb20971d207a663926c9eb7755642 Mon Sep 17 00:00:00 2001 From: Michael Madden Date: Thu, 7 May 2020 14:23:20 -0400 Subject: [PATCH 07/15] add activision id, closes #73 --- profiles/forms.py | 3 +++ .../0011_userprofile_activisionid.py | 18 ++++++++++++++++++ profiles/models.py | 1 + project-templates/profiles/edit_profile.html | 3 +++ project-templates/profiles/profile.html | 4 ++++ 5 files changed, 29 insertions(+) create mode 100644 profiles/migrations/0011_userprofile_activisionid.py diff --git a/profiles/forms.py b/profiles/forms.py index 7ac9c1f5f..3cb4e1d1f 100644 --- a/profiles/forms.py +++ b/profiles/forms.py @@ -35,6 +35,7 @@ class Meta: 'epic', 'lol', 'battlenet', + 'activisionid', 'twitter_profile', 'twitch_channel', 'favorite_game', @@ -57,6 +58,8 @@ def __init__(self, *args, **kwargs): ''}) self.fields['battlenet'].widget.attrs.update({'name': 'battlenet', 'class': 'form-control', 'style': ''}) + self.fields['activisionid'].widget.attrs.update({'name': 'activisionid', 'class': 'form-control', 'style': + ''}) self.fields['twitter_profile'].widget.attrs.update({'name': 'twitter_profile', 'class': 'form-control', 'style': ''}) self.fields['twitch_channel'].widget.attrs.update({'name': 'twitch_channel', 'class': 'form-control', 'style': diff --git a/profiles/migrations/0011_userprofile_activisionid.py b/profiles/migrations/0011_userprofile_activisionid.py new file mode 100644 index 000000000..07ccc86f9 --- /dev/null +++ b/profiles/migrations/0011_userprofile_activisionid.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.12 on 2020-05-07 18:19 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('profiles', '0010_delete_usergear'), + ] + + operations = [ + migrations.AddField( + model_name='userprofile', + name='activisionid', + field=models.CharField(blank=True, default='No Activision ID Linked', max_length=30), + ), + ] diff --git a/profiles/models.py b/profiles/models.py index f31e8d0d5..c4bccc51a 100644 --- a/profiles/models.py +++ b/profiles/models.py @@ -25,6 +25,7 @@ def __str__(self): epic = models.CharField(max_length=30, default='No Epic Linked', blank=True) lol = models.CharField(max_length=30, default='No LOL Linked', blank=True) battlenet = models.CharField(max_length=30, default='No Battle.net Linked', blank=True) + activisionid = models.CharField(max_length=30, default='No Activision ID Linked', blank=True) twitter_profile = models.CharField(max_length=30, default='No Twitter Linked', blank=True) twitch_channel = models.CharField(max_length=50, default='No Twitch Linked', blank=True) favorite_game = models.CharField(max_length=50, default='N/A', blank=True) diff --git a/project-templates/profiles/edit_profile.html b/project-templates/profiles/edit_profile.html index fc56911e2..9cc3a45b5 100644 --- a/project-templates/profiles/edit_profile.html +++ b/project-templates/profiles/edit_profile.html @@ -22,6 +22,9 @@
{{ form.psn }}
+ +
{{ form.activisionid }}
+
{{ form.twitter_profile }}
diff --git a/project-templates/profiles/profile.html b/project-templates/profiles/profile.html index 872ad3ba9..3badc59b9 100644 --- a/project-templates/profiles/profile.html +++ b/project-templates/profiles/profile.html @@ -36,6 +36,10 @@ PSN: {{ userprofile.psn }} + + Activision ID: + {{ userprofile.activisionid }} + Twitter: {{ userprofile.twitter_profile }} From 5b8722ecd2cad321eedfb4a724e398fa9d7ddd8d Mon Sep 17 00:00:00 2001 From: Michael Madden Date: Thu, 7 May 2020 14:33:30 -0400 Subject: [PATCH 08/15] rename templates to line up with app name --- project-templates/{tickets => support}/ticket_create.html | 0 project-templates/{tickets => support}/ticket_detail.html | 0 project-templates/{tickets => support}/ticket_list.html | 0 support/views.py | 8 ++++---- 4 files changed, 4 insertions(+), 4 deletions(-) rename project-templates/{tickets => support}/ticket_create.html (100%) rename project-templates/{tickets => support}/ticket_detail.html (100%) rename project-templates/{tickets => support}/ticket_list.html (100%) diff --git a/project-templates/tickets/ticket_create.html b/project-templates/support/ticket_create.html similarity index 100% rename from project-templates/tickets/ticket_create.html rename to project-templates/support/ticket_create.html diff --git a/project-templates/tickets/ticket_detail.html b/project-templates/support/ticket_detail.html similarity index 100% rename from project-templates/tickets/ticket_detail.html rename to project-templates/support/ticket_detail.html diff --git a/project-templates/tickets/ticket_list.html b/project-templates/support/ticket_list.html similarity index 100% rename from project-templates/tickets/ticket_list.html rename to project-templates/support/ticket_list.html diff --git a/support/views.py b/support/views.py index fef01aa35..69eab4fbe 100644 --- a/support/views.py +++ b/support/views.py @@ -16,7 +16,7 @@ class MyTicketListView(View): def get(self, request): form = self.form ticket_list = Ticket.objects.filter(creator=request.user, status__lte=2) - return render(request, 'tickets/ticket_list.html', + return render(request, 'support/ticket_list.html', {'form': form, 'ticket_list': ticket_list}) def post(self, request): @@ -30,7 +30,7 @@ def post(self, request): ticket_list = Ticket.objects.filter(pk=query) except ValueError: ticket_list = Ticket.objects.filter(text__contains=query) - return render(request, 'tickets/ticket_list.html', + return render(request, 'support/ticket_list.html', {'form': form, 'ticket_list': ticket_list}) @@ -49,7 +49,7 @@ def get(self, request, **kwargs): ticket = get_object_or_404(Ticket, pk=pk) creator = UserProfile.objects.get(user=ticket.creator) comments = TicketComment.objects.filter(ticket=pk) - return render(request, 'tickets/ticket_detail.html', {'form': form1, 'x': pk, "ticket": ticket, + return render(request, 'support/ticket_detail.html', {'form': form1, 'x': pk, "ticket": ticket, "comments": comments, 'creator': creator}) @@ -93,7 +93,7 @@ class TicketCreateView(View): def get(self, request): form = self.form_class() - return render(request, 'tickets/ticket_create.html', {'form': form}) + return render(request, 'support/ticket_create.html', {'form': form}) def post(self, request): form = self.form_class(request.POST) From 39637c245dafa55596c2c7509b120903da7559c5 Mon Sep 17 00:00:00 2001 From: Michael Madden Date: Thu, 7 May 2020 14:57:09 -0400 Subject: [PATCH 09/15] faq templates initial commit --- project-templates/support/faq_detail.html | 0 project-templates/support/faq_list.html | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 project-templates/support/faq_detail.html create mode 100644 project-templates/support/faq_list.html diff --git a/project-templates/support/faq_detail.html b/project-templates/support/faq_detail.html new file mode 100644 index 000000000..e69de29bb diff --git a/project-templates/support/faq_list.html b/project-templates/support/faq_list.html new file mode 100644 index 000000000..e69de29bb From e537fe66dcbeafb31a547242d8aab04cc953efd2 Mon Sep 17 00:00:00 2001 From: Michael Madden Date: Thu, 7 May 2020 14:57:39 -0400 Subject: [PATCH 10/15] faq front end implementation, closes #69 --- project-templates/support/faq_detail.html | 16 ++++++++++ project-templates/support/faq_list.html | 36 +++++++++++++++++++++++ support/urls.py | 4 ++- support/views.py | 14 ++++++++- 4 files changed, 68 insertions(+), 2 deletions(-) diff --git a/project-templates/support/faq_detail.html b/project-templates/support/faq_detail.html index e69de29bb..7a314fc72 100644 --- a/project-templates/support/faq_detail.html +++ b/project-templates/support/faq_detail.html @@ -0,0 +1,16 @@ +{% extends "base.html" %} +{% load static %} + +{% block head %} + FAQ #{{ faq.pk }} - {{ SITE_NAME }} +{% endblock %} + +{% block body %} +

{{ faq.category.name }}

+

{{ faq.question }}

+

{{ faq.anaswer }}

+

Creator: {{ faq.creator }}

+

Created: {{ faq.created }}, Updated: {{ faq.updated }}

+ +{% endblock %} + diff --git a/project-templates/support/faq_list.html b/project-templates/support/faq_list.html index e69de29bb..6481890ae 100644 --- a/project-templates/support/faq_list.html +++ b/project-templates/support/faq_list.html @@ -0,0 +1,36 @@ +{% extends "base.html" %} +{% load static %} + +{% block head %} + FAQ - {{ SITE_NAME }} +{% endblock %} + +{% block body %} +{% if questions.count == 0 %} +

There's nothing here yet! Check back soon!

+ {% endif %} + + + + + + + + + + + {% for q in questions %} + + + + + + + + + {% endfor %} +
CategoryQuestionAnswerLast Updated
{{ q.category.name }}{{ q.question }}{{ q.answer|truncatewords:20 }}{{ q.updated }}
+ + +{% endblock %} + diff --git a/support/urls.py b/support/urls.py index c688bd8f3..21427f71a 100644 --- a/support/urls.py +++ b/support/urls.py @@ -1,7 +1,7 @@ from django.contrib.auth.decorators import login_required from django.urls import path -from support.views import MyTicketListView, MyTicketDetailView, TicketCreateView +from support.views import MyTicketListView, MyTicketDetailView, TicketCreateView, FAQDetail, FAQListView app_name = 'support' @@ -9,4 +9,6 @@ path('', login_required(MyTicketListView.as_view()), name='list'), path('my//', login_required(MyTicketDetailView.as_view()), name='detail'), path('create/', login_required(TicketCreateView.as_view()), name='create'), + path('faq/', FAQListView, name='faq_list'), + path('faq//', FAQDetail, name='faq_detail') ] diff --git a/support/views.py b/support/views.py index 69eab4fbe..469bc44d1 100644 --- a/support/views.py +++ b/support/views.py @@ -6,7 +6,19 @@ from profiles.models import UserProfile from support.forms import TicketCreateForm, TicketCommentCreateForm, TicketStatusChangeForm, ListFilterForm -from support.models import Ticket, TicketComment +from support.models import Ticket, TicketComment, QuestionAnswer, QuestionAnswerCategory + + +def FAQListView(request): + questions = QuestionAnswer.objects.all() + return render(request, 'support/faq_list.html', + {'questions': questions}) + + +def FAQDetail(request, pk): + faq = get_object_or_404(QuestionAnswer, pk=pk) + template = 'support/faq_detail.html' + return render(request, template, {'faq': faq}) class MyTicketListView(View): From 9f2daec7633fc1810b40d676e379bd987c8a8bd4 Mon Sep 17 00:00:00 2001 From: Michael Madden Date: Thu, 7 May 2020 14:59:37 -0400 Subject: [PATCH 11/15] bump version --- olly/base_settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/olly/base_settings.py b/olly/base_settings.py index 47e0fdaa2..33cf456f6 100644 --- a/olly/base_settings.py +++ b/olly/base_settings.py @@ -156,4 +156,4 @@ LOGIN_REDIRECT_URL = '/' LOGIN_URL = '/login/' -SITE_VERSION = "0.8.0" +SITE_VERSION = "0.8.1" From 29164b3b62273da9643fdc5328d81962c5f74323 Mon Sep 17 00:00:00 2001 From: Steven Young Date: Thu, 7 May 2020 18:13:16 -0400 Subject: [PATCH 12/15] Staff panel work for object based slides --- .../staff/pages/slide_create.html | 28 +++++++++ .../staff/pages/slide_detail.html | 30 +++++++++ project-templates/staff/pages/slide_list.html | 37 +++++++++++ project-templates/staff/staffbase.html | 13 +++- staff/forms.py | 8 ++- staff/urls.py | 4 ++ staff/views/staff.py | 63 +++++++++++++++++++ 7 files changed, 181 insertions(+), 2 deletions(-) create mode 100644 project-templates/staff/pages/slide_create.html create mode 100644 project-templates/staff/pages/slide_detail.html create mode 100644 project-templates/staff/pages/slide_list.html diff --git a/project-templates/staff/pages/slide_create.html b/project-templates/staff/pages/slide_create.html new file mode 100644 index 000000000..350260145 --- /dev/null +++ b/project-templates/staff/pages/slide_create.html @@ -0,0 +1,28 @@ +{% extends "staff/staffbase.html" %} +{% load static %} + +{% block title %} + Create Slide +{% endblock %} +{% block body %} +
+ {% csrf_token %} + + {{ field.errors }} + + +
{{ form.header }}
+ + +
{{ form.subhead }}
+ + +
{{ form.link }}
+ + +
{{ form.image }}
+ + + +
+{% endblock %} \ No newline at end of file diff --git a/project-templates/staff/pages/slide_detail.html b/project-templates/staff/pages/slide_detail.html new file mode 100644 index 000000000..4370d5cc2 --- /dev/null +++ b/project-templates/staff/pages/slide_detail.html @@ -0,0 +1,30 @@ +{% extends "staff/staffbase.html" %} +{% load static %} + +{% block title %} + Edit Slide +{% endblock %} +{% block body %} +
+ {% csrf_token %} + + {{ field.errors }} + + +
{{ form.header }}
+ + +
{{ form.subhead }}
+ + +
{{ form.link }}
+ + +
{{ form.image }}
+ + + + Delete + +
+{% endblock %} \ No newline at end of file diff --git a/project-templates/staff/pages/slide_list.html b/project-templates/staff/pages/slide_list.html new file mode 100644 index 000000000..1d4db19cf --- /dev/null +++ b/project-templates/staff/pages/slide_list.html @@ -0,0 +1,37 @@ +{% extends 'staff/staffbase.html' %} +{% load static %} + + +{% block title %} + Slides +{% endblock %} +{% block body %} +
+

Create new slide

+ + + + + + + + + + {% for slide in slides %} + + + + + + + + {% endfor %} +
HeaderSubheadLink
+ {{ slide.header }} + + {{ slide.subhead }} + + {{ slide.link }} +
+
+{% endblock %} \ No newline at end of file diff --git a/project-templates/staff/staffbase.html b/project-templates/staff/staffbase.html index db0eeacf6..369f4605b 100644 --- a/project-templates/staff/staffbase.html +++ b/project-templates/staff/staffbase.html @@ -81,12 +81,23 @@ + +