Commit 5f7eff34 authored by Phil Hughes's avatar Phil Hughes

Changed cursors to only show draggable when logged in

Fixed lists allowed to be reorganized when logged out
Hides welcome state when logged out
parent df7ebcba
...@@ -19,6 +19,9 @@ $(function () { ...@@ -19,6 +19,9 @@ $(function () {
gl.IssueBoardsApp = new Vue({ gl.IssueBoardsApp = new Vue({
el: '#board-app', el: '#board-app',
props: {
disabled: Boolean
},
data: { data: {
state: BoardsStore.state state: BoardsStore.state
}, },
...@@ -26,6 +29,7 @@ $(function () { ...@@ -26,6 +29,7 @@ $(function () {
BoardsStore.create(); BoardsStore.create();
}, },
ready: function () { ready: function () {
BoardsStore.disabled = this.disabled;
gl.boardService.all() gl.boardService.all()
.then((resp) => { .then((resp) => {
const boards = resp.json(); const boards = resp.json();
......
(() => { (() => {
const Board = Vue.extend({ const Board = Vue.extend({
props: { props: {
board: Object board: Object,
disabled: Boolean
}, },
data: function () { data: function () {
return { return {
...@@ -38,6 +39,7 @@ ...@@ -38,6 +39,7 @@
}, },
ready: function () { ready: function () {
const options = _.extend({ const options = _.extend({
disabled: this.disabled,
group: 'boards', group: 'boards',
draggable: '.is-draggable', draggable: '.is-draggable',
handle: '.js-board-handle', handle: '.js-board-handle',
......
((w) => { ((w) => {
w.BoardsStore = { w.BoardsStore = {
disabled: false,
state: {}, state: {},
create: function () { create: function () {
this.state.lists = []; this.state.lists = [];
...@@ -41,7 +42,7 @@ ...@@ -41,7 +42,7 @@
addBlankState: function () { addBlankState: function () {
const addBlankState = this.shouldAddBlankState(); const addBlankState = this.shouldAddBlankState();
if (this.welcomeIsHidden()) return; if (this.welcomeIsHidden() || this.disabled) return;
if (addBlankState) { if (addBlankState) {
this.new({ this.new({
......
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
display: none; display: none;
} }
.user-can-drag {
cursor: -webkit-grab;
cursor: grab;
}
.is-dragging { .is-dragging {
* { * {
cursor: -webkit-grabbing; cursor: -webkit-grabbing;
...@@ -110,8 +115,6 @@ ...@@ -110,8 +115,6 @@
.board-header { .board-header {
border-top-left-radius: $border-radius-default; border-top-left-radius: $border-radius-default;
border-top-right-radius: $border-radius-default; border-top-right-radius: $border-radius-default;
cursor: -webkit-grab;
cursor: grab;
&.has-border { &.has-border {
padding-top: ($gl-padding - 3px); padding-top: ($gl-padding - 3px);
...@@ -230,8 +233,6 @@ ...@@ -230,8 +233,6 @@
border-radius: $border-radius-default; border-radius: $border-radius-default;
box-shadow: 0 1px 2px rgba(186, 186, 186, 0.5); box-shadow: 0 1px 2px rgba(186, 186, 186, 0.5);
list-style: none; list-style: none;
cursor: -webkit-grab;
cursor: grab;
&:not(:last-child) { &:not(:last-child) {
margin-bottom: 5px; margin-bottom: 5px;
......
%board{ "inline-template" => true, "v-cloak" => true, "v-for" => "board in state.lists | orderBy 'position'", ":board" => "board" } %board{ "inline-template" => true,
"v-cloak" => true,
"v-for" => "board in state.lists | orderBy 'position'",
":board" => "board",
":disabled" => "#{current_user.nil?}" }
.board{ ":class" => "{ 'is-draggable': !isPreset }" } .board{ ":class" => "{ 'is-draggable': !isPreset }" }
.board-inner .board-inner
%header.board-inner-container.board-header{ ":class" => "{ 'has-border': board.label }", ":style" => "{ borderTopColor: (board.label ? board.label.color : null) }" } %header.board-inner-container.board-header{ ":class" => "{ 'has-border': board.label }", ":style" => "{ borderTopColor: (board.label ? board.label.color : null) }" }
%h3.board-title.js-board-handle %h3.board-title.js-board-handle{ ":class" => "{ 'user-can-drag': !disabled }" }
{{ board.title }} {{ board.title }}
%span.pull-right{ "v-if" => "board.type !== 'blank'" } %span.pull-right{ "v-if" => "board.type !== 'blank'" }
{{ board.issues.length }} {{ board.issues.length }}
- if current_user
%board-delete{ "inline-template" => true, "v-if" => "!isPreset", ":board-id" => "board.id" } %board-delete{ "inline-template" => true, "v-if" => "!isPreset", ":board-id" => "board.id" }
%button.board-delete.has-tooltip.pull-right{ type: "button", title: "Delete list", "aria-label" => "Delete list", data: { placement: "bottom" }, "@click" => "deleteBoard" } %button.board-delete.has-tooltip.pull-right{ type: "button", title: "Delete list", "aria-label" => "Delete list", data: { placement: "bottom" }, "@click" => "deleteBoard" }
= icon("trash") = icon("trash")
...@@ -18,8 +23,8 @@ ...@@ -18,8 +23,8 @@
"v-if" => "board.type !== 'blank'", "v-if" => "board.type !== 'blank'",
":list" => "board", ":list" => "board",
":issues" => "board.issues", ":issues" => "board.issues",
":disabled" => "#{current_user.nil?}",
":loading" => "board.loading", ":loading" => "board.loading",
":disabled" => "disabled",
":issue-link-base" => "'#{namespace_project_issues_path(@project.namespace, @project)}'" } ":issue-link-base" => "'#{namespace_project_issues_path(@project.namespace, @project)}'" }
.board-list-loading.text-center{ "v-if" => "loading" } .board-list-loading.text-center{ "v-if" => "loading" }
= icon("spinner spin") = icon("spinner spin")
......
%li.card{ ":data-issue" => "issue.id", "v-for" => "issue in issues | orderBy 'id' -1", "track-by" => "id" } %li.card{ ":data-issue" => "issue.id",
"v-for" => "issue in issues | orderBy 'id' -1",
"track-by" => "id",
":class" => "{ 'user-can-drag': !disabled }" }
%h4.card-title %h4.card-title
%a{ ":href" => "issueLinkBase + '/' + issue.id", ":title" => "issue.title" } %a{ ":href" => "issueLinkBase + '/' + issue.id",
":title" => "issue.title" }
{{ issue.title }} {{ issue.title }}
.card-footer .card-footer
%span.card-number %span.card-number
= precede '#' do = precede '#' do
{{ issue.id }} {{ issue.id }}
%span.label.color-label{ "v-for" => "label in issue.labels", ":style" => "{ backgroundColor: label.color, color: label.textColor }" } %span.label.color-label{ "v-for" => "label in issue.labels",
":style" => "{ backgroundColor: label.color, color: label.textColor }" }
{{ label.title }} {{ label.title }}
%a.has-tooltip{ ":href" => "'/u/' + issue.assignee.username", ":title" => "'Assigned to ' + issue.assignee.name", "v-if" => "issue.assignee" } %a.has-tooltip{ ":href" => "'/u/' + issue.assignee.username",
":title" => "'Assigned to ' + issue.assignee.name",
"v-if" => "issue.assignee" }
%img.avatar.avatar-inline.s20{ ":src" => "issue.assignee.avatar", width: 20, height: 20 } %img.avatar.avatar-inline.s20{ ":src" => "issue.assignee.avatar", width: 20, height: 20 }
...@@ -10,5 +10,6 @@ ...@@ -10,5 +10,6 @@
= render 'shared/issuable/filter', type: :boards = render 'shared/issuable/filter', type: :boards
.boards-list#board-app{ "data-endpoint" => "#{namespace_project_board_path(@project.namespace, @project)}" } .boards-list#board-app{ "data-endpoint" => "#{namespace_project_board_path(@project.namespace, @project)}",
":disabled" => "#{current_user.nil?}" }
= render "projects/boards/components/board" = render "projects/boards/components/board"
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