From aaba993352d65ad645215083cd6a4a46006f4b32 Mon Sep 17 00:00:00 2001
From: Marin Jankovski <marin@gitlab.com>
Date: Wed, 25 Jun 2014 12:30:57 +0200
Subject: [PATCH] Skeleton of the group milestone index page.

---
 app/helpers/groups_helper.rb                  | 12 +++++++++++
 app/views/groups/_filter.html.haml            | 12 +++++++++++
 .../groups/milestones/_milestone.html.haml    | 13 ++++++++++++
 app/views/groups/milestones/index.html.haml   | 21 +++++++++++++++++++
 4 files changed, 58 insertions(+)
 create mode 100644 app/views/groups/_filter.html.haml
 create mode 100644 app/views/groups/milestones/_milestone.html.haml

diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb
index cfc9a572cac..0762a6925b3 100644
--- a/app/helpers/groups_helper.rb
+++ b/app/helpers/groups_helper.rb
@@ -31,6 +31,18 @@ module GroupsHelper
             end
 
     title
+  end
+
+  def group_filter_path(entity, options={})
+    exist_opts = {
+      state: params[:state],
+      scope: params[:scope]
+    }
+
+    options = exist_opts.merge(options)
 
+    path = request.path
+    path << "?#{options.to_param}"
+    path
   end
 end
diff --git a/app/views/groups/_filter.html.haml b/app/views/groups/_filter.html.haml
new file mode 100644
index 00000000000..2e97ea40afe
--- /dev/null
+++ b/app/views/groups/_filter.html.haml
@@ -0,0 +1,12 @@
+= form_tag group_filter_path(entity), method: 'get' do
+  %fieldset
+    %ul.nav.nav-pills.nav-stacked
+      %li{class: ("active" if !params[:status])}
+        = link_to group_filter_path(entity, status: nil) do
+          Active
+      %li{class: ("active" if params[:status] == 'closed')}
+        = link_to group_filter_path(entity, status: 'closed') do
+          Closed
+      %li{class: ("active" if params[:status] == 'all')}
+        = link_to group_filter_path(entity, status: 'all') do
+          All
diff --git a/app/views/groups/milestones/_milestone.html.haml b/app/views/groups/milestones/_milestone.html.haml
new file mode 100644
index 00000000000..1f8488782cf
--- /dev/null
+++ b/app/views/groups/milestones/_milestone.html.haml
@@ -0,0 +1,13 @@
+- if @milestones.any?
+  - @issues.group_by(&:project).each do |group|
+    .panel.panel-default.panel-small
+      - project = group[0]
+      .panel-heading
+        = link_to_project project
+        = link_to 'show all', project_issues_path(project), class: 'pull-right'
+
+      %ul.well-list.issues-list
+        - group[1].each do |issue|
+          = render 'projects/issues/issue', issue: issue
+  = paginate @issues, theme: "gitlab"
+
diff --git a/app/views/groups/milestones/index.html.haml b/app/views/groups/milestones/index.html.haml
index e69de29bb2d..8ba325d94a4 100644
--- a/app/views/groups/milestones/index.html.haml
+++ b/app/views/groups/milestones/index.html.haml
@@ -0,0 +1,21 @@
+%h3.page-title
+  Milestones
+  %span.pull-right milestones
+
+%p.light
+  Only milestones from
+  %strong #{@group.name}
+  group are listed here.
+
+%hr
+
+.row
+  .fixed.sidebar-expand-button.hidden-lg.hidden-md
+    %i.icon-list.icon-2x
+  .col-md-3.responsive-side
+    = render 'groups/filter', entity: 'milestones'
+  .col-md-9
+    - if @milestones.blank?
+      .nothing-here-block No milestones to show
+    - else
+      = render 'groups/milestones/milestone'
-- 
GitLab