Skip to content

Commit

Permalink
Hiding edit UI when submissions/editing is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
potch committed Jan 10, 2011
1 parent 8a99a25 commit a68a7e6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion apps/games/templates/games/mine.html
Expand Up @@ -8,7 +8,9 @@ <h1>My Games</h1>
<h2><a href="{{ game.get_absolute_url }}">{{ game.name }}</a></h2>
<p>{{ game.description|truncatewords_html:40 }}</p>
<ul class="links">
<li><a href="{% url games.edit game.id %}">Edit</a></li>
{% if settings.ALLOW_EDITING %}
<li><a href="{% url games.edit game.id %}">Edit</a></li>
{% endif %}
<li><a href="{{ game.url }}">Play</a></li>
{% if game.source %}
<li><a href="{{ game.source }}">See the source</a></li>
Expand All @@ -19,5 +21,7 @@ <h2><a href="{{ game.get_absolute_url }}">{{ game.name }}</a></h2>
<h2>You haven't submitted any games yet.</h2>
{% endfor %}
</article>
{% if settings.ALLOW_SUBMISSIONS %}
<h3><a href='{% url games.create %}'>Submit a new game</a></h3>
{% endif %}
{% endblock %}
4 changes: 2 additions & 2 deletions apps/games/templates/games/view.html
Expand Up @@ -12,7 +12,7 @@ <h2>Screenshots</h2>
</li>
{% empty %}
<li>No Screenshots Available</li>
{% if game.creator == request.user %}
{% if game.creator == request.user and settings.ALLOW_EDITING %}
<h3><a href="{% url games.edit game.id %}">Add Screenshots</a></h3>
{% endif %}
{% endfor %}
Expand All @@ -25,7 +25,7 @@ <h3><a href="{% url games.edit game.id %}">Add Screenshots</a></h3>
{% if game.source %}
<li><a href="{{ game.source }}">See the source</a></li>
{% endif %}
{% if game.creator == request.user %}
{% if game.creator == request.user and settings.ALLOW_EDITING %}
<li><a href="{% url games.edit game.id %}">Edit</a></li>
{% endif %}
</ul>
Expand Down
2 changes: 2 additions & 0 deletions apps/static/templates/static/home.html
Expand Up @@ -8,9 +8,11 @@ <h1 class="home-title">&lt;&#x200a;GAME_ON&#x200a;&gt;</h1>
<div class="home-message">
{% flatblock "home" 3600 %}
</div>
{% if settings.ALLOW_SUBMISSIONS %}
<div class="button">
<a href="{% url games.create %}"><br>ENTER NOW</a>
</div>
{% endif %}
<img class="header-left" src="{{ MEDIA_URL }}img/ships-ani.png">
<img class="header-right" src="{{ MEDIA_URL }}img/raygun.png">
{% endblock %}
2 changes: 2 additions & 0 deletions templates/base.html
Expand Up @@ -25,7 +25,9 @@
<section id="auth">
{% if user.is_authenticated %}
signed in as {{ user.username }} |
{% if settings.ALLOW_SUBMISSIONS or user.game_set.all %}
<a href="{% url games.mine %}">your games</a>|
{% endif %}
<a href="{% url auth_logout %}?next=/">logout</a>
{% else %}
<a class="login" href="{% url auth_login %}">login</a>
Expand Down

0 comments on commit a68a7e6

Please sign in to comment.