Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
AE
Sith
Commits
268a3325
Commit
268a3325
authored
Dec 09, 2015
by
Skia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor user groups to user prop
parent
77803596
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
core/templates/core/user_detail.html
core/templates/core/user_detail.html
+1
-1
core/templates/core/user_prop.html
core/templates/core/user_prop.html
+0
-0
core/urls.py
core/urls.py
+1
-1
core/views/forms.py
core/views/forms.py
+1
-1
core/views/user.py
core/views/user.py
+4
-4
No files found.
core/templates/core/user_detail.html
View file @
268a3325
...
...
@@ -16,7 +16,7 @@
<li><a
href=
"{% url 'core:user_edit' profile.id %}"
>
Edit
</a></li>
{% endif %}
{% if perms.core.change_prop_user %}
<li><a
href=
"{% url 'core:user_
g
ro
ups
' profile.id %}"
>
G
ro
u
ps
</a></li>
<li><a
href=
"{% url 'core:user_
p
ro
p
' profile.id %}"
>
P
rops
</a></li>
{% endif %}
</ul>
...
...
core/templates/core/user_
g
ro
ups
.html
→
core/templates/core/user_
p
ro
p
.html
View file @
268a3325
File moved
core/urls.py
View file @
268a3325
...
...
@@ -24,7 +24,7 @@ urlpatterns = [
url
(
r
'^user/$'
,
UserListView
.
as_view
(),
name
=
'user_list'
),
url
(
r
'^user/(?P<user_id>[0-9]+)/$'
,
UserView
.
as_view
(),
name
=
'user_profile'
),
url
(
r
'^user/(?P<user_id>[0-9]+)/edit$'
,
UserUpdateProfileView
.
as_view
(),
name
=
'user_edit'
),
url
(
r
'^user/(?P<user_id>[0-9]+)/
g
ro
ups
$'
,
UserUpdate
G
ro
ups
View
.
as_view
(),
name
=
'user_
g
ro
ups
'
),
url
(
r
'^user/(?P<user_id>[0-9]+)/
p
ro
p
$'
,
UserUpdate
P
ro
p
View
.
as_view
(),
name
=
'user_
p
ro
p
'
),
url
(
r
'^user/tools/$'
,
UserToolsView
.
as_view
(),
name
=
'user_tools'
),
# Page views
...
...
core/views/forms.py
View file @
268a3325
...
...
@@ -22,7 +22,7 @@ class RegisteringForm(UserCreationForm):
return
user
class
User
G
ro
ups
Form
(
forms
.
ModelForm
):
class
User
P
ro
p
Form
(
forms
.
ModelForm
):
error_css_class
=
'error'
required_css_class
=
'required'
class
Meta
:
...
...
core/views/user.py
View file @
268a3325
...
...
@@ -7,7 +7,7 @@ from django.views.generic import ListView, DetailView, TemplateView
import
logging
from
core.views
import
CanViewMixin
,
CanEditMixin
,
CanEditPropMixin
from
core.views.forms
import
RegisteringForm
,
User
G
ro
ups
Form
from
core.views.forms
import
RegisteringForm
,
User
P
ro
p
Form
from
core.models
import
User
def
login
(
request
):
...
...
@@ -111,14 +111,14 @@ class UserUpdateProfileView(CanEditMixin, UpdateView):
template_name
=
"core/user_edit.html"
fields
=
(
'first_name'
,
'last_name'
,
'nick_name'
,
'email'
,
'date_of_birth'
,
)
class
UserUpdate
G
ro
ups
View
(
CanEditPropMixin
,
UpdateView
):
class
UserUpdate
P
ro
p
View
(
CanEditPropMixin
,
UpdateView
):
"""
Edit a user's groups
"""
model
=
User
pk_url_kwarg
=
"user_id"
template_name
=
"core/user_
g
ro
ups
.html"
form_class
=
User
G
ro
ups
Form
template_name
=
"core/user_
p
ro
p
.html"
form_class
=
User
P
ro
p
Form
class
UserToolsView
(
TemplateView
):
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment