Browse Source

Moved to new search style and implemented switch to user button.

Martin Edenhofer 9 years ago
parent
commit
73242cd4b8

+ 2 - 0
app/assets/javascripts/app/controllers/_application_controller_table.js.coffee

@@ -55,6 +55,7 @@ class App.ControllerTable extends App.Controller
       groupBy:  'group'
       groupBy:  'group'
       checkbox: false
       checkbox: false
       radio:    false
       radio:    false
+      class:    'some-css-class'
       bindRow:
       bindRow:
         events:
         events:
           'click':      rowClick
           'click':      rowClick
@@ -170,6 +171,7 @@ class App.ControllerTable extends App.Controller
       checkbox: data.checkbox
       checkbox: data.checkbox
       radio:    data.radio
       radio:    data.radio
       groupBy:  data.groupBy
       groupBy:  data.groupBy
+      class:    data.class
       destroy:  destroy
       destroy:  destroy
       callbacks: data.callbackAttributes
       callbacks: data.callbackAttributes
     )
     )

+ 10 - 6
app/assets/javascripts/app/controllers/users.js.coffee

@@ -48,16 +48,19 @@ class Index extends App.Controller
     callbackHeader = (header) ->
     callbackHeader = (header) ->
       attribute =
       attribute =
         name:       'switch_to'
         name:       'switch_to'
-        display:    'Switch to'
+        display:    'Action'
         translation: true
         translation: true
       header.push attribute
       header.push attribute
       header
       header
 
 
     callbackAttributes = (value, object, attribute, header, refObject) ->
     callbackAttributes = (value, object, attribute, header, refObject) ->
-      value = ' <svg class="icon-user"><use xlink:href="#icon-user"></use></svg>'
-      attribute.class  = ''
-      attribute.link   = '#'
-      attribute.title  = App.i18n.translateInline('Switch to')
+      text                  = App.i18n.translateInline('Show as user')
+      value                 = ' '
+      attribute.raw         = ' <span class="btn btn--primary btn--table switchView"><svg class="icon icon-switchView"><use xlink:href="#icon-switchView" /></svg> ' + text + '</span>'
+      attribute.class       = ''
+      attribute.parentClass = 'no-padding'
+      attribute.link        = ''
+      attribute.title       = App.i18n.translateInline('Switch to')
       value
       value
 
 
     switchTo = (id,e) =>
     switchTo = (id,e) =>
@@ -75,7 +78,7 @@ class Index extends App.Controller
         @renderResult(user_ids)
         @renderResult(user_ids)
 
 
       new App.ControllerGenericEdit(
       new App.ControllerGenericEdit(
-        id:            item.id
+        id:       item.id
         pageData:
         pageData:
           title:     'Users'
           title:     'Users'
           home:      'users'
           home:      'users'
@@ -96,6 +99,7 @@ class Index extends App.Controller
       el:       @$('.table-overview')
       el:       @$('.table-overview')
       model:    App.User
       model:    App.User
       objects:  users
       objects:  users
+      class:    'user-list'
       callbackHeader:   callbackHeader
       callbackHeader:   callbackHeader
       callbackAttributes:
       callbackAttributes:
         switch_to: [
         switch_to: [

+ 5 - 3
app/assets/javascripts/app/views/generic/table.jst.eco

@@ -1,4 +1,4 @@
-<table class="table table-hover">
+<table class="table table-hover <% if @class: %><%- @class %><% end %>">
   <thead>
   <thead>
     <tr>
     <tr>
     <% if @checkbox: %>
     <% if @checkbox: %>
@@ -80,11 +80,13 @@
           <% if item.link: %>
           <% if item.link: %>
             <a href="<%- item.link %>" <% if item.target: %>target="<%= item.target %>"<% end %>>
             <a href="<%- item.link %>" <% if item.target: %>target="<%= item.target %>"<% end %>>
           <% end %>
           <% end %>
-          
+          <% if item.raw: %>
+            <%- item.raw %>
+          <% else: %>
           <span <% if item.class: %>class="<%= item.class %>"<% end %> <% if item.title: %>title="<%= item.title %>"<% end %> <% if item.data: %><% for data_key, data_item of item.data: %>data-<%- data_key %>="<%= data_item %>" <% end %><% end %>>
           <span <% if item.class: %>class="<%= item.class %>"<% end %> <% if item.title: %>title="<%= item.title %>"<% end %> <% if item.data: %><% for data_key, data_item of item.data: %>data-<%- data_key %>="<%= data_item %>" <% end %><% end %>>
             <%- value %>
             <%- value %>
           </span>
           </span>
-
+          <% end %>
           <% if item.link: %></a><% end %>
           <% if item.link: %></a><% end %>
         <% end %>
         <% end %>
       </td>
       </td>

+ 4 - 4
app/assets/javascripts/app/views/layout_ref/user_list.jst.eco

@@ -150,7 +150,7 @@
 
 
           <th>Lastname</th>
           <th>Lastname</th>
 
 
-          <th></th>
+          <th>Aktionen</th>
         </tr>
         </tr>
       </thead>
       </thead>
 
 
@@ -168,11 +168,11 @@
         </tr>
         </tr>
 
 
         <tr class="item" data-id="6" data-position="3" style="cursor: pointer;">
         <tr class="item" data-id="6" data-position="3" style="cursor: pointer;">
-          <td><span>hans@huber.com</span></td>
+          <td><span>hans.sebastian.hubermeyerschmidt@huber.com</span></td>
 
 
-          <td><span>Hans</span></td>
+          <td><span>Hans Sebastian</span></td>
 
 
-          <td><span>Huber2</span></td>
+          <td><span>Hubermeyerschmidt</span></td>
 
 
           <td class="no-padding">
           <td class="no-padding">
             <div class="btn btn--primary btn--table switchView"><svg class="icon icon-switchView"><use xlink:href="#icon-switchView" /></svg> Aus Benutzeransicht anzeigen</div>
             <div class="btn btn--primary btn--table switchView"><svg class="icon icon-switchView"><use xlink:href="#icon-switchView" /></svg> Aus Benutzeransicht anzeigen</div>

+ 4 - 2
app/assets/javascripts/app/views/user.jst.eco

@@ -11,9 +11,11 @@
   </div>
   </div>
 </div>
 </div>
 
 
-<div class="userSearch vertical center">
-  <input type="text" class="js-search form-control flex" name="search" placeholder="<%- @Ti('Search for users') %>">
+<div class="searchfield">
+  <svg class="icon icon-magnifier"><use xlink:href="#icon-magnifier" /></svg>
+  <input class="js-search form-control" name="search" placeholder="<%- @Ti('Search for users') %>" type="search">
 </div>
 </div>
+
 <div class="userSearch horizontal">
 <div class="userSearch horizontal">
   <div class="userSearch-label"><%- @T('Roles') %>:</div>
   <div class="userSearch-label"><%- @T('Roles') %>:</div>
   <div class="tabs tabs-wide horizontal">
   <div class="tabs tabs-wide horizontal">

+ 2 - 2
app/assets/stylesheets/zammad.css.scss

@@ -900,10 +900,10 @@ textarea,
 .searchfield {
 .searchfield {
   position: relative;
   position: relative;
   margin-bottom: 20px;
   margin-bottom: 20px;
-  
+
   .icon {
   .icon {
     left: 9px;
     left: 9px;
-    top: 6px;
+    top: 7px;
     width: 17px;
     width: 17px;
     height: 17px;
     height: 17px;
     position: absolute;
     position: absolute;