Skip to content

Commit

Permalink
Fixes #154 search result page and profile pages now do not contain da…
Browse files Browse the repository at this point in the history
…shboard links
  • Loading branch information
fallen committed Aug 18, 2019
1 parent 048c2eb commit daa4825
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 33 deletions.
47 changes: 24 additions & 23 deletions pytition/petition/templates/petition/org_profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,33 @@
<h2>{{org.name }} </h2>
</div>
<div class="row mt-3">
{% for petition in petitions %}
<div class="col-md-4 col-xs-6 text-center sb-preview">
<div class="card h-100">
<a href="#" class="sb-preview-img">
{% if not petition.twitter_image%}
<img class="card-img-top img-fluid img-thumbnail" src="{% static settings.DEFAULT_INDEX_THUMBNAIL %}">
{% else %}
<img class="card-img-top img-fluid img-thumbnail" src="{{ petition.twitter_image }}">
{% endif %}
</a>
<div class="card-body d-flex flex-column">
<h4 class="card-title">{{ petition.title|striptags }}</h4>
<p class="card-text">{{ petition.twitter_description|safe }}</p>
<div class="card-footer mt-auto">
<a href="{{ petition.url }}" class="btn btn-success">
{% trans "Sign!" %} <span class="badge badge-info">{{ petition.signature_number }}</span>
</a>
</div>
</div>
</div>
{% for petition in petitions %}
<div class="col-md-4 col-xs-6 text-center sb-preview">
<div class="card h-100 text-center">
<a href="{{ petition.url }}" class="sb-preview-img">
{% if not petition.twitter_image%}
<img class="card-img-top img-fluid img-thumbnail" src="{% static settings.DEFAULT_INDEX_THUMBNAIL %}">
{% else %}
<img class="card-img-top img-fluid img-thumbnail" src="{{ petition.twitter_image }}">
{% endif %}
</a>
<div class="card-body">
<div href="" class="text-muted">{{ petition.owner }}</div>
<h4 class="card-title"><a href="{{ petition.url }}">{{ petition.title|striptags }}</a></h4>
{% if petition.twitter_description %}
<p class="card-text">{{ petition.twitter_description|safe }}</p>
{% endif %}
<a href="{{ petition.url }}" class="btn btn-secondary btn-sm">{% trans "Sign!" %}</a>
</div>
{% if forloop.counter|divisibleby:3 or forloop.last %}
<div class="card-footer">
<small class="text-muted">{{ petition.signature_number }} signatures</small>
</div>
</div>
</div>
{% if forloop.counter|divisibleby:3 or forloop.last %}
</div>
<p></p>
<div class="row">
{% endif %}
{% endif %}
{% endfor %}
</div>
</div>
Expand Down
32 changes: 31 additions & 1 deletion pytition/petition/templates/petition/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,37 @@ <h3>Organizations</h3>
</div>
{% endif %}
<div>
{% include "petition/petition_list.html" with petitions=petitions.all title=_("Petitions") no_petition_msg=_("No result.") search=True %}

<div class="row">
{% for petition in petitions %}
<div class="col-md-4 col-xs-6 text-center sb-preview">
<div class="card h-100 text-center">
<a href="{{ petition.url }}" class="sb-preview-img">
{% if not petition.twitter_image%}
<img class="card-img-top img-fluid img-thumbnail" src="{% static settings.DEFAULT_INDEX_THUMBNAIL %}">
{% else %}
<img class="card-img-top img-fluid img-thumbnail" src="{{ petition.twitter_image }}">
{% endif %}
</a>
<div class="card-body">
<div href="" class="text-muted">{{ petition.owner }}</div>
<h4 class="card-title"><a href="{{ petition.url }}">{{ petition.title|striptags }}</a></h4>
{% if petition.twitter_description %}
<p class="card-text">{{ petition.twitter_description|safe }}</p>
{% endif %}
<a href="{{ petition.url }}" class="btn btn-secondary btn-sm">{% trans "Sign!" %}</a>
</div>
<div class="card-footer">
<small class="text-muted">{{ petition.signature_number }} signatures</small>
</div>
</div>
</div>
{% if forloop.counter|divisibleby:3 or forloop.last %}
</div>
<div class="row">
{% endif %}
{% endfor %}
</div>
</diV>
</div>
{% endblock main_content %}
Expand Down
21 changes: 12 additions & 9 deletions pytition/petition/templates/petition/user_profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,25 @@ <h2>{{user.name }} </h2>
{% if petitions|length > 0 %}
{% for petition in petitions %}
<div class="col-md-4 col-xs-6 text-center sb-preview">
<div class="card h-100">
<a href="#" class="sb-preview-img">
<div class="card h-100 text-center">
<a href="{{ petition.url }}" class="sb-preview-img">
{% if not petition.twitter_image%}
<img class="card-img-top img-fluid img-thumbnail" src="{% static settings.DEFAULT_INDEX_THUMBNAIL %}">
{% else %}
<img class="card-img-top img-fluid img-thumbnail" src="{{ petition.twitter_image }}">
{% endif %}
</a>
<div class="card-body d-flex flex-column">
<h4 class="card-title">{{ petition.title|striptags }}</h4>
<div class="card-body">
<div href="" class="text-muted">{{ petition.owner }}</div>
<h4 class="card-title"><a href="{{ petition.url }}">{{ petition.title|striptags }}</a></h4>
{% if petition.twitter_description %}
<p class="card-text">{{ petition.twitter_description|safe }}</p>
<div class="card-footer mt-auto">
<a href="{{ petition.url }}" class="btn btn-success">
{% trans "Sign!" %} <span class="badge badge-info">{{ petition.signature_number }}</span>
</a>
</div>
{% endif %}
<a href="{{ petition.url }}" class="btn btn-secondary btn-sm">{% trans "Sign!" %}</a>
</div>
<div class="card-footer">
<small class="text-muted">{{ petition.signature_number }} signatures</small>
</div>
</div>
</div>
</div>
Expand Down

0 comments on commit daa4825

Please sign in to comment.