Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All open User Stories #61

Merged
merged 49 commits into from
Mar 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
1ead8c6
user-story 46 functionalities
kaymaky Feb 16, 2017
da852e4
Added state-restrictions for evaluation, provided tests
igorbraun Mar 7, 2017
ca98f19
Merged branch user-story-40 into order-wizard
yduman Mar 10, 2017
7c0b4a9
Merge remote-tracking branch 'origin/user-story-42' into order-wizard
yduman Mar 10, 2017
9bad199
Merge remote-tracking branch 'origin/user-story-43' into order-wizard
yduman Mar 10, 2017
86e22ac
Merge branch 'user-story-50' into order-wizard
yduman Mar 10, 2017
b00981c
Merge branch 'order-wizard' into user-story-46
yduman Mar 10, 2017
28d7feb
updated requirements
yduman Mar 10, 2017
235296a
added bootstrap
yduman Mar 10, 2017
a38e1ee
implemented modal for order closing
yduman Mar 10, 2017
5e3b0fe
removed Bootstrap version and realized as FormView
yduman Mar 11, 2017
607a4cc
provided tests
yduman Mar 11, 2017
39fb509
added todo
yduman Mar 13, 2017
5287206
Added possibility to login as Veranstalter in every state
igorbraun Mar 13, 2017
09618b3
Added logout button from Veranstalter-dashboard
igorbraun Mar 13, 2017
9d638ff
Added logout button for bestellung-done view
igorbraun Mar 13, 2017
0748b1f
added more statusmanagement for order closing
yduman Mar 13, 2017
83fb484
Merge branch 'order-wizard' into user-story-46
yduman Mar 13, 2017
1f73992
Merge branch 'order-wizard' into user-story-51
yduman Mar 13, 2017
c4641f5
Merge branch 'order-wizard' into user-story-47
yduman Mar 13, 2017
1978c9b
Merge branch 'order-wizard' into user-story-48
yduman Mar 13, 2017
19e53be
Some progress for story 52
igorbraun Mar 13, 2017
26d0531
added jquery plugin 'chosen' to be able to select multiple statuses, …
yduman Mar 14, 2017
e9cef10
fixed POST data handling
yduman Mar 16, 2017
3fd9d9f
the sending of mails in relation to the status of a lecture is now po…
yduman Mar 17, 2017
84a283e
Merge branch 'order-wizard' into user-story-52
yduman Mar 17, 2017
76e4572
user can now send mails to tutors too
yduman Mar 17, 2017
f29167f
added some formatting
yduman Mar 17, 2017
13fd72b
Merge branch 'order-wizard' into user-story-53
yduman Mar 17, 2017
feaeca8
fixed error from merge
yduman Mar 17, 2017
3dd4e47
modified the model BarcodeAllowedState and added tests for it
yduman Mar 19, 2017
8d0ec8e
Merge branch 'user-story-46' into order-wizard
yduman Mar 19, 2017
9d8ee30
Merge branch 'user-story-51' into order-wizard
yduman Mar 19, 2017
bd17ed2
Merge branch 'user-story-47' into order-wizard
yduman Mar 19, 2017
14e76da
Merge branch 'user-story-48' into order-wizard
yduman Mar 19, 2017
d2f9edd
Merge branch 'user-story-52' into order-wizard
yduman Mar 19, 2017
b0c6d07
Merge branch 'user-story-53' into order-wizard
yduman Mar 19, 2017
cb58876
Merge branch 'order-wizard' into user-story-49
yduman Mar 19, 2017
cae44ba
fixed migration
yduman Mar 19, 2017
d3e3d0b
Merge branch 'user-story-49' into order-wizard
yduman Mar 19, 2017
e43a80c
added documentation for models
yduman Mar 19, 2017
c8519ec
added documentation for intern/__init__.py
yduman Mar 19, 2017
96e5388
added documentation for intern/vv.py
yduman Mar 19, 2017
5c10602
added documentation for views/veranstalter.py
yduman Mar 19, 2017
7032e9e
added documentation for admin.py
yduman Mar 19, 2017
a8e50b8
refactored auth.py
yduman Mar 19, 2017
02817bb
added documentation forms.py
yduman Mar 19, 2017
712f65c
refactored tools.py
yduman Mar 19, 2017
8bc044e
refactored urls.py
yduman Mar 19, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added media/jquery/chosen/chosen-sprite.png
Loading
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
Loading
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
Loading