Skip to content

Commit

Permalink
start using SASS, fix #209
Browse files Browse the repository at this point in the history
  • Loading branch information
pefoley2 committed Mar 27, 2016
1 parent 84d1e0d commit 76b45a7
Show file tree
Hide file tree
Showing 13 changed files with 106 additions and 54 deletions.
63 changes: 32 additions & 31 deletions Ion.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ intranet/apps/events/migrations/0014_event_show_attending.py
intranet/apps/events/migrations/0015_auto_20151130_1427.py
intranet/apps/events/migrations/0016_auto_20160323_2118.py
intranet/apps/events/migrations/0017_auto_20160323_2305.py
intranet/apps/events/migrations/0018_event_show_on_dashboard.py
intranet/apps/events/migrations/__init__.py
intranet/apps/feedback/__init__.py
intranet/apps/feedback/admin.py
Expand Down Expand Up @@ -493,37 +494,37 @@ intranet/settings/secret.sample
intranet/settings/travis_secret.py
intranet/static/manifest.json
intranet/static/teacher-guide.pdf
intranet/static/css/about.css
intranet/static/css/announcements.form.css
intranet/static/css/base.css
intranet/static/css/board.css
intranet/static/css/dashboard.css
intranet/static/css/dashboard.widgets.css
intranet/static/css/eighth.admin.css
intranet/static/css/eighth.attendance.css
intranet/static/css/eighth.common.css
intranet/static/css/eighth.profile.css
intranet/static/css/eighth.schedule.css
intranet/static/css/eighth.signup.css
intranet/static/css/emerg.css
intranet/static/css/events.css
intranet/static/css/files.css
intranet/static/css/groups.css
intranet/static/css/login.css
intranet/static/css/mobile.css
intranet/static/css/page_base.css
intranet/static/css/polls.css
intranet/static/css/preferences.css
intranet/static/css/profile.css
intranet/static/css/responsive.core.css
intranet/static/css/responsive.css
intranet/static/css/schedule.css
intranet/static/css/schedule.widget.css
intranet/static/css/search.css
intranet/static/css/signage.base.css
intranet/static/css/signage.touch.css
intranet/static/css/theme.blue.css
intranet/static/css/themes.css
intranet/static/css/about.scss
intranet/static/css/announcements.form.scss
intranet/static/css/base.scss
intranet/static/css/board.scss
intranet/static/css/dashboard.scss
intranet/static/css/dashboard.widgets.scss
intranet/static/css/eighth.admin.scss
intranet/static/css/eighth.attendance.scss
intranet/static/css/eighth.common.scss
intranet/static/css/eighth.profile.scss
intranet/static/css/eighth.schedule.scss
intranet/static/css/eighth.signup.scss
intranet/static/css/emerg.scss
intranet/static/css/events.scss
intranet/static/css/files.scss
intranet/static/css/groups.scss
intranet/static/css/login.scss
intranet/static/css/mobile.scss
intranet/static/css/page_base.scss
intranet/static/css/polls.scss
intranet/static/css/preferences.scss
intranet/static/css/profile.scss
intranet/static/css/responsive.core.scss
intranet/static/css/responsive.scss
intranet/static/css/schedule.scss
intranet/static/css/schedule.widget.scss
intranet/static/css/search.scss
intranet/static/css/signage.base.scss
intranet/static/css/signage.touch.scss
intranet/static/css/theme.blue.scss
intranet/static/css/themes.scss
intranet/static/img/Eighth-Icons.png
intranet/static/img/Eighth-Icons.svg
intranet/static/img/Eighth-Icons@2x.png
Expand Down
1 change: 1 addition & 0 deletions Ion.egg-info/requires.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ django-extensions==1.6.1
django-formtools==1.0
django-maintenancemode==0.11.2
django-oauth-toolkit==0.10.0
django-pipeline==1.6.7
django-redis-cache==1.6.5
django-redis-sessions==0.5.0
djangorestframework==3.3.3
Expand Down
3 changes: 3 additions & 0 deletions config/provision_vagrant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ touch .bash_history
apt-get -y install htop
apt-get -y install glances

# CSS
apt-get -y install ruby-sass

# PostsgreSQL
apt-get -y install postgresql
apt-get -y install postgresql-contrib
Expand Down
1 change: 1 addition & 0 deletions docs/rtd-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ django-extensions==1.6.1
django-formtools==1.0
django-maintenancemode==0.11.2
django-oauth-toolkit==0.10.0
django-pipeline==1.6.7
django-redis-cache==1.6.5
django-redis-sessions==0.5.0
djangorestframework==3.3.3
Expand Down
42 changes: 37 additions & 5 deletions intranet/settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,18 +192,49 @@
STATIC_URL = "/static/"

# Additional locations of static files
STATICFILES_DIRS = (
STATICFILES_DIRS = [
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don"t forget to use absolute paths, not relative paths.
os.path.join(PROJECT_ROOT, "static"),)
os.path.join(PROJECT_ROOT, "static")]

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = ("django.contrib.staticfiles.finders.FileSystemFinder",
STATICFILES_FINDERS = ["django.contrib.staticfiles.finders.FileSystemFinder",
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
# "django.contrib.staticfiles.finders.DefaultStorageFinder",
)
'pipeline.finders.PipelineFinder',
]

STATICFILES_STORAGE = "pipeline.storage.PipelineStorage"

PIPELINE = {
'CSS_COMPRESSOR': None,
'COMPILERS': [
'pipeline.compilers.sass.SASSCompiler',
],
'STYLESHEETS': {
'base': {
'source_filenames': [
'css/base.scss',
'css/themes.scss',
'css/responsive.scss'
],
'output_filename': 'css/base.css'
},
'eighth_admin': {
'source_filenames': [
'css/eighth.common.scss',
'css/eighth.admin.scss'
],
'output_filename': 'css/eighth_admin.css'
},
}
} # type: Dict[str,Any]

LIST_OF_INDEPENDENT_CSS = ['login', 'emerg', 'schedule', 'theme.blue', 'page_base', 'responsive.core', 'dashboard', 'events', 'schedule.widgets', 'dashboard.widgets']

for name in LIST_OF_INDEPENDENT_CSS:
PIPELINE['STYLESHEETS'].update(helpers.SingleCss(name))

AUTHENTICATION_BACKENDS = ("intranet.apps.auth.backends.MasterPasswordAuthenticationBackend",
"intranet.apps.auth.backends.KerberosAuthenticationBackend",
Expand Down Expand Up @@ -418,6 +449,7 @@ def get_month_seconds():
"django_extensions",
"rest_framework",
"maintenancemode",
"pipeline",
# Intranet apps
"intranet.apps",
"intranet.apps.announcements",
Expand Down
7 changes: 4 additions & 3 deletions intranet/templates/auth/login.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{% extends "page_base.html" %}
{% load staticfiles %}
{% load pipeline %}

{% block title %}
TJ {{ block.super }} - Login
{% endblock %}

{% block css %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% static 'css/schedule.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'css/login.css' %}" />
{% stylesheet 'schedule' %}
{% stylesheet 'login' %}
{% if login_warning %}
<link rel="stylesheet" type="text/css" href="{% static 'css/emerg.css' %}" />
{% stylesheet 'emerg' %}
{% endif %}
{% if bg_pattern %}
<style type="text/css">
Expand Down
11 changes: 6 additions & 5 deletions intranet/templates/dashboard/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{% load staticfiles %}
{% load dates %}
{% load cacheops %}
{% load pipeline %}

{% block title %}
{{ block.super }} - {{ dashboard_title }}
Expand All @@ -15,11 +16,11 @@

{% block css %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% static 'css/events.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'css/dashboard.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'css/dashboard.widgets.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'css/schedule.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'css/schedule.widget.css' %}" />
{% stylesheet 'events' %}
{% stylesheet 'dashboard' %}
{% stylesheet 'dashboard.widgets' %}
{% stylesheet 'schedule' %}
{% stylesheet 'schedule.widgets' %}
{% endblock %}

{% block js %}
Expand Down
8 changes: 5 additions & 3 deletions intranet/templates/eighth/admin/eighth_admin_page_base.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{% extends "page_with_nav.html" %}
{% load staticfiles %}
{% load pipeline %}

{% block title %}{{ block.super }} - Eighth Admin{% if admin_page_title and request.resolver_match.url_name != "eighth_admin_dashboard" %} - {{ admin_page_title }}{% endif %}{% endblock %}
{% block title %}
{{ block.super }} - Eighth Admin{% if admin_page_title and request.resolver_match.url_name != "eighth_admin_dashboard" %} - {{ admin_page_title }}{% endif %}
{% endblock %}

{% block css %}
<link rel="stylesheet" type="text/css" href="{% static 'vendor/selectize.js-0.12.1/dist/css/selectize.default.css' %}" />
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% static 'css/eighth.common.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'css/eighth.admin.css' %}" />
{% stylesheet 'eighth_admin' %}
{% endblock %}

{% block js %}
Expand Down
9 changes: 4 additions & 5 deletions intranet/templates/page_base.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% load staticfiles %}
<!doctype html>
{% load pipeline %}
<!DOCTYPE html>
<html lang='en'>
<head>
<title>{% block title %}Intranet{% endblock %}</title>
Expand All @@ -12,9 +13,7 @@
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans:100italic,400italic,700italic,100,400,700" />

<link rel="stylesheet" type="text/css" href="{% static 'css/base.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'css/themes.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'css/responsive.css' %}" />
{% stylesheet 'base' %}

{% if debug %}
<style type="text/css">
Expand All @@ -25,7 +24,7 @@
</style>
{% endif %}
{% endblock %}
<link rel="stylesheet" type="text/css" href="{% static 'css/theme.blue.css' %}" />
{% stylesheet 'theme.blue' %}
{% if theme.css %}
<link rel="stylesheet" type="text/css" href="{% static theme.css %}" />
{% endif %}
Expand Down
5 changes: 3 additions & 2 deletions intranet/templates/page_with_header.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{% extends "page_base.html" %}
{% load staticfiles %}
{% load pipeline %}

{% block css %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% static 'css/page_base.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'css/responsive.core.css' %}" />
{% stylesheet 'page_base' %}
{% stylesheet 'responsive.core' %}
<link rel="stylesheet" type="text/css" href="{% static 'vendor/messenger/build/css/messenger.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'vendor/messenger/build/css/messenger-theme-flat.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'vendor/jquery-ui-1.11.0.custom/jquery-ui.min.css' %}" />
Expand Down
7 changes: 7 additions & 0 deletions intranet/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,10 @@ def __contains__(self, key):
except ValueError:
pass
return False


def SingleCss(name):
return {name: {
'source_filenames': ['css/%s.scss' % name],
'output_filename': 'css/%s.css' % name
}}
2 changes: 2 additions & 0 deletions intranet/utils/helpers.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from typing import Any
class MigrationMock: ...
class InvalidString(str): ...
class GlobList:
Expand All @@ -8,3 +9,4 @@ def get_current_commit_long_hash(workdir: str) -> str: ...
def get_current_commit_info() -> str: ...
def get_current_commit_date() -> str: ...
def get_current_commit_github_url(workdir: str) -> str: ...
def SingleCss(name: str) -> Dict[str, Dict[str, Any]]: ...
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ django-extensions==1.6.1
django-formtools==1.0
django-maintenancemode==0.11.2
django-oauth-toolkit==0.10.0
django-pipeline==1.6.7
django-redis-cache==1.6.5
django-redis-sessions==0.5.0
djangorestframework==3.3.3
Expand Down

0 comments on commit 76b45a7

Please sign in to comment.