Permalink
Browse files

Finish move to Waffle.

  • Loading branch information...
1 parent 7afd629 commit 398d26375194917b3874486123404e3eeca1a0bd James Socol committed Aug 29, 2012
@@ -1,5 +1,8 @@
-from django.core.urlresolvers import reverse
from django.conf import settings
+from django.core.urlresolvers import reverse
+
+import waffle
+
def nav(request):
menu = {
@@ -13,9 +16,10 @@ def nav(request):
],
'location' : request.path,
}
- if not settings.ALLOW_GALLERY:
+ if not waffle.is_active(request, 'allow_gallery'):
menu['menu'].pop(1)
return menu
+
def global_settings(request):
- return {'settings': settings}
+ return {'settings': settings}
@@ -1,3 +1,5 @@
+{% load waffle_tags %}
+
<section class="game" id="game-{{ game.id }}">
<div class="thumb">
{% if game.screenshot_set.all %}
@@ -14,8 +16,10 @@
{% if game.source %}
<a class="action" href="{{ game.source }}">See the source</a>
{% endif %}
- {% if game.creator == request.user and settings.ALLOW_EDITING %}
- <a class="action" href="{% url games.edit game.id %}">Edit</a>
- {% endif %}
+ {% waffle allow_editing %}
+ {% if game.creator == request.user %}
+ <a class="action" href="{% url games.edit game.id %}">Edit</a>
+ {% endif %}
+ {% endwaffle %}
</nav>
</section>
@@ -1,4 +1,5 @@
{% extends "games/base.html" %}
+{% load waffle_tags %}
{% block content %}
<h1>{{ game.name }}</h1>
@@ -12,22 +13,26 @@
</li>
{% empty %}
<li>No Screenshots Available</li>
- {% if game.creator == request.user and settings.ALLOW_EDITING %}
- <h3><a href="{% url games.edit game.id %}">Add Screenshots</a></h3>
- {% endif %}
+ {% waffle allow_editing %}
+ {% if game.creator == request.user %}
+ <h3><a href="{% url games.edit game.id %}">Add Screenshots</a></h3>
+ {% endif %}
+ {% endwaffle %}
{% endfor %}
</ul>
</section>
-
+
<section class="description">
<ul class="links">
<li><a class="action" href="{{ game.url }}">Play the game</a></li>
{% if game.source %}
<li><a class="action" href="{{ game.source }}">See the source</a></li>
{% endif %}
- {% if game.creator == request.user and settings.ALLOW_EDITING %}
- <li><a class="action" href="{% url games.edit game.id %}">Edit</a></li>
- {% endif %}
+ {% waffle allow_editing %}
+ {% if game.creator == request.user %}
+ <li><a class="action" href="{% url games.edit game.id %}">Edit</a></li>
+ {% endif %}
+ {% endwaffle %}
</ul>
<h2>Description</h2>
@@ -38,7 +43,7 @@
{{ game.resources|linebreaks }}
{% endif %}
</section>
-
+
{% if not game.screenshot_set.all %}
{% endif %}

0 comments on commit 398d263

Please sign in to comment.