https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292019-12-13T07:09:30ZRedmineRedmine - Feature #32629: Add edit button to Wiki sidebarhttps://www.redmine.org/issues/32629?journal_id=953102019-12-13T07:09:30ZGo MAEDA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/issues/5208">Feature #5208</a>: Aibility to edit wiki sidebar</i> added</li></ul> Redmine - Feature #32629: Add edit button to Wiki sidebarhttps://www.redmine.org/issues/32629?journal_id=953362019-12-15T11:30:31ZTakenori TAKAKItakenory@gmail.com
<ul><li><strong>File</strong> <a href="/attachments/24461">add-edit-button-to-wiki-sidebar.png</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/24461/add-edit-button-to-wiki-sidebar.png">add-edit-button-to-wiki-sidebar.png</a> added</li></ul><p>Wow! I didn't know that feature. . .<br />If users can learn that Sidebar can be customized, Wiki usage will expand!<br />I post a patch and Screenshot below.</p>
<pre><code class="diff syntaxhl"><span class="gh">diff --git a/app/views/wiki/_sidebar.html.erb b/app/views/wiki/_sidebar.html.erb
index 16e8be167..236a02a36 100644
</span><span class="gd">--- a/app/views/wiki/_sidebar.html.erb
</span><span class="gi">+++ b/app/views/wiki/_sidebar.html.erb
</span><span class="p">@@ -1,3 +1,7 @@</span>
<span class="gi">+<div class="contextual">
+ <%= link_to l(:button_edit), edit_project_wiki_page_path(@project, 'sidebar'),
+ :class => 'icon icon-edit' %>
+</div>
</span> <% if @wiki && @wiki.sidebar -%>
<div class="wiki">
<%= textilizable @wiki.sidebar.content, :text %>
</code></pre>
<p><img src="https://www.redmine.org/attachments/download/24461/add-edit-button-to-wiki-sidebar.png" alt="" /></p> Redmine - Feature #32629: Add edit button to Wiki sidebarhttps://www.redmine.org/issues/32629?journal_id=953382019-12-15T11:53:32ZGo MAEDA
<ul><li><strong>Target version</strong> set to <i>Candidate for next major release</i></li></ul> Redmine - Feature #32629: Add edit button to Wiki sidebarhttps://www.redmine.org/issues/32629?journal_id=953392019-12-15T13:30:38ZMischa The Evil
<ul></ul><p>Takenori TAKAKI wrote in <a href="#note-2">#note-2</a>:</p>
<blockquote>
<p>I post a patch [...]</p>
</blockquote>
<p>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 <a class="changeset" title="Makes the wiki sidebar editable (#5208). The content of the wiki page named 'Sidebar' is rendered..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/3632">r3632</a>).</p> Redmine - Feature #32629: Add edit button to Wiki sidebarhttps://www.redmine.org/issues/32629?journal_id=953442019-12-16T04:32:41ZGo MAEDA
<ul></ul><p>Mischa The Evil wrote:</p>
<blockquote>
<p>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 <a class="changeset" title="Makes the wiki sidebar editable (#5208). The content of the wiki page named 'Sidebar' is rendered..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/3632">r3632</a>).</p>
</blockquote>
<p>Users who have protect_wiki_pages permission are allowed to edit "Sidebar" page.<br /><a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/entry/tags/4.0.5/app/models/wiki_page.rb#L60">source:tags/4.0.5/app/models/wiki_page.rb#L60</a><br /><a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/entry/tags/4.0.5/app/models/wiki_page.rb#L203">source:tags/4.0.5/app/models/wiki_page.rb#L203</a></p> Redmine - Feature #32629: Add edit button to Wiki sidebarhttps://www.redmine.org/issues/32629?journal_id=953452019-12-16T04:58:08ZMischa The Evil
<ul></ul><p>Go MAEDA wrote in <a href="#note-5">#note-5</a>:</p>
<blockquote>
<p>Users who have protect_wiki_pages permission are allowed to edit "Sidebar" page.</p>
</blockquote>
<p>I know, but the patch posted by Takenori in <a href="#note-2">#note-2</a> 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...</p> Redmine - Feature #32629: Add edit button to Wiki sidebarhttps://www.redmine.org/issues/32629?journal_id=953462019-12-16T07:12:47ZGo MAEDA
<ul></ul><p>Mischa The Evil wrote:</p>
<blockquote>
<p>Go MAEDA wrote in <a href="#note-5">#note-5</a>:</p>
<blockquote>
<p>Users who have protect_wiki_pages permission are allowed to edit "Sidebar" page.</p>
</blockquote>
<p>I know, but the patch posted by Takenori in <a href="#note-2">#note-2</a> 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...</p>
</blockquote>
<p>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.".</p> Redmine - Feature #32629: Add edit button to Wiki sidebarhttps://www.redmine.org/issues/32629?journal_id=953512019-12-17T04:30:56ZTakenori TAKAKItakenory@gmail.com
<ul><li><strong>File</strong> <a href="/attachments/24475">32629.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/24475/32629.patch">32629.patch</a> added</li></ul><p>Mischa The Evil wrote:</p>
<blockquote>
<p>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 <a class="changeset" title="Makes the wiki sidebar editable (#5208). The content of the wiki page named 'Sidebar' is rendered..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/3632">r3632</a>).</p>
</blockquote>
<p>Thank you for pointing out the lack of permission checks.<br />I recreated patch ( <a class="attachment" href="https://www.redmine.org/attachments/24475">32629.patch</a> ) with permission checks, based on comments from Mischa The Evil and Go Maeda.</p> Redmine - Feature #32629: Add edit button to Wiki sidebarhttps://www.redmine.org/issues/32629?journal_id=957262020-01-14T13:08:22ZGo MAEDA
<ul><li><strong>Target version</strong> changed from <i>Candidate for next major release</i> to <i>4.2.0</i></li></ul><p>LGTM. Setting the target version to 4.2.0.</p> Redmine - Feature #32629: Add edit button to Wiki sidebarhttps://www.redmine.org/issues/32629?journal_id=963312020-02-19T07:43:15ZRobert Schneider
<ul></ul><p>+1</p>
<p>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.</p>
<p>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.</p> Redmine - Feature #32629: Add edit button to Wiki sidebarhttps://www.redmine.org/issues/32629?journal_id=1015462021-03-26T02:19:28ZGo MAEDA
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Assignee</strong> set to <i>Go MAEDA</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Committed the patch. Thank you.</p>