Project

General

Profile

Feature #43969 » 0001-Add-icons-to-add-links-in-the-issue-view-s-Subtasks-.patch

Go MAEDA, 2026-04-18 10:20

View differences:

app/assets/images/icons.svg
287 287
      <path d="M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464"/>
288 288
      <path d="M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463"/>
289 289
    </symbol>
290
    <symbol viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" id="icon--link-add">
291
      <path d="M9 15l6 -6"/>
292
      <path d="M11 6l.463 -.536a5 5 0 0 1 7.072 0a4.993 4.993 0 0 1 -.001 7.072"/>
293
      <path d="M12.603 18.534a5.07 5.07 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463"/>
294
      <path d="M16 19h6"/>
295
      <path d="M19 16v6"/>
296
    </symbol>
290 297
    <symbol viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" id="icon--link-break">
291 298
      <path d="M9 15l3 -3m2 -2l1 -1"/>
292 299
      <path d="M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464"/>
app/helpers/application_helper.rb
368 368
  end
369 369

  
370 370
  def toggle_link(name, id, options={})
371
    html_options = options.slice(:class)
371 372
    onclick = "$('##{id}').toggle(); "
372 373
    onclick << (options[:focus] ? "$('##{options[:focus]}:visible').focus(); " : "this.blur(); ")
373 374
    onclick << "$(window).scrollTop($('##{options[:focus]}').position().top); " if options[:scroll]
374 375
    onclick << "return false;"
375
    link_to(name, "#", :onclick => onclick)
376
    link_to(name, "#", html_options.merge(:onclick => onclick))
376 377
  end
377 378

  
378 379
  def link_to_previous_month(year, month, options={})
app/helpers/issues_helper.rb
295 295

  
296 296
  # Returns a link for adding a new subtask to the given issue
297 297
  def link_to_new_subtask(issue)
298
    link_to(l(:button_add), url_for_new_subtask(issue))
298
    link_to(sprite_icon('add', l(:button_add)), url_for_new_subtask(issue), :class => 'icon icon-add')
299 299
  end
300 300

  
301 301
  def url_for_new_subtask(issue)
app/views/issues/_relations.html.erb
1 1
<div class="contextual">
2 2
<% if User.current.allowed_to?(:manage_issue_relations, @project) %>
3
  <%= toggle_link l(:button_add), 'new-relation-form', {:focus => 'relation_issue_to_id'} %>
3
  <%= toggle_link sprite_icon('link-add', l(:button_add)), 'new-relation-form', {:focus => 'relation_issue_to_id', :class => 'icon icon-link-add'} %>
4 4
<% end %>
5 5
</div>
6 6

  
config/icon_source.yml
250 250
  svg: movie
251 251
- name: file-music
252 252
  svg: file-music
253
- name: link-add
254
  svg: link-plus
test/functional/issues_controller_test.rb
2274 2274
        assert_select 'textarea[name=?]', 'issue[notes]'
2275 2275
      end
2276 2276
    end
2277
    # Add links for subtasks and related issues
2278
    assert_select 'div#issue_tree div.contextual a.icon.icon-add', :text => /Add/
2279
    assert_select 'div#relations div.contextual a.icon.icon-link-add', :text => /Add/
2277 2280
  end
2278 2281

  
2279 2282
  def test_show_should_display_attachment_icons_by_mime_type
(2-2/2)