Skip to content

Commit

Permalink
Finish v1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Doca committed Sep 14, 2015
2 parents aa9a822 + 39095eb commit 781d07d
Show file tree
Hide file tree
Showing 48 changed files with 435 additions and 221 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ fabfile.py
manlocal.py
db.sqlite3
.DS_Store
*.mo
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ https://github.com/volunteer-planner/volunteer_planner/wiki/DevelopmentRules

### 1.Install all required Ubuntu packages

sudo apt-get install python-dev python-pip git
sudo apt-get install python-dev python-pip git npm

If you are going to use a local mysql server, additionally install

Expand Down Expand Up @@ -59,34 +59,35 @@ or, if you intend to use mysql locally, install
*Note*: For the local environment, the DB username is assumed to be 'vp'
and their password is assumed to be 'volunteer_planner'.

### 6. Initialize the database
### 6. Create local runner

./manage.py migrate --settings=volunteer_planner.settings.local[_mysql]
cp man.py manlocal.py

### 7. Add a superuser
Edit the file and update values for db credentials, settings file (volunteer_planner.settings.local[_mysql]) and the rest with your preferred settings.

./manlocal.py createsuperuser --settings=volunteer_planner.settings.local[_mysql]
### 7. Initialize the database

./manlocal.py migrate

### 8. Add a superuser

./manlocal.py createsuperuser

You will be asked for username, email and password (twice). Remember that username and password.

### 8. Try running the server
### 9. Try running the server

./manlocal.py runserver --settings=volunteer_planner.settings.local[_mysql]
./manlocal.py runserver

Try opening http://localhost:8000/ in your browser.


### 9. Adding content

To add new organizations and shifts, you have to access the backend at `http://localhost:8000/admin`.
If prompted, login with the username/password you created in step 7 (in case you don't see an error page here).
If prompted, login with the username/password of the superuser you created earlier (in case you don't see an error page here).

http://localhost:8000/admin`

### 10. Importing dummy data

./manage.py loaddata demo_data.json --settings=volunteer_planner.settings.local[_mysql]

## The Project

We use less for precompiling css. The less file you will find in scheduler/static/bootstrap/less/project.less
Expand Down
Empty file added account/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions account/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
Empty file added account/migrations/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions account/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
17 changes: 17 additions & 0 deletions account/templates/user_account_edit.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% extends 'home.html' %}
{% load i18n %}

{% block title %}{{ user.username }}{% endblock %}
{% block body_class %}helpdesk{% endblock %}
{% block navbar %}
{% include 'navbar.html' %}
{% endblock %}
{% block content %}
<div class="col-md-8 col-md-offset-2 update_form">
<form action="." method="POST">
{% csrf_token %}
{{ form.as_p }}
<input class="button" type="submit" value="{% trans 'Save' %}">
</form>
</div>
{% endblock %}
21 changes: 21 additions & 0 deletions account/templates/user_detail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% extends 'home.html' %}
{% load i18n %}

{% block title %}{{ user.username }}{% endblock %}
{% block body_class %}helpdesk{% endblock %}

{% block navbar %}
{% include 'navbar.html' %}
{% endblock %}

{% block content %}
<div class="col-md-8 col-md-offset-2">
<ul class="list-group">
<li class="list-group-item list-group-item-info">{% trans 'Username' %}: {{ user.username }}</li>
<li class="list-group-item list-group-item-info">{% trans 'First name' %}: {{ user.first_name }}</li>
<li class="list-group-item list-group-item-info">{% trans 'Last name' %}: {{ user.last_name }}</li>
<li class="list-group-item list-group-item-info">{% trans 'Email' %}: {{ user.email }}</li>
</ul>
<div><a href="{% url 'account_edit' %}" class="btn btn-default">{% trans 'Edit Account' %}</a></div>
</div>
{% endblock %}
3 changes: 3 additions & 0 deletions account/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
7 changes: 7 additions & 0 deletions account/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.conf.urls import url
from .views import user_account_detail, AccountUpdateView

urlpatterns = [
url(r'^edit/$', AccountUpdateView.as_view(), name="account_edit"),
url(r'^', user_account_detail, name="account_detail"),
]
24 changes: 24 additions & 0 deletions account/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.views.generic.edit import UpdateView
from django.core.urlresolvers import reverse_lazy

from volunteer_planner.utils import LoginRequiredMixin


@login_required()
def user_account_detail(request):
user = request.user
return render(request, 'user_detail.html', {'user': user})


class AccountUpdateView(LoginRequiredMixin, UpdateView):
"""
Allows a user to update their profile.
"""
fields = ['first_name', 'last_name', 'email']
template_name = "user_account_edit.html"
success_url = reverse_lazy('account_detail')

def get_object(self, queryset=None):
return self.request.user
5 changes: 2 additions & 3 deletions blueprint/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from django.contrib import admin
from django.contrib.admin.widgets import FilteredSelectMultiple
# Register your models here.
from django import forms
from .models import BluePrintCreator, NeedBluePrint

Expand All @@ -14,12 +12,13 @@ def clean(self):
try:
if BluePrintCreator.objects.get(location=self.data['location']):
raise forms.ValidationError("Ort hat bereits eine Vorlage!")
except:
except Exception:
return self.cleaned_data


class BluePrintCreatorAdmin(admin.ModelAdmin):
form = BluePrintCreatorAdminForm
filter_horizontal = ('needs',)


class NeedBluePrintAdmin(admin.ModelAdmin):
Expand Down
Binary file removed locale/de/LC_MESSAGES/django.mo
Binary file not shown.
97 changes: 57 additions & 40 deletions locale/de/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-09-13 16:24+0200\n"
"POT-Creation-Date: 2015-09-14 10:29+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand All @@ -18,6 +18,30 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: account/templates/user_account_edit.html:14
msgid "Save"
msgstr "Speichern"

#: account/templates/user_detail.html:14 registration/forms.py:34
msgid "Username"
msgstr "Benutzername"

#: account/templates/user_detail.html:15
msgid "First name"
msgstr "Vorname"

#: account/templates/user_detail.html:16
msgid "Last name"
msgstr "Nachname"

#: account/templates/user_detail.html:17 registration/forms.py:37
msgid "Email"
msgstr "E-Mail Adresse"

#: account/templates/user_detail.html:19
msgid "Edit Account"
msgstr "Account bearbeiten"

#: notifications/models.py:13
msgid "title"
msgstr "Titel"
Expand All @@ -38,18 +62,10 @@ msgstr "Benutzer aktivieren"
msgid "Re-send activation emails"
msgstr "Aktivierungsmail erneut versenden"

#: registration/forms.py:34
msgid "Username"
msgstr "Benutzername"

#: registration/forms.py:35
msgid "This value may contain only letters, numbers and @/./+/-/_ characters."
msgstr "Der Wert darf nur Buchstaben, Zahlen und die Zeichen @, ., +, - und _ enthalten"

#: registration/forms.py:37
msgid "E-mail"
msgstr "E-Mail Adresse"

#: registration/forms.py:39
msgid "Password"
msgstr "Passwort"
Expand All @@ -62,21 +78,25 @@ msgstr "Passwort (noch einmal)"
msgid "A user with that username already exists."
msgstr "Es gibt bereits einen Benutzer mit diesem Benutzernamen."

#: registration/forms.py:76
#: registration/forms.py:58
msgid "A user with that email already exists. Please login instead."
msgstr "Die Emailadresse ist bereits bekannt. Bitte logge Dich ein mit Deinem Benutzername und Password."

#: registration/forms.py:82
msgid "I have read and agree to the Terms of Service"
msgstr "Ich habe die Nutzungsbedingungen gelesen und stimme ihnen zu"

#: registration/forms.py:77
#: registration/forms.py:83
msgid "You must agree to the terms to register"
msgstr "Sie müssen den Nutzungsbedingungen zustimmen"

#: registration/forms.py:93
#: registration/forms.py:99
msgid "This email address is already in use. Please supply a different email address."
msgstr "Diese E-Mail Adresse ist bereits registriert. Bitte verwenden Sie eine andere E-Mail Adresse"

#: registration/forms.py:118
#: registration/forms.py:124
msgid "Registration using free email addresses is prohibited. Please supply a different email address."
msgstr ""
msgstr "Die Registrierung mit einer E-Mail-Adresses dieses Anbieters ist leider verboten. Bitte verwende eine andere E-Mail-Adresse."

#: registration/models.py:219
msgid "user"
Expand All @@ -88,15 +108,12 @@ msgstr "Aktivierungsschlüssel"

#: registration/templates/activate.html:7
#, python-format
msgid ""
"\n"
"Thanks %(account)s, activation complete!\n"
"You may now <a href='%(auth_login_url)s'>login</a> using the username and password you set at registration.\n"
msgstr ""
msgid "Thanks %(account)s, activation complete! You may now <a href='%(auth_login_url)s'>login</a> using the username and password you set at registration."
msgstr "Danke %(account)s, die Aktivierung ist abgeschlossen! Du kannst dich jetzt mit deinem Benutzernamen und Passwort, welche du bei der Registrierung gewählt hast <a href='%(auth_login_url)s'>einloggen</a>."

#: registration/templates/activate.html:12
msgid "Oops &ndash; it seems that your activation key is invalid. Please check the url again."
msgstr ""
msgid "Oops &ndash; Either you activated your account already, or the activation key is invalid or has expired."
msgstr "Uuppss &ndash; Entweder dein Account wurde bereits aktiviert oder der Aktivierungschlüssel ist ungültig oder abgelaufen."

#: registration/templates/login.html:15
msgid "Your username and password didn't match. Please try again."
Expand All @@ -106,68 +123,68 @@ msgstr "Benutzername und Passort ungültig. Bitte versuchen Sie es erneut."
msgid "Scheduler"
msgstr "Schichtplaner"

#: scheduler/models.py:16
#: scheduler/models.py:17
msgid "shift"
msgstr "Schicht"

#: scheduler/models.py:17
#: scheduler/models.py:18
msgid "shifts"
msgstr "Schichten"

#: scheduler/models.py:18 scheduler/models.py:86
#: scheduler/models.py:20 scheduler/models.py:90
msgid "helptype"
msgstr "Hilfebereich"

#: scheduler/models.py:18
#: scheduler/models.py:20
msgid "helptype_text"
msgstr "Jeder Hilfebereich hat so viele Planelemente wie es Arbeitsschichten geben soll. Dies ist EINE Arbeitsschicht für einen bestimmten Tag"

#: scheduler/models.py:19 scheduler/models.py:122
#: scheduler/models.py:21 scheduler/models.py:125
msgid "location"
msgstr "Ort"

#: scheduler/models.py:22
#: scheduler/models.py:24
msgid "time from"
msgstr "Anfangszeit"

#: scheduler/models.py:27
#: scheduler/models.py:29
msgid "number of needed volunteers"
msgstr "Anz. benoetigter Freiwillige"
msgstr "Anz. benötigter Freiwillige"

#: scheduler/models.py:31
#: scheduler/models.py:34
msgid "assigned volunteers"
msgstr "Reg. Freiwillige"

#: scheduler/models.py:35
#: scheduler/models.py:39
msgid "volunteers"
msgstr "Freiwillige"

#: scheduler/models.py:87
#: scheduler/models.py:91
msgid "helptypes"
msgstr "Hilfebereiche"

#: scheduler/models.py:102
#: scheduler/models.py:106
msgid "timeperiod"
msgstr "Zeitspanne"

#: scheduler/models.py:103
#: scheduler/models.py:107
msgid "timeperiods"
msgstr "Zeitspannen"

#: scheduler/models.py:123
#: scheduler/models.py:126
msgid "locations"
msgstr "Orte"

#: scheduler/views.py:94
#: scheduler/views.py:79
msgid "The submitted data was invalid."
msgstr "Die eingegebenen Daten sind ungültig."

#: scheduler/views.py:105
#: scheduler/views.py:90
#, python-brace-format
msgid "We can't add you to this shift because you've already agreed to other shifts at the same time: {conflicts}"
msgstr "Sie können der Schicht nicht beitreten, da Sie bereits an anderen mit überschneidenden Zeiten teilnehmen: {conflicts}"

#: scheduler/views.py:108
#: scheduler/views.py:93
msgid "You were successfully added to this shift."
msgstr "Sie haben sich erfolgreich für die Schicht angemeldet."

Expand All @@ -191,11 +208,11 @@ msgstr "Organisation"
msgid "email"
msgstr "E-Mail"

#: volunteer_planner/settings/base.py:128
#: volunteer_planner/settings/base.py:130
msgid "German"
msgstr "Deutsch"

#: volunteer_planner/settings/base.py:129
#: volunteer_planner/settings/base.py:131
msgid "English"
msgstr "Englisch"

Expand Down
5 changes: 4 additions & 1 deletion man.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "volunteer_planner.settings.local")
os.environ.setdefault("DATABASE_PW", "")
os.environ.setdefault("DB_USER", "")
os.environ.setdefault("SECRET_KEY", "1")
os.environ.setdefault("LANGUAGE", "de")

# if you omit this values dummy email backend will be used
os.environ.setdefault("EMAIL_ADDRESS", "")
os.environ.setdefault("EMAIL_HOST_PASSWORD", "")
os.environ.setdefault("SECRET_KEY", "1")

from django.core.management import execute_from_command_line

Expand Down
Loading

0 comments on commit 781d07d

Please sign in to comment.