From 3f05854c9c76f45780a4dd0d198c35777d0fc459 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Mon, 29 Sep 2014 10:38:28 +0200 Subject: [PATCH 1/2] userSearch --- .../app/controllers/users.js.coffee | 2 +- app/assets/javascripts/app/views/user.jst.eco | 40 +++++++++---------- app/assets/stylesheets/zzz.css.erb | 26 +++++++++++- 3 files changed, 45 insertions(+), 23 deletions(-) diff --git a/app/assets/javascripts/app/controllers/users.js.coffee b/app/assets/javascripts/app/controllers/users.js.coffee index 7a11e4bd5..6f9e9c573 100644 --- a/app/assets/javascripts/app/controllers/users.js.coffee +++ b/app/assets/javascripts/app/controllers/users.js.coffee @@ -14,7 +14,7 @@ class Index extends App.Controller @html App.view('user')( head: 'Users' buttons: [ - { name: 'New User', 'data-type': 'new', class: 'primary' } + { name: 'New User', 'data-type': 'new', class: 'btn--success' } ] roles: App.Role.all() ) diff --git a/app/assets/javascripts/app/views/user.jst.eco b/app/assets/javascripts/app/views/user.jst.eco index a04fedf87..655a76045 100644 --- a/app/assets/javascripts/app/views/user.jst.eco +++ b/app/assets/javascripts/app/views/user.jst.eco @@ -1,24 +1,24 @@ -
-
-
-

<%- @T( @head ) %> <%- @T( 'Management' ) %>

-
-
- <% if @buttons: %> - <% for button in @buttons: %> - <%- @T( button.name ) %> - <% end %> - <% end %> -
+
+
+

<%- @T( @head ) %> <%- @T( 'Management' ) %>

- - - -
- <% for role in @roles: %> -
<%- @T(role.displayName() ) %>
+
+ <% if @buttons: %> + <% for button in @buttons: %> + <%- @T( button.name ) %> + <% end %> <% end %>
+
-
-
\ No newline at end of file +
+ +
<%- @T('Filter') %>:
+
+ <% for role in @roles: %> +
<%- @T(role.displayName() ) %>
+ <% end %> +
+
+ +
\ No newline at end of file diff --git a/app/assets/stylesheets/zzz.css.erb b/app/assets/stylesheets/zzz.css.erb index ab388708a..d2edce54f 100644 --- a/app/assets/stylesheets/zzz.css.erb +++ b/app/assets/stylesheets/zzz.css.erb @@ -438,8 +438,17 @@ textarea, border-radius: 3px; transition: none; box-shadow: none; + outline: none; } + input[type=text]:focus, + input[type=password]:focus, + input[type=email]:focus, + textarea:focus { + border-color: hsl(200,71%,59%); + box-shadow: 0 0 0 3px hsl(201,62%,90%); + } + .form-control:focus, .tokenfield.focus { box-shadow: none; @@ -624,8 +633,8 @@ ol.tabs li { } .tab { - height: 39px; - padding: 9px; + height: 40px; + padding: 10px 20px; text-align: center; border-right: 1px solid rgba(0,8,14,.08); cursor: pointer; @@ -3447,6 +3456,19 @@ footer { [contenteditable] > .placeholder { color: #999; } + +.userSearch-label { + margin: 0 10px 0 20px; +} + +.userSearch .tab:not(.active) { + background: white; +} + +.userSearch .tabs { + margin: 0; +} + /* ---------------- From 208608472dda8cd765d3fbe81bedaa85193da5ed Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Mon, 29 Sep 2014 10:42:52 +0200 Subject: [PATCH 2/2] fix userSearch bindings --- app/assets/javascripts/app/controllers/users.js.coffee | 8 +++++--- app/assets/javascripts/app/views/user.jst.eco | 2 +- app/assets/stylesheets/zzz.css.erb | 4 ++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/app/controllers/users.js.coffee b/app/assets/javascripts/app/controllers/users.js.coffee index 6f9e9c573..de080c635 100644 --- a/app/assets/javascripts/app/controllers/users.js.coffee +++ b/app/assets/javascripts/app/controllers/users.js.coffee @@ -1,4 +1,6 @@ class Index extends App.Controller + elements: + '.js-search' : 'searchInput' events: 'click [data-type="new"]': 'new' @@ -24,14 +26,14 @@ class Index extends App.Controller (e) => e.preventDefault() $(e.target).toggleClass('active') - term = @$('.search').val().trim() + term = @searchInput.val().trim() return if !term @delay( @search, 220, 'search' ) ) # start search - @$('.search').bind( 'keyup', (e) => - term = @$('.search').val().trim() + @searchInput.bind( 'keyup', (e) => + term = @searchInput.val().trim() return if !term return if term is @term @term = term diff --git a/app/assets/javascripts/app/views/user.jst.eco b/app/assets/javascripts/app/views/user.jst.eco index 655a76045..cf6d9da72 100644 --- a/app/assets/javascripts/app/views/user.jst.eco +++ b/app/assets/javascripts/app/views/user.jst.eco @@ -12,7 +12,7 @@
- +
<%- @T('Filter') %>:
<% for role in @roles: %> diff --git a/app/assets/stylesheets/zzz.css.erb b/app/assets/stylesheets/zzz.css.erb index d2edce54f..a59ec7f82 100644 --- a/app/assets/stylesheets/zzz.css.erb +++ b/app/assets/stylesheets/zzz.css.erb @@ -3457,6 +3457,10 @@ footer { color: #999; } +.userSearch { + margin-bottom: 20px; +} + .userSearch-label { margin: 0 10px 0 20px; }