Skip to content

Commit

Permalink
move grant op meta to misc ns; source sans pro; meta on builder page;…
Browse files Browse the repository at this point in the history
… more tweaks
  • Loading branch information
andrew committed Jun 2, 2016
1 parent b2903a7 commit 773c56f
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 42 deletions.
23 changes: 23 additions & 0 deletions src/cljs/ulysses/components/misc.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
(ns ulysses.components.misc
(:require [ulysses.utils :refer [mechanism-to-contextual]]
[ulysses.components.basic :refer [label]]
[ulysses.lib.moment :as m]))

;; ----------------------------------------------------------------------------
;; grant op meta
;; ----------------------------------------------------------------------------

(defn grant-op-time-left-label [mi]
(when (m/is-valid mi)
[label :default
"ends "
(-> mi (m/from-now false))]))

(defn grant-op-fm-label [{:keys [name]}]
[label (-> name keyword mechanism-to-contextual) name])

(defn grant-op-meta
[{:keys [funding-mechanism due-date]}]
[:div.grant-op-meta
[grant-op-fm-label funding-mechanism]
[grant-op-time-left-label due-date]])
14 changes: 10 additions & 4 deletions src/cljs/ulysses/pages/builder.cljs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns ulysses.pages.builder
(:require [re-frame.core :as re-frame :refer [subscribe dispatch]]
[ulysses.components.basic :refer [hink link loading-or-no-results fa]]
[ulysses.components.misc :refer [grant-op-meta]]
[ulysses.components.word-cloud :refer [word-cloud]]
[ulysses.utils :refer [map-subels map-lookup str->int]]
[reagent.core :as r]
Expand Down Expand Up @@ -119,7 +120,7 @@
[:div.faculties-pool.table-responsive
[:table.table.table-striped.table-bordered.table-sm
[:thead
[:tr [:th nil] [:th "Name"] [:th "Title"] [:th "Year Hired"] [:th "Score"]]]
[:tr [:th nil] [:th "Name"] [:th "Title"] [:th "Year Hired"] [:th "Score"] [:th ""]]]
[:tbody
(map-subels pool-row faculties-and-metrics)]]]))

Expand Down Expand Up @@ -147,10 +148,15 @@
[:h3 "Word Cloud"]]]]])

(defn builder-header
[{:keys [title purpose]}]
[{:keys [title purpose] :as op}]
[:div.builder-header
[:h3.text-xs-center.mb-15 title]
[:p purpose]])
[:div.container-fluid
[:div.row
[:div.col-md-12
[:h3.text-xs-center.mb-15 title]
[:div.text-xs-center
[grant-op-meta op]]
[:p purpose]]]]])

;; ----------------------------------------------------------------------------
;; main
Expand Down
21 changes: 4 additions & 17 deletions src/cljs/ulysses/pages/home.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
truncate-with-ellipsis]]
[ulysses.components.basic :refer [hink
link
label
dropdown
loading-or-no-results
css-transition-group-standard]]
[ulysses.lib.moment :as m]
[ulysses.components.misc :refer [grant-op-meta]]
[ulysses.routes :as routes]))

;; ----------------------------------------------------------------------------
Expand All @@ -20,15 +19,6 @@

; grant-op-box ----------

(defn grant-op-box-time-left [mi]
(when (m/is-valid mi)
[label :default
"ends "
(-> mi (m/from-now false))]))

(defn grant-op-box-fm-label [{:keys [name]}]
[label (-> name keyword mechanism-to-contextual) name])

(defn grant-op-box-initial-team-member [tm]
[:span (or (:name tm) ", ")])

Expand Down Expand Up @@ -81,15 +71,12 @@
;; primary sub-components
;; ----------------------------------------------------------------------------

(defn grant-op-box [grant]
(let [{:keys [id title purpose due-date funding-mechanism initial-team]} grant
body (truncate-with-ellipsis purpose 300)]
(defn grant-op-box [{:keys [id title purpose initial-team] :as op}]
(let [body (truncate-with-ellipsis purpose 300)]
[:div.grant-op-box
[link [:builder :grant-op-id id] {:class :inside}
[:div.title title]
[:div.meta
[grant-op-box-fm-label funding-mechanism]
[grant-op-box-time-left due-date]]
[grant-op-meta op]
[:div.about [:p body]]
[grant-op-box-initial-team initial-team]]
[grant-op-box-actions id]]))
Expand Down
10 changes: 5 additions & 5 deletions src/sass/_bootstrap-overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@
// by a factor (for each size)

.form-control {
padding-bottom: $input-padding-y * .7;
// padding-bottom: $input-padding-y * .7;
}

.form-control-sm {
padding-bottom: $input-padding-y-sm * .6;
// padding-bottom: $input-padding-y-sm * .6;
}

.form-control-lg {
padding-bottom: $input-padding-y-lg * .8;
// padding-bottom: $input-padding-y-lg * .8;
}

.c-select {
padding-bottom: .375rem * .7 !important;
// padding-bottom: .375rem * .7 !important;
}

// ----------------------------------------------------------------------------

// label padding is off

.label {
padding-top: .35em;
// padding-top: .35em;
}
18 changes: 15 additions & 3 deletions src/sass/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ h3,
h4,
h5,
h6 {
font-weight: 100;
text-transform: lowercase;
}

Expand All @@ -42,7 +41,7 @@ a.fancy-switch {
height: 22px;
left: 0;
position: absolute;
top: 4px;
top: 5px;
width: 40px;

&::after {
Expand Down Expand Up @@ -88,7 +87,8 @@ a.fancy-switch {
display: inline-block;
font-size: 1.3em;
font-weight: bold;
padding-top: 2px;
line-height: 0;
padding-top: 6px;
text-decoration: none;

&:active,
Expand Down Expand Up @@ -118,3 +118,15 @@ a.fancy-switch {
.multi-select {
width: 100%;
}

.grant-op-meta {
margin-bottom: 10px;

.label {
margin-right: 5px;

&:last-of-type {
margin-right: 0;
}
}
}
2 changes: 1 addition & 1 deletion src/sass/_fonts.scss
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@import url(https://fonts.googleapis.com/css?family=Catamaran:500,400,300,100);
@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:500,400,300|Catamaran:100);
5 changes: 4 additions & 1 deletion src/sass/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ $link-color: $brand-primary;

// Typography ------------------------

$font-family-sans-serif: "Catamaran", "Helvetica Neue", Helvetica, Arial, sans-serif;
$font-family-sans-serif: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;

$headings-font-family: 'Catamaran', sans-serif;
$headings-font-weight: 100;

// More Misc

Expand Down
2 changes: 1 addition & 1 deletion src/sass/components/_faculties-pool.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.faculties-pool {
background: $white;
max-height: 50vh;
max-height: 25vh;
overflow-y: auto;

.table {
Expand Down
8 changes: 0 additions & 8 deletions src/sass/components/_grant-op-boxes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ $grant-op-box-actions-height: 42px;
font-size: 1.5em;
}

.meta {
margin-bottom: 10px;

.label {
margin-right: 5px;
}
}

.about {
opacity: 0;
transition: opacity 150ms;
Expand Down
4 changes: 2 additions & 2 deletions src/sass/components/_uconn-banner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
margin-bottom: 0;

.ovpr-sub {
margin-top: 10px;
margin-top: 9px;

a {
font-size: 1rem;
Expand Down Expand Up @@ -104,7 +104,7 @@

.ovpr-sub {
float: left;
margin-top: 18px;
margin-top: 17px;

a {
color: $grayed-link-color;
Expand Down

0 comments on commit 773c56f

Please sign in to comment.