[extensions-web] Don't show the inline editing field when the user doesn't have permissions



commit 887a3c921682a79eb76f1af6eb5c10875aec91d3
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sun Dec 18 18:51:01 2011 -0500

    Don't show the inline editing field when the user doesn't have permissions

 .../extensions/templates/extensions/detail.html    |    2 +-
 .../templates/extensions/detail_edit.html          |    2 ++
 sweettooth/static/js/main.js                       |    2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/sweettooth/extensions/templates/extensions/detail.html b/sweettooth/extensions/templates/extensions/detail.html
index a59f948..62b39a8 100644
--- a/sweettooth/extensions/templates/extensions/detail.html
+++ b/sweettooth/extensions/templates/extensions/detail.html
@@ -22,7 +22,7 @@
 {% block extra-body-header %}
 {% endblock %}
 
-    <div class="extension single-page"
+    <div class="extension single-page {% block extra-ext-class %}{% endblock %}"
          data-epk="{{ extension.pk }}"
          data-uuid="{{ extension.uuid }}"
          data-ver-url-base="{% url extensions-version-detail ext_pk=extension.pk slug=extension.slug pk='' %}"
diff --git a/sweettooth/extensions/templates/extensions/detail_edit.html b/sweettooth/extensions/templates/extensions/detail_edit.html
index 843cd7b..e0dbd15 100644
--- a/sweettooth/extensions/templates/extensions/detail_edit.html
+++ b/sweettooth/extensions/templates/extensions/detail_edit.html
@@ -119,3 +119,5 @@
   <input type="file" accept="image/*">
 </div>
 {% endblock %}
+
+{% block extra-ext-class %}editable{% endblock %}
diff --git a/sweettooth/static/js/main.js b/sweettooth/static/js/main.js
index 5e591cc..14998cb 100644
--- a/sweettooth/static/js/main.js
+++ b/sweettooth/static/js/main.js
@@ -134,7 +134,7 @@ require(['jquery', 'messages', 'extensions', 'uploader',
 
         $('div.extension').checkForUpdates();
 
-        var pk = $('.extension.single-page').data('epk');
+        var pk = $('.extension.single-page.editable').data('epk');
         if (pk) {
             var inlineEditURL = '/ajax/edit/' + pk;
             $('#extension_name, #extension_url').csrfEditable(inlineEditURL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]