diff --git a/css/style.scss b/css/style.scss index 1f6f77fbd..0469ebbb4 100644 --- a/css/style.scss +++ b/css/style.scss @@ -4,6 +4,7 @@ * @author Julius Härtl * @author Artem Anufrij * @author Marin Treselj + * @author Oskar Kurz * * @license GNU AGPL version 3 or any later version * @@ -101,8 +102,11 @@ input.input-inline { } } .app-navigation-entry-edit { - .colorselect div{ - height: 32px; + .colorselect { + div, label { + height: 32px; + width: auto; + } } form { display: flex; @@ -814,6 +818,10 @@ input.input-inline { border: none; } + label.color { + flex-grow: 1; + } + .selected { background-image: url('../../../core/img/actions/checkmark.svg'); background-position: center center; @@ -823,6 +831,19 @@ input.input-inline { background-image: url('../../../core/img/actions/checkmark-white.svg'); } } + + .colorselect-label { + background-image: url('../img/color_picker.svg'); + background-position: center center; + background-repeat: no-repeat; + opacity: 1; + input { + position: absolute; + visibility: hidden; + height: 32px; + width: 40px; + } + } } .labels { @@ -888,7 +909,8 @@ input.input-inline { .colorselect { flex-grow: 1; - div { + div, + label { min-width: 32px; } } diff --git a/img/color_picker.svg b/img/color_picker.svg new file mode 100644 index 000000000..acd651fbb --- /dev/null +++ b/img/color_picker.svg @@ -0,0 +1,5 @@ + + + + +image/svg+xmlOpenclipart diff --git a/js/controller/ColorPickerController.js b/js/controller/ColorPickerController.js new file mode 100644 index 000000000..8de938556 --- /dev/null +++ b/js/controller/ColorPickerController.js @@ -0,0 +1,44 @@ +/* + * @copyright Copyright (c) 2018 Oskar Kurz + * + * @author Oskar Kurz + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +import app from '../app/App.js'; + +/* global oc_defaults OC */ +app.controller('ColorPickerController', ['$scope', function ($scope) { + $scope.hashedColor = ''; + + $scope.setColor = function (object, color) { + object.color = color; + object.hashedColor = '#' + color; + + return object; + }; + + $scope.setHashedColor = function (object) { + object.color = object.hashedColor.substr(1); + return object; + }; + + $scope.getCustomBackground = function (color) { + return {'background-color': color}; + }; +}]); diff --git a/templates/part.board.sidebarView.php b/templates/part.board.sidebarView.php index 88ce3de6d..d51852f2c 100644 --- a/templates/part.board.sidebarView.php +++ b/templates/part.board.sidebarView.php @@ -84,8 +84,11 @@ -
-

+
+

+
t('Update')); ?> @@ -99,8 +102,11 @@ -
-

+
+

+
t('Create')); ?> diff --git a/templates/part.boardlist.php b/templates/part.boardlist.php index f116830bf..1fb80c96e 100644 --- a/templates/part.boardlist.php +++ b/templates/part.boardlist.php @@ -33,9 +33,12 @@
-
-

-
+
+
+ +
@@ -102,12 +105,12 @@ -
-
-
+
+
+ +
diff --git a/templates/part.navigation.php b/templates/part.navigation.php index ad38388b8..53dfa592d 100644 --- a/templates/part.navigation.php +++ b/templates/part.navigation.php @@ -38,8 +38,11 @@ -
-
+
+
+
@@ -53,8 +56,11 @@ -
-

+
+

+