Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0fbdc363
authored
10 years ago
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: access user profiles by username
parent
89dc52ae
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
11 additions
and
9 deletions
+11
-9
circle/dashboard/templates/base.html
+1
-1
circle/dashboard/templates/dashboard/group-detail.html
+2
-2
circle/dashboard/templates/dashboard/profile.html
+1
-1
circle/dashboard/templates/dashboard/vm-detail/_activity-timeline.html
+1
-1
circle/dashboard/templates/dashboard/vm-detail/access.html
+1
-1
circle/dashboard/urls.py
+2
-2
circle/dashboard/views.py
+3
-1
No files found.
circle/dashboard/templates/base.html
View file @
0fbdc363
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
</ul>
</ul>
{% if user.is_authenticated and user.pk %}
{% if user.is_authenticated and user.pk %}
<a
class=
"navbar-brand pull-right"
href=
"{% url "
logout
"
%}?
next=
{%
url
"
login
"
%}"
style=
"color: white; font-size: 10px;"
><i
class=
"icon-signout icon-sign-out"
></i>
{% trans "Log out" %}
</a>
<a
class=
"navbar-brand pull-right"
href=
"{% url "
logout
"
%}?
next=
{%
url
"
login
"
%}"
style=
"color: white; font-size: 10px;"
><i
class=
"icon-signout icon-sign-out"
></i>
{% trans "Log out" %}
</a>
<a
class=
"navbar-brand pull-right"
href=
"{% url "
dashboard
.
views
.
profile
"
pk=
user.pk
%}"
title=
"{% trans "
User
profile
"
%}"
style=
"color: white; font-size: 10px;"
><i
class=
"icon-user "
></i>
{{user}}
</a>
<a
class=
"navbar-brand pull-right"
href=
"{% url "
dashboard
.
views
.
profile
"
username=
user.username
%}"
title=
"{% trans "
User
profile
"
%}"
style=
"color: white; font-size: 10px;"
><i
class=
"icon-user "
></i>
{{user}}
</a>
{% if user.is_superuser %}
{% if user.is_superuser %}
<a
class=
"navbar-brand pull-right"
href=
"/network/"
style=
"color: white; font-size: 10px;"
><i
class=
"icon-globe"
></i>
{% trans "Network" %}
</a>
<a
class=
"navbar-brand pull-right"
href=
"/network/"
style=
"color: white; font-size: 10px;"
><i
class=
"icon-globe"
></i>
{% trans "Network" %}
</a>
<a
class=
"navbar-brand pull-right"
href=
"/admin/"
style=
"color: white; font-size: 10px;"
><i
class=
"icon-cogs"
></i>
{% trans "Admin" %}
</a>
<a
class=
"navbar-brand pull-right"
href=
"/admin/"
style=
"color: white; font-size: 10px;"
><i
class=
"icon-cogs"
></i>
{% trans "Admin" %}
</a>
...
...
This diff is collapsed.
Click to expand it.
circle/dashboard/templates/dashboard/group-detail.html
View file @
0fbdc363
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
<i
class=
"icon-user"
></i>
<i
class=
"icon-user"
></i>
</td>
</td>
<td>
<td>
<a
href=
"{% url "
dashboard
.
views
.
profile
"
pk=
i.pk
%}"
title=
"{{ i.username }}"
<a
href=
"{% url "
dashboard
.
views
.
profile
"
username=
i.username
%}"
title=
"{{ i.username }}"
>
{% include "dashboard/_display-name.html" with user=i show_org=True %}
</a>
>
{% include "dashboard/_display-name.html" with user=i show_org=True %}
</a>
</td>
</td>
<td>
<td>
...
@@ -93,7 +93,7 @@
...
@@ -93,7 +93,7 @@
<i
class=
"icon-user"
></i>
<i
class=
"icon-user"
></i>
</td>
</td>
<td>
<td>
<a
href=
"{% url "
dashboard
.
views
.
profile
"
pk=
i.user.pk
%}"
title=
"{{ i.user.username }}"
<a
href=
"{% url "
dashboard
.
views
.
profile
"
username=
i.user.username
%}"
title=
"{{ i.user.username }}"
>
{% include "dashboard/_display-name.html" with user=i.user show_org=True %}
</a>
>
{% include "dashboard/_display-name.html" with user=i.user show_org=True %}
</a>
</td>
</td>
<td>
<td>
...
...
This diff is collapsed.
Click to expand it.
circle/dashboard/templates/dashboard/profile.html
View file @
0fbdc363
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
{% if request.user == profile %}
{% if request.user == profile %}
<p>
<p>
{% trans "Use email address as Gravatar profile image" %}:
{% trans "Use email address as Gravatar profile image" %}:
<input
id=
"dashboard-profile-use-gravatar"
data-user=
"{{ profile.
pk
}}"
<input
id=
"dashboard-profile-use-gravatar"
data-user=
"{{ profile.
username
}}"
{%
if
profile
.
profile
.
use_gravatar
%}
checked=
"checked"
{%
endif
%}
{%
if
profile
.
profile
.
use_gravatar
%}
checked=
"checked"
{%
endif
%}
type=
"checkbox"
/>
<a
href=
"https://gravatar.com"
>
{% trans "What's Gravatar?" %}
</a>
type=
"checkbox"
/>
<a
href=
"https://gravatar.com"
>
{% trans "What's Gravatar?" %}
</a>
</p>
</p>
...
...
This diff is collapsed.
Click to expand it.
circle/dashboard/templates/dashboard/vm-detail/_activity-timeline.html
View file @
0fbdc363
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
{{ a.get_readable_name }}{% if user.is_superuser %}
</a>
{% endif %}
{{ a.get_readable_name }}{% if user.is_superuser %}
</a>
{% endif %}
</strong>
</strong>
{{ a.started|date:"Y-m-d H:i" }}{% if a.user %},
{{ a.started|date:"Y-m-d H:i" }}{% if a.user %},
<a
class=
"no-style-link"
href=
"{% url "
dashboard
.
views
.
profile
"
pk=
a.user.pk
%}"
>
<a
class=
"no-style-link"
href=
"{% url "
dashboard
.
views
.
profile
"
username=
a.user.username
%}"
>
{% include "dashboard/_display-name.html" with user=a.user show_org=True %}
{% include "dashboard/_display-name.html" with user=a.user show_org=True %}
</a>
</a>
{% endif %}
{% endif %}
...
...
This diff is collapsed.
Click to expand it.
circle/dashboard/templates/dashboard/vm-detail/access.html
View file @
0fbdc363
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
<tr>
<tr>
<td><i
class=
"icon-user"
></i></td>
<td><i
class=
"icon-user"
></i></td>
<td>
<td>
<a
href=
"{% url "
dashboard
.
views
.
profile
"
pk=
i.user.pk
%}"
title=
"{{ i.user.username }}"
<a
href=
"{% url "
dashboard
.
views
.
profile
"
username=
i.user.username
%}"
title=
"{{ i.user.username }}"
>
{% include "dashboard/_display-name.html" with user=i.user show_org=True %}
</a>
>
{% include "dashboard/_display-name.html" with user=i.user show_org=True %}
</a>
</td>
</td>
<td>
<td>
...
...
This diff is collapsed.
Click to expand it.
circle/dashboard/urls.py
View file @
0fbdc363
...
@@ -135,9 +135,9 @@ urlpatterns = patterns(
...
@@ -135,9 +135,9 @@ urlpatterns = patterns(
url
(
r'^profile/$'
,
MyPreferencesView
.
as_view
(),
url
(
r'^profile/$'
,
MyPreferencesView
.
as_view
(),
name
=
"dashboard.views.profile-preferences"
),
name
=
"dashboard.views.profile-preferences"
),
url
(
r'^profile/(?P<
pk>\d
+)/$'
,
ProfileView
.
as_view
(),
url
(
r'^profile/(?P<
username>\w
+)/$'
,
ProfileView
.
as_view
(),
name
=
"dashboard.views.profile"
),
name
=
"dashboard.views.profile"
),
url
(
r'^profile/(?P<
pk>\d
+)/use_gravatar/$'
,
toggle_use_gravatar
),
url
(
r'^profile/(?P<
username>\w
+)/use_gravatar/$'
,
toggle_use_gravatar
),
url
(
r'^group/(?P<group_pk>\d+)/remove/acl/user/(?P<member_pk>\d+)/$'
,
url
(
r'^group/(?P<group_pk>\d+)/remove/acl/user/(?P<member_pk>\d+)/$'
,
GroupRemoveAclUserView
.
as_view
(),
GroupRemoveAclUserView
.
as_view
(),
...
...
This diff is collapsed.
Click to expand it.
circle/dashboard/views.py
View file @
0fbdc363
...
@@ -2656,6 +2656,8 @@ class InterfaceDeleteView(DeleteView):
...
@@ -2656,6 +2656,8 @@ class InterfaceDeleteView(DeleteView):
class
ProfileView
(
LoginRequiredMixin
,
DetailView
):
class
ProfileView
(
LoginRequiredMixin
,
DetailView
):
template_name
=
"dashboard/profile.html"
template_name
=
"dashboard/profile.html"
model
=
User
model
=
User
slug_field
=
"username"
slug_url_kwarg
=
"username"
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
ProfileView
,
self
)
.
get_context_data
(
**
kwargs
)
context
=
super
(
ProfileView
,
self
)
.
get_context_data
(
**
kwargs
)
...
@@ -2697,7 +2699,7 @@ class ProfileView(LoginRequiredMixin, DetailView):
...
@@ -2697,7 +2699,7 @@ class ProfileView(LoginRequiredMixin, DetailView):
@require_POST
@require_POST
def
toggle_use_gravatar
(
request
,
**
kwargs
):
def
toggle_use_gravatar
(
request
,
**
kwargs
):
user
=
get_object_or_404
(
User
,
pk
=
kwargs
[
'pk
'
])
user
=
get_object_or_404
(
User
,
username
=
kwargs
[
'username
'
])
if
not
request
.
user
==
user
:
if
not
request
.
user
==
user
:
raise
PermissionDenied
()
raise
PermissionDenied
()
...
...
This diff is collapsed.
Click to expand it.
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