From e2733e6b1e78b53eed7f396af0daae8ffba0e3a1 Mon Sep 17 00:00:00 2001 From: Christopher Charbonneau Wells Date: Mon, 6 Nov 2017 16:24:21 -0500 Subject: [PATCH] Improve Dashboard view. This commit adds a placeholder image for Child objects (in the future, hopefully, photo uploads will be added) and reworks the Dashboard view to look better when more than one child is in the database. There are also some minor tweaks to the Child detail view and one new Gulp requirement to improve the flow of copying static image assets from apps. --- .../static_src/img/core/child-placeholder.png | Bin 0 -> 6393 bytes core/static_src/scss/core.scss | 5 ++ core/templates/core/child_detail.html | 43 ++--------------- dashboard/static_src/scss/dashboard.scss | 0 .../dashboard/child_button_group.html | 37 +++++++++++++++ dashboard/templates/dashboard/dashboard.html | 44 ++++++++++-------- dashboard/tests/tests_views.py | 19 ++++---- dashboard/views.py | 22 +++++---- gulpfile.js/config.js | 4 ++ gulpfile.js/tasks/extras.js | 11 ++++- package-lock.json | 9 ++++ package.json | 1 + 12 files changed, 117 insertions(+), 78 deletions(-) create mode 100644 core/static_src/img/core/child-placeholder.png create mode 100644 core/static_src/scss/core.scss create mode 100644 dashboard/static_src/scss/dashboard.scss create mode 100644 dashboard/templates/dashboard/child_button_group.html diff --git a/core/static_src/img/core/child-placeholder.png b/core/static_src/img/core/child-placeholder.png new file mode 100644 index 0000000000000000000000000000000000000000..294d77c5c5a90c8959747a57161c193d66c5df40 GIT binary patch literal 6393 zcmcIpXE>Z&yB@tWdJSWg5M>OajLwYSd(>b?H^Ugcmnad8-r0ywv?LNWL_$dH5FvU9 zNwla@BAdhhcJ}w3bDe$uo%g!l>s`-U_kBOlTI*Ts$MYr|8*0%|a!>*Q02&=_xG4ZY zfWLali7tCOoL-(^e%NscYn&Oz6&K`$MFG^17-tkn$H&PHWr}h_hWNcgDFOgQ{2u1k zIBNram?kTc571FZz!>FNW6JdjFYtD6QA2EH07 zcMt7QEXpj@(A*`|%S9duR#65i2E#4|d{8(iP_U0T+8-9I1pZSOcGLMnkgU8oR7OHxQd$%wDFKy*NXSBWN*?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hRXVJd(?lmYwmztH}!>51~+ofcuPkM6HLZi7UMUkc(EKbLh}^-a1DnQEWxp&uUA5 z573lKliyNjk4uT?gEs*|0+s`Uf^|v8EZfB8=fN*aubsa;(TZS<3ReN?@`fECj<7H!ttw(b>af-p(@Qbfy7Yk|DJ99_L0t@7_j=m;v8!^eFXAueq7#X;VTNkdz{>~)n8?=HC^wr zf7V0RI!y58=8s;FYB7`fj;F6k@YUTI$W9-&1$hgBIgX=Dfl|BA zb`Ihpd?^5<$EkUy@C1gc@e;E6OZoN&&1d9nO9t)bOL-(_!&w%5&jWL)1vC z%w+qP^VlCpWgAAhZFFQc`G~zSjnM6hqM)YDk3&Y?hwE@@D&9Bz@eeR(3U1@>w+!_S z4TZ(^w6*oe6!*?HXib)6Hi7Z1|r_|j(2wkQWK8n_pLVg0gJxW zgvjtA30I#xYR<}j&ZY^0)7Z3bP{(yLeBRD z(Il{MK48qf)X;QNMpx6FNQs8-9k%6xgyf5byKWRo55LwfE)!11laW|0Jb(jM5Av>) z6qOi2Bln{?6^8se0|0(Xq=qW3-5xJrk&p#`Fa031h>CcA(s}G6 zyyz&kM&voZ?>Hisz@D-ye)cxQ4#nH!rPrEob;8*J7_4+3>#Er+Q@_>lsP6Z&!7A^q4;rtBHnzlXU|xz)=Rlx}pxkO7y>o16 zPo{vfBFIILm1nGL$=e3Nke%O{Qol_viEov^!}6;h^xrB#zsgMie+8+lI@kXwLE%5H cMiEj2_;W; -
{{ object }}
+ +
{{ object }}

Born {{ object.birth_date }}
Age {{ object.birth_date|timesince }}

- -
- - {% if perms.core.view_child %} - - - - {% endif %} - - - - {% if perms.core.change_child %} - - {% endif %} - - {% if perms.core.delete_child %} - - {% endif %} - -
+ {% include 'dashboard/child_button_group.html' %} {% endblock %} \ No newline at end of file diff --git a/dashboard/static_src/scss/dashboard.scss b/dashboard/static_src/scss/dashboard.scss new file mode 100644 index 00000000..e69de29b diff --git a/dashboard/templates/dashboard/child_button_group.html b/dashboard/templates/dashboard/child_button_group.html new file mode 100644 index 00000000..8bf1815f --- /dev/null +++ b/dashboard/templates/dashboard/child_button_group.html @@ -0,0 +1,37 @@ +
+ + {% if perms.core.view_child %} + + + + {% endif %} + + + + {% if perms.core.change_child %} + + {% endif %} + + {% if perms.core.delete_child %} + + {% endif %} + +
\ No newline at end of file diff --git a/dashboard/templates/dashboard/dashboard.html b/dashboard/templates/dashboard/dashboard.html index 2c3fd784..1591a938 100644 --- a/dashboard/templates/dashboard/dashboard.html +++ b/dashboard/templates/dashboard/dashboard.html @@ -1,27 +1,31 @@ {% extends 'babybuddy/page.html' %} +{% load static %} -{% block title %}Welcome!{% endblock %} +{% block title %}Dashboard{% endblock %} + +{% block breadcrumbs %} + +{% endblock %} {% block content %} -
- {% for child in objects %} -
- -
-

- {{ child.name }} - {{ child.birth_date }} -

-

- {% if perms.core.view_child %} - - - - {% endif %} -

-
-