]> git.ipfire.org Git - ipfire.org.git/commitdiff
wiki: Don't show watch checkbox when a page is already being watched
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 3 Dec 2018 17:54:21 +0000 (17:54 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 3 Dec 2018 17:54:21 +0000 (17:54 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/wiki/edit.html

index 1c6598a3064fa3e6b8c26807b6f64435031dc767..8bfef5d0b18aa01b4fc5c6a06e712f2a9283371c 100644 (file)
                                        </div>
                                </div>
 
-                               <div class="form-group form-check">
-                                       <input type="checkbox" class="form-check-input" name="watch" id="watch" checked>
-                                       <label class="form-check-label" for="watch">{{ _("Watch this page") }}</label>
-                               </div>
+                               {% if page and not page.is_watching(current_user) %}
+                                       <div class="form-group form-check">
+                                               <input type="checkbox" class="form-check-input" name="watch" id="watch" checked>
+                                               <label class="form-check-label" for="watch">{{ _("Watch this page") }}</label>
+                                       </div>
+                               {% end %}
 
                                <button type="submit" class="btn btn-primary btn-block">
                                        {% if page %}{{ _("Save Page") }}{% else %}{{ _("Create Page") }}{% end %}