diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-09-07 16:42:23 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-09-07 16:42:23 +0300 |
commit | b4778a586665fe522ae3f4f7a567766b696b847d (patch) | |
tree | 133d25f06731111382632e8f42b81532b9b19b81 /app/views/shared/boards | |
parent | cb555da178573ceac01f0b76060572545857364a (diff) | |
parent | a1a839c99f7d9ce69ce0712d93951dba216ecb11 (diff) |
Merge branch 'ee_issue_928_backport' into 'master'
Group boards CE backport
See merge request !13883
Diffstat (limited to 'app/views/shared/boards')
10 files changed, 254 insertions, 0 deletions
diff --git a/app/views/shared/boards/_show.html.haml b/app/views/shared/boards/_show.html.haml new file mode 100644 index 00000000000..1a50b7d4b69 --- /dev/null +++ b/app/views/shared/boards/_show.html.haml @@ -0,0 +1,40 @@ +- @no_breadcrumb_container = true +- @no_container = true +- @content_class = "issue-boards-content" +- breadcrumb_title "Issue Board" +- page_title "Boards" + +- content_for :page_specific_javascripts do + = webpack_bundle_tag 'common_vue' + = webpack_bundle_tag 'filtered_search' + = webpack_bundle_tag 'boards' + + %script#js-board-template{ type: "text/x-template" }= render "shared/boards/components/board" + %script#js-board-modal-filter{ type: "text/x-template" }= render "shared/issuable/search_bar", type: :boards_modal + += render "projects/issues/head" + +.hidden-xs.hidden-sm + = render 'shared/issuable/search_bar', type: :boards + +#board-app.boards-app{ "v-cloak" => true, data: board_data } + .boards-list{ ":class" => "{ 'is-compact': detailIssueVisible }" } + .boards-app-loading.text-center{ "v-if" => "loading" } + = icon("spinner spin") + %board{ "v-cloak" => true, + "v-for" => "list in state.lists", + "ref" => "board", + ":list" => "list", + ":disabled" => "disabled", + ":issue-link-base" => "issueLinkBase", + ":root-path" => "rootPath", + ":board-id" => "boardId", + ":key" => "_uid" } + = render "shared/boards/components/sidebar" + %board-add-issues-modal{ "blank-state-image" => render('shared/empty_states/icons/issues.svg'), + "new-issue-path" => new_project_issue_path(@project), + "milestone-path" => milestones_filter_dropdown_path, + "label-path" => labels_filter_path, + ":issue-link-base" => "issueLinkBase", + ":root-path" => "rootPath", + ":project-id" => @project.try(:id) } diff --git a/app/views/shared/boards/components/_board.html.haml b/app/views/shared/boards/components/_board.html.haml new file mode 100644 index 00000000000..ce0aa72ab00 --- /dev/null +++ b/app/views/shared/boards/components/_board.html.haml @@ -0,0 +1,47 @@ +.board{ ":class" => '{ "is-draggable": !list.preset, "is-expandable": list.isExpandable, "is-collapsed": !list.isExpanded }', + ":data-id" => "list.id" } + .board-inner + %header.board-header{ ":class" => '{ "has-border": list.label && list.label.color }', ":style" => "{ borderTopColor: (list.label && list.label.color ? list.label.color : null) }", "@click" => "toggleExpanded($event)" } + %h3.board-title.js-board-handle{ ":class" => '{ "user-can-drag": (!disabled && !list.preset) }' } + %i.fa.fa-fw.board-title-expandable-toggle{ "v-if": "list.isExpandable", + ":class": "{ \"fa-caret-down\": list.isExpanded, \"fa-caret-right\": !list.isExpanded && list.position === -1, \"fa-caret-left\": !list.isExpanded && list.position !== -1 }", + "aria-hidden": "true" } + + %span.board-title-text.has-tooltip{ "v-if": "list.type !== \"label\"", + ":title" => '(list.label ? list.label.description : "")' } + {{ list.title }} + + %span.has-tooltip{ "v-if": "list.type === \"label\"", + ":title" => '(list.label ? list.label.description : "")', + data: { container: "body", placement: "bottom" }, + class: "label color-label title board-title-text", + ":style" => "{ backgroundColor: (list.label && list.label.color ? list.label.color : null), color: (list.label && list.label.color ? list.label.text_color : \"#2e2e2e\") }" } + {{ list.title }} + - if can?(current_user, :admin_list, current_board_parent) + %board-delete{ "inline-template" => true, + ":list" => "list", + "v-if" => "!list.preset && list.id" } + %button.board-delete.has-tooltip.pull-right{ type: "button", title: "Delete list", "aria-label" => "Delete list", data: { placement: "bottom" }, "@click.stop" => "deleteBoard" } + = icon("trash") + .issue-count-badge.clearfix{ "v-if" => 'list.type !== "blank"' } + %span.issue-count-badge-count.pull-left{ ":class" => '{ "has-btn": list.type !== "closed" && !disabled }' } + {{ list.issuesSize }} + - if can?(current_user, :admin_list, current_board_parent) + %button.issue-count-badge-add-button.btn.btn-small.btn-default.has-tooltip.js-no-trigger-collapse{ type: "button", + "@click" => "showNewIssueForm", + "v-if" => 'list.type !== "closed"', + "aria-label" => "New issue", + "title" => "New issue", + data: { placement: "top", container: "body" } } + = icon("plus", class: "js-no-trigger-collapse") + + %board-list{ "v-if" => 'list.type !== "blank"', + ":list" => "list", + ":issues" => "list.issues", + ":loading" => "list.loading", + ":disabled" => "disabled", + ":issue-link-base" => "issueLinkBase", + ":root-path" => "rootPath", + "ref" => "board-list" } + - if can?(current_user, :admin_list, current_board_parent) + %board-blank-state{ "v-if" => 'list.id == "blank"' } diff --git a/app/views/shared/boards/components/_sidebar.html.haml b/app/views/shared/boards/components/_sidebar.html.haml new file mode 100644 index 00000000000..b3f73e96b81 --- /dev/null +++ b/app/views/shared/boards/components/_sidebar.html.haml @@ -0,0 +1,28 @@ +%board-sidebar{ "inline-template" => true, + ":current-user" => "#{current_user ? current_user.to_json(only: [:username, :id, :name], methods: [:avatar_url]) : {}}" } + %transition{ name: "boards-sidebar-slide" } + %aside.right-sidebar.right-sidebar-expanded.issue-boards-sidebar{ "v-show" => "showSidebar" } + .issuable-sidebar + .block.issuable-sidebar-header + %span.issuable-header-text.hide-collapsed.pull-left + %strong + {{ issue.title }} + %br/ + %span + = precede "#" do + {{ issue.iid }} + %a.gutter-toggle.pull-right{ role: "button", + href: "#", + "@click.prevent" => "closeSidebar", + "aria-label" => "Toggle sidebar" } + = custom_icon("icon_close", size: 15) + .js-issuable-update + = render "shared/boards/components/sidebar/assignee" + = render "shared/boards/components/sidebar/milestone" + = render "shared/boards/components/sidebar/due_date" + = render "shared/boards/components/sidebar/labels" + = render "shared/boards/components/sidebar/notifications" + %remove-btn{ ":issue" => "issue", + ":issue-update" => "'#{build_issue_link_base}/' + issue.iid + '.json'", + ":list" => "list", + "v-if" => "canRemove" } diff --git a/app/views/shared/boards/components/sidebar/_assignee.html.haml b/app/views/shared/boards/components/sidebar/_assignee.html.haml new file mode 100644 index 00000000000..3d2e8471a60 --- /dev/null +++ b/app/views/shared/boards/components/sidebar/_assignee.html.haml @@ -0,0 +1,32 @@ +.block.assignee{ ref: "assigneeBlock" } + %template{ "v-if" => "issue.assignees" } + %assignee-title{ ":number-of-assignees" => "issue.assignees.length", + ":loading" => "loadingAssignees", + ":editable" => can_admin_issue? } + %assignees.value{ "root-path" => "#{root_url}", + ":users" => "issue.assignees", + ":editable" => can_admin_issue?, + "@assign-self" => "assignSelf" } + + - if can_admin_issue? + .selectbox.hide-collapsed + %input.js-vue{ type: "hidden", + name: "issue[assignee_ids][]", + ":value" => "assignee.id", + "v-if" => "issue.assignees", + "v-for" => "assignee in issue.assignees", + ":data-avatar_url" => "assignee.avatar", + ":data-name" => "assignee.name", + ":data-username" => "assignee.username" } + .dropdown + - dropdown_options = issue_assignees_dropdown_options + %button.dropdown-menu-toggle.js-user-search.js-author-search.js-multiselect.js-save-user-data.js-issue-board-sidebar{ type: 'button', ref: 'assigneeDropdown', data: board_sidebar_user_data, + ":data-issuable-id" => "issue.iid", + ":data-issue-update" => "'#{build_issue_link_base}/' + issue.iid + '.json'" } + = dropdown_options[:title] + = icon("chevron-down") + .dropdown-menu.dropdown-select.dropdown-menu-user.dropdown-menu-selectable.dropdown-menu-author + = dropdown_title("Assign to") + = dropdown_filter("Search users") + = dropdown_content + = dropdown_loading diff --git a/app/views/shared/boards/components/sidebar/_due_date.html.haml b/app/views/shared/boards/components/sidebar/_due_date.html.haml new file mode 100644 index 00000000000..db794d6f855 --- /dev/null +++ b/app/views/shared/boards/components/sidebar/_due_date.html.haml @@ -0,0 +1,32 @@ +.block.due_date + .title + Due date + - if can_admin_issue? + = icon("spinner spin", class: "block-loading") + = link_to "Edit", "#", class: "js-sidebar-dropdown-toggle edit-link pull-right" + .value + .value-content + %span.no-value{ "v-if" => "!issue.dueDate" } + No due date + %span.bold{ "v-if" => "issue.dueDate" } + {{ issue.dueDate | due-date }} + - if can_admin_issue? + %span.no-value.js-remove-due-date-holder{ "v-if" => "issue.dueDate" } + \- + %a.js-remove-due-date{ href: "#", role: "button" } + remove due date + - if can_admin_issue? + .selectbox + %input{ type: "hidden", + name: "issue[due_date]", + ":value" => "issue.dueDate" } + .dropdown + %button.dropdown-menu-toggle.js-due-date-select.js-issue-boards-due-date{ type: 'button', + data: { toggle: 'dropdown', field_name: "issue[due_date]", ability_name: "issue" }, + ":data-issue-update" => "'#{build_issue_link_base}/' + issue.iid + '.json'" } + %span.dropdown-toggle-text Due date + = icon('chevron-down') + .dropdown-menu.dropdown-menu-due-date + = dropdown_title('Due date') + = dropdown_content do + .js-due-date-calendar diff --git a/app/views/shared/boards/components/sidebar/_labels.html.haml b/app/views/shared/boards/components/sidebar/_labels.html.haml new file mode 100644 index 00000000000..1f540bdaf93 --- /dev/null +++ b/app/views/shared/boards/components/sidebar/_labels.html.haml @@ -0,0 +1,37 @@ +.block.labels + .title + Labels + - if can_admin_issue? + = icon("spinner spin", class: "block-loading") + = link_to "Edit", "#", class: "js-sidebar-dropdown-toggle edit-link pull-right" + .value.issuable-show-labels + %span.no-value{ "v-if" => "issue.labels && issue.labels.length === 0" } + None + %a{ href: "#", + "v-for" => "label in issue.labels" } + %span.label.color-label.has-tooltip{ ":style" => "{ backgroundColor: label.color, color: label.textColor }" } + {{ label.title }} + - if can_admin_issue? + .selectbox + %input{ type: "hidden", + name: "issue[label_names][]", + "v-for" => "label in issue.labels", + ":value" => "label.id" } + .dropdown + %button.dropdown-menu-toggle.js-label-select.js-multiselect.js-issue-board-sidebar{ type: "button", + data: { toggle: "dropdown", + field_name: "issue[label_names][]", + show_no: "true", + show_any: "true", + project_id: @project&.try(:id), + labels: labels_filter_path(false), + namespace_path: @project.try(:namespace).try(:full_path), + project_path: @project.try(:path) }, + ":data-issue-update" => "'#{build_issue_link_base}/' + issue.iid + '.json'" } + %span.dropdown-toggle-text + Label + = icon('chevron-down') + .dropdown-menu.dropdown-select.dropdown-menu-paging.dropdown-menu-labels.dropdown-menu-selectable + = render partial: "shared/issuable/label_page_default" + - if can?(current_user, :admin_label, current_board_parent) + = render partial: "shared/issuable/label_page_create" diff --git a/app/views/shared/boards/components/sidebar/_milestone.html.haml b/app/views/shared/boards/components/sidebar/_milestone.html.haml new file mode 100644 index 00000000000..d09c7c218e0 --- /dev/null +++ b/app/views/shared/boards/components/sidebar/_milestone.html.haml @@ -0,0 +1,29 @@ +.block.milestone + .title + Milestone + - if can_admin_issue? + = icon("spinner spin", class: "block-loading") + = link_to "Edit", "#", class: "js-sidebar-dropdown-toggle edit-link pull-right" + .value + %span.no-value{ "v-if" => "!issue.milestone" } + None + %span.bold.has-tooltip{ "v-if" => "issue.milestone" } + {{ issue.milestone.title }} + - if can_admin_issue? + .selectbox + %input{ type: "hidden", + ":value" => "issue.milestone.id", + name: "issue[milestone_id]", + "v-if" => "issue.milestone" } + .dropdown + %button.dropdown-menu-toggle.js-milestone-select.js-issue-board-sidebar{ type: "button", data: { toggle: "dropdown", show_no: "true", field_name: "issue[milestone_id]", milestones: milestones_filter_path(format: :json), ability_name: "issue", use_id: "true", default_no: "true" }, + ":data-selected" => "milestoneTitle", + ":data-issuable-id" => "issue.iid", + ":data-issue-update" => "'#{build_issue_link_base}/' + issue.iid + '.json'" } + Milestone + = icon("chevron-down") + .dropdown-menu.dropdown-select.dropdown-menu-selectable + = dropdown_title("Assign milestone") + = dropdown_filter("Search milestones") + = dropdown_content + = dropdown_loading diff --git a/app/views/shared/boards/components/sidebar/_notifications.html.haml b/app/views/shared/boards/components/sidebar/_notifications.html.haml new file mode 100644 index 00000000000..9b989c23cab --- /dev/null +++ b/app/views/shared/boards/components/sidebar/_notifications.html.haml @@ -0,0 +1,7 @@ +- if current_user + .block.light.subscription{ ":data-url" => "'#{build_issue_link_base}/' + issue.iid + '/toggle_subscription'" } + %span.issuable-header-text.hide-collapsed.pull-left + Notifications + %button.btn.btn-default.pull-right.js-subscribe-button.issuable-subscribe-button.hide-collapsed{ type: "button" } + %span + {{issue.subscribed ? 'Unsubscribe' : 'Subscribe'}} diff --git a/app/views/shared/boards/index.html.haml b/app/views/shared/boards/index.html.haml new file mode 100644 index 00000000000..2a5b8b1441e --- /dev/null +++ b/app/views/shared/boards/index.html.haml @@ -0,0 +1 @@ += render "show" diff --git a/app/views/shared/boards/show.html.haml b/app/views/shared/boards/show.html.haml new file mode 100644 index 00000000000..2a5b8b1441e --- /dev/null +++ b/app/views/shared/boards/show.html.haml @@ -0,0 +1 @@ += render "show" |