-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 2016-08-mn-report-comments
- Loading branch information
Showing
46 changed files
with
562 additions
and
70 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Opin: A youth participation platform | ||
Copyright (C) 2016 Liquid Democracy e.V. | ||
|
||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as | ||
published by the Free Software Foundation, either version 3 of the | ||
License, or (at your option) any later version. | ||
|
||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
|
||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
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 DashboardConfig(AppConfig): | ||
name = 'euth.dashboard' | ||
label = 'euth_dashboard' |
56 changes: 56 additions & 0 deletions
56
euth/dashboard/templates/euth_dashboard/base_dashboard.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,56 @@ | ||
{% extends "base.html" %} | ||
{% load i18n dashboard_templatetags %} | ||
|
||
|
||
{% block content %} | ||
<div class="container-narrow"> | ||
<div class="dashboard row"> | ||
<div class="col-md-3"> | ||
<div class="dashboard-nav"> | ||
<div class="list-group"> | ||
{% url 'dashboard-overview' as dashboard_overview %} | ||
<a href="{{ dashboard_overview }}" class="list-group-item"> | ||
<h4 class="list-group-item-heading {% selected request dashboard_overview %}"> | ||
<i class="fa fa-home" aria-hidden="true"></i> {% trans 'Overview' %} | ||
</h4> | ||
</a> | ||
<!--<a href="#" class="list-group-item"> | ||
<h4 class="list-group-item-heading"> | ||
<i class="fa fa-rocket" aria-hidden="true"></i> Organisations | ||
</h4> | ||
</a> | ||
<a href="#" class="list-group-item"> | ||
<h4 class="list-group-item-heading"> | ||
<i class="fa fa-clone" aria-hidden="true"></i> Projects | ||
</h4> | ||
</a> | ||
<a href="#" class="list-group-item"> | ||
<h4 class="list-group-item-heading"> | ||
<i class="fa fa-check" aria-hidden="true"></i> Moderation | ||
</h4> | ||
</a> | ||
<a href="#" class="list-group-item"> | ||
<h4 class="list-group-item-heading"> | ||
<i class="fa fa-users" aria-hidden="true"></i> Users | ||
</h4> | ||
</a>--> | ||
{% url 'dashboard-profile' as dashboard_profile %} | ||
<a href="{{ dashboard_profile }}" class="list-group-item"> | ||
<h4 class="list-group-item-heading {% selected request dashboard_profile %}"> | ||
<i class="fa fa-user" aria-hidden="true"></i> {% trans 'Profile' %} | ||
</h4> | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col-md-9"> | ||
<div class="dashboard-content"> | ||
{% block dashboard_content %} | ||
{% endblock %} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
{% endblock %} |
6 changes: 6 additions & 0 deletions
6
euth/dashboard/templates/euth_dashboard/dashboard_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,6 @@ | ||
{% extends "euth_dashboard/base_dashboard.html" %} | ||
{% load i18n %} | ||
|
||
{% block dashboard_content %} | ||
<h1>{% trans 'Overview' %}</h1> | ||
{% endblock %} |
28 changes: 28 additions & 0 deletions
28
euth/dashboard/templates/euth_dashboard/profile_detail.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,28 @@ | ||
{% extends "euth_dashboard/base_dashboard.html" %} | ||
{% load widget_tweaks i18n %} | ||
|
||
{% block dashboard_content %} | ||
<h1>{% trans 'Profile' %}</h1> | ||
|
||
<div class="general-form"> | ||
<form enctype="multipart/form-data" action="{{ request.path }}" method="post"> | ||
{% csrf_token %} | ||
{{ form.media }} | ||
{% for field in form %} | ||
<div class="form-group {% if field.errors %}has-error {% endif %}"> | ||
<label>{{ field.label }}</label> | ||
{% render_field field class="form-control" %} | ||
{% if field.errors %} | ||
<span class="help-block">{{ field.errors.0 }}</span> | ||
{% endif %} | ||
</div> | ||
{% endfor %} | ||
<button type="submit" class="submit-button">{% trans 'post'%}</button> | ||
{% if mode == 'create' %} | ||
<a href="{% url 'project-detail' project.slug %}" class="cancel-button">{% trans 'cancel'%}</a> | ||
{% elif mode == 'update' %} | ||
<a href="{% url 'idea-detail' idea.slug %}" class="cancel-button">{% trans 'cancel'%}</a> | ||
{% endif %} | ||
</form> | ||
</div> | ||
{% endblock %} |
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,11 @@ | ||
from django import template | ||
|
||
register = template.Library() | ||
|
||
|
||
@register.simple_tag | ||
def selected(request, pattern): | ||
path = request.path | ||
if path == pattern: | ||
return 'selected' | ||
return '' |
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,10 @@ | ||
from django.conf.urls import url | ||
|
||
from . import views | ||
|
||
urlpatterns = [ | ||
url(r'profile/$', | ||
views.DashboardProfileView.as_view(), name='dashboard-profile'), | ||
url(r'', | ||
views.DashboardOverviewView.as_view(), name='dashboard-overview'), | ||
] |
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,23 @@ | ||
from braces.views import LoginRequiredMixin | ||
from django.shortcuts import get_object_or_404 | ||
from django.views import generic | ||
|
||
from euth.user_management import models as user_models | ||
|
||
|
||
class DashboardProfileView(LoginRequiredMixin, generic.UpdateView): | ||
|
||
model = user_models.User | ||
template_name = "euth_dashboard/profile_detail.html" | ||
fields = ['avatar', 'email'] | ||
|
||
def get_object(self): | ||
return get_object_or_404(user_models.User, pk=self.request.user.id) | ||
|
||
def get_success_url(self): | ||
return self.request.path | ||
|
||
|
||
class DashboardOverviewView(LoginRequiredMixin, generic.TemplateView): | ||
|
||
template_name = "euth_dashboard/dashboard_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
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
21 changes: 12 additions & 9 deletions
21
euth/ideas/templates/euth_ideas/includes/idea_list_tile.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 |
---|---|---|
@@ -1,32 +1,35 @@ | ||
{% load i18n thumbnail static %} | ||
<div class="idea-list-tile"> | ||
{% if idea.image %} | ||
<a href="{% url 'idea-detail' idea.slug %}" class="idea-tile-image-link col-md-2 col-sm-2 col-xs-3" style="background-size: cover; background-image: url({{ idea.image.url }});"> | ||
<a href="{% url 'idea-detail' idea.slug %}" class="idea-tile-image-link" style="background-image: url({{ idea.image.url }});"> | ||
</a> | ||
{% else %} | ||
<a href="{% url 'idea-detail' idea.slug %}" class="idea-tile-image-link col-md-2 col-sm-2 col-xs-3"> | ||
<a href="{% url 'idea-detail' idea.slug %}" class="idea-tile-image-link"> | ||
</a> | ||
{% endif %} | ||
<div class="idea-tile-body col-md-10 col-md-offset-2 col-sm-10 col-sm-offset-2 col-xs-9 col-xs-offset-3"> | ||
<div class="idea-tile-body"> | ||
<div class="row"> | ||
<div class="col-lg-8"> | ||
<div class="col-xs-8"> | ||
<h3 class="idea-tile-title"> | ||
<a href="{% url 'idea-detail' idea.slug %}"> | ||
{{ idea.name }} | ||
</a> | ||
</h3> | ||
</div> | ||
<div class="col-lg-4 pull-right idea-meta"> | ||
<!-- FIXME: votes --> | ||
<div class="col-xs-4 pull-right idea-meta"> | ||
<span class="idea-upvotes idea-meta-item">{{ idea.positive_rates }} <i class="fa fa-chevron-up" aria-hidden="true"></i></span> | ||
<span class="idea-downvotes idea-meta-item">{{ idea.negative_rates }} <i class="fa fa-chevron-down" aria-hidden="true"></i></span> | ||
<span class="idea-comments-count idea-meta-item"><i class="fa fa-comment-o" aria-hidden="true"></i> {{ idea.comments.count }}</span> | ||
</div> | ||
</div> | ||
<div class="avatar-small"> | ||
<!-- FIXME: logo --> | ||
<img src="/static/images/logo.svg" width="30" height="30" alt=""/><div class="name">{{ idea.creator.username }} <span class="idea-date"> {{ idea.created | date }}</span></div> | ||
{% if idea.creator.avatar %} | ||
<img src="{{ idea.creator.avatar | thumbnail_url:'avatar_small'}}" width="30" height="30" alt=""/> | ||
{% else %} | ||
<img src="/static/images/logo.svg" width="30" height="30" alt=""/> | ||
{% endif %} | ||
<div class="name">{{ idea.creator.username }} <span class="idea-date"> {{ idea.created | date }}</span> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
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
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
Oops, something went wrong.