Project

General

Profile

Actions

Feature #32629

closed

Add edit button to Wiki sidebar

Added by Go MAEDA almost 5 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Wiki
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

Description

I suggest adding "Edit" button to Wiki sidebar. The button is to edit the wiki page named "Sidebar".

You can customize the Wiki sidebar by editing the page named "Sidebar" in Redmine 1.0.0 (RC) or later (#5208). However, the feature is really difficult to find because there is no user interface that indicates the existence of the feature. There is a sentence that explains the feature in RedmineWikis, but I don't think it is enough to let many users know the feature.

The content of the wiki page named 'Sidebar' is rendered in the wiki sidebar if it exists.

It will be really easy to find the feature if "Edit" button is placed on the top of the Wiki sidebar.


Files

wiki-sidebar-edit-button@2x.png (42.2 KB) wiki-sidebar-edit-button@2x.png Go MAEDA, 2019-12-13 04:43
add-edit-button-to-wiki-sidebar.png (93 KB) add-edit-button-to-wiki-sidebar.png Takenori TAKAKI, 2019-12-15 12:29
32629.patch (1.44 KB) 32629.patch Takenori TAKAKI, 2019-12-17 05:26

Related issues

Related to Redmine - Feature #5208: Aibility to edit wiki sidebarClosed2010-03-29

Actions
Actions #1

Updated by Go MAEDA almost 5 years ago

Actions #2

Updated by Takenori TAKAKI almost 5 years ago

Wow! I didn't know that feature. . .
If users can learn that Sidebar can be customized, Wiki usage will expand!
I post a patch and Screenshot below.

diff --git a/app/views/wiki/_sidebar.html.erb b/app/views/wiki/_sidebar.html.erb
index 16e8be167..236a02a36 100644
--- a/app/views/wiki/_sidebar.html.erb
+++ b/app/views/wiki/_sidebar.html.erb
@@ -1,3 +1,7 @@
+<div class="contextual">
+  <%= link_to l(:button_edit), edit_project_wiki_page_path(@project, 'sidebar'),
+              :class => 'icon icon-edit' %>
+</div>
 <% if @wiki && @wiki.sidebar -%>
   <div class="wiki">
     <%= textilizable @wiki.sidebar.content, :text %>

Actions #3

Updated by Go MAEDA almost 5 years ago

  • Target version set to Candidate for next major release
Actions #4

Updated by Mischa The Evil almost 5 years ago

Takenori TAKAKI wrote in #note-2:

I post a patch [...]

I don't think we should display such a link when the user doesn't have sufficient permissions to add/edit that 'Sidebar' page (see r3632).

Actions #5

Updated by Go MAEDA almost 5 years ago

Mischa The Evil wrote:

I don't think we should display such a link when the user doesn't have sufficient permissions to add/edit that 'Sidebar' page (see r3632).

Users who have protect_wiki_pages permission are allowed to edit "Sidebar" page.
source:tags/4.0.5/app/models/wiki_page.rb#L60
source:tags/4.0.5/app/models/wiki_page.rb#L203

Actions #6

Updated by Mischa The Evil almost 5 years ago

Go MAEDA wrote in #note-5:

Users who have protect_wiki_pages permission are allowed to edit "Sidebar" page.

I know, but the patch posted by Takenori in #note-2 doesn't seem to be doing any check on the user having that permission whatsoever. Please let me know if I'm missing something here...

Actions #7

Updated by Go MAEDA almost 5 years ago

Mischa The Evil wrote:

Go MAEDA wrote in #note-5:

Users who have protect_wiki_pages permission are allowed to edit "Sidebar" page.

I know, but the patch posted by Takenori in #note-2 doesn't seem to be doing any check on the user having that permission whatsoever. Please let me know if I'm missing something here...

Sorry for the confusing comment. I intended to add technical details. I should have added a sentence "The patch should be updated to check the permission.".

Actions #8

Updated by Takenori TAKAKI almost 5 years ago

Mischa The Evil wrote:

I don't think we should display such a link when the user doesn't have sufficient permissions to add/edit that 'Sidebar' page (see r3632).

Thank you for pointing out the lack of permission checks.
I recreated patch ( 32629.patch ) with permission checks, based on comments from Mischa The Evil and Go Maeda.

Actions #9

Updated by Go MAEDA almost 5 years ago

  • Target version changed from Candidate for next major release to 4.2.0

LGTM. Setting the target version to 4.2.0.

Actions #10

Updated by Robert Schneider almost 5 years ago

+1

Good idea. Small suggestion: If is not already considered: What do you think about that the Sidebar page contains those three default links straight away? If it was not created yet and you click the button or go directly to the page via URL, one sees the default links in the editor. This would also allow to remove those links.

If the page does not exist then the default links will be shown. But if it is entered the first time, the page gets populated with the default links. From there on only the Sidebar page gets rendered as Sidebar. If it gets deleted, then the default links will be shown again. So there two states: show 'virtual' Sidebar with the default links or show the Sidebar wiki page.

Actions #11

Updated by Go MAEDA over 3 years ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch. Thank you.

Actions

Also available in: Atom PDF