~pepe/neil

761f67098e987220d4ab2dfc82974a9598d3f739 — Josef Pospíšil a month ago 6eed3a4
Add complete project flag
3 files changed, 12 insertions(+), 5 deletions(-)

M neil/watch/clients.janet
M public/css/main.css
M templates/projects/line.temple
M neil/watch/clients.janet => neil/watch/clients.janet +1 -1
@@ 43,7 43,7 @@
(defn detail [{:params {:id i}}]
  (define-brush)
  (def c (load brush i))
  (def tsp (sort-by-timestamp (values (get c :projects []))))
  (def tsp (sort-by-state-timestamp (values (get c :projects []))))
  (detail/render-dict @{:client c
                        :client-id (c :uuid)
                        :projects tsp}))

M public/css/main.css => public/css/main.css +8 -0
@@ 204,6 204,14 @@ a[class^="icon-"]:hover::before {
  width: 58%;
}

.completed {
  background-image: var(--icon-valid);
  background-size: contain;
	color: transparent;
	width: 0.75rem;
	height: 0.75rem;
}

.project .head :is(h1, h2) {
  margin: var(--nav-link-spacing-vertical) 0;
}

M templates/projects/line.temple => templates/projects/line.temple +3 -4
@@ 6,14 6,13 @@
%}

<hstack id="{{ pid }}">
  <hstack>
  <hstack spacing="xs">
    <a class="{- (unless ((state= "active") p) "complete") -}"
     href={{ (resolve :projects/detail :id (p :uuid)) }}>{{ (p :name) }}</a>
    {% (when-let [ts (and ((state= "active") p) (p :tasks))
                  lt (length (filter (fn [t] ((state= "active") t)) ts))
                  _ (pos? lt)] %}
         <small>{{ lt }}</small>
    {% ) %}
                  _ (pos? lt)] (ptag "small" (. "(" lt ")"))) %}
    {% (when ((state= "completed") p) (ptag "small" "completed" @{:class "completed"})) %}
  </hstack>
  <spacer></spacer>
  {% (when (p :pin) (ptag "small" (. "Pinned to: " (format-date (p :pin)) "&nbsp;"))) %}