Show the Save button only if it useful
authorSimo Sorce <simo@redhat.com>
Tue, 27 May 2014 20:13:28 +0000 (16:13 -0400)
committerSimo Sorce <simo@redhat.com>
Thu, 29 May 2014 13:49:14 +0000 (09:49 -0400)
If the user cannot perform any action there is no reason to show the
save button.

Signed-off-by: Simo Sorce <simo@redhat.com>
templates/admin/providers/saml2_sp.html

index 50d38ed..0b7385b 100644 (file)
             </div>
         {% endif %}
 
-        <button id="submit" class="btn btn-primary" name="submit" type="submit" value="Submit">
-            Save
-        </button>
-        <a href="{{ backurl }}" class="btn btn-default" title="Back">Back</a>
+        {% if user.name == data.owner or user.is_admin %}
+            <button id="submit" class="btn btn-primary" name="submit" type="submit" value="Submit">
+                Save
+            </button>
+        {% endif %}
+            <a href="{{ backurl }}" class="btn btn-default" title="Back">Back</a>
         </form>
     </div>
 {% endblock %}