Add-context-menu-icon-on-issue-v3.patch

Mizuki ISHIKAWA, 2018-05-23 07:46

Download (3.6 KB)

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">
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 { background-color: transparent !important; }
439
.contextual span.hascontextmenu a.js-contextmenu { color: #169 !important; }
438 440

  
439 441
.splitcontent {overflow:auto;}
440 442
.splitcontentleft, #list-left {float:left; width:49%;}
public/stylesheets/responsive.css
624 624
    float: none;
625 625
  }
626 626

  
627
  .contextual span.hascontextmenu a.js-contextmenu {
628
      width: initial !important;
629
      height: initial !important;
630
      margin-top: 3px !important;
631
      padding-left: 25px !important;
632
  }
633
  .contextual span.hascontextmenu a.js-contextmenu::after { content: ''; }
634

  
627 635
  /* loading indicator */
628 636
  #ajax-indicator {
629 637
    width: 60%;
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'
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'
1617
      end
1618
    end
1599 1619
  end
1600 1620

  
1601 1621
  def test_show_should_display_update_form