https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292019-02-19T13:01:56ZRedmineRedmine - Feature #30829: Simpler link syntax "#note-123" to make a link to a note of the current issuehttps://www.redmine.org/issues/30829?journal_id=902922019-02-19T13:01:56ZBernhard Rohloff
<ul></ul><p>I think it's a nice usability improvement.<br />+1</p> Redmine - Feature #30829: Simpler link syntax "#note-123" to make a link to a note of the current issuehttps://www.redmine.org/issues/30829?journal_id=902932019-02-19T13:41:07ZYuuki NARA
<ul></ul><p>+1</p> Redmine - Feature #30829: Simpler link syntax "#note-123" to make a link to a note of the current issuehttps://www.redmine.org/issues/30829?journal_id=902942019-02-19T14:06:37ZAnonymous
<ul></ul><p>+1</p> Redmine - Feature #30829: Simpler link syntax "#note-123" to make a link to a note of the current issuehttps://www.redmine.org/issues/30829?journal_id=904542019-02-27T09:20:01ZHolger Just
<ul></ul><p>Since <a class="issue tracker-3 status-5 priority-4 priority-default closed" title="Patch: Allow to link to an anchor of the current wikipage (Closed)" href="https://www.redmine.org/issues/16313">#16313</a>, you can already use <code>[[#note-123]]</code> to link to an arbitrary ID on the current page, regardless of whether this is an issue note, a wiki header, or any other id.</p>
<p>Maybe this is already sufficient?</p> Redmine - Feature #30829: Simpler link syntax "#note-123" to make a link to a note of the current issuehttps://www.redmine.org/issues/30829?journal_id=904562019-02-27T09:29:17ZGo MAEDA
<ul></ul><p>Holger Just wrote:</p>
<blockquote>
<p>Since <a class="issue tracker-3 status-5 priority-4 priority-default closed" title="Patch: Allow to link to an anchor of the current wikipage (Closed)" href="https://www.redmine.org/issues/16313">#16313</a>, you can already use <code>[[#note-123]]</code> to link to an arbitrary ID on the current page, regardless of whether this is an issue note, a wiki header, or any other id.</p>
</blockquote>
<p>Oh, I didn't know that! Thank you.</p>
<p>But my team already has a working patch. The patch will be posted soon.</p>
<p>I think <code>#note-123</code> is even more intuitive than <code>[[#note-123]]</code> because it is more consistent with the syntax <code>#98765#note-123</code>. And <code>[[#note-123]]</code> looks like a link to a Wiki page.</p> Redmine - Feature #30829: Simpler link syntax "#note-123" to make a link to a note of the current issuehttps://www.redmine.org/issues/30829?journal_id=905482019-03-04T06:59:08ZYuichi HARADA
<ul><li><strong>File</strong> <a href="/attachments/22561">30829-linkto-current-issue-note.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/22561/30829-linkto-current-issue-note.patch">30829-linkto-current-issue-note.patch</a> added</li></ul><p>+1<br />The link to a note of current issue is very easy to write.<br />I attached a patch.</p> Redmine - Feature #30829: Simpler link syntax "#note-123" to make a link to a note of the current issuehttps://www.redmine.org/issues/30829?journal_id=905552019-03-04T11:41:25ZGo MAEDA
<ul><li><strong>Target version</strong> set to <i>Candidate for next major release</i></li></ul> Redmine - Feature #30829: Simpler link syntax "#note-123" to make a link to a note of the current issuehttps://www.redmine.org/issues/30829?journal_id=906122019-03-06T03:53:16ZGo MAEDA
<ul><li><strong>Target version</strong> changed from <i>Candidate for next major release</i> to <i>4.1.0</i></li></ul><p>LGTM. Setting the target version to 4.1.0.</p> Redmine - Feature #30829: Simpler link syntax "#note-123" to make a link to a note of the current issuehttps://www.redmine.org/issues/30829?journal_id=906802019-03-10T09:08:22ZMarius BÄ‚LTEANU
<ul></ul><p>Go MAEDA wrote:</p>
<blockquote>
<p>LGTM. Setting the target version to 4.1.0.</p>
</blockquote>
<p>The patch as it is cannot be committed because we should link only to anchor and not to the entire url in order to preserve existing parameters (eg: issue_count, issue_position, etc) and to prevent issue/page reloading.</p> Redmine - Feature #30829: Simpler link syntax "#note-123" to make a link to a note of the current issuehttps://www.redmine.org/issues/30829?journal_id=906812019-03-10T09:22:57ZMarius BÄ‚LTEANU
<ul></ul><p>Maybe the below changes are enough to implement this feature:</p>
<pre><code class="diff syntaxhl"><span class="gh">diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 8fa56ac..c477169 100644
</span><span class="gd">--- a/app/helpers/application_helper.rb
</span><span class="gi">+++ b/app/helpers/application_helper.rb
</span><span class="p">@@ -949,6 +949,8 @@</span> module ApplicationHelper
:class => issue.css_classes,
:title => "#{issue.tracker.name}: #{issue.subject.truncate(100)} (#{issue.status.name})")
end
<span class="gi">+ elsif identifier == 'note'
+ link = link_to("#note-#{comment_id}", "#note-#{comment_id}")
</span> end
when 'document'
if document = Document.visible.find_by_id(oid)
<span class="p">@@ -1066,7 +1068,7 @@</span> module ApplicationHelper
)
)
(
<span class="gd">- (?<identifier1>\d+)
</span><span class="gi">+ (?<identifier1>((\d)+|(note)))
</span> (?<comment_suffix>
(\#note)?
-(?<comment_id>\d+)
</code></pre> Redmine - Feature #30829: Simpler link syntax "#note-123" to make a link to a note of the current issuehttps://www.redmine.org/issues/30829?journal_id=907982019-03-18T13:20:24ZGo MAEDA
<ul></ul><p>Test code for Marius's patch in <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Simpler link syntax "#note-123" to make a link to a note of the current issue (Closed)" href="https://www.redmine.org/issues/30829#note-10">#30829#note-10</a>.</p>
<pre><code class="diff syntaxhl"><span class="gh">diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb
index 619a9e544..8c841a081 100644
</span><span class="gd">--- a/test/helpers/application_helper_test.rb
</span><span class="gi">+++ b/test/helpers/application_helper_test.rb
</span><span class="p">@@ -28,7 +28,7 @@</span> class ApplicationHelperTest < Redmine::HelperTest
:members, :member_roles, :roles,
:repositories, :changesets,
:projects_trackers,
<span class="gd">- :trackers, :issue_statuses, :issues, :versions, :documents,
</span><span class="gi">+ :trackers, :issue_statuses, :issues, :versions, :documents, :journals,
</span> :wikis, :wiki_pages, :wiki_contents,
:boards, :messages, :news,
:attachments, :enumerations,
<span class="p">@@ -423,6 +423,14 @@</span> RAW
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text), "#{text} failed" }
end
+ def test_link_to_note_within_the_same_page
<span class="gi">+ issue = Issue.find(1)
+ assert_equal '<p><a href="#note-14">#note-14</a></p>', textilizable('#note-14', :object => issue)
+
+ journal = Journal.find(2)
+ assert_equal '<p><a href="#note-2">#note-2</a></p>', textilizable('#note-2', :object => journal)
+ end
+
</span> def test_user_links_with_email_as_login_name_should_not_be_parsed_textile
with_settings :text_formatting => 'textile' do
u = User.generate!(:login => 'jsmith@somenet.foo')
</code></pre> Redmine - Feature #30829: Simpler link syntax "#note-123" to make a link to a note of the current issuehttps://www.redmine.org/issues/30829?journal_id=908302019-03-20T05:16:41ZGo 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 for improving Redmine.</p> Redmine - Feature #30829: Simpler link syntax "#note-123" to make a link to a note of the current issuehttps://www.redmine.org/issues/30829?journal_id=908312019-03-20T05:19:13ZGo MAEDA
<ul><li><strong>Status</strong> changed from <i>Closed</i> to <i>Reopened</i></li></ul><p>Also help files (public/help/*/wiki_syntax_detailed_*.html) should be updated.</p> Redmine - Feature #30829: Simpler link syntax "#note-123" to make a link to a note of the current issuehttps://www.redmine.org/issues/30829?journal_id=908702019-03-21T13:27:50ZGo MAEDA
<ul><li><strong>File</strong> <a href="/attachments/22674">30829-help.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/22674/30829-help.patch">30829-help.patch</a> added</li></ul><p>Go MAEDA wrote:</p>
<blockquote>
<p>Also help files (public/help/*/wiki_syntax_detailed_*.html) should be updated.</p>
</blockquote>
<p>Attaching a patch for help files on behalf of <a href="/users/334743">Hinako Tajima</a>.</p> Redmine - Feature #30829: Simpler link syntax "#note-123" to make a link to a note of the current issuehttps://www.redmine.org/issues/30829?journal_id=908922019-03-23T05:58:28ZGo MAEDA
<ul><li><strong>Status</strong> changed from <i>Reopened</i> to <i>Closed</i></li></ul><p>Committed the patch for help files in <a class="changeset" title="Add a link syntax "#note-6" to help files (#30829). Contributed by Hinako Tajima." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/18002">r18002</a>.</p>