Skip to content
This repository has been archived by the owner on Oct 21, 2018. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
Conflicts:
	.travis.yml
  • Loading branch information
BrendanBerkley committed Feb 18, 2015
2 parents 4b13fd4 + 889bef0 commit cf3bc1c
Show file tree
Hide file tree
Showing 72 changed files with 1,679 additions and 934 deletions.
18 changes: 12 additions & 6 deletions .travis.yml
Expand Up @@ -2,17 +2,23 @@ language: python
sudo: false
python:
- '2.7'
env:
global:
- secure: ldhPANju1rSMCws2HqtzCSUAzNwWSvWXNMoS6SkOoZd8Y7gl7ZWsZjRRfAmH9zu5ypavzuhW741VHbki4yTb2tWCMduZPOJ+I+KLJ3nISb1gzdb3PkinDJLqMoT+0VpB8M6pr1fJcbxianzQThjR7rqNsNgMneQgZ3eZ7UJZ+I8=
- secure: gcPqU2hAr7mDAc397k1/IiiQ0l3E9RA3UK8rxcRgSsHY35W78JqsgD5n1DdnDRjHxRIMc7pvtA3Lghi/aE4FCuLkJXDkqK0oRtwcPFV+cdotlDUVoaYi3rV8e2x4tmOdSJKn7by0PM+s83elMpBPOmrqWsl+YmSeumzOuOtgs3o=
install:
- pip install -r requirements.txt
- pip install -r dev-requirements.txt
addons:
- postgresql: "9.3"
postgresql: "9.3"
sauce_connect: true
services:
- redis-server
before_script:
- psql -c "CREATE DATABASE mydb;" -U postgres
- psql -c "CREATE DATABASE travisci;" -U postgres
- python manage.py migrate
- python manage.py populate_sample_data
- npm install -g -q protractor
- python manage.py runserver &
script:
- python manage.py test
notifications:
webhooks: internal.burkesoftware.com:5555/bot/travisci/b533355d64d688a5984c122d9e6b9af2
on_start: true
- python manage.py test
94 changes: 15 additions & 79 deletions README.md
Expand Up @@ -89,102 +89,38 @@ SWoRD allows users to save basic company information for each work site associat
![Alt text](https://raw.github.com/burke-software/django-sis/master/screenshots/cwsp4.jpg)

# Development Environment
You can easily get Djanog-sis running in an isolated development environment using [Fig and Docker](http://orchardup.github.io/fig/). We have testing this to work on both OSX and Ubuntu.

## OSX
You can easily get Django-sis running in an isolated development environment using [Fig and Docker](http://fig.sh). We have tested this to work on both OSX and Ubuntu.

#### Pre-req's
Before you begin, make sure you have both [VirtualBox](https://www.virtualbox.org/wiki/Downloads) and [Vagrant](http://www.vagrantup.com/downloads.html) installed.
## Fig And Docker

#### Install boot2docker (** Warning: This may take forever **)
See fig [installation docs](http://www.fig.sh/install.html)

Just follow the instructions [on the Docker website](https://docs.docker.com/installation/mac/). This should install the boot2docker application which you will be able to see in your launcher.
**Database**

To launch boot2docker, simply click on the boot2docker application icon from the application launcher.
*The following commands need to run from Linux or from the boot2docker virtual machine shell.

Alternatively, you can initiate boot2docker from the command line with these three commands:
`fig run --rm web python manage.py migrate`

```
boot2docker init
boot2docker start
$(boot2docker shellinit)
```
**Run**

You are now ready to install and use fig using the instructions below.
`fig up`

#### Install fig
Enjoy your django-sis instance on `localhost:8000`*

```
curl -L https://github.com/orchardup/fig/releases/download/0.5.1/darwin > /usr/local/bin/fig
```
```
chmod +x /usr/local/bin/fig
```
#### Syncdb & Migrate
*Note: this will change slightly when we move to 1.7*
*may be alternative address if using boot2docker.

```
fig run web python manage.py migrate
```
#### Run

```
fig up
```
To log in set up sample data or run

Now, the server is running, it may tell you that it's running at `localhost:8000` or `0.0.0.0:8000` but it's actually running at your docker-ip location, which you can find by running:

```
boot2docker ip
```

Let's say this is the docker-ip: `192.123.45.678`, you should then be able to see the server in your browser at `192.123.45.678:8000`
`fig run --rm web python manage.py createsuperuser`

## Sample Data
We have some sample data that might be useful when testing out the development environment. To load the data, try this:

```
fig run web python manage.py populate_sample_data
```

## Ubuntu

#### Install Docker
Follow the instructions on the docker website, [here](http://docs.docker.com/installation/ubuntulinux/)

#### Add user to group

```
sudo gpasswd -a ${USER} docker
```

#### Install Fig

```
curl -L https://github.com/orchardup/fig/releases/download/0.5.1/linux > /usr/local/bin/fig
```
```
chmod +x /usr/local/bin/fig
```
#### Syncdb & Migrate

```
fig run web python manage.py migrate
```
#### Run

```
fig up
```

Enjoy your django-sis instance on **localhost:8000**

## Sample Data
We have some sample data that might be useful when testing out the development environment. To load the data, try this:

```
fig run web python manage.py populate_sample_data
```
`fig run --rm web python manage.py populate_sample_data`

This will create a superuser with username/password of aa/aa

## Multi tenant (optional)
Set `MULTI_TENANT=True` in settings_local.py. You can create a new tenant with
Expand Down
9 changes: 6 additions & 3 deletions api/routers.py
Expand Up @@ -7,18 +7,21 @@
from api.admissions.views import ApplicantAdditionalInformationViewSet
from api.admissions.views import EmergencyContactViewSet
from api.admissions.views import ApplicantForeignKeyRelatedFieldChoicesViewSet
from ecwsp.gradebook.api_views import AssignmentViewSet


router = routers.DefaultRouter()
router.register(r'grades', GradeViewSet)
router.register(r'courses', CourseViewSet)
router.register(r'sections', SectionViewSet)
router.register(r'assignments', AssignmentViewSet)
router.register(r'applicant', ApplicantViewSet)
router.register(r'applicant-custom-field', ApplicantCustomFieldViewSet)
router.register(r'application-template', ApplicationTemplateViewSet )
router.register(r'emergency-contact', EmergencyContactViewSet)
router.register(r'applicant-additional-information', ApplicantAdditionalInformationViewSet )
router.register(r'applicant-foreign-key-field-choices',
ApplicantForeignKeyRelatedFieldChoicesViewSet,
router.register(r'applicant-foreign-key-field-choices',
ApplicantForeignKeyRelatedFieldChoicesViewSet,
base_name='applicant-foreign-key-field-choices'
)
api_urls = router.urls
api_urls = router.urls
5 changes: 2 additions & 3 deletions api/schedule/serializers.py
Expand Up @@ -31,10 +31,9 @@ class Meta:


class SimpleSectionSerializer(serializers.ModelSerializer):
teachers = TeacherSerializer()
#teachers = TeacherSerializer()
class Meta:
model = CourseSection
depth = 0


class CourseSerializer(serializers.ModelSerializer):
Expand All @@ -44,7 +43,7 @@ class CourseSerializer(serializers.ModelSerializer):

id = serializers.ReadOnlyField()
#sections = serializers.PrimaryKeyRelatedField(many=True, read_only=True)
sections = SimpleSectionSerializer()
sections = SimpleSectionSerializer(many=True)
department_id = serializers.PrimaryKeyRelatedField(
source='department',
queryset=Department.objects.all(),
Expand Down
14 changes: 7 additions & 7 deletions ecwsp/admissions/templates/admissions/funnel.html
Expand Up @@ -45,12 +45,12 @@
{% endblock %}

{% block breadcrumbs %}
<div id="breadcrumbs">
<a href="/">{% trans 'Home' %}</a>{% if title %} &rsaquo; {{ title }}{% endif %}
&rsaquo; <a href="{% url "admin:app_list" 'admissions' %}">{% trans 'Admissions' %}</a>
&rsaquo; <a href="../">{% trans 'Reports' %}</a>
&rsaquo; Funnel
</div>
<ul>
<li><a href="/">{% trans 'Home' %}</a>{% if title %} &rsaquo; {{ title }}{% endif %}</li>
<li><a href="{% url "admin:app_list" 'admissions' %}">{% trans 'Admissions' %}</a></li>
<li><a href="../">{% trans 'Reports' %}</a></li>
<li>Funnel</li>
</ul>
{% endblock %}

{% block content %}
Expand All @@ -62,7 +62,7 @@ <h2> Admissions Funnel for year{{ years|pluralize }} {% for year in years %} {{
{{ level }}
<table style="margin-left: auto;margin-right: auto;">
<tr>
<td class="level thin"">
<td class="level thin">
Total:
</td>
<td class="level thin">
Expand Down
10 changes: 5 additions & 5 deletions ecwsp/admissions/templates/admissions/report.html
Expand Up @@ -2,11 +2,11 @@
{% load i18n %}

{% block breadcrumbs %}
<div id="breadcrumbs">
<a href="/">{% trans 'Home' %}</a>{% if title %} &rsaquo; {{ title }}{% endif %}
&rsaquo; <a href="{% url "admin:app_list" 'admissions' %}">{% trans 'Admissions' %}</a>
&rsaquo; {{ test }} Reports
</div>
<ul>
<li><a href="/">{% trans 'Home' %}</a>{% if title %} &rsaquo; {{ title }}{% endif %}</li>
<li><a href="{% url "admin:app_list" 'admissions' %}">{% trans 'Admissions' %}</a></li>
<li>{{ test }} Reports</li>
</ul>
{% endblock %}

{% block content %}
Expand Down
20 changes: 10 additions & 10 deletions ecwsp/attendance/templates/attendance/attendance_report.html
Expand Up @@ -5,16 +5,16 @@
{{ form.media }}
{% endblock %}

{% block breadcrumbs %}
<div id="breadcrumbs">
<a href="/admin">
Home
</a>
&rsaquo;
<a href="{% url 'admin:attendance_studentattendance_changelist' %}">
Student Attendance
</a>
&rsaquo; Attendance Reports</div>
{% block nav_page_specific %}
<div id="mm-page-specific" role="navigation">
<div class="breadcrumb">
<ul>
<li><a href="/admin">Home</a></li>
<li><a href="{% url 'admin:attendance_studentattendance_changelist' %}">Student Attendance</a></li>
<li>Attendance Reports</li>
</ul>
</div>
</div>
{% endblock %}

{% block content %}
Expand Down
51 changes: 27 additions & 24 deletions ecwsp/attendance/templates/attendance/teacher_submissions.html
@@ -1,46 +1,49 @@
{% extends "admin/base_site.html" %}
{% extends "base_next.html" %}
<!-- LOADING -->
{% load i18n admin_modify grp_tags %}

{% block breadcrumbs %}
<div id="breadcrumbs">
<a href="/admin">
Home
</a>
&rsaquo;
<a href="/admin/attendance/studentattendance/">
Student Attendance
</a>
&rsaquo; Attendance Submissions
</div>
{% block nav_page_specific %}
<div id="mm-page-specific" role="navigation">
<div class="breadcrumb">
<ul>
<li><a href="/admin">Home</a></li>
<li><a href="/admin/attendance/studentattendance/">Student Attendance</a></li>
<li>Attendance Submissions</li>
</ul>
</div>
</div>
{% endblock %}

{% block title %}Today&rsquo;s Attendance Submissions{% endblock %}

{% block content %}
<h2> Today's Attendance Submissions </h2>
<div class='table'>
<table>


<table class="table table-striped">
<thead>
<tr>
<th>Course Section</th>
<th>Teacher</th>
<th>Submitted?</th>
</tr>
</thead>
<tbody>
{% for submission in submissions %}
<tr>
<td>{{ submission.homeroom }}</td>
<td>{{ submission.teacher }}</td>
<td>
{{ submission.submitted }}
{% if submission.submitted_by %}
{% if submission.submitted_by != submission.teacher %}
, by {{ submission.submitted_by }}
{% endif %}
{% endif %}
</td>

{{ submission.submitted }}
{% if submission.submitted_by %}
{% if submission.submitted_by != submission.teacher %}
, by {{ submission.submitted_by }}
{% endif %}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>

{% endblock %}

3 changes: 2 additions & 1 deletion ecwsp/attendance/views.py
Expand Up @@ -194,7 +194,8 @@ def teacher_submissions(request):
submissions.append(submission)
return render_to_response(
'attendance/teacher_submissions.html',
{'request': request, 'submissions': submissions})
{'request': request, 'submissions': submissions},
RequestContext(request, {}),)


def daily_attendance_report_wrapper(request):
Expand Down
20 changes: 1 addition & 19 deletions ecwsp/benchmark_grade/templates/benchmark_grade/comments.html
Expand Up @@ -15,24 +15,6 @@
</style>
{% endblock %}

{% block nav %}
<!-- only useful override here is removing gumby-fixed from <nav> tag -->
<nav class="navbar" id="nav1">
<div class="sixteen colgrid">
{% include "gumby/nav.html" %}
<div class="breadcrumbs">
<div id="breadcrumbs_area" class="row">
<div class="sixteen columns">
{% block breadcrumbs %}
{{ block.super }}
{% endblock %}
</div>
</div>
</div>
</div>
</nav>
{% endblock %}

{% block bigcontent %}
<div class="row hidden" id="attention-getter">
<div class="four columns centered text-center">
Expand All @@ -41,7 +23,7 @@
</div>

<div class="row">
<h2>{{ course_section.name }} Comments</h2>
<h2 style="padding-top: 20px;">{{ course_section.name }} Comments</h2>
</div>

<div class="row">
Expand Down

0 comments on commit cf3bc1c

Please sign in to comment.