diff --git a/popular_proposal/views/proposal_views.py b/popular_proposal/views/proposal_views.py index 185464db..b5044004 100644 --- a/popular_proposal/views/proposal_views.py +++ b/popular_proposal/views/proposal_views.py @@ -53,6 +53,7 @@ ProposalTemporaryData,) from votainteligente.view_mixins import EmbeddedViewBase +import random class ProposalCreationView(FormView): @@ -207,6 +208,11 @@ class HomeView(EmbeddedViewBase, ProposalFilterMixin, FilterView): filterset_class = ProposalGeneratedAtFilter context_object_name = 'popular_proposals' + def get_context_data(self, **kwargs): + context = super(HomeView, self).get_context_data(**kwargs) + context['form_type'] = random.randint(0,1) + return context + class ProposalsPerArea(EmbeddedViewBase, ProposalFilterMixin, ListView): template_name = 'popular_proposal/area.html' diff --git a/votai_general_theme/templates/popular_proposal/_filter_form.html b/votai_general_theme/templates/popular_proposal/_filter_form.html new file mode 100644 index 00000000..2dc16b2f --- /dev/null +++ b/votai_general_theme/templates/popular_proposal/_filter_form.html @@ -0,0 +1,68 @@ +{% load i18n %} +{% load bootstrap3 %} + +{% if form %} +
+
+ {% include 'modal.html' with modalId='subscribeToSearch' title='Mantente al dia con tus tematicas de interes' %} + + {% if form.is_filled_search %} + + {% endif %} + + +
+
+ +{% endif %} \ No newline at end of file diff --git a/votai_general_theme/templates/popular_proposal/_filter_tag_form.html b/votai_general_theme/templates/popular_proposal/_filter_tag_form.html new file mode 100644 index 00000000..2b90d19f --- /dev/null +++ b/votai_general_theme/templates/popular_proposal/_filter_tag_form.html @@ -0,0 +1,41 @@ + +
+

Te invitamos a filtar y encontrar propuestas ciudadanas en las siguientes áreas

+ +
+ \ No newline at end of file diff --git a/votai_general_theme/templates/popular_proposal/_lista_propuestas.html b/votai_general_theme/templates/popular_proposal/_lista_propuestas.html index dac30cff..1f086ef3 100644 --- a/votai_general_theme/templates/popular_proposal/_lista_propuestas.html +++ b/votai_general_theme/templates/popular_proposal/_lista_propuestas.html @@ -16,70 +16,10 @@ $('[data-toggle="tooltip"]').tooltip(); }); -{% if form %} -
-
- {% include 'modal.html' with modalId='subscribeToSearch' title='Mantente al dia con tus tematicas de interes' %} - - {% if form.is_filled_search %} - - {% endif %} - - -
-
- +{% if form_type %} + {% include 'popular_proposal/_filter_form.html' %} +{% else %} + {% include 'popular_proposal/_filter_tag_form.html' %} {% endif %}