Permalink
Browse files

Merge pull request #191 from zalun/read_only

switching read_only mode
  • Loading branch information...
2 parents 16a10f8 + 00e20cf commit f25a60aaa559ba6b4018ec0923974b0252824d0c @clouserw clouserw committed Dec 5, 2013
@@ -3,6 +3,7 @@ <h1 id="flightdeck-logo"><a title="Mozilla Labs &minus; Add-on Builder" href="{{
<a id="brand" title="Mozilla" href="http://www.mozilla.com/en-US/">Mozilla</a>
<nav>
<ul>
+ {% if (not waffle.switch("read_only")) %}
<li>
<span>Create &#9662;</span>
<div class="pointytip">
@@ -13,9 +14,12 @@ <h1 id="flightdeck-logo"><a title="Mozilla Labs &minus; Add-on Builder" href="{{
</ul>
</div>
</li>
+ {% endif %}
+ {# search is broken
<li {% if page == "search" %}class="active"{% endif %}>
<span><a title="Search" href="{{ url('search') }}">Search</a></span>
</li>
+ #}
{#<li {% if page == "packages" %}class="active"{% endif %}><span><a title="Package Browser" href="{{ url('jp_browser_addons') }}">Package Browser</a></span></li>#}
<li><span><a title="Documentation" href="https://addons.mozilla.org/en-US/developers/docs/sdk/latest/" target="new">Docs</a></span></li>
{% if user.is_authenticated() %}
@@ -1,9 +1,9 @@
<li class="UI_Edit_Version {% if item.is_library and not user == item.author %}single{% endif %}">
<a title="View {{ item.full_name }}" href="{{ item.get_latest_url()}}">
- {% if user == item.author %}Edit{% else %}View{% endif %}</a>
+ {% if ((not waffle.switch('read_only')) and (user == item.author)) %}Edit{% else %}View{% endif %}</a>
</li>
-{% if user == item.author %}
+{% if ((not waffle.switch('read_only')) and (user == item.author)) %}
<li class="UI_Delete">
<a title="Once and for all" href="{{ item.get_delete_url()}}">
Delete
View
@@ -8,6 +8,7 @@
import tempfile
import urllib2
import time
+import waffle
from simplejson import JSONDecodeError
from statsd import statsd
@@ -111,7 +112,7 @@ def view_or_edit(request, pk=None, id_number=None, type_id=None,
revision = get_package_revision(pk, id_number, type_id,
revision_number, version_name, latest)
- edit_available = True
+ edit_available = not waffle.switch_is_active('read_only')
if revision.package.deleted:
edit_available = False
if not request.user.is_authenticated():

0 comments on commit f25a60a

Please sign in to comment.