-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #335 from ciudadanointeligente/proposal_detail_page
Proposal detail page
- Loading branch information
Showing
19 changed files
with
191 additions
and
44 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.9.2 on 2016-04-18 20:56 | ||
from __future__ import unicode_literals | ||
|
||
import autoslug.fields | ||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('popular_proposal', '0008_proposaltemporarydata_overall_comments'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='popularproposal', | ||
name='slug', | ||
field=autoslug.fields.AutoSlugField(default='', editable=False, populate_from='title', unique=True), | ||
), | ||
] |
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,24 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.9.2 on 2016-04-18 21:17 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations | ||
|
||
|
||
def gen_slug(apps, schema_editor): | ||
PopularProposal = apps.get_model('popular_proposal', 'PopularProposal') | ||
counter = 0 | ||
for popular_proposal in PopularProposal.objects.all(): | ||
counter += 1 | ||
popular_proposal.slug = 'proposal_{:d}'.format(counter) | ||
popular_proposal.save() | ||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('popular_proposal', '0009_popularproposal_slug'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(gen_slug, reverse_code=migrations.RunPython.noop), | ||
] |
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
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
36 changes: 36 additions & 0 deletions
36
votai_general_theme/templates/popular_proposal/_likers.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,36 @@ | ||
{% load staticfiles %} | ||
{% load votainteligente_extras %} | ||
{% load i18n %} | ||
{% load thumbnail %} | ||
{% if proposal.likers.all %} | ||
|
||
<div class="row"> | ||
<div class="col-md-12"> | ||
<div class="alert alert-success" role="alert"> | ||
<span class="badge">{{proposal.likers.count}}</span> | ||
{% blocktrans %}Ciudadanos apoyan{% endblocktrans %} | ||
</div> | ||
|
||
</div> | ||
</div> | ||
{% endif %} | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
{% if user.is_authenticated %} | ||
|
||
{% if not user|likes:proposal %} | ||
<a class="btn btn-md btn-success full-width" data-toggle="modal" data-target="#supportProposal" | ||
data-url="{% url 'popular_proposals:like_a_proposal' pk=proposal.id %}"> | ||
{% blocktrans %}Apoyar{% endblocktrans %} | ||
</span> | ||
</a> | ||
{% endif %} | ||
{% else %} | ||
<a class="btn btn-md btn-success full-width" href="{% url 'auth_login' %}"> | ||
{% blocktrans %}Apoyar{% endblocktrans %} | ||
</span> | ||
</a> | ||
|
||
{% endif%} | ||
</div> | ||
</div> |
45 changes: 45 additions & 0 deletions
45
votai_general_theme/templates/popular_proposal/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,45 @@ | ||
{% extends "base.html" %} | ||
{% load votainteligente_extras %} | ||
{% load staticfiles %} | ||
{% load i18n %} | ||
{% load thumbnail %} | ||
{% load bootstrap_tags %} | ||
{% block extrajs %} | ||
$(function(){ | ||
$('.loadFromUrl').on('show.bs.modal', function (event) { | ||
var anchor = $(event.relatedTarget) // Button that triggered the modal | ||
var modal = $(this) | ||
var body = modal.find('.modal-body'); | ||
body.load(anchor.data('url')); | ||
}) | ||
$('[data-toggle="tooltip"]').tooltip(); | ||
}); | ||
{% endblock extrajs %} | ||
|
||
{% block title %}{{popular_proposal.title}}{% endblock title%} | ||
|
||
{% block content %} | ||
{% include 'modal.html' with modalId='supportProposal' title='Apoya una propuesta' %} | ||
<div> | ||
|
||
|
||
<!-- Featured Elections --> | ||
<div class="contenedorDestacado fondo-blanco"> | ||
<h1>{{popular_proposal.title}}</h1> | ||
<div class="text-right"><a href="{% url 'area' slug=popular_proposal.area.id %}" class="btn btn-primary btn-lg">{{popular_proposal.area}}</a></div> | ||
|
||
<dl> | ||
|
||
|
||
{% for key, value in popular_proposal.data.items %} | ||
<dt>{{key|popular_proposal_question}}</dt> | ||
<dd>{{value|popular_proposal_when}}</dd> | ||
{% endfor %} | ||
</dl> | ||
</div> | ||
{% include 'popular_proposal/_likers.html' with proposal=popular_proposal %} | ||
</div> | ||
{% endblock content %} | ||
|
||
{% block extrafooter %} | ||
{% endblock extrafooter %} |
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