Fixed issue#313 - Admin -> Channels -> Email -> Filters not shown / no name shown.

This commit is contained in:
Martin Edenhofer 2016-10-27 01:09:10 +02:00
parent 51683d9859
commit 0a83811479
4 changed files with 26 additions and 10 deletions

View file

@ -38,11 +38,10 @@ class App.ChannelEmailFilter extends App.Controller
constructor: -> constructor: ->
super super
App.PostmasterFilter.subscribe(@render, initFetch: true)
App.PostmasterFilter.subscribe( @render, initFetch: true )
render: => render: =>
data = App.PostmasterFilter.search( sortBy: 'name' ) data = App.PostmasterFilter.search(sortBy: 'name')
template = $( '<div><div class="overview"></div><a data-type="new" class="btn btn--success">' + App.i18n.translateContent('New') + '</a></div>' ) template = $( '<div><div class="overview"></div><a data-type="new" class="btn btn--success">' + App.i18n.translateContent('New') + '</a></div>' )
@ -131,11 +130,10 @@ class App.ChannelEmailSignature extends App.Controller
constructor: -> constructor: ->
super super
App.Signature.subscribe(@render, initFetch: true)
App.Signature.subscribe( @render, initFetch: true )
render: => render: =>
data = App.Signature.search( sortBy: 'name' ) data = App.Signature.search(sortBy: 'name')
template = $( '<div><div class="overview"></div><a data-type="new" class="btn btn--success">' + App.i18n.translateContent('New') + '</a></div>' ) template = $( '<div><div class="overview"></div><a data-type="new" class="btn btn--success">' + App.i18n.translateContent('New') + '</a></div>' )

View file

@ -544,6 +544,10 @@ class App.Model extends Spine.Model
if data.assets if data.assets
App.Collection.loadAssets(data.assets) App.Collection.loadAssets(data.assets)
# in case of no record_ids are there, no inital render is fired
if _.isEmpty(data.record_ids)
App[@className].trigger('refresh')
# find / load object # find / load object
else else
App[@className].refresh(data) App[@className].refresh(data)

View file

@ -17,10 +17,10 @@
<th style="width: 40px" class="table-radio"></th> <th style="width: 40px" class="table-radio"></th>
<% end %> <% end %>
<% for item, i in @header: %> <% for item, i in @header: %>
<th class="js-tableHead<%= " #{ item.className }" if item.className %><%= " align-#{ item.align }" if item.align %>" style="width:<%= item.displayWidth %>px" data-column-key="<%= item.name %>"> <th class="js-tableHead<%= " #{ item.className }" if item.className %><%= " align-#{ item.align }" if item.align %>" style="<% if item.displayWidth: %>width:<%= item.displayWidth %>px<% end %>" data-column-key="<%= item.name %>">
<div class="table-column-head<%= ' js-sort' if @table_id %>"> <div class="table-column-head<%= ' js-sort' if @table_id %>">
<div class="table-column-title"> <div class="table-column-title">
<%- @T( item.display ) %> <%- @T(item.display) %>
</div> </div>
<div class="table-column-sortIcon"> <div class="table-column-sortIcon">
<% if item.sortOrderIcon: %> <% if item.sortOrderIcon: %>

View file

@ -23,10 +23,24 @@ class AdminChannelEmailTest < TestCase
click(css: 'a[href="#manage"]') click(css: 'a[href="#manage"]')
click(css: '.content.active a[href="#channels/email"]') click(css: '.content.active a[href="#channels/email"]')
# check if postmaster filter are shown
click(css: '.content.active a[href="#c-filter"]')
match(
css: '.content.active #c-filter .overview',
value: 'No Entries',
)
# check if signatures are shown
click(css: '.content.active a[href="#c-signature"]')
match(
css: '.content.active #c-signature .overview',
value: 'default',
)
click(css: '.content.active a[href="#c-account"]')
click(css: '.content.active .js-channelNew') click(css: '.content.active .js-channelNew')
modal_ready() modal_ready()
set( set(
css: '.modal input[name="realname"]', css: '.modal input[name="realname"]',
value: 'My System', value: 'My System',