diff --git a/citavi_mapper/urls.py b/citavi_mapper/urls.py index badc63f..8164945 100644 --- a/citavi_mapper/urls.py +++ b/citavi_mapper/urls.py @@ -6,14 +6,13 @@ from django.contrib import admin admin.autodiscover() from frontend.views import login_wrap, logout_wrap -from frontend.views import IndexView, RegisterView, ProjectContextView +from frontend.views import IndexView, ProjectView urlpatterns = patterns('', url(r'^$', IndexView.as_view(), name='frontend-index'), - url(r'^project/$', ProjectContextView.as_view(), name='frontend-projectcontext'), + url(r'^projects/$', ProjectView.as_view(), name='frontend-projects'), url(r'^login/$', login_wrap, name='frontend-login'), url(r'^logout/$', logout_wrap, name='frontend-logout'), - url(r'^register/', RegisterView.as_view(), name='frontend-register'), url(r'^admin/', include(admin.site.urls)), ) \ No newline at end of file diff --git a/frontend/forms.py b/frontend/forms.py index 1d8d890..5239d29 100644 --- a/frontend/forms.py +++ b/frontend/forms.py @@ -5,9 +5,9 @@ from frontend.models import ProjectContext from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, Layout -class NewProjectContextForm(forms.ModelForm): +class NewProjectForm(forms.ModelForm): def __init__(self, *args, **kwargs): - super(NewProjectContextForm, self).__init__(*args, **kwargs) + super(NewProjectForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.form_class = 'form-horizontal' self.helper.label_class = 'col-lg-2' @@ -16,7 +16,7 @@ class NewProjectContextForm(forms.ModelForm): self.helper.layout = Layout( 'name', 'description', - Submit('send', 'Senden', css_class = 'btn-default') + Submit('send', 'Create', css_class = 'btn-default') ) name = forms.CharField( diff --git a/frontend/templates/index.html b/frontend/templates/index.html index f4ea2ce..fc2ee86 100644 --- a/frontend/templates/index.html +++ b/frontend/templates/index.html @@ -1,8 +1,10 @@ {% extends "layout/base.html" %} {% block content %} +
- Welcome, {{user}}!
Feel free to discover.
- Project Contexts
+
{% crispy form %}
++ TABLE HERE +
{% endblock %} \ No newline at end of file diff --git a/frontend/templates/register.html b/frontend/templates/register.html deleted file mode 100644 index d3eae2d..0000000 --- a/frontend/templates/register.html +++ /dev/null @@ -1,6 +0,0 @@ -{% extends "layout/base.html" %} -{% block content %} -- Please register here. -
-{% endblock %} \ No newline at end of file diff --git a/frontend/views.py b/frontend/views.py index 6376be4..a5f595b 100644 --- a/frontend/views.py +++ b/frontend/views.py @@ -6,7 +6,7 @@ from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from django.contrib.auth.views import login, logout -from frontend.forms import NewProjectContextForm +from frontend.forms import NewProjectForm FRONTEND_PAGE_NAME = 'Citavi Mapper' @@ -85,15 +85,11 @@ class IndexView(ProtectedTemplateView): template_name = 'index.html' page_title = 'Index' -class RegisterView(MyTemplateView): - template_name = 'register.html' - page_title = 'Register' - -class ProjectContextView(ProtectedFormView): - template_name = 'projectcontext.html' - page_title = 'Project Contexts' - form_class = NewProjectContextForm - success_url = '/project' +class ProjectView(ProtectedFormView): + template_name = 'projects.html' + page_title = 'Projects' + form_class = NewProjectForm + success_url = '/projects' def form_valid(self, form): - return super(ProjectContextView, self).form_valid(form) + return super(ProjectView, self).form_valid(form)