Merge pull request #256 from pablodip/sort-and-filter-fixes-3

Sort and filter fixes 3
This commit is contained in:
P 2018-02-08 16:30:50 +01:00 committed by GitHub
commit abaf5b3b31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 14 deletions

View File

@ -8,7 +8,8 @@
[commiteth.handlers :as handlers]
[commiteth.db :as db]
[commiteth.ui-model :as ui-model]
[commiteth.subscriptions :as subs]))
[commiteth.subscriptions :as subs]
[commiteth.util :as util]))
(defn bounty-item [bounty]
@ -207,8 +208,11 @@
[:div
(let [left (inc (* (dec page-number) items-per-page))
right (dec (+ left item-count))]
[:div.item-counts-label
[:span (str "Showing " left "-" right " of " total-count)]])
[:div.item-counts-label-and-sorting-container
[:div.item-counts-label
[:span (str "Showing " left "-" right " of " total-count)]]
(when-not (util/os-windows?)
[bounties-sort-view])])
(display-data-page bounty-page-data bounty-item container-element)]))
(defn bounties-page []
@ -223,8 +227,7 @@
[:div.ui.container.open-bounties-container
{:ref #(reset! container-element %1)}
[:div.open-bounties-header "Bounties"]
[:div.open-bounties-filter-and-sort
[bounty-filters-view]
[bounties-sort-view]]
[bounties-list @bounty-page-data container-element]]))
))
(when-not (util/os-windows?)
[:div.open-bounties-filter-and-sort
[bounty-filters-view]])
[bounties-list @bounty-page-data container-element]]))))

View File

@ -208,12 +208,12 @@
[:div.ui.vertical.segment
[:div.ui.container
[:div.ui.grid.stackable
[:div {:class (str (if (show-top-hunters?) "ten" "sixteen")
[:div {:class (str (if (show-top-hunters?) "eleven" "sixteen")
" wide computer sixteen wide tablet column")}
[:div.ui.container
[(pages @current-page)]]]
(when (show-top-hunters?)
[:div.six.wide.column.computer.only
[:div.five.wide.column.computer.only
[:div.ui.container.top-hunters
[:h3.top-hunters-header "Top 5 hunters"]
[:div.top-hunters-subheader "All time"]

View File

@ -0,0 +1,5 @@
(ns commiteth.util
(:require [clojure.string :as string]))
(defn os-windows? []
(string/includes? (-> js/navigator .-platform) "Win"))

View File

@ -414,6 +414,11 @@
color: #42505c;
}
.item-counts-label-and-sorting-container {
display: flex;
justify-content: space-between;
}
.open-bounties-filter-and-sort {
margin-top: 24px;
display: flex;
@ -442,6 +447,7 @@
margin-right: 10px;
position: relative;
display: flex;
z-index: 1000;
.text {
margin: 8px 12px;
@ -669,7 +675,7 @@
font-weight: 500;
line-height: 1.0;
color: #8d99a4;
padding: 8px 12px;
padding: 16px 12px 0;
display: flex;
align-items: center;
}
@ -711,6 +717,10 @@
}
}
.open-bounty-item:first-child {
border-top: #eaecee 1px solid !important;
}
.open-bounty-item {
background-color: #fff;
display: flex;
@ -1267,12 +1277,11 @@ body {
}
.item-counts-label {
margin: auto;
//margin: auto;
font-family: "PostGrotesk-Book";
font-size: 15px;
color: #8d99a4;
padding-top: 8px;
padding-bottom: 8px;
padding-top: 20px;
}