Project

General

Profile

Feature #28829 » Add-context-menu-icon-on-issue.patch

Mizuki ISHIKAWA, 2018-05-22 03:35

View differences:

app/views/issues/_action_menu.html.erb
4 4
<%= watcher_link(@issue, User.current) %>
5 5
<%= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'icon icon-copy' if User.current.allowed_to?(:copy_issues, @project) && Issue.allowed_target_projects.any? %>
6 6
<%= link_to l(:button_delete), issue_path(@issue), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'icon icon-del' if @issue.deletable? %>
7
</div>
7
<%= form_tag({}, :data => {:cm_url => issues_context_menu_path}) do %>
8
  <span class="hascontextmenu icon-only-context-menu">
9
    <%= check_box_tag("ids[]", @issue.id, false, :style => 'display:none;', :id => nil) %>
10
    <%= link_to_context_menu %>
11
  </span>
12
<% end %>
13
</div>
public/stylesheets/application.css
435 435
.contextual .icon {padding-top: 2px; padding-bottom: 3px;}
436 436
.contextual input, .contextual select {font-size:0.9em;}
437 437
.message .contextual { margin-top: 0; }
438
.contextual span.hascontextmenu.icon-only-context-menu { background-color: transparent !important; }
438 439

  
439 440
.splitcontent {overflow:auto;}
440 441
.splitcontentleft, #list-left {float:left; width:49%;}
test/functional/issues_controller_test.rb
1573 1573
      end
1574 1574
    end
1575 1575
    assert_select 'title', :text => "Bug #1: Cannot print recipes - eCookbook - Redmine"
1576

  
1577
    # Assert action_menu on issue
1578
    assert_select 'div.contextual' do
1579
      assert_select 'a[href=?]', '/issues/1/edit'
1580
      assert_select "form[data-cm-url=?]", '/issues/context_menu' do
1581
        assert_select 'span[class=?]', 'hascontextmenu icon-only-context-menu'
1582
      end
1583
    end
1576 1584
  end
1577 1585

  
1578 1586
  def test_show_by_manager
......
1596 1604
        assert_select 'textarea[name=?]', 'issue[notes]'
1597 1605
      end
1598 1606
    end
1607

  
1608
    # Assert action_menu on issue
1609
    assert_select "div.contextual" do
1610
      assert_select 'a[href=?]', '/issues/1/edit'
1611
      assert_select 'a[href=?]', '/issues/1/time_entries/new'
1612
      assert_select 'a[href=?]', '/watchers/watch?object_id=1&object_type=issue'
1613
      assert_select 'a[href=?]', '/projects/ecookbook/issues/1/copy'
1614
      assert_select 'a[href=?][data-method=?]', '/issues/1', 'delete'
1615
      assert_select 'form[data-cm-url=?]', '/issues/context_menu' do
1616
        assert_select 'span[class=?]', 'hascontextmenu icon-only-context-menu'
1617
      end
1618
    end
1599 1619
  end
1600 1620

  
1601 1621
  def test_show_should_display_update_form
(2-2/9)