From 80e7d249146c661edf80519315d5c26dd70a4d14 Mon Sep 17 00:00:00 2001 From: jan Date: Sun, 27 Nov 2016 21:19:39 +0100 Subject: flexy flexbox diff --git a/assets_src/css/materialize_extend.css b/assets_src/css/materialize_extend.css index f06d042..64b58e2 100644 --- a/assets_src/css/materialize_extend.css +++ b/assets_src/css/materialize_extend.css @@ -1,3 +1,24 @@ span.badge.new.no-caption::after { content: ""; } + +/* some flexy flexbox stuff */ +.flex { + display: flex; + flex-direction: row; + flex-wrap: wrap; + align-items: stretch; +} + +.flex .flex-card { + display: flex; + margin-right: 16px; + max-width: 400px; +} + +.flex .flex-card .pull-down { + position: absolute; + bottom: 0; + left: 0; + width: 100%; +} diff --git a/frontend/renderer.go b/frontend/renderer.go index 7d3a161..6fada60 100644 --- a/frontend/renderer.go +++ b/frontend/renderer.go @@ -19,6 +19,7 @@ type Action struct { // Card ist eine Karte im Materialize-Design. type Card struct { Title string + SubTitle *string Image string Description string Size string diff --git a/views/includes/card.html b/views/includes/card.html index a96cb49..457eef9 100644 --- a/views/includes/card.html +++ b/views/includes/card.html @@ -1,6 +1,6 @@ {{ define "card" }} {{ $card := . }} -
+
{{ if $card.Image }} @@ -8,7 +8,7 @@
{{ end }} - {{ $card.Title | html }} + {{ $card.Title | html }}{{ if $card.SubTitle }}{{ $card.SubTitle | html }}{{ end }}

{{ $card.Description | html }}

diff --git a/views/pages/dashboard.html b/views/pages/dashboard.html index 589b0fd..2eacaba 100644 --- a/views/pages/dashboard.html +++ b/views/pages/dashboard.html @@ -11,7 +11,7 @@
{{ range $category := .categories }}

{{ $category.Title }}

-
+
{{ range $category.Cards }} {{ template "card" . }} {{ end }} -- cgit v0.10.1 From 09b7406c21eec7e9919aeb2a29375bd573a4bb51 Mon Sep 17 00:00:00 2001 From: jan Date: Sun, 27 Nov 2016 22:12:44 +0100 Subject: fixieren diff --git a/assets_src/css/materialize_extend.css b/assets_src/css/materialize_extend.css index 64b58e2..46f92ee 100644 --- a/assets_src/css/materialize_extend.css +++ b/assets_src/css/materialize_extend.css @@ -16,9 +16,8 @@ span.badge.new.no-caption::after { max-width: 400px; } -.flex .flex-card .pull-down { - position: absolute; - bottom: 0; - left: 0; - width: 100%; +.flex .flex-card .card { + display: flex; + flex-direction: column; + justify-content: space-between; } diff --git a/views/includes/card.html b/views/includes/card.html index 457eef9..41ad2ce 100644 --- a/views/includes/card.html +++ b/views/includes/card.html @@ -11,7 +11,7 @@ {{ $card.Title | html }}{{ if $card.SubTitle }}{{ $card.SubTitle | html }}{{ end }}

{{ $card.Description | html }}

-
+
{{ range $action := $card.Actions }} {{ if $action.Disabled }} {{ $action.Name | html }} -- cgit v0.10.1 From 6243b499153e43a2226a6c490afbe230e04b4677 Mon Sep 17 00:00:00 2001 From: keiser Date: Thu, 1 Dec 2016 17:38:31 +0100 Subject: =?UTF-8?q?F=C3=BCr=20dich=20Jan?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/modules/lists/lists.go b/modules/lists/lists.go index 05baf4a..b4d944b 100644 --- a/modules/lists/lists.go +++ b/modules/lists/lists.go @@ -84,6 +84,7 @@ func (m *Module) getListGrils(list *models.List) error { defer rows.Close() list.Grils = list.Grils[:0] var ids []int + grilMap := make(map[int]*models.ListGril) for rows.Next() { var grilID int lg := &models.ListGril{} @@ -93,6 +94,7 @@ func (m *Module) getListGrils(list *models.List) error { continue } ids = append(ids, grilID) + grilMap[grilID] = lg list.Grils = append(list.Grils, lg) } @@ -103,8 +105,8 @@ func (m *Module) getListGrils(list *models.List) error { return err } - for id, gril := range grils { - list.Grils[id].Gril = gril + for _, gril := range grils { + grilMap[gril.ID].Gril = gril } sort.Sort(ListGrils(list.Grils)) -- cgit v0.10.1