Skip to content

Commit

Permalink
Merge pull request #51 from joshkh/better-toolbar-layout
Browse files Browse the repository at this point in the history
Better toolbar layout
  • Loading branch information
yochannah authored Mar 21, 2018
2 parents bbcdb9b + a076cef commit ce88428
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 78 deletions.
8 changes: 8 additions & 0 deletions less/site.less
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@
white-space: pre;
}

.dashboard-buttons {
margin-right: 30px;
}

.codegen-checkbox-container {
margin-top: 15px;
}


.popover {
padding: 0;
Expand Down
64 changes: 32 additions & 32 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject org.intermine/im-tables "0.8.0"
(defproject org.intermine/im-tables "0.8.1"
:dependencies [[org.clojure/clojure "1.9.0"]
[org.clojure/clojurescript "1.10.145"]
[reagent "0.7.0" :exclusions [cljsjs/react]]
Expand Down Expand Up @@ -33,54 +33,54 @@
:clean-targets ^{:protect false} ["resources/public/js/compiled" "target"
"test/js"]

:figwheel {:css-dirs ["resources/public/css"]
:figwheel {:css-dirs ["resources/public/css"]
:server-port 3448}

:less {:source-paths ["less"]
:target-path "resources/public/css"}
:target-path "resources/public/css"}

:profiles
{:dev
{:dependencies [[binaryage/devtools "0.9.9"]]

:plugins [[lein-figwheel "0.5.15"]
[lein-doo "0.1.7"]]
:plugins [[lein-figwheel "0.5.15"]
[lein-doo "0.1.7"]]
}}

:cljsbuild
{:builds
[{:id "dev"
[{:id "dev"
:source-paths ["src"]
:figwheel {:on-jsload "im-tables.core/mount-root"}
:compiler {:main im-tables.core
:output-to "resources/public/js/compiled/app.js"
:output-dir "resources/public/js/compiled/out"
:asset-path "js/compiled/out"
:source-map-timestamp true
:preloads [devtools.preload]
:parallel-build true
:npm-deps {:highlight.js "9.12.0"}
:install-deps true
:external-config {:devtools/config {:features-to-install :all}}
}}
:figwheel {:on-jsload "im-tables.core/mount-root"}
:compiler {:main im-tables.core
:output-to "resources/public/js/compiled/app.js"
:output-dir "resources/public/js/compiled/out"
:asset-path "js/compiled/out"
:source-map-timestamp true
:preloads [devtools.preload]
:parallel-build true
:npm-deps {:highlight.js "9.12.0"}
:install-deps true
:external-config {:devtools/config {:features-to-install :all}}
}}

{:id "min"
{:id "min"
:source-paths ["src"]
:jar true
:compiler {:main im-tables.core
:output-to "resources/public/js/compiled/app.js"
:optimizations :advanced
:closure-defines {goog.DEBUG false}
:npm-deps {:highlight.js "9.12.0"}
:install-deps true
:pretty-print false}}
:jar true
:compiler {:main im-tables.core
:output-to "resources/public/js/compiled/app.js"
:optimizations :advanced
:closure-defines {goog.DEBUG false}
:npm-deps {:highlight.js "9.12.0"}
:install-deps true
:pretty-print false}}

{:id "test"
{:id "test"
:source-paths ["src" "test/cljs"]
:compiler {:main im-tables.runner
:output-to "resources/public/js/compiled/test.js"
:output-dir "resources/public/js/compiled/test/out"
:optimizations :none}}
:compiler {:main im-tables.runner
:output-to "resources/public/js/compiled/test.js"
:output-dir "resources/public/js/compiled/test/out"
:optimizations :none}}
]}

;:prep-tasks [["cljsbuild" "once" "min"] ["less" "once"] "compile"]
Expand Down
44 changes: 20 additions & 24 deletions src/im_tables/views/dashboard/main.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
[:div.row
[column-manager/main loc]]
[:div.row.im-table-toolbar
[:div.col-md-8
[:div.btn-toolbar

[:div.col-sm-12
[:div.btn-toolbar.pull-left.dashboard-buttons
[:div.btn-group
[:button.btn.btn-default
{:on-click (fn []
Expand All @@ -30,24 +29,21 @@
[:div.btn-group [save/main loc]]
[:div.btn-group [exporttable/exporttable loc]]
[:div.btn-group [codegen/main loc]]
[undo/main loc]
]
]
[:div.col-md-4
[:div.container-fluid
[:div.row.pagination-bar
[:div.col-xs-12
[:div.pull-right
[:div.pull-right [pager/main loc
(merge pagination
{:total (get response :iTotalRecords)})]]
[:label.pull-right
{:style {:padding-right "20px"}}
(when (:iTotalRecords response)
(str "Showing "
(inc (:start pagination)) " to "
(min
(+ (:start pagination) (:limit pagination))
(:iTotalRecords response))
" of "
(.toLocaleString (:iTotalRecords response)) " rows"))]]]]]]]]))
[undo/main loc]]
[:div.row.pagination-bar.pull-left
[:div.pull-left
[pager/main loc
(merge pagination
{:total (get response :iTotalRecords)})]]
[:label.pull-left
{:style {:padding-left "10px"}}
(when (:iTotalRecords response)
(str "Showing "
(inc (:start pagination)) " to "
(min
(+ (:start pagination) (:limit pagination))
(:iTotalRecords response))
" of "
(.toLocaleString (:iTotalRecords response)) " rows"))]

]]]]))
36 changes: 17 additions & 19 deletions src/im_tables/views/dashboard/manager/codegen/main.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,23 @@
:on-change (fn [e]
(dispatch [:main/set-codegen-option loc :lang (oget e :target :value) true]))}
(map (fn [[value {:keys [label]}]] ^{:key value} [:option {:value value} label]) languages)]
(when (= "js" lang)
[:div.checkbox
[:label [:input
{:type "checkbox"
:value ""
:on-change (fn [e] (dispatch [:main/set-codegen-option loc :html? (not html?)]))
:checked html?}] "Include HTML"]])
[:div.checkbox
[:label [:input
{:type "checkbox"
:value ""
:on-change (fn [e] (dispatch [:main/set-codegen-option loc :comments? (not comments?)]))
:checked comments?}] "Include comments"]]
[:div.checkbox
[:label [:input
{:type "checkbox"
:value ""
:on-change (fn [e] (dispatch [:main/set-codegen-option loc :highlight? (not highlight?)]))
:checked highlight?}] "Highlight syntax"]]
[:div.codegen-checkbox-container
(when (= "js" lang)
[:div [:label [:input
{:type "checkbox"
:value ""
:on-change (fn [e] (dispatch [:main/set-codegen-option loc :html? (not html?)]))
:checked html?}] " Include HTML"]])
[:div [:label [:input
{:type "checkbox"
:value ""
:on-change (fn [e] (dispatch [:main/set-codegen-option loc :comments? (not comments?)]))
:checked comments?}] " Include comments"]]
[:div [:label [:input
{:type "checkbox"
:value ""
:on-change (fn [e] (dispatch [:main/set-codegen-option loc :highlight? (not highlight?)]))
:checked highlight?}] " Highlight syntax"]]]
]))))


Expand Down
2 changes: 0 additions & 2 deletions src/im_tables/views/dashboard/pagination.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

(def show-amounts (list 10 20 50 100 250))



(defn main []
(fn [loc {:keys [start limit total]}]
[:div.btn-toolbar
Expand Down
2 changes: 1 addition & 1 deletion src/im_tables/views/dashboard/undo.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
explanations (subscribe [:undo-explanations loc])
redo-explanations (subscribe [:redo-explanations loc])]
(fn []
[:div.btn-toolbar
[:div.btn-group
[:div.btn-group
[:button.btn.btn-default
{:disabled (not @undos)
Expand Down

0 comments on commit ce88428

Please sign in to comment.