Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

The scaffold views will now work with javascript turned off. Also, re…

…placed most references to controller with service.
  • Loading branch information...
commit c3328a7db3d253fea5d067cd31d3f0da03507315 1 parent 2c2659f
@macourtney authored
Showing with 106 additions and 109 deletions.
  1. +3 −3 conjure_flow/test/conjure/flow/test_base.clj
  2. +4 −4 conjure_flow/test/views/layouts/templates/breadcrumbs.clj
  3. +2 −2 conjure_flow/test/views/layouts/templates/links.clj
  4. +3 −3 conjure_flow/test/views/layouts/templates/tabs.clj
  5. +7 −7 conjure_plugin/test/config/routes.clj
  6. +3 −3 conjure_scaffold/src/flows/template_flow.clj
  7. +4 −4 conjure_scaffold/src/helpers/template_helper.clj
  8. +2 −2 conjure_scaffold/src/views/templates/add.clj
  9. +2 −2 conjure_scaffold/src/views/templates/ajax_edit.clj
  10. +2 −2 conjure_scaffold/src/views/templates/ajax_show.clj
  11. +4 −5 conjure_scaffold/src/views/templates/delete_warning.clj
  12. +4 −5 conjure_scaffold/src/views/templates/edit.clj
  13. +4 −4 conjure_scaffold/src/views/templates/list_records.clj
  14. +3 −3 conjure_scaffold/src/views/templates/record_cell.clj
  15. +2 −2 conjure_scaffold/src/views/templates/record_row.clj
  16. +1 −1  conjure_scaffold/src/views/templates/record_view.clj
  17. +4 −5 conjure_scaffold/src/views/templates/show.clj
  18. +4 −4 conjure_scaffold/test/views/layouts/templates/breadcrumbs.clj
  19. +2 −2 conjure_scaffold/test/views/layouts/templates/links.clj
  20. +3 −3 conjure_scaffold/test/views/layouts/templates/tabs.clj
  21. +1 −1  conjure_script_core/resources/new_project/src/helpers/home_helper.clj
  22. +7 −7 conjure_script_core/test/config/routes.clj
  23. +4 −4 conjure_server/test/views/layouts/templates/breadcrumbs.clj
  24. +1 −1  conjure_test/src/conjure/test/builder.clj
  25. +1 −1  conjure_util/src/conjure/util/conjure_utils.clj
  26. +18 −18 conjure_util/test/conjure/util/test_conjure_utils.clj
  27. +1 −1  conjure_util/test/helpers/home_helper.clj
  28. +1 −1  conjure_view/src/conjure/view/util.clj
  29. +4 −4 conjure_view/test/views/layouts/templates/breadcrumbs.clj
  30. +2 −2 conjure_view/test/views/layouts/templates/links.clj
  31. +3 −3 conjure_view/test/views/layouts/templates/tabs.clj
View
6 conjure_flow/test/conjure/flow/test_base.clj
@@ -23,13 +23,13 @@
(is (=
(redirect-map "/home/welcome")
(redirect-to "/home/welcome"))))
- (request/set-request-map { :request { :scheme :http, :server-name "www.conjureapp.com" } :controller "home" :action "welcome" }
+ (request/set-request-map { :request { :scheme :http, :server-name "www.conjureapp.com" } :service "home" :action "welcome" }
(is (=
(redirect-map "http://www.conjureapp.com/home/welcome")
(redirect-to {})))
(is (=
(redirect-map "http://www.conjureapp.com/home/goodbye")
- (redirect-to { :controller "home", :action "goodbye" } )))
+ (redirect-to { :service "home", :action "goodbye" } )))
(is (=
(redirect-map "http://www.conjureapp.com/home/goodbye" 301)
- (redirect-to { :controller "home", :action "goodbye", :status 301 })))))
+ (redirect-to { :service "home", :action "goodbye", :status 301 })))))
View
8 conjure_flow/test/views/layouts/templates/breadcrumbs.clj
@@ -7,23 +7,23 @@
(list
[:p { :id "breadcrumbs"}
(let [layout-info (request/layout-info)
- original-controller (:controller layout-info)
+ original-controller (:service layout-info)
original-action (:action layout-info)
id (:id (:params layout-info))]
(list
"You are here: "
(link-to
[:strong (conjure-str-utils/human-title-case original-controller)]
- { :controller original-controller, :action "index", :params {} })
+ { :service original-controller, :action "index", :params {} })
" > "
(if id
(list
(link-to
[:strong (conjure-str-utils/human-title-case original-action)]
- { :controller original-controller, :action original-action, :params { :id id } })
+ { :service original-controller, :action original-action, :params { :id id } })
" > " [:strong id])
(link-to
[:strong (conjure-str-utils/human-title-case original-action)]
- { :controller original-controller, :action original-action, :params {} }))))]
+ { :service original-controller, :action original-action, :params {} }))))]
[:hr { :class "noscreen" }]))
View
4 conjure_flow/test/views/layouts/templates/links.clj
@@ -7,7 +7,7 @@
(defn
#^{ :doc "Returns the link controller from the given link map." }
link-controller [link-map location-controller]
- (string-utils/str-keyword (or (:controller (:url-for link-map)) location-controller)))
+ (string-utils/str-keyword (or (:service (:url-for link-map)) location-controller)))
(defn
#^{ :doc "Returns the link action from the given link map." }
@@ -25,7 +25,7 @@
(defn
#^{ :doc "Returns the id for a link or nil if no id should be set for the link." }
link-id [link-map original-request-map]
- (let [location-controller (:controller original-request-map)
+ (let [location-controller (:service original-request-map)
location-action (:action original-request-map)
link-controller (link-controller link-map location-controller)
link-action (link-action link-map location-action)]
View
6 conjure_flow/test/views/layouts/templates/tabs.clj
@@ -15,8 +15,8 @@
(defn
#^{ :doc "Returns the id for the tab, or nil if no id is needed." }
tab-id [tab-map original-request-map]
- (let [location-controller (:controller original-request-map)
- tab-controller (string-utils/str-keyword (or (:controller (:url-for tab-map)) location-controller))]
+ (let [location-controller (:service original-request-map)
+ tab-controller (string-utils/str-keyword (or (:service (:url-for tab-map)) location-controller))]
(when
(or
(:is-active tab-map)
@@ -34,7 +34,7 @@
#^{ :doc "Returns a tab map generated from a controller name." }
controller-tab [controller-name]
{ :text (string-utils/human-title-case controller-name),
- :url-for { :controller controller-name, :action "index" } })
+ :url-for { :service controller-name, :action "index" } })
(defn
#^{ :doc "Gets or generates all of the tab maps for use by generate-tab." }
View
14 conjure_plugin/test/config/routes.clj
@@ -6,17 +6,17 @@
(def ^:dynamic routes
{
:compiled
- [ { :route (clout/route-compile "/:controller/:action/:id")
- :request-map { :controller 'controller, :action 'action, :params { :id 'id } } }
+ [ { :route (clout/route-compile "/:service/:action/:id")
+ :request-map { :service 'service, :action 'action, :params { :id 'id } } }
- { :route (clout/route-compile "/:controller/:action")
- :request-map { :controller 'controller, :action 'action } }
+ { :route (clout/route-compile "/:service/:action")
+ :request-map { :service 'service, :action 'action } }
- { :route (clout/route-compile "/:controller")
- :request-map { :controller 'controller, :action "index" } }
+ { :route (clout/route-compile "/:service")
+ :request-map { :service 'service, :action "index" } }
{ :route (clout/route-compile "/")
- :request-map { :controller "home", :action "index" } } ]
+ :request-map { :service "home", :action "index" } } ]
; If you want to use your own route function, uncomment the key below and add your function to the vector. You
; function should take no arguments, and return a partial request map containing at least the controller and action
View
6 conjure_scaffold/src/flows/template_flow.clj
@@ -55,9 +55,9 @@
(delete-warning-view/render-view))
(def-action edit
- (when-let [id (request/id)]
- (edit-view/render-view))
- (redirect-to { :action "list-records", :params {} }))
+ (if-let [id (request/id)]
+ (edit-view/render-view)
+ (redirect-to { :action "list-records", :params {} })))
(def-action index
(redirect-to { :action "list-records" }))
View
8 conjure_scaffold/src/helpers/template_helper.clj
@@ -37,8 +37,8 @@
template-tabs [request-map]
(map
(fn [tab-map]
- (let [tab-controller (string-utils/str-keyword (:controller (:url-for tab-map)))]
- (if (and tab-controller (= tab-controller (:controller request-map)))
+ (let [tab-controller (string-utils/str-keyword (:service (:url-for tab-map)))]
+ (if (and tab-controller (= tab-controller (:service request-map)))
(assoc tab-map :is-active true)
tab-map)))
(request/set-request-map request-map
@@ -50,10 +50,10 @@ action or the action in the given request-map" }
template-request-map
([request-map] (template-request-map request-map (:action request-map)))
([request-map action]
- (let [controller (:controller request-map)
+ (let [controller (:service request-map)
tabs (template-tabs request-map)]
(merge request-map
- { :controller "templates",
+ { :service "templates",
:action action,
:layout-info { :tabs (template-tabs request-map) } }))))
View
4 conjure_scaffold/src/views/templates/add.clj
@@ -10,9 +10,9 @@
table-metadata (template-helper/table-metadata model-name)]
[:div { :class "article" }
[:h2 (str "Add a " (conjure-str-utils/human-title-case model-name))]
- (form-for { :name "create", :action "create", :controller model-name }
+ (form-for { :name "create", :action "create", :service model-name }
(list
(record-form/render-body table-metadata {})
(form-button "Create")
(nbsp)
- (link-to "Cancel" { :action "list-records", :controller model-name } )))]))
+ (link-to "Cancel" { :action "list-records", :service model-name } )))]))
View
4 conjure_scaffold/src/views/templates/ajax_edit.clj
@@ -17,7 +17,7 @@
(ajax-form-for
{ :name "ajax-save",
:action "ajax-save",
- :controller model-name,
+ :service model-name,
:update (success-fn row-id :replace) }
(list
(hidden-field record :record :id)
@@ -27,5 +27,5 @@
(ajax-link-to "Hide"
{ :update (success-fn row-id :replace)
:action "ajax-row"
- :controller model-name
+ :service model-name
:params { :id record } })))]]]))
View
4 conjure_scaffold/src/views/templates/ajax_show.clj
@@ -18,11 +18,11 @@
(ajax-link-to "Edit"
{ :update (success-fn row-id :replace)
:action "ajax-edit"
- :controller model-name
+ :service model-name
:params { :id record } })
(nbsp)
(ajax-link-to "Hide"
{ :update (success-fn row-id :replace)
:action "ajax-row"
- :controller model-name
+ :service model-name
:params { :id record } })]]]))
View
9 conjure_scaffold/src/views/templates/delete_warning.clj
@@ -6,12 +6,11 @@
(def-view []
(let [model-name (request/service)
- table-metadata (template-helper/table-metadata model-name)
- record (request/record)]
+ record (template-helper/get-record model-name (request/id))]
[:div { :class "article" }
[:h2 (str "Deleting " (or (:name record) (:id record)))]
[:p "Are you sure you want to delete this record?"]
- (record-view/render-body table-metadata record)
- (button-to "Delete" { :action "delete", :controller model-name, :params { :id record } })
+ (record-view/render-body (template-helper/table-metadata model-name) record)
+ (button-to "Delete" { :action "delete", :service model-name, :params { :id record } })
(nbsp)
- (link-to "Cancel" { :action "list-records", :controller model-name })]))
+ (link-to "Cancel" { :action "list-records", :service model-name })]))
View
9 conjure_scaffold/src/views/templates/edit.clj
@@ -6,14 +6,13 @@
(def-view []
(let [model-name (request/service)
- table-metadata (template-helper/table-metadata model-name)
- record (request/record)]
+ record (template-helper/get-record model-name (request/id))]
[:div { :class "article" }
[:h2 (str "Editing " (or (:name record) (:id record) " a record"))]
- (form-for { :name "save", :action "save", :controller model-name }
+ (form-for { :name "save", :action "save", :service model-name }
(list
(hidden-field record :record :id)
- (record-form/render-body table-metadata record)
+ (record-form/render-body (template-helper/table-metadata model-name) record)
(form-button "Save")
(nbsp)
- (link-to "Cancel" { :action "show", :controller model-name, :params { :id record } } )))]))
+ (link-to "Cancel" { :action "show", :service model-name, :params { :id record } } )))]))
View
8 conjure_scaffold/src/views/templates/list_records.clj
@@ -33,20 +33,20 @@
[:h2 (str (conjure-str-utils/human-title-case model-name) " List")]
[:table { :id "list-table" }
(header table-metadata)
- (map #(record-row/render-body model-name table-metadata %) records)]
+ (map record-row/render-body records)]
[:div { :id "add" }
[:div { :id "add-form", :style "display: none" }
(ajax-form-for
{ :name "record",
:action "ajax-add",
- :controller model-name,
+ :service model-name,
:update '(addFormSuccess "#list-table" "#add-link" "#add-form") }
(list
(record-form/render-body table-metadata {})
(form-button "Create")
(nbsp)
- (link-to "Cancel" { :action "list-records", :controller model-name, :html-options { :id "add-cancel" } } )))]
- (link-to "Add" { :action "add", :controller model-name, :html-options { :id "add-link" } } )]]
+ (link-to "Cancel" { :action "list-records", :service model-name, :html-options { :id "add-cancel" } } )))]
+ (link-to "Add" { :action "add", :service model-name, :html-options { :id "add-link" } } )]]
[:script { :type "text/javascript" }
(keyword
(scriptjure/js
View
6 conjure_scaffold/src/views/templates/record_cell.clj
@@ -10,14 +10,14 @@
(ajax-link-to record-id
{ :update (success-fn (str "row-" record-id) :replace)
:action "ajax-show"
- :controller model-name,
+ :service model-name,
:params { :id record-id }
:html-options
{ :href (conjure-utils/url-for
- { :action "show", :controller model-name, :params { :id (:id record) } }) } })]
+ { :action "show", :service model-name, :params { :id (:id record) } }) } })]
(let [record-key-str (conjure-str-utils/str-keyword record-key)]
(if (. record-key-str endsWith "_id")
(let [belongs-to-model (conjure-str-utils/strip-ending record-key-str "_id")
belongs-to-id (get record record-key)]
- [:td (link-to belongs-to-id { :controller belongs-to-model, :action "show", :id belongs-to-id })])
+ [:td (link-to belongs-to-id { :service belongs-to-model, :action "show", :id belongs-to-id })])
[:td (get record record-key)])))))
View
4 conjure_scaffold/src/views/templates/record_row.clj
@@ -22,10 +22,10 @@
{ :update (success-fn row-id :remove)
:confirm (confirm-fn (str "Are you sure you want to delete the record with id: " (:id record)))
:action "ajax-delete"
- :controller model-name,
+ :service model-name,
:params { :id record }
:html-options
{ :href (conjure-utils/url-for
{ :action "delete-warning",
- :controller model-name,
+ :service model-name,
:params { :id record } }) } })]]))
View
2  conjure_scaffold/src/views/templates/record_view.clj
@@ -12,7 +12,7 @@
belongs-to-id (get record record-key)]
[:p [:strong field-name] ": "
(link-to belongs-to-id
- { :controller belongs-to-model,
+ { :service belongs-to-model,
:action "show",
:params { :id belongs-to-id } })])))
View
9 conjure_scaffold/src/views/templates/show.clj
@@ -7,11 +7,10 @@
(def-view []
(let [model-name (request/service)
- table-metadata (template-helper/table-metadata model-name)
- record (request/record)]
+ record (template-helper/get-record model-name (request/id))]
[:div { :class "article" }
[:h2 (or (:name record) (str "Showing a " (conjure-str-utils/human-title-case model-name)))]
- (record-view/render-body table-metadata record)
- (link-to "List" { :action "list-records", :controller model-name })
+ (record-view/render-body (template-helper/table-metadata model-name) record)
+ (link-to "List" { :action "list-records", :service model-name })
(nbsp)
- (link-to "Edit" { :action "edit", :controller model-name, :params { :id record } })]))
+ (link-to "Edit" { :action "edit", :service model-name, :params { :id record } })]))
View
8 conjure_scaffold/test/views/layouts/templates/breadcrumbs.clj
@@ -7,23 +7,23 @@
(list
[:p { :id "breadcrumbs"}
(let [layout-info (request/layout-info)
- original-controller (:controller layout-info)
+ original-controller (:service layout-info)
original-action (:action layout-info)
id (:id (:params layout-info))]
(list
"You are here: "
(link-to
[:strong (conjure-str-utils/human-title-case original-controller)]
- { :controller original-controller, :action "index", :params {} })
+ { :service original-controller, :action "index", :params {} })
" > "
(if id
(list
(link-to
[:strong (conjure-str-utils/human-title-case original-action)]
- { :controller original-controller, :action original-action, :params { :id id } })
+ { :service original-controller, :action original-action, :params { :id id } })
" > " [:strong id])
(link-to
[:strong (conjure-str-utils/human-title-case original-action)]
- { :controller original-controller, :action original-action, :params {} }))))]
+ { :service original-controller, :action original-action, :params {} }))))]
[:hr { :class "noscreen" }]))
View
4 conjure_scaffold/test/views/layouts/templates/links.clj
@@ -7,7 +7,7 @@
(defn
#^{ :doc "Returns the link controller from the given link map." }
link-controller [link-map location-controller]
- (string-utils/str-keyword (or (:controller (:url-for link-map)) location-controller)))
+ (string-utils/str-keyword (or (:service (:url-for link-map)) location-controller)))
(defn
#^{ :doc "Returns the link action from the given link map." }
@@ -25,7 +25,7 @@
(defn
#^{ :doc "Returns the id for a link or nil if no id should be set for the link." }
link-id [link-map original-request-map]
- (let [location-controller (:controller original-request-map)
+ (let [location-controller (:service original-request-map)
location-action (:action original-request-map)
link-controller (link-controller link-map location-controller)
link-action (link-action link-map location-action)]
View
6 conjure_scaffold/test/views/layouts/templates/tabs.clj
@@ -15,8 +15,8 @@
(defn
#^{ :doc "Returns the id for the tab, or nil if no id is needed." }
tab-id [tab-map original-request-map]
- (let [location-controller (:controller original-request-map)
- tab-controller (string-utils/str-keyword (or (:controller (:url-for tab-map)) location-controller))]
+ (let [location-controller (:service original-request-map)
+ tab-controller (string-utils/str-keyword (or (:service (:url-for tab-map)) location-controller))]
(when
(or
(:is-active tab-map)
@@ -34,7 +34,7 @@
#^{ :doc "Returns a tab map generated from a controller name." }
controller-tab [controller-name]
{ :text (string-utils/human-title-case controller-name),
- :url-for { :controller controller-name, :action "index" } })
+ :url-for { :service controller-name, :action "index" } })
(defn
#^{ :doc "Gets or generates all of the tab maps for use by generate-tab." }
View
2  conjure_script_core/resources/new_project/src/helpers/home_helper.clj
@@ -8,7 +8,7 @@
request-map
:layout-info
{ :links
- [{ :text "Home", :url-for { :controller :home, :action :index } }]}))
+ [{ :text "Home", :url-for { :service :home, :action :index } }]}))
(defmacro
with-home-request-map [& body]
View
14 conjure_script_core/test/config/routes.clj
@@ -6,17 +6,17 @@
(def ^:dynamic routes
{
:compiled
- [ { :route (clout/route-compile "/:controller/:action/:id")
- :request-map { :controller 'controller, :action 'action, :params { :id 'id } } }
+ [ { :route (clout/route-compile "/:service/:action/:id")
+ :request-map { :service 'service, :action 'action, :params { :id 'id } } }
- { :route (clout/route-compile "/:controller/:action")
- :request-map { :controller 'controller, :action 'action } }
+ { :route (clout/route-compile "/:service/:action")
+ :request-map { :service 'service, :action 'action } }
- { :route (clout/route-compile "/:controller")
- :request-map { :controller 'controller, :action "index" } }
+ { :route (clout/route-compile "/:service")
+ :request-map { :service 'service, :action "index" } }
{ :route (clout/route-compile "/")
- :request-map { :controller "home", :action "index" } } ]
+ :request-map { :service "home", :action "index" } } ]
; If you want to use your own route function, uncomment the key below and add your function to the vector. You
; function should take no arguments, and return a partial request map containing at least the controller and action
View
8 conjure_server/test/views/layouts/templates/breadcrumbs.clj
@@ -7,23 +7,23 @@
(list
[:p { :id "breadcrumbs"}
(let [layout-info (request/layout-info)
- original-controller (:controller layout-info)
+ original-controller (:service layout-info)
original-action (:action layout-info)
id (:id (:params layout-info))]
(list
"You are here: "
(link-to
[:strong (conjure-str-utils/human-title-case original-controller)]
- { :controller original-controller, :action "index", :params {} })
+ { :service original-controller, :action "index", :params {} })
" > "
(if id
(list
(link-to
[:strong (conjure-str-utils/human-title-case original-action)]
- { :controller original-controller, :action original-action, :params { :id id } })
+ { :service original-controller, :action original-action, :params { :id id } })
" > " [:strong id])
(link-to
[:strong (conjure-str-utils/human-title-case original-action)]
- { :controller original-controller, :action original-action, :params {} }))))]
+ { :service original-controller, :action original-action, :params {} }))))]
[:hr { :class "noscreen" }]))
View
2  conjure_test/src/conjure/test/builder.clj
@@ -67,7 +67,7 @@
([controller action silent]
(let [controller-view-unit-test-directory
(find-or-create-controller-view-unit-test-directory
- { :controller controller,
+ { :service controller,
:silent silent })]
(if (and controller action controller-view-unit-test-directory)
(file-utils/create-file (util/view-unit-test-file controller action controller-view-unit-test-directory) silent)))))
View
2  conjure_util/src/conjure/util/conjure_utils.clj
@@ -177,7 +177,7 @@ the result." }
(propagate-session-id
request-map
(merge
- (select-keys request-map [:service :controller :action :request :temp-session])
+ (select-keys request-map [:service :service :action :request :temp-session])
params)))
(defn
View
36 conjure_util/test/conjure/util/test_conjure_utils.clj
@@ -55,43 +55,43 @@
(deftest test-merge-url-for-params
(is (=
- { :controller "hello", :action "edit", :params { :id 0 } }
+ { :service "hello", :action "edit", :params { :id 0 } }
(merge-url-for-params
- { :controller "hello", :action "show", :params { :id 1 } }
+ { :service "hello", :action "show", :params { :id 1 } }
{ :action "edit", :params { :id 0 } })))
(is (=
- { :controller "hello", :action "edit" }
+ { :service "hello", :action "edit" }
(merge-url-for-params
- { :controller "hello", :action "show", :params { :id 1 } }
+ { :service "hello", :action "show", :params { :id 1 } }
{ :action "edit" })))
(is (=
- { :controller "hello", :action "edit", :params { :id 0 } }
+ { :service "hello", :action "edit", :params { :id 0 } }
(merge-url-for-params
- { :controller "hello", :action "show", :params { :id 1, :text "blah" } }
+ { :service "hello", :action "show", :params { :id 1, :text "blah" } }
{ :action "edit", :params { :id 0 } }))))
(deftest test-url-for
- (request/set-request-map { :controller "hello", :action "show" }
+ (request/set-request-map { :service "hello", :action "show" }
(is (= "/hello/show" (url-for))))
- (request/set-request-map { :controller "hello", :action "show", :params { :id 1 } }
+ (request/set-request-map { :service "hello", :action "show", :params { :id 1 } }
(is (= "/hello/show" (url-for))))
- (request/set-request-map { :controller "hello", :action "show", :params { :id { :id 1 } } }
+ (request/set-request-map { :service "hello", :action "show", :params { :id { :id 1 } } }
(is (= "/hello/show" (url-for))))
- (request/set-request-map { :controller "hello", :action "show", :anchor "message"}
+ (request/set-request-map { :service "hello", :action "show", :anchor "message"}
(is (= "/hello/show" (url-for))))
- (request/set-request-map { :controller "hello", :action "show", :params { :id 1 }, :anchor "message"}
+ (request/set-request-map { :service "hello", :action "show", :params { :id 1 }, :anchor "message"}
(is (= "/hello/show" (url-for))))
- (request/set-request-map { :controller "hello", :action "show", :anchor "message"}
+ (request/set-request-map { :service "hello", :action "show", :anchor "message"}
(is (= "/hello/show/#message" (url-for { :anchor "message" }))))
- (request/set-request-map { :controller "hello", :action "show" }
+ (request/set-request-map { :service "hello", :action "show" }
(is (= "/hello/show/1/#message" (url-for { :params { :id 1 }, :anchor "message" }))))
- (request/set-request-map { :controller "hello", :action "show" }
+ (request/set-request-map { :service "hello", :action "show" }
(is (= "/hello/show/1" (url-for { :params { :id 1 } }))))
- (request/set-request-map { :controller "hello", :action "show" }
+ (request/set-request-map { :service "hello", :action "show" }
(is (= "/hello/show/1" (url-for { :params { :id { :id 1 } } }))))
- (request/set-request-map { :controller "hello", :action "add" }
+ (request/set-request-map { :service "hello", :action "add" }
(is (= "/hello/show/1" (url-for { :action "show", :params { :id 1 } }))))
- (let [params { :controller "hello", :action "show", :params { :id 1 } }]
+ (let [params { :service "hello", :action "show", :params { :id 1 } }]
(request/set-request-map { :request { :server-name "localhost" } }
(is (= "http://localhost/hello/show/1" (url-for params))))
(request/set-request-map { :request { :server-name "localhost" :server-port 8080 } }
@@ -102,7 +102,7 @@
(is (= "http://localhost:8080/hello/show/1" (url-for (merge params { :port 8080})))))
(request/set-request-map { :request { :server-name "localhost" } }
(is (= "http://foo:bar@localhost/hello/show/1" (url-for (merge params { :user "foo", :password "bar"}))))))
- (let [params { :controller "hello", :action "show", :params { :id 1, :session-id "blah" } }]
+ (let [params { :service "hello", :action "show", :params { :id 1, :session-id "blah" } }]
(binding [session-config/use-session-cookie false]
(request/set-request-map { :request { :server-name "localhost" } }
(is (= "http://localhost/hello/show/1?session-id=blah" (url-for params)))))))
View
2  conjure_util/test/helpers/home_helper.clj
@@ -8,7 +8,7 @@
request-map
:layout-info
{ :links
- [{ :text "Home", :url-for { :controller :home, :action :index } }]}))
+ [{ :text "Home", :url-for { :service :home, :action :index } }]}))
(defmacro
with-home-request-map [& body]
View
2  conjure_view/src/conjure/view/util.clj
@@ -148,7 +148,7 @@ the original request-map." }
:layout-info
(merge
(:layout-info request/request-map)
- (select-keys request/request-map [:service :controller :action :params])) }))
+ (select-keys request/request-map [:service :service :action :params])) }))
(defn-
#^{:doc "Returns the rendered layout for the given layout name with the given body."}
View
8 conjure_view/test/views/layouts/templates/breadcrumbs.clj
@@ -7,23 +7,23 @@
(list
[:p { :id "breadcrumbs"}
(let [layout-info (request/layout-info)
- original-controller (:controller layout-info)
+ original-controller (:service layout-info)
original-action (:action layout-info)
id (:id (:params layout-info))]
(list
"You are here: "
(link-to
[:strong (conjure-str-utils/human-title-case original-controller)]
- { :controller original-controller, :action "index", :params {} })
+ { :service original-controller, :action "index", :params {} })
" > "
(if id
(list
(link-to
[:strong (conjure-str-utils/human-title-case original-action)]
- { :controller original-controller, :action original-action, :params { :id id } })
+ { :service original-controller, :action original-action, :params { :id id } })
" > " [:strong id])
(link-to
[:strong (conjure-str-utils/human-title-case original-action)]
- { :controller original-controller, :action original-action, :params {} }))))]
+ { :service original-controller, :action original-action, :params {} }))))]
[:hr { :class "noscreen" }]))
View
4 conjure_view/test/views/layouts/templates/links.clj
@@ -7,7 +7,7 @@
(defn
#^{ :doc "Returns the link controller from the given link map." }
link-controller [link-map location-controller]
- (string-utils/str-keyword (or (:controller (:url-for link-map)) location-controller)))
+ (string-utils/str-keyword (or (:service (:url-for link-map)) location-controller)))
(defn
#^{ :doc "Returns the link action from the given link map." }
@@ -25,7 +25,7 @@
(defn
#^{ :doc "Returns the id for a link or nil if no id should be set for the link." }
link-id [link-map original-request-map]
- (let [location-controller (:controller original-request-map)
+ (let [location-controller (:service original-request-map)
location-action (:action original-request-map)
link-controller (link-controller link-map location-controller)
link-action (link-action link-map location-action)]
View
6 conjure_view/test/views/layouts/templates/tabs.clj
@@ -15,8 +15,8 @@
(defn
#^{ :doc "Returns the id for the tab, or nil if no id is needed." }
tab-id [tab-map original-request-map]
- (let [location-controller (:controller original-request-map)
- tab-controller (string-utils/str-keyword (or (:controller (:url-for tab-map)) location-controller))]
+ (let [location-controller (:service original-request-map)
+ tab-controller (string-utils/str-keyword (or (:service (:url-for tab-map)) location-controller))]
(when
(or
(:is-active tab-map)
@@ -34,7 +34,7 @@
#^{ :doc "Returns a tab map generated from a controller name." }
controller-tab [controller-name]
{ :text (string-utils/human-title-case controller-name),
- :url-for { :controller controller-name, :action "index" } })
+ :url-for { :service controller-name, :action "index" } })
(defn
#^{ :doc "Gets or generates all of the tab maps for use by generate-tab." }
Please sign in to comment.
Something went wrong with that request. Please try again.