Commit 2ac744e9 authored by Rubén Dávila's avatar Rubén Dávila

Show buttons based on current tab.

parent 7ecd30a8
...@@ -64,6 +64,7 @@ class @Milestone ...@@ -64,6 +64,7 @@ class @Milestone
constructor: -> constructor: ->
@bindIssuesSorting() @bindIssuesSorting()
@bindMergeRequestSorting() @bindMergeRequestSorting()
@bindTabsSwitching
bindIssuesSorting: -> bindIssuesSorting: ->
$("#issues-list-unassigned, #issues-list-ongoing, #issues-list-closed").sortable( $("#issues-list-unassigned, #issues-list-ongoing, #issues-list-closed").sortable(
...@@ -122,3 +123,12 @@ class @Milestone ...@@ -122,3 +123,12 @@ class @Milestone
Milestone.updateMergeRequest(ui.item, merge_request_url, data) Milestone.updateMergeRequest(ui.item, merge_request_url, data)
).disableSelection() ).disableSelection()
bindMergeRequestSorting: ->
$('a[data-toggle="tab"]').on 'show.bs.tab', (e) ->
currentTabClass = $(e.target).data('show')
previousTabClass = $(e.relatedTarget).data('show')
$(previousTabClass).hide()
$(currentTabClass).removeClass('hidden')
$(currentTabClass).show()
...@@ -29,7 +29,7 @@ li.milestone { ...@@ -29,7 +29,7 @@ li.milestone {
} }
.milestone-summary { .milestone-summary {
margin-bottom: 15px; margin-bottom: 25px;
} }
.milestone-stat { .milestone-stat {
......
...@@ -63,16 +63,26 @@ ...@@ -63,16 +63,26 @@
%span.time-elapsed %span.time-elapsed
%strong== #{@milestone.percent_time_used}% %strong== #{@milestone.percent_time_used}%
time elapsed time elapsed
%span.pull-right= @milestone.expires_at %span.pull-right.tab-issues-buttons.tab-labels-buttons
- if can?(current_user, :create_issue, @project)
= link_to new_namespace_project_issue_path(@project.namespace, @project, issue: { milestone_id: @milestone.id }), class: "btn btn-grouped", title: "New Issue" do
%i.fa.fa-plus
New Issue
- if can?(current_user, :read_issue, @project)
= link_to 'Browse Issues', namespace_project_issues_path(@milestone.project.namespace, @milestone.project, milestone_title: @milestone.title), class: "btn btn-grouped"
%span.pull-right.tab-merge-requests-buttons.hidden
- if can?(current_user, :read_merge_request, @project)
= link_to 'Browse Merge Requests', namespace_project_merge_requests_path(@milestone.project.namespace, @milestone.project, milestone_title: @milestone.title), class: "btn btn-grouped"
= milestone_progress_bar(@milestone) = milestone_progress_bar(@milestone)
%ul.nav-links.no-top.no-bottom %ul.nav-links.no-top.no-bottom
%li.active %li.active
= link_to '#tab-issues', 'data-toggle' => 'tab' do = link_to '#tab-issues', 'data-toggle' => 'tab', 'data-show' => '.tab-issues-buttons' do
Issues Issues
%span.badge= @issues.count %span.badge= @issues.count
%li %li
= link_to '#tab-merge-requests', 'data-toggle' => 'tab' do = link_to '#tab-merge-requests', 'data-toggle' => 'tab', 'data-show' => '.tab-merge-requests-buttons' do
Merge Requests Merge Requests
%span.badge= @merge_requests.count %span.badge= @merge_requests.count
%li %li
...@@ -80,24 +90,12 @@ ...@@ -80,24 +90,12 @@
Participants Participants
%span.badge= @users.count %span.badge= @users.count
%li %li
= link_to '#tab-labels', 'data-toggle' => 'tab' do = link_to '#tab-labels', 'data-toggle' => 'tab', 'data-show' => '.tab-issues-buttons' do
Labels Labels
%span.badge= @labels.count %span.badge= @labels.count
.tab-content .tab-content
.tab-pane.active#tab-issues .tab-pane.active#tab-issues
.content-block.oneline-block
.controls
- if can?(current_user, :create_issue, @project)
= link_to new_namespace_project_issue_path(@project.namespace, @project, issue: { milestone_id: @milestone.id }), class: "btn btn-grouped", title: "New Issue" do
%i.fa.fa-plus
New Issue
- if can?(current_user, :read_issue, @project)
= link_to 'Browse Issues', namespace_project_issues_path(@milestone.project.namespace, @milestone.project, milestone_title: @milestone.title), class: "btn btn-grouped"
.oneline
All issues in this milestone
.row.prepend-top-default .row.prepend-top-default
.col-md-4 .col-md-4
= render('issues', title: 'Unstarted Issues (open and unassigned)', issues: @issues.opened.unassigned, id: 'unassigned') = render('issues', title: 'Unstarted Issues (open and unassigned)', issues: @issues.opened.unassigned, id: 'unassigned')
...@@ -107,14 +105,6 @@ ...@@ -107,14 +105,6 @@
= render('issues', title: 'Completed Issues (closed)', issues: @issues.closed, id: 'closed') = render('issues', title: 'Completed Issues (closed)', issues: @issues.closed, id: 'closed')
.tab-pane#tab-merge-requests .tab-pane#tab-merge-requests
.content-block.oneline-block
.controls
- if can?(current_user, :read_merge_request, @project)
= link_to 'Browse Merge Requests', namespace_project_merge_requests_path(@milestone.project.namespace, @milestone.project, milestone_title: @milestone.title), class: "btn btn-grouped"
.oneline
All merge requests in this milestone
.row.prepend-top-default .row.prepend-top-default
.col-md-3 .col-md-3
= render('merge_requests', title: 'Work in progress (open and unassigned)', merge_requests: @merge_requests.opened.unassigned, id: 'unassigned') = render('merge_requests', title: 'Work in progress (open and unassigned)', merge_requests: @merge_requests.opened.unassigned, id: 'unassigned')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment