Commit e66a8b4c authored by Marin Jankovski's avatar Marin Jankovski

Move milestone link in group head, 2 column milestone for MR and issues.

parent c223fb1a
...@@ -7,3 +7,12 @@ ...@@ -7,3 +7,12 @@
.member-search-form { .member-search-form {
float: left; float: left;
} }
.milestone-row {
@include str-truncated(90%);
}
.label.label-default.project-name {
width: 80px;
@include str-truncated(80%);
}
...@@ -14,8 +14,8 @@ class Groups::MilestonesController < ApplicationController ...@@ -14,8 +14,8 @@ class Groups::MilestonesController < ApplicationController
def show def show
project_milestones = Milestone.where(project_id: group.projects) project_milestones = Milestone.where(project_id: group.projects)
@group_milestone = Milestones::GroupService.new(project_milestones).milestone(title) @group_milestone = Milestones::GroupService.new(project_milestones).milestone(title)
@project_issues = @group_milestone.filter_by(params[:status], "issues") @issues = @group_milestone.issues
@project_merge_requests = @group_milestone.filter_by(params[:status], "merge_requests") @merge_requests = @group_milestone.merge_requests
end end
def update def update
......
...@@ -65,16 +65,12 @@ class GroupMilestone ...@@ -65,16 +65,12 @@ class GroupMilestone
state == 'closed' state == 'closed'
end end
def opened_unassigned_issues def issues
milestones.map{ |milestone| milestone.issues.opened.unassigned } milestones.map{ |milestone| milestone.issues }.flatten.group_by(&:state)
end end
def opened_assigned_issues def merge_requests
milestones.map{ |milestone| milestone.issues.opened.assigned } milestones.map{ |milestone| milestone.merge_requests }.flatten.group_by(&:state)
end
def closed_issues
milestones.map{ |milestone| milestone.issues.closed }
end end
def participants def participants
......
%li{ id: dom_id(issue, 'sortable'), class: 'issue-row', 'data-iid' => issue.iid } %li{ id: dom_id(issue, 'sortable'), class: 'issue-row', 'data-iid' => issue.iid }
%span.str-truncated %span.milestone-row
- project = issue.project - project = issue.project
%span.label.label-default.project-name
= project.name
= link_to [project, issue] do = link_to [project, issue] do
%span.cgray ##{issue.iid} %span.cgray ##{issue.iid}
= link_to_gfm issue.title, [project, issue] = link_to_gfm issue.title, [project, issue]
......
.panel.panel-default .panel.panel-default
.panel-heading= name .panel-heading= title
%ul{ class: "well-list issues-sortable-list" } %ul{ class: "well-list issues-sortable-list" }
- issues.each do |issue| - if issues
= render 'issue', issue: issue - issues.each do |issue|
= render 'issue', issue: issue
%li{ id: dom_id(merge_request, 'sortable'), class: 'mr-row', 'data-iid' => merge_request.iid } %li{ id: dom_id(merge_request, 'sortable'), class: 'mr-row', 'data-iid' => merge_request.iid }
%span.str-truncated %span.milestone-row
- project = merge_request.project - project = merge_request.project
%span.label.label-default.project-name
= project.name
= link_to [project, merge_request] do = link_to [project, merge_request] do
%span.cgray ##{merge_request.iid} %span.cgray ##{merge_request.iid}
= link_to_gfm truncate(merge_request.title, length: 60), [project, merge_request] = link_to_gfm merge_request.title, [project, merge_request]
.pull-right.assignee-icon
- if merge_request.assignee
= image_tag avatar_icon(merge_request.assignee.email, 16), class: "avatar s16"
.panel.panel-default .panel.panel-default
.panel-heading= name .panel-heading= title
%ul{ class: "well-list merge_requests-sortable-list" } %ul{ class: "well-list merge_requests-sortable-list" }
- merge_requests.sort_by(&:position).each do |merge_request| - if merge_requests
= render 'merge_request', merge_request: merge_request - merge_requests.sort_by(&:position).each do |merge_request|
= render 'merge_request', merge_request: merge_request
...@@ -52,19 +52,17 @@ ...@@ -52,19 +52,17 @@
.tab-content .tab-content
.tab-pane.active#tab-issues .tab-pane.active#tab-issues
.row .row
.col-md-4.responsive-side .col-md-6
= render 'groups/filter', entity: 'milestone' = render 'issues', title: "Open", issues: @issues["opened"]
.col-md-8 .col-md-6
- @project_issues.each do |name, issues| = render 'issues', title: "Closed", issues: @issues["closed"]
= render 'issues', name: name, issues: issues
.tab-pane#tab-merge-requests .tab-pane#tab-merge-requests
.row .row
.col-md-4.responsive-side .col-md-6
= render 'groups/filter', entity: 'milestone' = render 'merge_requests', title: "Open", merge_requests: @merge_requests["opened"]
.col-md-8 .col-md-6
- @project_merge_requests.each do |name, merge_requests| = render 'merge_requests', title: "Closed", merge_requests: @merge_requests["closed"]
= render 'merge_requests', name: name, merge_requests: merge_requests
.tab-pane#tab-participants .tab-pane#tab-participants
%ul.bordered-list %ul.bordered-list
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
= nav_link(path: 'groups#show', html_options: {class: 'home'}) do = nav_link(path: 'groups#show', html_options: {class: 'home'}) do
= link_to group_path(@group), title: "Home" do = link_to group_path(@group), title: "Home" do
Activity Activity
= nav_link(path: 'groups#milestones') do
= link_to group_milestones_path(@group) do
Milestones
= nav_link(path: 'groups#issues') do = nav_link(path: 'groups#issues') do
= link_to issues_group_path(@group) do = link_to issues_group_path(@group) do
Issues Issues
...@@ -12,9 +15,6 @@ ...@@ -12,9 +15,6 @@
Merge Requests Merge Requests
- if current_user - if current_user
%span.count= current_user.cared_merge_requests.opened.of_group(@group).count %span.count= current_user.cared_merge_requests.opened.of_group(@group).count
= nav_link(path: 'groups#milestones') do
= link_to group_milestones_path(@group) do
Milestones
= nav_link(path: 'groups#members') do = nav_link(path: 'groups#members') do
= link_to "Members", members_group_path(@group) = link_to "Members", members_group_path(@group)
......
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