Skip to content
This repository has been archived by the owner on Dec 8, 2017. It is now read-only.

Commit

Permalink
Merge pull request #15 from 18F/wireframing
Browse files Browse the repository at this point in the history
Front end working and other changes
  • Loading branch information
khandelwal committed Nov 28, 2015
2 parents 9430c9b + 1210e6a commit fe3818d
Show file tree
Hide file tree
Showing 446 changed files with 21,004 additions and 365 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ forecast-admin/forecast/db.sqlite3
__pycache__
*.pyc
.coverage
**/.cache/
**/.sass-cache/
**/.cache
**/.sass-cache
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
language: python
python:
- "3.4"
- "3.5"
install: cd forecast-admin/forecast && pip install -r requirements.txt
cache:
directories:
Expand Down
1 change: 1 addition & 0 deletions forecast-admin/forecast/forecast/data/fy16q1.csv

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions forecast-admin/forecast/forecast/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls))
"""
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from rest_framework import routers

Expand All @@ -23,6 +24,7 @@

router = routers.DefaultRouter()
router.register(r'opportunities', views.OpportunityViewSet)
router.register(r'osbu', views.OSBUAdvisorViewSet)
router.register(r'offices', views.OfficeViewSet)

urlpatterns = [
Expand All @@ -41,3 +43,5 @@
url(r'^reset/done/$', auth_views.password_reset_complete,
name='password_reset_complete'),
]

admin.site.site_header = 'GSA Forecast Administration Page'
3 changes: 2 additions & 1 deletion forecast-admin/forecast/forecast/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@

import os
from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise


os.environ.setdefault("DJANGO_SETTINGS_MODULE", "forecast.settings")
# important that the whitenoise import is after the line above

from whitenoise.django import DjangoWhiteNoise
application = get_wsgi_application()
application = DjangoWhiteNoise(application)
18 changes: 17 additions & 1 deletion forecast-admin/forecast/opportunities/admin.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
from django.contrib import admin

# Register your models here.
from .models import Opportunity, Office
from .models import Opportunity, Office, OSBUAdvisor


@admin.register(Opportunity)
class OpportunityAdmin(admin.ModelAdmin):

def make_published(self, request, queryset):
for obj in queryset:
obj.published = True
obj.save()
make_published.short_description = "Publish selected oppotunities"

def make_unpublished(self, request, queryset):
queryset.update(published=False)
make_unpublished.short_description = "Unpublish selected oppotunities"

list_display = ['__str__', 'office', 'published']
ordering = ['office']
actions = [make_published, make_unpublished]

def get_queryset(self, request):
"""Limit Pages to those that belong to the request's user."""
qs = super(OpportunityAdmin, self).get_queryset(request)
Expand All @@ -25,3 +39,5 @@ def get_queryset(self, request):
"""Limit Pages to those that belong to the request's user."""
qs = super(OfficeAdmin, self).get_queryset(request)
return qs

admin.site.register(OSBUAdvisor)
13 changes: 13 additions & 0 deletions forecast-admin/forecast/opportunities/fixtures/users.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- fields:
is_active: true
last_name: ''
user_permissions: []
first_name: ''
is_superuser: true
email: ''
username: admin
password: pbkdf2_sha256$20000$SeBQtWDFH2HW$FPmflJ4hN0yk4uPS47gqMyqEt2WhSWFVxOqUFLRxuLE=
is_staff: true
groups: []
pk: 1
model: auth.user
Empty file.
Empty file.
77 changes: 49 additions & 28 deletions forecast-admin/forecast/opportunities/migrations/0001_initial.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('opportunities', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='opportunity',
name='estimated_fiscal_year',
field=models.IntegerField(default=2016, max_length=5),
),
migrations.AlterField(
model_name='opportunity',
name='estimated_fiscal_year_quarter',
field=models.IntegerField(default=1, max_length=200),
),
]

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('opportunities', '0002_auto_20151127_0151'),
]

operations = [
migrations.AlterField(
model_name='opportunity',
name='estimated_fiscal_year',
field=models.IntegerField(default=2016),
),
migrations.AlterField(
model_name='opportunity',
name='estimated_fiscal_year_quarter',
field=models.IntegerField(default=1),
),
]
Loading

0 comments on commit fe3818d

Please sign in to comment.