Make url patterns more consistent

parent 5ecf6985
from django.conf.urls import url
from django.conf.urls import include, url
from django.views.generic.base import RedirectView
from . import views
......@@ -6,16 +6,20 @@ from . import views
app_name = "education"
urlpatterns = [
url('^exam/(?P<id>[0-9]*)/$', views.exam, name="exam"),
url('^summary/(?P<id>[0-9]*)/$', views.summary, name="summary"),
url('^exam/submit/$', views.submit_exam, name="submit-exam"),
url('^summary/submit/$', views.submit_summary, name="submit-summary"),
url('^exam/submit/(?P<id>[0-9]*)/$', views.submit_exam, name="submit-exam"),
url('^summary/submit/(?P<id>[0-9]*)/$', views.submit_summary, name="submit-summary"),
url('^courses/$', views.courses, name="courses"),
url('^courses/(?P<id>[0-9]*)/$', views.course, name="course"),
url('^books/$', views.books, name="books"),
url('^$',
url(r'^books/$', views.books, name="books"),
url(r'^courses/', include([
url(r'^$', views.courses, name="courses"),
url(r'^(?P<id>[0-9]*)/', include([
url(r'^$', views.course, name="course"),
url(r'^upload-exam/$', views.submit_exam, name="submit-exam"),
url(r'^upload-summary/$', views.submit_summary, name="submit-summary"),
])),
])),
url(r'^exams/(?P<id>[0-9]*)/$', views.exam, name="exam"),
url(r'^summaries/(?P<id>[0-9]*)/$', views.summary, name="summary"),
url(r'^upload-exam/$', views.submit_exam, name="submit-exam"),
url(r'^upload-summary/$', views.submit_summary, name="submit-summary"),
url(r'^$',
RedirectView.as_view(pattern_name='education:courses',
permanent=True), name="index"),
]
......@@ -16,7 +16,7 @@
<hr>
<div>
<a href="{% url 'members:profile' %}">{% trans "show public profile"|capfirst %}</a>
<a href="{% url 'members:profile' request.user.pk %}">{% trans "show public profile"|capfirst %}</a>
<p>{% blocktrans %}Take a look at your own profile.{% endblocktrans %}</p>
</div>
......@@ -43,4 +43,4 @@
</div>
</div>
{% endblock %}}
\ No newline at end of file
{% endblock %}}
from django.conf.urls import url
from django.conf.urls import include, url
from . import views
......@@ -9,8 +9,6 @@ urlpatterns = [
views.get_become_a_member_document,
name='become-a-member-document'),
url('^profile/(?P<pk>[0-9]*)$', views.profile, name='profile'),
url('^profile$', views.profile, name='profile'),
url('^profile/edit/$', views.edit_profile, name='edit-profile'),
url('^account$', views.account, name='account'),
url('^$', views.index, name='index'),
]
......@@ -6,5 +6,5 @@ app_name = "thabloid"
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^viewer/(?P<year>[0-9]{4})/(?P<issue>[0-9]+)/$', views.viewer, name='viewer'),
url(r'^(?P<year>[0-9]{4})/(?P<issue>[0-9]+)/$', views.viewer, name='viewer'),
]
......@@ -68,7 +68,7 @@
</div>
{% else %}
<div class="btn-group" id="account-menu">
<a class="btn btn-default" href="{% url 'members:account' %}"><i class="fa fa-user"></i> {% trans "My Account" %}</a>
<a class="btn btn-default" href="{% url 'account' %}"><i class="fa fa-user"></i> {% trans "My Account" %}</a>
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="caret"></span>
</button>
......
......@@ -52,15 +52,15 @@ urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^mailinglists/', include('mailinglists.urls')),
url(r'^members/', include('members.urls')),
url(r'^nyi$', TemplateView.as_view(template_name='status/nyi.html'), name='#'),
url(r'^account/$', members.views.account, name='account'),
url(r'^events/', include('events.urls')),
url(r'^pizzas/', include('pizzas.urls')),
url(r'^index\.php/events/ical/feed\.ics', DeprecationFeed()),
url(r'^newsletters/', include('newsletters.urls')),
url(r'^association$', TemplateView.as_view(
template_name='singlepages/association.html'), name='association'),
url(r'^association/', include([
url(r'^activemembers/', include('activemembers.urls')),
url(r'^', include([ # 'association' menu
url(r'^', include('activemembers.urls')),
url(r'^merchandise/', include('merchandise.urls')),
url(r'^documents/', include('documents.urls')),
url(r'^become-a-member/', members.views.become_a_member, name='become-a-member'),
......@@ -69,8 +69,8 @@ urlpatterns = [
])),
url(r'^for-members$', TemplateView.as_view(
template_name='singlepages/for_members.html'), name='for-members'),
url(r'^for-members/', include([
url(r'^become-active', TemplateView.as_view(template_name='singlepages/become_active.html'), name='become-active'),
url(r'^', include([ # 'for members' menu
url(r'^become-active/', TemplateView.as_view(template_name='singlepages/become_active.html'), name='become-active'),
url(r'^photos/', include('photos.urls')),
url(r'^statistics/', members.views.statistics, name='statistics'),
url(r'^styleguide/', TemplateView.as_view(template_name='singlepages/styleguide.html'), name='styleguide'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment