diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/views/shared/milestones/_record.html.haml | 17 | ||||
-rw-r--r-- | app/views/shared/milestones/_records.html.haml | 14 |
2 files changed, 31 insertions, 0 deletions
diff --git a/app/views/shared/milestones/_record.html.haml b/app/views/shared/milestones/_record.html.haml new file mode 100644 index 00000000000..a753dd78a6a --- /dev/null +++ b/app/views/shared/milestones/_record.html.haml @@ -0,0 +1,17 @@ +-# @project is present when viewing Project's milestone +- project = @project || record.project + +%li{ id: dom_id(record, 'sortable'), class: "#{dom_class(record)}-row", 'data-iid' => record.iid, 'data-url' => polymorphic_path(record) } + %span + - if show_project_name + %strong #{project.name} · + - elsif show_full_project_name + %strong #{project.name_with_namespace} · + = link_to_gfm record.title, [project.namespace.becomes(Namespace), project, record], title: record.title + %div{class: "#{dom_class(record)}-detail"} + = link_to [project.namespace.becomes(Namespace), project, record] do + %span{ class: "#{dom_class(record)}-number" } ##{record.iid} + - record.labels.each do |label| + = render_colored_label(label) + - if record.assignee + = image_tag avatar_icon(record.assignee, 16), class: "avatar s16", alt: '' diff --git a/app/views/shared/milestones/_records.html.haml b/app/views/shared/milestones/_records.html.haml new file mode 100644 index 00000000000..29fd6aaac9b --- /dev/null +++ b/app/views/shared/milestones/_records.html.haml @@ -0,0 +1,14 @@ +- show_counter = local_assigns.fetch(:show_counter, false) +- primary = local_assigns.fetch(:primary, false) +- panel_class = primary ? 'panel-primary' : 'panel-default' + +.panel{ class: panel_class } + .panel-heading + = title + - if show_counter + .pull-right= records.size + + - class_prefix = dom_class(records).pluralize + %ul{ class: "well-list #{class_prefix}-sortable-list", id: "#{class_prefix}-list-#{id}", "data-state" => id } + - records.sort_by(&:position).each do |record| + = render 'shared/milestones/record', record: record, show_project_name: show_project_name, show_full_project_name: show_full_project_name |