Skip to content

Commit

Permalink
Merge pull request #75 from NFM-Studios/develop
Browse files Browse the repository at this point in the history
Closes #54 #73 #69 - V0.8.1 Draft
  • Loading branch information
techlover1 committed May 7, 2020
2 parents 42e4be2 + 2b81d1f commit 463a984
Show file tree
Hide file tree
Showing 29 changed files with 352 additions and 30 deletions.
19 changes: 19 additions & 0 deletions news/migrations/0003_auto_20200507_1737.py
@@ -0,0 +1,19 @@
# Generated by Django 2.2.12 on 2020-05-07 17:37

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

dependencies = [
('news', '0002_auto_20190713_1335'),
]

operations = [
migrations.AlterField(
model_name='post',
name='publish',
field=models.DateTimeField(default=django.utils.timezone.now, null=True),
),
]
19 changes: 19 additions & 0 deletions news/migrations/0004_auto_20200507_1741.py
@@ -0,0 +1,19 @@
# Generated by Django 2.2.12 on 2020-05-07 17:41

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

dependencies = [
('news', '0003_auto_20200507_1737'),
]

operations = [
migrations.AlterField(
model_name='post',
name='publish',
field=models.DateTimeField(blank=True, default=django.utils.timezone.now, null=True),
),
]
2 changes: 1 addition & 1 deletion news/models.py
Expand Up @@ -19,7 +19,7 @@ class Post(models.Model):
slug = models.SlugField(max_length=250, unique_for_date='publish')
author = models.ForeignKey(User, related_name='blog_posts', on_delete=models.SET_NULL, null=True, blank=True)
body = models.TextField()
publish = models.DateTimeField(default=timezone.now, blank=True)
publish = models.DateTimeField(default=timezone.now, null=True, blank=True)
created = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
status = models.CharField(max_length=12, choices=STATUS_CHOICES, default='draft')
Expand Down
2 changes: 1 addition & 1 deletion olly/base_settings.py
Expand Up @@ -156,4 +156,4 @@
LOGIN_REDIRECT_URL = '/'
LOGIN_URL = '/login/'

SITE_VERSION = "0.8.0"
SITE_VERSION = "0.8.1"
9 changes: 8 additions & 1 deletion olly/context_processors.py
@@ -1,10 +1,17 @@
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist

from pages import models as pagesmodels

try:
SocialInfo = pagesmodels.SocialInfo.objects.get(pk=1)
except ObjectDoesNotExist:
SocialInfo = None


def site_info(request):
return {'SITE_NAME': settings.SITE_NAME,
'SITE_SERVER': settings.SITE_SERVER,
'SITE_VERSION': settings.SITE_VERSION,
'SocialInfo': pagesmodels.SocialInfo.objects.get(pk=1),
'SocialInfo': SocialInfo,
'ESPORTS_MODE': settings.ESPORTS_MODE}
2 changes: 2 additions & 0 deletions olly/settings.py
Expand Up @@ -59,11 +59,13 @@
# Media files
MEDIA_ROOT = os.path.join(BASE_DIR, 'olly/media')

AWS_DEFAULT_ACL = 'public-read'
AWS_ACCESS_KEY_ID = os.environ['storage_key_id']
AWS_SECRET_ACCESS_KEY = os.environ['storage_secret_key']
AWS_S3_ENDPOINT_URL = os.environ['storage_endpoint_url']
AWS_STORAGE_BUCKET_NAME = os.environ['storage_bucket_name']
AWS_LOCATION = ''
AWS_QUERYSTRING_AUTH = False
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
MEDIA_URL = "%s/%s/" % (AWS_S3_ENDPOINT_URL, AWS_STORAGE_BUCKET_NAME)

Expand Down
3 changes: 3 additions & 0 deletions profiles/forms.py
Expand Up @@ -35,6 +35,7 @@ class Meta:
'epic',
'lol',
'battlenet',
'activisionid',
'twitter_profile',
'twitch_channel',
'favorite_game',
Expand All @@ -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':
Expand Down
16 changes: 16 additions & 0 deletions 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',
),
]
18 changes: 18 additions & 0 deletions 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),
),
]
16 changes: 1 addition & 15 deletions profiles/models.py
Expand Up @@ -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)
Expand All @@ -40,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)
Expand Down
3 changes: 1 addition & 2 deletions project-templates/base.html
Expand Up @@ -11,8 +11,7 @@
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
crossorigin="anonymous"></script>
<link rel="stylesheet" href="{% static "fontawesome5.0.4/css/fontawesome-all.min.css" %}">
<script src="{% static 'js/nfm.js' %}"></script>


{% block head %}
<title>PageName - {{ SITE_NAME }}</title>
{% endblock %}
Expand Down
3 changes: 3 additions & 0 deletions project-templates/profiles/edit_profile.html
Expand Up @@ -22,6 +22,9 @@
<label>PSN</label>
<div class="form-group">{{ form.psn }}</div>

<label>Activision ID</label>
<div class="form-group">{{ form.activisionid }}</div>

<label>Twitter Username</label>
<div class="form-group">{{ form.twitter_profile }}</div>

Expand Down
4 changes: 4 additions & 0 deletions project-templates/profiles/profile.html
Expand Up @@ -36,6 +36,10 @@
<td><strong>PSN:</strong></td>
<td>{{ userprofile.psn }} </td>
</tr>
<tr>
<td><strong>Activision ID:</strong></td>
<td>{{ userprofile.activisionid }} </td>
</tr>
<tr>
<td><strong>Twitter:</strong></td>
<td><a href="http://twitter.com/{{ userprofile.twitter_profile }}">{{ userprofile.twitter_profile }}</a>
Expand Down
4 changes: 2 additions & 2 deletions project-templates/profiles/registration_form.html
Expand Up @@ -8,8 +8,8 @@
<h3>Add a new account</h3>
<form class="form-horizonal" role="form" action="" method="post">
{% csrf_token %}
{% include 'profiles/stock/registration_form_template.html' %}
{% include 'profiles/stock/captcha.html' %}
{% include 'profiles/registration_form_template.html' %}
{% include 'profiles/captcha.html' %}
<button type="submit" class="btn btn-success">Submit</button>
</form>
{% endblock %}
1 change: 1 addition & 0 deletions project-templates/staff/news/news_article_edit.html
Expand Up @@ -56,6 +56,7 @@
<script type="text/javascript">
$(function () {
$('#datetimepicker1').datetimepicker({
date: moment('{{form.publish.value|date:"Y-m-d H:i" }}'),
format: 'YYYY-MM-DD HH:mm'
});

Expand Down
28 changes: 28 additions & 0 deletions project-templates/staff/pages/slide_create.html
@@ -0,0 +1,28 @@
{% extends "staff/staffbase.html" %}
{% load static %}
<link rel="stylesheet" href="{% static "css/staff.css" %}">
{% block title %}
Create Slide
{% endblock %}
{% block body %}
<form enctype="multipart/form-data" method="post">
{% csrf_token %}

{{ field.errors }}

<label>Header</label>
<div class="form-group">{{ form.header }}</div>

<label>Sub header</label>
<div class="form-group">{{ form.subhead }}</div>

<label>Link</label>
<div class="form-group">{{ form.link }}</div>

<label>Image</label>
<div class="form-group">{{ form.image }}</div>


<button type="submit" class="btn btn-primary">Submit</button>
</form>
{% endblock %}
30 changes: 30 additions & 0 deletions project-templates/staff/pages/slide_detail.html
@@ -0,0 +1,30 @@
{% extends "staff/staffbase.html" %}
{% load static %}
<link rel="stylesheet" href="{% static "css/staff.css" %}">
{% block title %}
Edit Slide
{% endblock %}
{% block body %}
<form enctype="multipart/form-data" method="post">
{% csrf_token %}

{{ field.errors }}

<label>Header</label>
<div class="form-group">{{ form.header }}</div>

<label>Sub header</label>
<div class="form-group">{{ form.subhead }}</div>

<label>Link</label>
<div class="form-group">{{ form.link }}</div>

<label>Image</label>
<div class="form-group">{{ form.image }}</div>


<button type="submit" class="btn btn-primary">Submit</button>
<a href="{% url 'staff:slide_delete' pk=pk %}" onclick="return confirm('Are you sure you want to delete this Slide?')" class="btn btn-danger">Delete</a>

</form>
{% endblock %}
37 changes: 37 additions & 0 deletions project-templates/staff/pages/slide_list.html
@@ -0,0 +1,37 @@
{% extends 'staff/staffbase.html' %}
{% load static %}
<link rel="stylesheet" href="{% static "css/staff.css" %}">

{% block title %}
Slides
{% endblock %}
{% block body %}
<div style="overflow-x:auto;">
<h2><a href="{% url 'staff:slide_create' %}"><i class="fa fa-plus"></i>Create new slide </a></h2>

<table class="table table-hover">
<tr id="header">
<thead>
<th>Header</th>
<th>Subhead</th>
<th>Link</th>
</thead>
</tr>
{% for slide in slides %}
<tbody>
<tr scope="">
<td>
<a href="{% url 'staff:slide_detail' pk=slide.pk %}">{{ slide.header }}</a>
</td>
<td>
{{ slide.subhead }}
</td>
<td>
{{ slide.link }}
</td>
</tr>
</tbody>
{% endfor %}
</table>
</div>
{% endblock %}
13 changes: 12 additions & 1 deletion project-templates/staff/staffbase.html
Expand Up @@ -81,12 +81,23 @@
</li>
</ul>
</li>

<li class="nav-item" data-toggle="tooltip" data-placement="right" title="Pages">
<a class="nav-link" href="{% url 'staff:pages' %}">
<a class="nav-link nav-link-collapse collapsed" data-toggle="collapse" href="#collapsePages"
data-parent="#exampleAccordion">
<i class="fa fa-fw fa-pencil"></i>
<span class="nav-link-text">Pages</span>
</a>
<ul class="sidenav-second-level collapse" id="collapsePages">
<li>
<a href="{% url 'staff:pages' %}">Static Info</a>
</li>
<li>
<a href="{% url 'staff:slide_list' %}">Front page slides</a>
</li>
</ul>
</li>

<li class="nav-item" data-toggle="tooltip" data-placement="right" title="partners">
<a class="nav-link" href="{% url 'staff:partner_list' %}">
<i class="fa fa-fw fa-paw"></i>
Expand Down
16 changes: 16 additions & 0 deletions project-templates/support/faq_detail.html
@@ -0,0 +1,16 @@
{% extends "base.html" %}
{% load static %}

{% block head %}
<title>FAQ #{{ faq.pk }} - {{ SITE_NAME }}</title>
{% endblock %}

{% block body %}
<h1>{{ faq.category.name }}</h1>
<h2>{{ faq.question }}</h2>
<p>{{ faq.anaswer }}</p>
<p>Creator: {{ faq.creator }}</p>
<p>Created: {{ faq.created }}, Updated: {{ faq.updated }}</p>

{% endblock %}

0 comments on commit 463a984

Please sign in to comment.