Skip to content

Commit

Permalink
Merge pull request #61 from yduman/documentation
Browse files Browse the repository at this point in the history
All open User Stories
  • Loading branch information
ckleemann committed Mar 21, 2017
2 parents e80e8e3 + 8bc044e commit 100f0d4
Show file tree
Hide file tree
Showing 29 changed files with 2,979 additions and 674 deletions.
Binary file added media/jquery/chosen/chosen-sprite.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/jquery/chosen/chosen-sprite@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
447 changes: 447 additions & 0 deletions media/jquery/chosen/chosen.css

Large diffs are not rendered by default.

1,269 changes: 1,269 additions & 0 deletions media/jquery/chosen/chosen.jquery.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions media/jquery/chosen/chosen.jquery.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions media/jquery/chosen/chosen.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
coverage==4.3.4
Django==1.10.5
django-debug-toolbar==1.6
Django==1.10.6
django-debug-toolbar==1.7
docutils==0.13.1
sqlparse==0.2.2
sqlparse==0.2.3
freezegun==0.3.8
django-formtools==2.0
22 changes: 20 additions & 2 deletions src/feedback/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@


class PersonAdmin(admin.ModelAdmin):
"""Admin View für Personen"""
list_display = ('__unicode__', 'email', 'fachgebiet')
search_fields = ['vorname', 'nachname', 'email', ]
list_filter = ('fachgebiet',)

class FachgebietZuweisenForm(forms.Form):
"""Form für die Zuweisung von einem Fachgebiet für eine Person."""
_selected_action = forms.CharField(widget=forms.MultipleHiddenInput)

def assign_fachgebiet_action(self, request, queryset):
"""Definiert eine Admin-Action für die Fachgebietzuweisung."""
form = None
suggestion_list = []

Expand Down Expand Up @@ -58,6 +61,7 @@ def assign_fachgebiet_action(self, request, queryset):


class LogInline(admin.TabularInline):
"""Admin View für Log"""
model = Log
readonly_fields = ('veranstaltung', 'user', 'scanner', 'timestamp', 'status', 'interface')
can_delete = False
Expand All @@ -67,6 +71,7 @@ def has_add_permission(self, request, obj=None):


class VeranstaltungAdmin(admin.ModelAdmin):
"""Admin View für Veranstaltung"""
fieldsets = [
('Stammdaten', {'fields':
['typ', 'name', 'semester', 'status', 'lv_nr', 'grundstudium', 'evaluieren',
Expand All @@ -85,17 +90,20 @@ class VeranstaltungAdmin(admin.ModelAdmin):
inlines = [LogInline, ]

def save_model(self, request, obj, form, change):
"""Definiert eine Post-Save Operation."""
super(VeranstaltungAdmin, self).save_model(request, obj, form, change)
# Post-Save Operation
for changed_att in form.changed_data:
if changed_att == "status": # Wenn Status sich aendert, wird es notiert
# Wenn sich der Status ändert, wird es geloggt.
if changed_att == "status":
obj.log(request.user)

class StatusAendernForm(forms.Form):
"""Definiert eine Form für Änderung einen Status'."""
_selected_action = forms.CharField(widget=forms.MultipleHiddenInput)
status = forms.ChoiceField(choices=Veranstaltung.STATUS_CHOICES)

def status_aendern_action(self, request, queryset):
"""Beschreibt eine Admin-Action für die Statusänderung."""
form = None

if 'apply' in request.POST:
Expand All @@ -121,26 +129,31 @@ def status_aendern_action(self, request, queryset):


class SemesterAdmin(admin.ModelAdmin):
"""Admin View für Semester"""
list_display = ('__unicode__', 'sichtbarkeit', 'fragebogen')
list_filter = ('sichtbarkeit', 'fragebogen')
ordering = ('-semester',)


class EinstellungAdmin(admin.ModelAdmin):
"""Admin View für Einstellung"""
list_display = ('name', 'wert')
list_editable = ('wert',)


class MailvorlageAdmin(admin.ModelAdmin):
"""Admin View für Mailvorlage"""
list_display = ('subject',)


class KommentarAdmin(admin.ModelAdmin):
"""Admin View für Kommentar"""
list_display = ('typ', 'name', 'semester', 'autor')
list_display_links = ('name',)


class TutorAdmin(admin.ModelAdmin):
"""Admin View für Tutor"""
fieldsets = [
('Stammdaten', {'fields':
['vorname', 'nachname', 'email',
Expand All @@ -161,27 +174,32 @@ def render_change_form(self, request, context, *args, **kwargs):


class BarcodeScannEventAdmin(admin.ModelAdmin):
"""Admin View für BarcodeScannEvent"""
list_display = ('veranstaltung', 'timestamp',)
readonly_fields = ('veranstaltung', 'timestamp',)


class BarcodeAllowedStateInline(admin.TabularInline):
"""Admin View für BarcodeAllowedState"""
model = BarcodeAllowedState


class BarcodeScannerAdmin(admin.ModelAdmin):
"""Admin View für BarcodeScanner"""
inlines = [
BarcodeAllowedStateInline,
]
list_display = ('token', 'description')


class FachgebietEmailAdminInline(admin.TabularInline):
"""Admin View für FachgebietEmail"""
model = FachgebietEmail
extra = 1


class FachgebietAdmin(admin.ModelAdmin):
"""Admin View für Fachgebiet"""
list_display = ('name', 'kuerzel')
list_display_links = ('name',)
inlines = (FachgebietEmailAdminInline,)
Expand Down
6 changes: 3 additions & 3 deletions src/feedback/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from feedback.models.base import Veranstaltung


### Login mit Veranstalter-Rechten ############################################
# ------------------------------ Login mit Veranstalter-Rechten ------------------------------ #

class VeranstalterBackend(ModelBackend):
def authenticate(self, vid, token):
Expand All @@ -34,7 +34,7 @@ def authenticate(self, user, current_user=None, reset=False):
return None


### Nutzung eines Fachschaftsaccounts #########################################
# ------------------------------ Nutzung eines Fachschaftsaccounts ------------------------------ #

class FSAccountBackend(RemoteUserBackend):
# Login wird automatisch über RemoteUserMiddleware bzw. RemoteUserBackend abgewickelt,
Expand All @@ -53,7 +53,7 @@ def clean_username(self, username):
if settings.DEBUG:
credentials = b64decode(username.split()[1])
user = credentials.split(':')[0]
return (smart_unicode(user))
return smart_unicode(user)
else:
return username

Expand Down
32 changes: 27 additions & 5 deletions src/feedback/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@


class VeranstaltungEvaluationForm(forms.ModelForm):
"""Definiert die Form für den 1. Schritt des Wizards"""
required_css_class = 'required'

class Meta:
Expand All @@ -23,6 +24,7 @@ def __init__(self, *args, **kwargs):


class VeranstaltungBasisdatenForm(forms.ModelForm):
"""Definiert die Form für den 2. Schritt des Wizards."""
required_css_class = 'required'

def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -69,6 +71,7 @@ class Meta:


class VeranstaltungPrimaerDozentForm(forms.ModelForm):
"""Definiert die Form für den 3. Schritt des Wizards."""
required_css_class = 'required'

def __init__(self, *args, **kwargs):
Expand All @@ -87,6 +90,7 @@ class Meta:


class VeranstaltungDozentDatenForm(forms.ModelForm):
"""Definiert die Form für den 4. Schritt des Wizards."""
required_css_class = 'required'

def __init__(self, *args, **kwargs):
Expand All @@ -101,6 +105,7 @@ class Meta:


class VeranstaltungFreieFragen(forms.ModelForm):
"""Definiert die Form für den 5. Schritt des Wizards."""
required_css_class = 'required'

class Meta:
Expand All @@ -109,6 +114,7 @@ class Meta:


class VeranstaltungTutorenForm(forms.Form):
"""Definiert die Form für den 6. Schritt des Wizards."""
required_css_class = 'required'

csv_tutoren = forms.CharField(label='CSV', widget=forms.Textarea, required=False)
Expand All @@ -120,6 +126,7 @@ def __init__(self, *args, **kwargs):


class VeranstaltungVeroeffentlichung(forms.ModelForm):
"""Definiert die Form für den 7. Schritt des Wizards."""
required_css_class = 'required'

class Meta:
Expand All @@ -128,10 +135,12 @@ class Meta:


class UploadFileForm(forms.Form):
"""Definiert die Form für den XML Import."""
file = forms.FileField(label='Datei')


class PersonForm(forms.ModelForm):
"""Definiert die Form für die Bearbeitung von Personen."""
class Meta:
model = Person
fields = ('geschlecht', 'email')
Expand All @@ -144,7 +153,15 @@ def clean(self):
raise forms.ValidationError('Das Feld für die Anrede oder Email ist leer.')


class PersonUpdateForm(forms.ModelForm):
"""Definiert die Form für die Nachpflege von Personendaten"""
class Meta:
model = Person
fields = ('anschrift', 'fachgebiet')


class KommentarModelForm(forms.ModelForm):
"""Definiert die Form für Kommentare."""
def __init__(self, *args, **kwargs):
veranst = kwargs.pop('veranstaltung', None)

Expand All @@ -159,14 +176,19 @@ class Meta:
exclude = ('veranstaltung',)


class PersonUpdateForm(forms.ModelForm):
class Meta:
model = Person
fields = ('anschrift', 'fachgebiet')
CLOSE_ORDER_CHOICES = (
('ja', 'Ja'),
('nein', 'Nein')
)


class CloseOrderForm(forms.Form):
"""Definiert die Form für das Beenden der Bestellphase"""
auswahl = forms.ChoiceField(choices=CLOSE_ORDER_CHOICES)


class CreateBarcodeScannEventForm(forms.ModelForm):
"""Handelt die erste haelfte von Barcode scanns"""
"""Definiert die Form für einen Barcodescan-Event"""
scanner_token = forms.CharField()

class Meta:
Expand Down

0 comments on commit 100f0d4

Please sign in to comment.