diff --git a/resources/styles/partials/dashboard-grid.scss b/resources/styles/partials/dashboard-grid.scss index 55344cc2f5..edaf7b3376 100644 --- a/resources/styles/partials/dashboard-grid.scss +++ b/resources/styles/partials/dashboard-grid.scss @@ -66,6 +66,14 @@ overflow: scroll; width: 100%; + .dashboard-grid-row { + align-items: center; + display: flex; + flex-wrap: wrap; + justify-content: center; + width: 100%; + } + .grid-item { align-items: center; border-radius: $br-medium; diff --git a/src/uxbox/ui/dashboard/colors.cljs b/src/uxbox/ui/dashboard/colors.cljs index 21fd17fe54..38553b359d 100644 --- a/src/uxbox/ui/dashboard/colors.cljs +++ b/src/uxbox/ui/dashboard/colors.cljs @@ -133,23 +133,24 @@ [:section.dashboard-grid.library (page-title coll) [:div.dashboard-grid-content - (when own? - [:div.grid-item.small-item.add-project - {:on-click #(udl/open! :color-form {:coll coll})} - [:span "+ New color"]]) - (for [color (remove nil? (:colors coll)) - :let [color-rgb (hex->rgb color)]] - [:div.grid-item.small-item.project-th {:key color} - [:span.color-swatch {:style {:background-color color}}] - [:span.color-data color] - [:span.color-data (apply str "RGB " (interpose ", " color-rgb))] - (if own? - [:div.project-th-actions - [:div.project-th-icon.edit - {:on-click #(edit-cb color)} i/pencil] - [:div.project-th-icon.delete - {:on-click #(remove-cb color)} - i/trash]])])]])))) + [:div.dashboard-grid-row + (when own? + [:div.grid-item.small-item.add-project + {:on-click #(udl/open! :color-form {:coll coll})} + [:span "+ New color"]]) + (for [color (remove nil? (:colors coll)) + :let [color-rgb (hex->rgb color)]] + [:div.grid-item.small-item.project-th {:key color} + [:span.color-swatch {:style {:background-color color}}] + [:span.color-data color] + [:span.color-data (apply str "RGB " (interpose ", " color-rgb))] + (if own? + [:div.project-th-actions + [:div.project-th-icon.edit + {:on-click #(edit-cb color)} i/pencil] + [:div.project-th-icon.delete + {:on-click #(remove-cb color)} + i/trash]])])]]])))) (def ^:const ^:private grid (mx/component diff --git a/src/uxbox/ui/dashboard/elements.cljs b/src/uxbox/ui/dashboard/elements.cljs index 27bda046ed..bf552853c3 100644 --- a/src/uxbox/ui/dashboard/elements.cljs +++ b/src/uxbox/ui/dashboard/elements.cljs @@ -41,87 +41,88 @@ [own] (html [:div.dashboard-grid-content - [:div.grid-item.add-project - {on-click #(udl/open! :new-element)} - [:span "+ New element"]] - [:div.grid-item.project-th - [:span.grid-item-image i/image] - [:h3 "Custom element"] - [:div.project-th-actions - [:div.project-th-icon.edit i/pencil] - [:div.project-th-icon.delete i/trash]]] - [:div.grid-item.project-th - [:span.grid-item-image i/image] - [:h3 "Custom element"] - [:div.project-th-actions - [:div.project-th-icon.edit i/pencil] - [:div.project-th-icon.delete i/trash]]] - [:div.grid-item.project-th - [:span.grid-item-image i/image] - [:h3 "Custom element"] - [:div.project-th-actions - [:div.project-th-icon.edit i/pencil] - [:div.project-th-icon.delete i/trash]]] - [:div.grid-item.project-th - [:span.grid-item-image i/image] - [:h3 "Custom element"] - [:div.project-th-actions - [:div.project-th-icon.edit i/pencil] - [:div.project-th-icon.delete i/trash]]] - [:div.grid-item.project-th - [:span.grid-item-image i/image] - [:h3 "Custom element"] - [:div.project-th-actions - [:div.project-th-icon.edit i/pencil] - [:div.project-th-icon.delete i/trash]]] - [:div.grid-item.project-th - [:span.grid-item-image i/image] - [:h3 "Custom element"] - [:div.project-th-actions - [:div.project-th-icon.edit i/pencil] - [:div.project-th-icon.delete i/trash]]] - [:div.grid-item.project-th - [:span.grid-item-image i/image] - [:h3 "Custom element"] - [:div.project-th-actions - [:div.project-th-icon.edit i/pencil] - [:div.project-th-icon.delete i/trash]]] - [:div.grid-item.project-th - [:span.grid-item-image i/image] - [:h3 "Custom element"] - [:div.project-th-actions - [:div.project-th-icon.edit i/pencil] - [:div.project-th-icon.delete i/trash]]] - [:div.grid-item.project-th - [:span.grid-item-image i/image] - [:h3 "Custom element"] - [:div.project-th-actions - [:div.project-th-icon.edit i/pencil] - [:div.project-th-icon.delete i/trash]]] - [:div.grid-item.project-th - [:span.grid-item-image i/image] - [:h3 "Custom element"] - [:div.project-th-actions - [:div.project-th-icon.edit i/pencil] - [:div.project-th-icon.delete i/trash]]] - [:div.grid-item.project-th - [:span.grid-item-image i/image] - [:h3 "Custom element"] - [:div.project-th-actions - [:div.project-th-icon.edit i/pencil] - [:div.project-th-icon.delete i/trash]]] - [:div.grid-item.project-th - [:span.grid-item-image i/image] - [:h3 "Custom element"] - [:div.project-th-actions - [:div.project-th-icon.edit i/pencil] - [:div.project-th-icon.delete i/trash]]] - [:div.grid-item.project-th - [:span.grid-item-image i/image] - [:h3 "Custom element"] - [:div.project-th-actions - [:div.project-th-icon.edit i/pencil] - [:div.project-th-icon.delete i/trash]]]])) + [:div.dashboard-grid-row + [:div.grid-item.add-project + {on-click #(udl/open! :new-element)} + [:span "+ New element"]] + [:div.grid-item.project-th + [:span.grid-item-image i/image] + [:h3 "Custom element"] + [:div.project-th-actions + [:div.project-th-icon.edit i/pencil] + [:div.project-th-icon.delete i/trash]]] + [:div.grid-item.project-th + [:span.grid-item-image i/image] + [:h3 "Custom element"] + [:div.project-th-actions + [:div.project-th-icon.edit i/pencil] + [:div.project-th-icon.delete i/trash]]] + [:div.grid-item.project-th + [:span.grid-item-image i/image] + [:h3 "Custom element"] + [:div.project-th-actions + [:div.project-th-icon.edit i/pencil] + [:div.project-th-icon.delete i/trash]]] + [:div.grid-item.project-th + [:span.grid-item-image i/image] + [:h3 "Custom element"] + [:div.project-th-actions + [:div.project-th-icon.edit i/pencil] + [:div.project-th-icon.delete i/trash]]] + [:div.grid-item.project-th + [:span.grid-item-image i/image] + [:h3 "Custom element"] + [:div.project-th-actions + [:div.project-th-icon.edit i/pencil] + [:div.project-th-icon.delete i/trash]]] + [:div.grid-item.project-th + [:span.grid-item-image i/image] + [:h3 "Custom element"] + [:div.project-th-actions + [:div.project-th-icon.edit i/pencil] + [:div.project-th-icon.delete i/trash]]] + [:div.grid-item.project-th + [:span.grid-item-image i/image] + [:h3 "Custom element"] + [:div.project-th-actions + [:div.project-th-icon.edit i/pencil] + [:div.project-th-icon.delete i/trash]]] + [:div.grid-item.project-th + [:span.grid-item-image i/image] + [:h3 "Custom element"] + [:div.project-th-actions + [:div.project-th-icon.edit i/pencil] + [:div.project-th-icon.delete i/trash]]] + [:div.grid-item.project-th + [:span.grid-item-image i/image] + [:h3 "Custom element"] + [:div.project-th-actions + [:div.project-th-icon.edit i/pencil] + [:div.project-th-icon.delete i/trash]]] + [:div.grid-item.project-th + [:span.grid-item-image i/image] + [:h3 "Custom element"] + [:div.project-th-actions + [:div.project-th-icon.edit i/pencil] + [:div.project-th-icon.delete i/trash]]] + [:div.grid-item.project-th + [:span.grid-item-image i/image] + [:h3 "Custom element"] + [:div.project-th-actions + [:div.project-th-icon.edit i/pencil] + [:div.project-th-icon.delete i/trash]]] + [:div.grid-item.project-th + [:span.grid-item-image i/image] + [:h3 "Custom element"] + [:div.project-th-actions + [:div.project-th-icon.edit i/pencil] + [:div.project-th-icon.delete i/trash]]] + [:div.grid-item.project-th + [:span.grid-item-image i/image] + [:h3 "Custom element"] + [:div.project-th-actions + [:div.project-th-icon.edit i/pencil] + [:div.project-th-icon.delete i/trash]]]]])) (def ^:const ^:private grid (mx/component diff --git a/src/uxbox/ui/dashboard/icons.cljs b/src/uxbox/ui/dashboard/icons.cljs index 5d3cf84a76..777c7acce4 100644 --- a/src/uxbox/ui/dashboard/icons.cljs +++ b/src/uxbox/ui/dashboard/icons.cljs @@ -108,13 +108,14 @@ [:section.dashboard-grid.library (page-title coll) [:div.dashboard-grid-content - (for [icon (:icons coll)] - [:div.grid-item.small-item.project-th {} - [:span.grid-item-image #_i/toggle (uusc/render-shape-svg icon nil)] - [:h3 (:name icon)] - #_[:div.project-th-actions - [:div.project-th-icon.edit i/pencil] - [:div.project-th-icon.delete i/trash]]])]])))) + [:div.dashboard-grid-row + (for [icon (:icons coll)] + [:div.grid-item.small-item.project-th {} + [:span.grid-item-image #_i/toggle (uusc/render-shape-svg icon nil)] + [:h3 (:name icon)] + #_[:div.project-th-actions + [:div.project-th-icon.edit i/pencil] + [:div.project-th-icon.delete i/trash]]])]]])))) (def grid (mx/component diff --git a/src/uxbox/ui/dashboard/projects.cljs b/src/uxbox/ui/dashboard/projects.cljs index 6683383dc0..831da26901 100644 --- a/src/uxbox/ui/dashboard/projects.cljs +++ b/src/uxbox/ui/dashboard/projects.cljs @@ -200,14 +200,15 @@ [:section.dashboard-grid [:h2 "Your projects"] [:div.dashboard-grid-content - [:div.grid-item.add-project - {:on-click on-click} - [:span "+ New project"]] - (for [item (->> (vals projects) - (dp/filter-projects-by filtering) - (dp/sort-projects-by ordering))] - (-> (grid-item item) - (rum/with-key (:id item))))]])))) + [:div.dashboard-grid-row + [:div.grid-item.add-project + {:on-click on-click} + [:span "+ New project"]] + (for [item (->> (vals projects) + (dp/filter-projects-by filtering) + (dp/sort-projects-by ordering))] + (-> (grid-item item) + (rum/with-key (:id item))))]]])))) (def grid (mx/component