Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Commit

Permalink
Add basic project settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
ptgolden committed Jul 27, 2015
1 parent 837bd69 commit d26d0cb
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
16 changes: 16 additions & 0 deletions editorsnotes/auth/templates/project_settings.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{% extends "user_settings_base.html" %}

{% block setting_content %}
<h2>{{ project }}</h2>

<h3>Project settings</h3>

<h3>Project roster</h3>

<h3>Project roles</h3>

<h3>Download project archive</h3>

<h3>Delete project</h3>

{% endblock %}
6 changes: 5 additions & 1 deletion editorsnotes/auth/templates/user_project_settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ <h2>Projects</h2>
<section>
<h3>Current projects</h3>
{% for project, role in user.get_affiliated_projects_with_roles %}
<div>{{ role }}: {{ project }}</div>
<div>
<a href="{% url "auth:project_settings" project.slug %}">
{{ project.name }}
</a> ({{ role.role }})
</div>
{% empty %}
<p>None</p>
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion editorsnotes/auth/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
url(r'^account/projects/$', views.user_project_settings, name='user_project_settings'),

# Projects
url(r'^projects/(?P<project_slug>\w+)$', views.project_home, name='project_home'),
url(r'^account/projects/(?P<project_slug>\w+)$', views.project_settings, name='project_settings'),

# Account creation things
url(r'^account/create$', views.create_account, name='create_account'),
Expand Down
16 changes: 10 additions & 6 deletions editorsnotes/auth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
from django.contrib.auth.decorators import login_required
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.http import Http404
from django.shortcuts import render_to_response, redirect
from django.shortcuts import render_to_response, redirect, get_object_or_404
from django.template import RequestContext
from django.utils.http import urlsafe_base64_decode

from .forms import ENUserCreationForm, UserProfileForm, ProjectForm
from .models import User
from .models import User, Project
from .utils import send_activation_email


Expand Down Expand Up @@ -111,8 +111,7 @@ def user_project_settings(request):

# Add the user to the editor role
project.roles.get().group.user_set.add(request.user)

form = ProjectForm()
return redirect('auth:user_project_settings')
else:
form = ProjectForm()
return render_to_response(
Expand All @@ -125,7 +124,12 @@ def user_project_settings(request):


@login_required
def project_home(request, project_slug):
def project_settings(request, project_slug):
"View/change project name, slug, and roster."
project = get_object_or_404(Project, slug=project_slug)
return render_to_response(
'project_home.html', context_instance=RequestContext(request))
'project_settings.html',
{
'project': project
},
RequestContext(request))

0 comments on commit d26d0cb

Please sign in to comment.