Skip to content

Commit

Permalink
showing proposals in NGO profile
Browse files Browse the repository at this point in the history
  • Loading branch information
damian-garrido committed Jun 5, 2017
1 parent 5f2c434 commit 22f316c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
19 changes: 14 additions & 5 deletions organization_profiles/templates/organization_detail_view.hbs
Expand Up @@ -55,10 +55,19 @@
</div>
</div>
<!-- propuestas -->
{{#if proposals }}
<div class="">
<div class="container">

<div class="container">
{{#if proposals}}
<h3 class="page-header">Propuestas</h3>
<div class="row">
{{#each proposals }}
<div class="col-md-4">
{{{card}}}
</div>
{{/each}}
</div>
</div>
{{else}}
{{#if is_owner}}
<p>Comienza a generar tus propuestas en el siguiente <a href="{{create_proposal_url}}">enlace</a></p>
{{/if}}
{{/if}}
</div>
1 change: 1 addition & 0 deletions organization_profiles/views.py
Expand Up @@ -72,6 +72,7 @@ def render_to_response(self, context, **kwargs):
context['is_owner'] = self.request.user == self.object
if context['is_owner']:
context['update_url'] = reverse('organization_profiles:update')
context['create_proposal_url'] = reverse('popular_proposals:propose_wizard_full_without_area')
if self.object.organization_template.content:
return self.response_class(self.object.organization_template.content,
context)
Expand Down
5 changes: 4 additions & 1 deletion popular_proposal/models.py
Expand Up @@ -17,6 +17,7 @@
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from django.core.mail import mail_admins
from django.template.loader import get_template


class NeedingModerationManager(models.Manager):
Expand Down Expand Up @@ -198,7 +199,9 @@ def get_absolute_url(self):

@property
def card(self):
return "La Fiera es muy linda"
return get_template("popular_proposal/popular_proposal_card.html").render({
'proposal': self
})

def notify_candidates_of_new(self):
if not (settings.NOTIFY_CANDIDATES and settings.NOTIFY_CANDIDATES_OF_NEW_PROPOSAL):
Expand Down

0 comments on commit 22f316c

Please sign in to comment.