Moved to new search style and implemented switch to user button.
This commit is contained in:
parent
238cc7edd4
commit
73242cd4b8
6 changed files with 27 additions and 17 deletions
|
@ -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
|
||||||
)
|
)
|
||||||
|
|
|
@ -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>'
|
text = App.i18n.translateInline('Show as user')
|
||||||
attribute.class = ''
|
value = ' '
|
||||||
attribute.link = '#'
|
attribute.raw = ' <span class="btn btn--primary btn--table switchView"><svg class="icon icon-switchView"><use xlink:href="#icon-switchView" /></svg> ' + text + '</span>'
|
||||||
attribute.title = App.i18n.translateInline('Switch to')
|
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: [
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -11,9 +11,11 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="userSearch vertical center">
|
<div class="searchfield">
|
||||||
<input type="text" class="js-search form-control flex" name="search" placeholder="<%- @Ti('Search for users') %>">
|
<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">
|
||||||
|
|
|
@ -903,7 +903,7 @@ textarea,
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
left: 9px;
|
left: 9px;
|
||||||
top: 6px;
|
top: 7px;
|
||||||
width: 17px;
|
width: 17px;
|
||||||
height: 17px;
|
height: 17px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
Loading…
Reference in a new issue