Skip to content

Commit

Permalink
Merge pull request #2129 from akvo/#2113-private-results
Browse files Browse the repository at this point in the history
[#2113] Show results framework for private projects as well
  • Loading branch information
damienallen committed May 3, 2016
2 parents 4ae18da + 98f490f commit edfa28c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion akvo/rest/views/typeahead.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def typeahead_user_projects(request):
def typeahead_impact_projects(request):
user = request.user
projects = Project.objects.all() if user.is_admin or user.is_superuser else user.my_projects()
projects = projects.published().filter(is_impact_project=True, is_public=True).order_by('title')
projects = projects.published().filter(is_impact_project=True).order_by('title')

return Response(
rejig(projects, TypeaheadProjectSerializer(projects, many=True))
Expand Down
13 changes: 6 additions & 7 deletions akvo/templates/myrsr/my_projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
</tr>
</thead>
{% for project in page %}
<tr class="{% if not project.is_public %}isPrivate{% elif not project.is_published %}notPublished{% endif %}">
<tr class="{% if not project.is_published %}notPublished{% elif not project.is_public %}isPrivate{% endif %}">
<td class="media">
<a class="pull-left" href="{% url 'project-main' project.id %}">
{% img project 64 64 project.title %}
Expand All @@ -56,10 +56,10 @@ <h4 class="media-heading">{% if project.title %}{{ project.title }}{% else %}&lt
</a>
<p class="small">{{ project.subtitle }}</p>
</div>
{% if not project.is_public %}
<span class="privatePjt">{% trans 'Private' %}</span>
{% elif not project.is_published %}
{% if not project.is_published %}
<span class="unplubishedPjt">{% trans 'Unpublished' %}</span>
{% elif not project.is_public %}
<span class="privatePjt">{% trans 'Private' %}</span>
{% endif %}
</td>
<td><i class="fa fa-tag"></i> {% for validation in project.validations.all %}{{ validation.name }}{% if not forloop.last %} + {% endif %}{% endfor %} {% trans 'project' %}</td>
Expand All @@ -71,14 +71,13 @@ <h4 class="media-heading">{% if project.title %}{{ project.title }}{% else %}&lt
{% has_perm 'rsr.change_project' user project as can_edit_project %}
{% if can_edit_project %}
<li><a href="{% url 'project_editor' project.pk %}">{% trans 'Edit' %}</a></li>
{% if project.is_impact_project and project.is_published and project.is_public %}
{% if project.is_impact_project and project.is_published %}
<li><a href="{% url 'my_results' project.pk %}">{% trans 'Results data' %}</a></li>
{% else %}
<li><a class="addUpdate disabled" title="{% trans "Can't update a private or unpublished project" %}">{% trans 'Results data' %}</a></li>
<li><a class="addUpdate disabled" title="{% trans "Can't update an unpublished project" %}">{% trans 'Results data' %}</a></li>
{% endif %}
{% endif %}
{% if project.is_published and project.is_public %}
{% has_perm 'rsr.post_updates' project as can_add_update %}
<li><a href="{% url 'add-update' project.pk %}">{% trans 'Update' %}</a></li>
{% else %}
<li> <a class="addUpdate disabled" title="{% trans "Can't update a private or unpublished project" %}"> {% trans "Update" %} </a></li>
Expand Down

0 comments on commit edfa28c

Please sign in to comment.