-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
184 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,10 @@ | |
float: right; | ||
} | ||
|
||
.tablist--left { | ||
text-align: left; | ||
} | ||
|
||
.tablist__left { | ||
float: left; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
.userdashboard-profile__side { | ||
padding: $padding; | ||
min-height: 100%; | ||
text-align: center; | ||
border: 1px solid #dadada; | ||
} | ||
|
||
.userdashboard-profile__avatar { | ||
border-radius: 50%; | ||
shape-outside: circle(); | ||
box-shadow: 0 0 2em rgba(0, 0, 0, 0.1); | ||
position: relative; | ||
|
||
~ h2 { | ||
clear: both; | ||
} | ||
} | ||
|
||
.userdashboard-profile__main { | ||
padding: 0 $padding; | ||
} | ||
|
||
@media (min-width: $breakpoint) { | ||
/* Ensure that info sidebar is always visible in sm | ||
and above and only a tab in sm | ||
*/ | ||
|
||
.userdashboard-profile__side { | ||
display: block; | ||
padding: 2*$padding; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class Config(AppConfig): | ||
name = 'apps.userdashboard' | ||
label = 'a4_candy_userdashboard' |
50 changes: 50 additions & 0 deletions
50
apps/userdashboard/templates/a4_candy_userdashboard/base_userdashboard.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{% extends "base.html" %} | ||
{% load i18n thumbnail %} | ||
|
||
{% block content %} | ||
{% block dashboard_nav %} | ||
<div class="tablist tablist--left tablist--background"> | ||
<div class="container"> | ||
<nav class="d-none d-sm-inline-block" aria-label="{% trans 'Dashboard' %}"> | ||
<a href="{% url 'userdashboard-overview' %}" | ||
class="tab {% ifequal view.menu_item 'overview' %}active{% endifequal %}"> | ||
{% trans 'Overview' %} | ||
</a> | ||
<a href="{% url 'userdashboard-moderation' %}" | ||
class="tab {% ifequal view.menu_item 'moderation' %}active{% endifequal %}"> | ||
{% trans 'Moderation' %} | ||
</a> | ||
</nav> | ||
</div> | ||
</div> | ||
|
||
<div class="row pt-4 bg-white"> | ||
|
||
<div class="col-md-2 offset-2"> | ||
<div | ||
class="tabpanel userdashboard-profile userdashboard-profile__side" | ||
id="userdashboard-user-{{ user.pk }}-tile" | ||
role="tabpanel" | ||
aria-labelledby="userdashboard-{{ user.pk }}-tile" | ||
aria-expanded="false"> | ||
<a href="{% url 'profile' user.username %}"> | ||
{% if user.avatar %} | ||
<img class="userdashboard-profile__avatar mb-2" src="{% thumbnail user.avatar '170x170' crop %}" alt="" /> | ||
{% else %} | ||
<img class="userdashboard-profile__avatar mb-2" src="{{ user.avatar_fallback }}" width="170" height="170" alt="" /> | ||
{% endif %} | ||
</a> | ||
|
||
<h1 class="mt-0 u-word-break-all"> | ||
{{ user.username }} | ||
</h1> | ||
</div> | ||
</div> | ||
{% endblock %} | ||
|
||
<div class="col-md-6"> | ||
{% block dashboard_content %} | ||
{% endblock %} | ||
</div> | ||
</div> | ||
{% endblock %} |
3 changes: 3 additions & 0 deletions
3
apps/userdashboard/templates/a4_candy_userdashboard/userdashboard_moderation.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{% extends "a4_candy_userdashboard/base_userdashboard.html" %} | ||
|
||
{% block dashboard_content %}{% endblock %} |
3 changes: 3 additions & 0 deletions
3
apps/userdashboard/templates/a4_candy_userdashboard/userdashboard_overview.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{% extends "a4_candy_userdashboard/base_userdashboard.html" %} | ||
|
||
{% block dashboard_content %}{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from django.conf.urls import url | ||
|
||
from . import views | ||
|
||
urlpatterns = [ | ||
url(r'^overview/$', | ||
views.UserDashboardOverviewView.as_view(), | ||
name='userdashboard-overview'), | ||
url(r'^moderation/$', | ||
views.UserDashboardModerationView.as_view(), | ||
name='userdashboard-moderation'), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from django.views import generic | ||
|
||
from apps.users.models import User | ||
|
||
|
||
class UserDashboardOverviewView(generic.base.ContextMixin, | ||
generic.base.TemplateResponseMixin, | ||
generic.base.View, | ||
): | ||
|
||
model = User | ||
template_name = 'a4_candy_userdashboard/userdashboard_overview.html' | ||
menu_item = 'overview' | ||
|
||
def get(self, request): | ||
response = self.render_to_response(self.get_context_data()) | ||
return response | ||
|
||
|
||
class UserDashboardModerationView(generic.base.ContextMixin, | ||
generic.base.TemplateResponseMixin, | ||
generic.base.View): | ||
|
||
model = User | ||
template_name = 'a4_candy_userdashboard/userdashboard_moderation.html' | ||
menu_item = 'moderation' | ||
|
||
def get(self, request): | ||
response = self.render_to_response(self.get_context_data()) | ||
return response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters