Added new helper method to generate icon's. Show zammad log for system actions.

This commit is contained in:
Martin Edenhofer 2015-10-19 09:40:32 +02:00
parent 043dd6c11e
commit fadba4e196
6 changed files with 11 additions and 4 deletions

View file

@ -28,7 +28,7 @@ class App.UiElement.textarea
params:
form_id: @form_id
text:
uploadButton: '<svg class="icon icon-paperclip"><use xlink:href="#icon-paperclip"></use></svg>'
uploadButton: App.Utils.icon('paperclip')
template: '<div class="qq-uploader">' +
'<pre class="btn qq-upload-icon qq-upload-drop-area"><span>{dragZoneText}</span></pre>' +
'<div class="btn btn-default qq-upload-icon2 qq-upload-button pull-right" style="">{uploadButtonText}</div>' +

View file

@ -62,7 +62,7 @@ class Index extends App.Controller
callbackAttributes = (value, object, attribute, header, refObject) ->
text = App.i18n.translateInline('View from user\'s perspective')
value = ' '
attribute.raw = ' <span class="btn btn--primary btn--table switchView" title="' + text + '"><svg class="icon icon-switchView"><use xlink:href="#icon-switchView" /></svg> ' + text + '</span>'
attribute.raw = ' <span class="btn btn--primary btn--table switchView" title="' + text + '">' + App.Utils.icon('switchView') + text + '</span>'
attribute.class = ''
attribute.parentClass = 'actionCell no-padding'
attribute.link = ''

View file

@ -219,7 +219,7 @@ class App extends Spine.Controller
# define icon helper
params.Icon = (name, className = '') ->
"<svg class=\"icon icon-#{name} #{className}\"><use xlink:href=\"#icon-#{name}\" /></svg>"
App.Utils.icon(name, className)
# define richtext helper
params.RichText = ( string ) ->

View file

@ -592,3 +592,6 @@ class App.Utils
while num.length < digits
num = '0' + num
num
@icon: (name, className = '') ->
"<svg class=\"icon icon-#{name} #{className}\"><use xlink:href=\"#icon-#{name}\" /></svg>"

View file

@ -51,6 +51,10 @@ class App.User extends App.Model
if placement
placement = "data-placement=\"#{placement}\""
# use system avatar for system actions
if @id is 1
return "<span class='avatar' style='background: white'>#{App.Utils.icon('logo')}</span>"
# use generated avatar
if !@image || @image is 'none' || unique
return @uniqueAvatar(size, placement, cssClass, avatar, type)

View file

@ -1,7 +1,7 @@
<% if @items.length: %>
<% for item in @items: %>
<div class="activity-entry activity-entry--removeable<% if item.seen: %> is-inactive<% end %>" data-id="<%- item.id %>">
<a class="activity-avatar user-popover" data-id="<%= item.created_by_id %>" href="<%- item.created_by.uiUrl() %>">
<a class="activity-avatar user-popover" data-id="<%= item.created_by_id %>" <% if item.created_by_id isnt 1: %>href="<%- item.created_by.uiUrl() %>"<% end %>>
<%- item.created_by.avatar() %>
</a>
<div class="activity-body">