This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Link to timetable fixed #142
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.10.5 on 2017-02-12 15:33 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('ophasebase', '0004_auto_20170209_2025'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='ophasecategory', | ||
name='details_template', | ||
field=models.CharField(default='', max_length=50, verbose_name='Template für Stundenplan View'), | ||
preserve_default=False, | ||
), | ||
migrations.AddField( | ||
model_name='ophasecategory', | ||
name='details_url', | ||
field=models.CharField(default='', max_length=50, verbose_name='Link zum Stundenplan'), | ||
preserve_default=False, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.10.5 on 2017-02-12 15:33 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('ophasebase', '0005_auto_20170212_1633'), | ||
('website', '0006_oinforz'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='schedule', | ||
name='degree', | ||
), | ||
migrations.AddField( | ||
model_name='schedule', | ||
name='category', | ||
field=models.OneToOneField(default=1, on_delete=django.db.models.deletion.CASCADE, to='ophasebase.OphaseCategory', verbose_name='Ophasen Kategorie'), | ||
preserve_default=False, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
from django.conf.urls import url | ||
from django.views.generic.base import RedirectView | ||
|
||
from . import views | ||
|
||
|
||
app_name = 'website' | ||
urlpatterns = [ | ||
url(r'^$', views.HomepageView.as_view(), name='homepage'), | ||
url(r'^bachelor/$', views.ScheduleView.as_view(), kwargs={'degree': 'BSC'}, name='bachelor'), | ||
url(r'^master-de/$', views.ScheduleView.as_view(), kwargs={'degree': 'MSC'}, name='master-de'), | ||
url(r'^master-dss/$', views.ScheduleView.as_view(), kwargs={'degree': 'DSS'}, name='master-dss'), | ||
url(r'^jba/$', views.ScheduleView.as_view(), kwargs={'degree': 'JBA'}, name='jba'), | ||
url(r'^edu/$', views.ScheduleView.as_view(), kwargs={'degree': 'EDU'}, name='edu'), | ||
url(r'^details/(?P<category>[^/]+)/$', views.DetailsView.as_view(), name='details'), | ||
url(r'^helfen/$', views.HelfenView.as_view(), name='helfen'), | ||
url(r'^oinforz/$', views.OInforzView.as_view(), name='oinforz'), | ||
] | ||
|
||
#Redirect old links | ||
urlpatterns += [ | ||
url(r'^' + category + r'/$', | ||
RedirectView.as_view(pattern_name='website:details', | ||
permanent=False), | ||
kwargs = {'category' : category}, | ||
name = category) | ||
for category in ['bachelor', 'master-de', 'master-dss', 'jba', 'edu'] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could replace these two fields with a slug field containing an url name which could also be used as a template name. There should also be a method
getSlug()
, which uses the name of the categorie if the slug field is empty. This avoids actions requiered by the user when upgrading.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The slug would then be used to lookup the corresponding category in the website model (enforce unique).