diff --git a/.env b/.env new file mode 100644 index 0000000..d66dd13 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +source /var/www/sgawebsite/env/bin/activate diff --git a/.gitignore b/.gitignore index 19cb45c..d15d914 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,21 @@ -_site -.sass-cache -.jekyll-metadata -Gemfile.lock -gems/ +.DS_Store +*.pyc +*.pyo +env +env* +dist +build +*.egg +*.egg-info +_mailinglist +.tox +.cache/ +.idea/ +__pycache__/ +migrations/ +config.py +settings.py +env/ +db.sqlite3 +*.json +admin/ diff --git a/Gemfile b/Gemfile deleted file mode 100644 index d87e1e9..0000000 --- a/Gemfile +++ /dev/null @@ -1,29 +0,0 @@ -source "https://rubygems.org" - -# Hello! This is where you manage which Jekyll version is used to run. -# When you want to use a different version, change it below, save the -# file and run `bundle install`. Run Jekyll with `bundle exec`, like so: -# -# bundle exec jekyll serve -# -# This will help ensure the proper Jekyll version is running. -# Happy Jekylling! -gem "jekyll", "3.5.2" - -# This is the default theme for new Jekyll sites. You may change this to anything you like. -gem "minima", "~> 2.0" -gem "hash-joiner", "~> 0.0.7" -gem "json", "~> 2.1.0" - -# If you want to use GitHub Pages, remove the "gem "jekyll"" above and -# uncomment the line below. To upgrade, run `bundle update github-pages`. -# gem "github-pages", group: :jekyll_plugins - -# If you have any plugins, put them here! -group :jekyll_plugins do - gem "jekyll-feed", "~> 0.6" -end - -# Windows does not include zoneinfo files, so bundle the tzinfo-data gem -gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] - diff --git a/_layouts/compress.html b/_layouts/compress.html deleted file mode 100644 index 8248010..0000000 --- a/_layouts/compress.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -# Jekyll layout that compresses HTML -# v3.0.2 -# http://jch.penibelst.de/ -# © 2014–2015 Anatol Broder -# MIT License ---- - -{% capture _LINE_FEED %} -{% endcapture %}{% if site.compress_html.ignore.envs contains jekyll.environment %}{{ content }}{% else %}{% capture _content %}{{ content }}{% endcapture %}{% assign _profile = site.compress_html.profile %}{% if site.compress_html.endings == "all" %}{% assign _endings = "html head body li dt dd p rt rp optgroup option colgroup caption thead tbody tfoot tr td th" | split: " " %}{% else %}{% assign _endings = site.compress_html.endings %}{% endif %}{% for _element in _endings %}{% capture _end %}{% endcapture %}{% assign _content = _content | remove: _end %}{% endfor %}{% if _profile and _endings %}{% assign _profile_endings = _content | size | plus: 1 %}{% endif %}{% for _element in site.compress_html.startings %}{% capture _start %}<{{ _element }}>{% endcapture %}{% assign _content = _content | remove: _start %}{% endfor %}{% if _profile and site.compress_html.startings %}{% assign _profile_startings = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.comments == "all" %}{% assign _comments = "" | split: " " %}{% else %}{% assign _comments = site.compress_html.comments %}{% endif %}{% if _comments.size == 2 %}{% capture _comment_befores %}.{{ _content }}{% endcapture %}{% assign _comment_befores = _comment_befores | split: _comments.first %}{% for _comment_before in _comment_befores %}{% if forloop.first %}{% continue %}{% endif %}{% capture _comment_outside %}{% if _carry %}{{ _comments.first }}{% endif %}{{ _comment_before }}{% endcapture %}{% capture _comment %}{% unless _carry %}{{ _comments.first }}{% endunless %}{{ _comment_outside | split: _comments.last | first }}{% if _comment_outside contains _comments.last %}{{ _comments.last }}{% assign _carry = false %}{% else %}{% assign _carry = true %}{% endif %}{% endcapture %}{% assign _content = _content | remove_first: _comment %}{% endfor %}{% if _profile %}{% assign _profile_comments = _content | size | plus: 1 %}{% endif %}{% endif %}{% assign _pre_befores = _content | split: "" %}{% assign _pres_after = "" %}{% if _pres.size != 0 %}{% if site.compress_html.blanklines %}{% assign _lines = _pres.last | split: _LINE_FEED %}{% capture _pres_after %}{% for _line in _lines %}{% assign _trimmed = _line | split: " " | join: " " %}{% if _trimmed != empty or forloop.last %}{% unless forloop.first %}{{ _LINE_FEED }}{% endunless %}{{ _line }}{% endif %}{% endfor %}{% endcapture %}{% else %}{% assign _pres_after = _pres.last | split: " " | join: " " %}{% endif %}{% endif %}{% capture _content %}{{ _content }}{% if _pre_before contains "" %}{% endif %}{% unless _pre_before contains "" and _pres.size == 1 %}{{ _pres_after }}{% endunless %}{% endcapture %}{% endfor %}{% if _profile %}{% assign _profile_collapse = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.clippings == "all" %}{% assign _clippings = "html head title base link meta style body article section nav aside h1 h2 h3 h4 h5 h6 hgroup header footer address p hr blockquote ol ul li dl dt dd figure figcaption main div table caption colgroup col tbody thead tfoot tr td th" | split: " " %}{% else %}{% assign _clippings = site.compress_html.clippings %}{% endif %}{% for _element in _clippings %}{% assign _edges = " ;; ;" | replace: "e", _element | split: ";" %}{% assign _content = _content | replace: _edges[0], _edges[1] | replace: _edges[2], _edges[3] | replace: _edges[4], _edges[5] %}{% endfor %}{% if _profile and _clippings %}{% assign _profile_clippings = _content | size | plus: 1 %}{% endif %}{{ _content }}{% if _profile %}
Step Bytes
raw {{ content | size }}{% if _profile_endings %}
endings {{ _profile_endings }}{% endif %}{% if _profile_startings %}
startings {{ _profile_startings }}{% endif %}{% if _profile_comments %}
comments {{ _profile_comments }}{% endif %}{% if _profile_collapse %}
collapse {{ _profile_collapse }}{% endif %}{% if _profile_clippings %}
clippings {{ _profile_clippings }}{% endif %}
{% endif %}{% endif %} diff --git a/_plugins/file_exists.rb b/_plugins/file_exists.rb deleted file mode 100644 index 30480ca..0000000 --- a/_plugins/file_exists.rb +++ /dev/null @@ -1,23 +0,0 @@ -module Jekyll - class FileExistsTag < Liquid::Tag - - def initialize(tag_name, path, tokens) - super - @path = path - end - - def render(context) - # Pipe parameter through Liquid to make additional replacements possible - url = Liquid::Template.parse(@path).render context - - # Adds the site source, so that it also works with a custom one - site_source = context.registers[:site].config['source'] - file_path = site_source + '/' + url - - # Check if file exists (returns true or false) - "#{File.exist?(file_path.strip!)}" - end - end -end - -Liquid::Template.register_tag('file_exists', Jekyll::FileExistsTag) \ No newline at end of file diff --git a/_plugins/jekyll_get.rb b/_plugins/jekyll_get.rb deleted file mode 100644 index f5fb7e3..0000000 --- a/_plugins/jekyll_get.rb +++ /dev/null @@ -1,40 +0,0 @@ -require 'json' -require 'hash-joiner' -require 'open-uri' - -module Jekyll_Get - class Generator < Jekyll::Generator - safe true - priority :highest - - def generate(site) - config = site.config['jekyll_get'] - if !config - return - end - if !config.kind_of?(Array) - config = [config] - end - config.each do |d| - begin - target = site.data[d['data']] - source = JSON.load(open(d['json'])) - if target - HashJoiner.deep_merge target, source - else - site.data[d['data']] = source - end - if d['cache'] - data_source = (site.config['data_source'] || '_data') - path = "#{data_source}/#{d['data']}.json" - open(path, 'wb') do |file| - file << JSON.generate(site.data[d['data']]) - end - end - rescue - next - end - end - end - end -end diff --git a/_posts/2017-09-04-welcome-to-jekyll.markdown b/_posts/2017-09-04-welcome-to-jekyll.markdown deleted file mode 100644 index b8a69a2..0000000 --- a/_posts/2017-09-04-welcome-to-jekyll.markdown +++ /dev/null @@ -1,25 +0,0 @@ ---- -layout: post -title: "Welcome to Jekyll!" -date: 2017-09-04 13:44:53 -0400 -categories: jekyll update ---- -You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated. - -To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works. - -Jekyll also offers powerful support for code snippets: - -{% highlight ruby %} -def print_hi(name) - puts "Hi, #{name}" -end -print_hi('Tom') -#=> prints 'Hi, Tom' to STDOUT. -{% endhighlight %} - -Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll Talk][jekyll-talk]. - -[jekyll-docs]: https://jekyllrb.com/docs/home -[jekyll-gh]: https://github.com/jekyll/jekyll -[jekyll-talk]: https://talk.jekyllrb.com/ diff --git a/about.html b/about.html deleted file mode 100644 index 97dd1e2..0000000 --- a/about.html +++ /dev/null @@ -1,73 +0,0 @@ ---- -layout: compress -permalink: /about -orgs: ["officers", "excomm", "senators", "sponsors"] ---- - - - - - {% include head.html %} - About - TJSGA - - - {% include header.html %} -
-
-

Contact Us!

-
- - "The world is moved not only by the mighty shoves of the heroes, but also by the aggregate of the tiny pushes of each honest worker." - Helen Keller - -
-
- Contact us at - sga.tjhsst@gmail.com. We would love to answer questions or hear - about how you think we can improve TJ! -
-
-
- {% for org in site.data.about %} -
-

{{ org['name'] }}

- {% for member in org.members %} -
- {% assign year = member.year | downcase %} - {% assign first = member.first | slice: 0 %} - {% assign last = member.last | slice: 0,7 %} - {% if org['username'] != "sponsors" %} - {% capture filename %}img/people/{{ year }}{{ first }}{{ last }}.jpg{% endcapture %} - {% else %} - {% capture filename %}img/people/{{ first }}{{ last }}.jpg{% endcapture %} - {% endif %} - {% capture exists %} - {% file_exists {{ path }} %} - {% endcapture %} - {% if exists == false %} - {% capture filename %}img/profile.jpg{% endcapture %} - {% endif %} -
- -
-
- {{ member.first }} {{ member.last }} - {% if org['username'] != "sponsors" and org['username'] != "senators" %} - {{ year }} - {% endif %} - - {% if org['username'] != "officers" %} - {{ member.title }} - {% endif %} - - {% if org['username'] == "officers" %} -

{{ member.intro }}

- {% endif %} -
-
- {% endfor %} -
- {% endfor %} -
- {% include footer.html %} - - diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..5b67c94 --- /dev/null +++ b/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sgawebsite.settings") + try: + from django.core.management import execute_from_command_line + except ImportError: + # The above import may fail for some other reason. Ensure that the + # issue is really that Django is missing to avoid masking other + # exceptions on Python 2. + try: + import django + except ImportError: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) + raise + execute_from_command_line(sys.argv) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..2248dd0 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,7 @@ +certifi==2018.4.16 +chardet==3.0.4 +Django==2.0.5 +idna==2.6 +pytz==2018.4 +requests==2.18.4 +urllib3==1.22 diff --git a/run.sh b/run.sh index f17b83f..05862b8 100755 --- a/run.sh +++ b/run.sh @@ -6,6 +6,5 @@ #/web/activities/ghs/public/env/bin/python run.py $PORT #export PATH=$PATH:/home/2018wzhang/.gem/ruby/2.3.0/bin; #/home/2018wzhang/.gem/ruby/2.3.0/bin/bundler exec jekyll serve --port $PORT -bundle exec jekyll serve --port $PORT - +/web/activities/sga/sgawebsite/manage.py runserver $PORT #/web/activities/ghs/public/env/bin/python /web/activities/ghs/public/ghswebsite/app.py $PORT diff --git a/sgawebsite/__init__.py b/sgawebsite/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/sgawebsite/apps/__init__.py b/sgawebsite/apps/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/sgawebsite/apps/main/__init__.py b/sgawebsite/apps/main/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/sgawebsite/apps/main/admin.py b/sgawebsite/apps/main/admin.py new file mode 100644 index 0000000..c525d3c --- /dev/null +++ b/sgawebsite/apps/main/admin.py @@ -0,0 +1,14 @@ +from django.contrib import admin + +from .models import Member, Resource + +''' +class MemberAdmin(admin.ModelAdmin): + list_display = ('name', 'display') + + +class ResourceAdmin(admin.ModelAdmin): + list_display = ('name', 'display') +''' +admin.site.register(Member) +admin.site.register(Resource) diff --git a/sgawebsite/apps/main/apps.py b/sgawebsite/apps/main/apps.py new file mode 100644 index 0000000..833bff6 --- /dev/null +++ b/sgawebsite/apps/main/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class MainConfig(AppConfig): + name = 'main' diff --git a/sgawebsite/apps/main/migrations/__init__.py b/sgawebsite/apps/main/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/sgawebsite/apps/main/models.py b/sgawebsite/apps/main/models.py new file mode 100644 index 0000000..1f2dbda --- /dev/null +++ b/sgawebsite/apps/main/models.py @@ -0,0 +1,29 @@ +from django.db import models + +# Create your models here. + + +class Member(models.Model): + first_name = models.CharField(max_length=50) + last_name = models.CharField(max_length=50) + year = models.IntegerField(blank=True, default=-1) + intro = models.CharField(max_length=140, blank=True, default='') + title = models.CharField(max_length=30, blank=True, default='') + CATEGORIES = (('officers', 'Officers'), ('excomm', 'Executive Committee'), + ('senators', 'Class Senators'), ('sponsors', 'Sponsors')) + category = models.CharField(max_length=10, choices=CATEGORIES) + + def __str__(self): + return self.first_name + ' ' + self.last_name + + +class Resource(models.Model): + name = models.CharField(max_length=50) + link = models.URLField() + text = models.CharField(max_length=140) + CATEGORIES = (('general', 'General Resources'), + ('event', 'Event Resources')) + category = models.CharField(max_length=1, choices=CATEGORIES) + + def __str__(self): + return self.name diff --git a/sgawebsite/apps/main/tests.py b/sgawebsite/apps/main/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/sgawebsite/apps/main/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/sgawebsite/apps/main/urls.py b/sgawebsite/apps/main/urls.py new file mode 100644 index 0000000..c9ae138 --- /dev/null +++ b/sgawebsite/apps/main/urls.py @@ -0,0 +1,11 @@ +from django.conf.urls import url + +from .views import * + +urlpatterns = [ + url(r'^$', index, name='index'), + url(r'about', about, name='about'), + url(r'resources', resources, name='resources'), + url(r'events', events, name='events'), + +] diff --git a/sgawebsite/apps/main/views.py b/sgawebsite/apps/main/views.py new file mode 100644 index 0000000..37d2302 --- /dev/null +++ b/sgawebsite/apps/main/views.py @@ -0,0 +1,59 @@ +from django.shortcuts import render +from django.template.defaulttags import register +from .models import Member, Resource +from django.contrib.staticfiles.storage import staticfiles_storage +import os + + +def index(request): + return render(request, 'index.html') + + +def about(request): + categories = list(Member.CATEGORIES) + orgs = [c[0] for c in list(Member.CATEGORIES)] + data = dict() + context = dict() + for c in categories: + data[c[0]] = Member.objects.filter(category=c[0]) + print(categories) + context['categories'] = categories + context['orgs'] = orgs + context['data'] = data + return render(request, 'about.html', context) + + +@register.filter +def get_item(dictionary, key): + return dictionary.get(key) + + +@register.filter +def username(obj): + if obj.first_name and obj.last_name: + if obj.year > 0: + return str(str(obj.year) + + obj.first_name[:1] + + obj.last_name[:7]).lower() + else: + return str(obj.first_name[:1] + obj.last_name[:7]).lower() + return None + + +@register.filter +def filename(obj): + uname = username(obj) + folder = 'img' + filepath = os.path.join(folder, 'people', uname + '.jpg') + if uname is not None and staticfiles_storage.exists(filepath): + return os.path.join('static', filepath) + else: + return os.path.join('static', folder, 'profile.jpg') + + +def resources(request): + return render(request, 'resources.html') + + +def events(request): + return render(request, 'events.html') diff --git a/sgawebsite/example_settings.py b/sgawebsite/example_settings.py new file mode 100644 index 0000000..d35834e --- /dev/null +++ b/sgawebsite/example_settings.py @@ -0,0 +1,127 @@ +""" +Django settings for sgawebsite project. + +Generated by 'django-admin startproject' using Django 1.11.5. + +For more information on this file, see +https://docs.djangoproject.com/en/1.11/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/1.11/ref/settings/ +""" + +import os + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = '' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'sgawebsite', + 'sgawebsite.apps', + 'sgawebsite.apps.main' +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'sgawebsite.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'sgawebsite.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/1.11/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } +} + + +# Password validation +# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/1.11/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/1.11/howto/static-files/ + +STATIC_URL = '/static/' +STATICFILES_DIRS = [ + os.path.join(BASE_DIR, 'static'), +] +LOGIN_REDIRECT_URL = '/' diff --git a/sgawebsite/sgawebsite/__init__.py b/sgawebsite/sgawebsite/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/css/about.css b/sgawebsite/static/css/about.css similarity index 100% rename from css/about.css rename to sgawebsite/static/css/about.css diff --git a/css/footer.css b/sgawebsite/static/css/footer.css similarity index 100% rename from css/footer.css rename to sgawebsite/static/css/footer.css diff --git a/css/header.css b/sgawebsite/static/css/header.css similarity index 100% rename from css/header.css rename to sgawebsite/static/css/header.css diff --git a/css/main.css b/sgawebsite/static/css/main.css similarity index 100% rename from css/main.css rename to sgawebsite/static/css/main.css diff --git a/css/responsive.css b/sgawebsite/static/css/responsive.css similarity index 100% rename from css/responsive.css rename to sgawebsite/static/css/responsive.css diff --git a/icons/favicon.ico b/sgawebsite/static/icons/favicon.ico similarity index 100% rename from icons/favicon.ico rename to sgawebsite/static/icons/favicon.ico diff --git a/icons/fb.jpg b/sgawebsite/static/icons/fb.jpg similarity index 100% rename from icons/fb.jpg rename to sgawebsite/static/icons/fb.jpg diff --git a/icons/flickr.png b/sgawebsite/static/icons/flickr.png similarity index 100% rename from icons/flickr.png rename to sgawebsite/static/icons/flickr.png diff --git a/icons/mail.jpg b/sgawebsite/static/icons/mail.jpg similarity index 100% rename from icons/mail.jpg rename to sgawebsite/static/icons/mail.jpg diff --git a/icons/menu.png b/sgawebsite/static/icons/menu.png similarity index 100% rename from icons/menu.png rename to sgawebsite/static/icons/menu.png diff --git a/icons/menu.svg b/sgawebsite/static/icons/menu.svg similarity index 100% rename from icons/menu.svg rename to sgawebsite/static/icons/menu.svg diff --git a/icons/tw.jpg b/sgawebsite/static/icons/tw.jpg similarity index 100% rename from icons/tw.jpg rename to sgawebsite/static/icons/tw.jpg diff --git a/img/DSC09503.jpg b/sgawebsite/static/img/DSC09503.jpg similarity index 100% rename from img/DSC09503.jpg rename to sgawebsite/static/img/DSC09503.jpg diff --git a/img/bg.jpg b/sgawebsite/static/img/bg.jpg similarity index 100% rename from img/bg.jpg rename to sgawebsite/static/img/bg.jpg diff --git a/img/dome-original.png b/sgawebsite/static/img/dome-original.png similarity index 100% rename from img/dome-original.png rename to sgawebsite/static/img/dome-original.png diff --git a/img/group.jpg b/sgawebsite/static/img/group.jpg similarity index 100% rename from img/group.jpg rename to sgawebsite/static/img/group.jpg diff --git a/img/logo.png b/sgawebsite/static/img/logo.png similarity index 100% rename from img/logo.png rename to sgawebsite/static/img/logo.png diff --git a/img/originals.tar.gz b/sgawebsite/static/img/originals.tar.gz similarity index 100% rename from img/originals.tar.gz rename to sgawebsite/static/img/originals.tar.gz diff --git a/img/people/2018alin.jpg b/sgawebsite/static/img/people/2018alin.jpg similarity index 100% rename from img/people/2018alin.jpg rename to sgawebsite/static/img/people/2018alin.jpg diff --git a/img/people/2018alulushi.jpg b/sgawebsite/static/img/people/2018alulushi.jpg similarity index 100% rename from img/people/2018alulushi.jpg rename to sgawebsite/static/img/people/2018alulushi.jpg diff --git a/img/people/2018jprabhal.jpg b/sgawebsite/static/img/people/2018jprabhal.jpg similarity index 100% rename from img/people/2018jprabhal.jpg rename to sgawebsite/static/img/people/2018jprabhal.jpg diff --git a/img/people/2018jwang.jpg b/sgawebsite/static/img/people/2018jwang.jpg similarity index 100% rename from img/people/2018jwang.jpg rename to sgawebsite/static/img/people/2018jwang.jpg diff --git a/img/people/2018kdu.jpg b/sgawebsite/static/img/people/2018kdu.jpg similarity index 100% rename from img/people/2018kdu.jpg rename to sgawebsite/static/img/people/2018kdu.jpg diff --git a/img/people/2018llin.jpg b/sgawebsite/static/img/people/2018llin.jpg similarity index 100% rename from img/people/2018llin.jpg rename to sgawebsite/static/img/people/2018llin.jpg diff --git a/img/people/2018nbegotka.jpg b/sgawebsite/static/img/people/2018nbegotka.jpg similarity index 100% rename from img/people/2018nbegotka.jpg rename to sgawebsite/static/img/people/2018nbegotka.jpg diff --git a/img/people/2018schappid.jpg b/sgawebsite/static/img/people/2018schappid.jpg similarity index 100% rename from img/people/2018schappid.jpg rename to sgawebsite/static/img/people/2018schappid.jpg diff --git a/img/people/2018sxie.jpg b/sgawebsite/static/img/people/2018sxie.jpg similarity index 100% rename from img/people/2018sxie.jpg rename to sgawebsite/static/img/people/2018sxie.jpg diff --git a/img/people/2018wzhang.jpg b/sgawebsite/static/img/people/2018wzhang.jpg similarity index 100% rename from img/people/2018wzhang.jpg rename to sgawebsite/static/img/people/2018wzhang.jpg diff --git a/img/people/2019amohidee.jpg b/sgawebsite/static/img/people/2019amohidee.jpg similarity index 100% rename from img/people/2019amohidee.jpg rename to sgawebsite/static/img/people/2019amohidee.jpg diff --git a/img/people/2019ephillip.jpg b/sgawebsite/static/img/people/2019ephillip.jpg similarity index 100% rename from img/people/2019ephillip.jpg rename to sgawebsite/static/img/people/2019ephillip.jpg diff --git a/img/people/2019lgersony.jpg b/sgawebsite/static/img/people/2019lgersony.jpg similarity index 100% rename from img/people/2019lgersony.jpg rename to sgawebsite/static/img/people/2019lgersony.jpg diff --git a/img/people/2019lkeesing.jpg b/sgawebsite/static/img/people/2019lkeesing.jpg similarity index 100% rename from img/people/2019lkeesing.jpg rename to sgawebsite/static/img/people/2019lkeesing.jpg diff --git a/img/people/2019mcho.jpg b/sgawebsite/static/img/people/2019mcho.jpg similarity index 100% rename from img/people/2019mcho.jpg rename to sgawebsite/static/img/people/2019mcho.jpg diff --git a/img/people/2019skazmi.jpg b/sgawebsite/static/img/people/2019skazmi.jpg similarity index 100% rename from img/people/2019skazmi.jpg rename to sgawebsite/static/img/people/2019skazmi.jpg diff --git a/img/people/2019suppalap.jpg b/sgawebsite/static/img/people/2019suppalap.jpg similarity index 100% rename from img/people/2019suppalap.jpg rename to sgawebsite/static/img/people/2019suppalap.jpg diff --git a/img/people/2020bandrade.jpg b/sgawebsite/static/img/people/2020bandrade.jpg similarity index 100% rename from img/people/2020bandrade.jpg rename to sgawebsite/static/img/people/2020bandrade.jpg diff --git a/img/people/2020dbedi.jpg b/sgawebsite/static/img/people/2020dbedi.jpg similarity index 100% rename from img/people/2020dbedi.jpg rename to sgawebsite/static/img/people/2020dbedi.jpg diff --git a/img/people/2020mdass.jpg b/sgawebsite/static/img/people/2020mdass.jpg similarity index 100% rename from img/people/2020mdass.jpg rename to sgawebsite/static/img/people/2020mdass.jpg diff --git a/img/people/2020mhuang.jpg b/sgawebsite/static/img/people/2020mhuang.jpg similarity index 100% rename from img/people/2020mhuang.jpg rename to sgawebsite/static/img/people/2020mhuang.jpg diff --git a/img/people/2020mkyryche.jpg b/sgawebsite/static/img/people/2020mkyryche.jpg similarity index 100% rename from img/people/2020mkyryche.jpg rename to sgawebsite/static/img/people/2020mkyryche.jpg diff --git a/img/people/2020rkalra.jpg b/sgawebsite/static/img/people/2020rkalra.jpg similarity index 100% rename from img/people/2020rkalra.jpg rename to sgawebsite/static/img/people/2020rkalra.jpg diff --git a/img/people/ahurowit.jpg b/sgawebsite/static/img/people/ahurowit.jpg similarity index 100% rename from img/people/ahurowit.jpg rename to sgawebsite/static/img/people/ahurowit.jpg diff --git a/img/people/convert.sh b/sgawebsite/static/img/people/convert.sh similarity index 100% rename from img/people/convert.sh rename to sgawebsite/static/img/people/convert.sh diff --git a/img/people/mrazzino.jpg b/sgawebsite/static/img/people/mrazzino.jpg similarity index 100% rename from img/people/mrazzino.jpg rename to sgawebsite/static/img/people/mrazzino.jpg diff --git a/img/profile.jpg b/sgawebsite/static/img/profile.jpg similarity index 100% rename from img/profile.jpg rename to sgawebsite/static/img/profile.jpg diff --git a/img/web-image.sh b/sgawebsite/static/img/web-image.sh similarity index 100% rename from img/web-image.sh rename to sgawebsite/static/img/web-image.sh diff --git a/js/sidebar-min.js b/sgawebsite/static/js/sidebar-min.js similarity index 100% rename from js/sidebar-min.js rename to sgawebsite/static/js/sidebar-min.js diff --git a/js/sidebar.js b/sgawebsite/static/js/sidebar.js similarity index 100% rename from js/sidebar.js rename to sgawebsite/static/js/sidebar.js diff --git a/404.html b/sgawebsite/templates/404.html similarity index 100% rename from 404.html rename to sgawebsite/templates/404.html diff --git a/sgawebsite/templates/about.html b/sgawebsite/templates/about.html new file mode 100644 index 0000000..d1e700a --- /dev/null +++ b/sgawebsite/templates/about.html @@ -0,0 +1,57 @@ + + +{% load static %} + + + {% include 'head.html' %} + About - TJSGA + + + {% include 'header.html' %} +
+
+

Contact Us!

+
+ + "The world is moved not only by the mighty shoves of the heroes, but also by the aggregate of the tiny pushes of each honest worker." - Helen Keller + +
+
+ Contact us at + sga.tjhsst@gmail.com. We would love to answer questions or hear + about how you think we can improve TJ! +
+
+
+ {% for org in categories %} +
+

{{ org.1 }}

+ {% with key=data|get_item:org.0 %} + {% for member in key %} +
+
+ +
+
+ {{ member.first_name }} {{ member.last_name }} + {% if member.category != 'sponsors' and member.category != 'senators' %} + {{ member.year }} + {% endif %} + + {% if member.category != "officers" %} + {{ member.title }} + {% endif %} + + {% if member.category == "officers" and member.intro != '' %} +

{{ member.intro }}

+ {% endif %} +
+
+ {% endfor %} + {% endwith %} +
+ {% endfor %} +
+ {% include 'footer.html' %} + + diff --git a/sgawebsite/templates/events.html b/sgawebsite/templates/events.html new file mode 100644 index 0000000..77313c4 --- /dev/null +++ b/sgawebsite/templates/events.html @@ -0,0 +1,20 @@ +{% load static %} + + + + + {% include 'head.html' %} + Events - TJSGA + + + {% include 'header.html' %} +
+
+ +
+
+
+
+ {% include 'footer.html' %} + + diff --git a/_includes/footer.html b/sgawebsite/templates/footer.html similarity index 85% rename from _includes/footer.html rename to sgawebsite/templates/footer.html index e99d1f4..7c2e910 100644 --- a/_includes/footer.html +++ b/sgawebsite/templates/footer.html @@ -1,3 +1,4 @@ +{% load static %} - + diff --git a/forms.html b/sgawebsite/templates/forms.html similarity index 90% rename from forms.html rename to sgawebsite/templates/forms.html index 2be2879..9c67698 100644 --- a/forms.html +++ b/sgawebsite/templates/forms.html @@ -1,8 +1,3 @@ ---- -layout: compress -permalink: /forms -sections: ["general", "events", "elections"] ---- diff --git a/_includes/head.html b/sgawebsite/templates/head.html similarity index 58% rename from _includes/head.html rename to sgawebsite/templates/head.html index 322a330..9249f99 100644 --- a/_includes/head.html +++ b/sgawebsite/templates/head.html @@ -1,3 +1,4 @@ +{% load static %} @@ -5,7 +6,7 @@ - - - - + + + + diff --git a/_includes/header.html b/sgawebsite/templates/header.html similarity index 82% rename from _includes/header.html rename to sgawebsite/templates/header.html index 8aa427e..239c360 100644 --- a/_includes/header.html +++ b/sgawebsite/templates/header.html @@ -1,3 +1,4 @@ +{% load static %}
- {% include footer.html %} + {% include 'footer.html' %} diff --git a/resources.html b/sgawebsite/templates/resources.html similarity index 96% rename from resources.html rename to sgawebsite/templates/resources.html index 0192bf0..f9b4048 100644 --- a/resources.html +++ b/sgawebsite/templates/resources.html @@ -1,15 +1,12 @@ ---- -layout: compress -permalink: /resources ---- +{% load static %} - {% include head.html %} + {% include 'head.html' %} Resources - TJSGA - {% include header.html %} + {% include 'header.html' %}
@@ -88,6 +85,6 @@ permalink: /resources
- {% include footer.html %} + {% include 'footer.html' %} diff --git a/robots.txt b/sgawebsite/templates/robots.txt similarity index 100% rename from robots.txt rename to sgawebsite/templates/robots.txt diff --git a/sgawebsite/urls.py b/sgawebsite/urls.py new file mode 100644 index 0000000..681e913 --- /dev/null +++ b/sgawebsite/urls.py @@ -0,0 +1,34 @@ +"""sgawebsite URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/1.11/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.conf.urls import url, include + 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) +""" +from django.conf.urls import include, url +from django.views.generic import TemplateView +from django.contrib import admin +from .apps.main import urls as main +import requests + +about = requests.get('https://sgawebsite-e30e2.firebaseio.com/about.json') +forms = requests.get('https://sgawebsite-e30e2.firebaseio.com/forms.json') +with open('about.json', 'w') as f: + f.write(str(about.json()[0])) +with open('forms.json', 'w') as f: + f.write(str(forms.json()[0])) + + +urlpatterns = [ + url(r'^admin/', admin.site.urls), + url(r'^', include(main)), + url(r'^robots\.txt$', TemplateView.as_view(template_name='robots.txt'), name='robots.txt') +] diff --git a/sgawebsite/wsgi.py b/sgawebsite/wsgi.py new file mode 100644 index 0000000..73c3257 --- /dev/null +++ b/sgawebsite/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for sgawebsite project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sgawebsite.settings") + +application = get_wsgi_application()