Improved translation feature.

This commit is contained in:
Martin Edenhofer 2012-05-13 14:53:35 +02:00
parent 9ee0bbb895
commit b8111353ba
32 changed files with 180 additions and 116 deletions

View file

@ -2,7 +2,7 @@ class App.Controller extends Spine.Controller
# add @title methode to set title
title: (name) ->
$('html head title').html( Config.product_name + ' - ' + T(name) )
$('html head title').html( Config.product_name + ' - ' + Ti(name) )
# add @notify methode to create notification
notify: (data) ->
@ -166,7 +166,7 @@ class App.Controller extends Spine.Controller
name_new = name
if attribute.translate
name_new = T(name)
name_new = Ti(name)
attribute.options.push {
name: name_new,
value: item.id,
@ -399,10 +399,6 @@ class App.Controller extends Spine.Controller
if row.callback
object[row.name]['name'] = row.callback(object[row.name]['name'])
# check if translation is needed
if row.translate
object[row.name]['name'] = T( object[row.name]['name'] )
# @log 'table', 'header', header, 'overview', data_types, 'objects', objects
table = App.view('generic/table')(
header: header,

View file

@ -13,6 +13,7 @@ class Index extends App.ControllerLevel2
]
page: {
title: 'Channels',
head: 'Channels',
sub_title: 'Management'
nav: '#channels',
}

View file

@ -19,6 +19,7 @@ class Index extends App.ControllerLevel2
]
@page = {
title: 'System',
head: 'System',
sub_title: 'Settings'
nav: '#settings/system',
}
@ -32,6 +33,7 @@ class Index extends App.ControllerLevel2
]
@page = {
title: 'Security',
head: 'Security',
sub_title: 'Settings'
nav: '#settings/security',
}
@ -45,6 +47,7 @@ class Index extends App.ControllerLevel2
]
@page = {
title: 'Ticket',
head: 'Ticket',
sub_title: 'Settings'
nav: '#settings/ticket',
}

View file

@ -148,7 +148,8 @@ class App.i18n extends App.Ajax
constructor: ->
@set('de')
window.T = @translate
window.T = @translate_content
window.Ti = @translate_inline
set: (locale) =>
@map = {}
@ -162,21 +163,47 @@ class App.i18n extends App.Ajax
console.log 'error', error, statusText, xhr.statusCode
)
translate_inline: (string, args...) =>
@translate(string, args...)
translate_content: (string, args...) =>
translated = @translate(string, args...)
# replace = '<span class="translation" contenteditable="true" data-text="' + @escape(string) + '">' + translated + '<span class="icon-edit"></span>'
replace = '<span class="translation" contenteditable="true" data-text="' + @escape(string) + '">' + translated + ''
# if !@_translated
# replace += '<span class="missing">XX</span>'
replace += '</span>'
translate: (string, args...) =>
# return '' on undefined
return '' if string is undefined
# return translation
if @map[string] isnt undefined
@_translated = true
translated = @map[string]
else
@_translated = false
translated = string
# search %s
for arg in args
translated = translated.replace(/%s/, arg)
# escape
translated = @escape(translated)
# return translated string
return translated
escape: (string) ->
string = ('' + string)
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/\x22/g, '&quot;')
class App.Run extends Spine.Controller
constructor: ->
super
@ -204,6 +231,26 @@ class App.Run extends Spine.Controller
window.Session['UISeletion'] = @getSelected() + ''
)
# $('.translation [contenteditable]')
$('.translation')
.live 'focus', ->
$this = $(this)
$this.data 'before', $this.html()
console.log('11111before', $this.html())
return $this
.live 'blur keyup paste', ->
# .live 'blur', ->
$this = $(this)
if $this.data('before') isnt $this.html()
$this.data 'before', $this.html()
$this.trigger('change')
console.log('111changed', $this.html(), $this.attr('data-text') )
a = $this.html()
a = ('' + a)
.replace(/<.+?>/g, '')
$this.html(a)
return $this
# @ws = new WebSocket("ws://localhost:3001/");
# Set event handlers.

View file

@ -1,5 +1,5 @@
<div class="page-header">
<h1><%= T('New Ticket') %> <small></small></h1>
<h1><%- T('New Ticket') %> <small></small></h1>
</div>
<form class="form-horizontal">
@ -16,6 +16,6 @@
</div>
</div>
<div class="form-actions">
<button type="reset" class="btn cancel"><%= T('Cancel') %></button>&nbsp;<button type="submit" class="btn btn-primary submit"><%= T('Create') %></button>
<button type="reset" class="btn cancel"><%- T('Cancel') %></button>&nbsp;<button type="submit" class="btn btn-primary submit"><%- T('Create') %></button>
</div>
</form>

View file

@ -7,9 +7,9 @@
<div class="row">
<div class="span12">
<%= @ticket.group.name %> -
<%= T(@ticket.ticket_state.name) %> -
<%= T(@ticket.ticket_priority.name) %> -
<%= @ticket.humanTime %>
<%- T(@ticket.ticket_state.name) %> -
<%- T(@ticket.ticket_priority.name) %> -
<%- @ticket.humanTime %>
</div>
</div>
</div>
@ -26,24 +26,24 @@
<div class="span8 well-muted article-message <% if article.internal is true: %> internal<% end %>">
<% if article.from: %>
<div>
<strong title="<%= T('From') %>: <%= article.from %>"><%= article.from %></strong>
<strong title="<%- Ti('From') %>: <%= article.from %>"><%= article.from %></strong>
<% if article.actions: %>
<% for action in article.actions: %>
-
<a href="#" data-type="<%= action.type %>" class="<% if action.class: %><%= action.class %><% end %>"><%= action.name %></a>
<% end %>
<% end %>
- <%= article.humanTime %> ago
- <%- article.humanTime %> <%- T('ago') %>
</div>
<% end %>
<% if article.to: %>
<div title="<%= T('To') %>: <%= article.to %>"><%= article.to %></div>
<div title="<%- Ti('To') %>: <%= article.to %>"><%= article.to %></div>
<% end %>
<% if article.cc: %>
<div title="<%= T('Cc') %>: <%= article.cc %>"><%= article.cc %></div>
<div title="<%- Ti('Cc') %>: <%= article.cc %>"><%= article.cc %></div>
<% end %>
<% if article.subject: %>
<div title="<%= T('Subject') %>: <%= article.subject %>"><%= article.subject %></div>
<div title="<%- Ti('Subject') %>: <%= article.subject %>"><%= article.subject %></div>
<% end %>
<% if article.attachments: %>
<div>
@ -71,7 +71,7 @@
<div class="keepleft" id="file-uploader"></div>
&nbsp;
<button type="submit" class="btn btn-primary submit"><%= T('Submit') %></button>
<button type="submit" class="btn btn-primary submit"><%- T('Submit') %></button>
</form>
</div>
</div>
@ -85,8 +85,8 @@
<div class="well">
<h3>Actions</h3>
<ul>
<li><a href="#" data-type="history">History</a></li>
<li><a href="#" data-type="merge">Merge</a></li>
<li><a href="#" data-type="history"><%- T('History') %></a></li>
<li><a href="#" data-type="merge"><%- T('Merge') %></a></li>
</ul>
</div>
</div>

View file

@ -1,13 +1,13 @@
<form class="form-horizontal">
<div class="modal-header">
<a href="#" class="close">&times;</a>
<h3><%= T(@head) %></h3>
<h3><%- T(@head) %></h3>
</div>
<div class="modal-body">
<%- @form %>
</div>
<div class="modal-footer">
<button class="btn btn-primary submit"><%= T('Submit') %></button>
<button class="btn secondary cancel"><%= T('Cancel') %></button>
<button class="btn btn-primary submit"><%- T('Submit') %></button>
<button class="btn secondary cancel"><%- T('Cancel') %></button>
</div>
</form>

View file

@ -1,5 +1,5 @@
<div class="page-header">
<h1><%= @head %> <small><a href="#" data-type="settings" class="icon-edit"></a></small></h1>
<h1><%- T(@head) %> <small><a href="#" data-type="settings" class="icon-edit"></a></small></h1>
</div>
<div class="row">

View file

@ -1,10 +1,10 @@
<div class="row">
<div class="span3">
<h2><%= T(@head) %></h2>
<h2><%- T(@head) %></h2>
<dl>
<% for item in @items: %>
<dt><span class="user-data" data-id="<%= item.created_by_id %>">"<%= item.created_by.realname %>"</span></dt>
<dd><%= T(item.history_type.name) %> <span data-id="<%= item.o_id %>"><a data-type="edit" href="#"><%= item.history_object.name %> (<%= item.ticket.title %>)</a></span>.</dd>
<dd><%- T(item.history_type.name) %> <span data-id="<%= item.o_id %>"><a data-type="edit" href="#"><%= item.history_object.name %> (<%= item.ticket.title %>)</a></span>.</dd>
<% end %>
</dl>
</div>

View file

@ -1,6 +1,6 @@
<div class="row">
<div class="span3">
<h2><%= T(@head) %></h2>
<h2><%- T(@head) %></h2>
<ul>
<% for item in @items: %>
<li><span data-id="<%= item.o_id %>"><a data-type="edit" href="#"><%= item.history_object.name %> (<%= item.ticket.title %>)</a></span></li>

View file

@ -1,6 +1,6 @@
<div class="row">
<div class="span3">
<h2><%= T(@head) %></h2>
<h2><%- T(@head) %></h2>
<ul>
<% for item in @items: %>
<li><a href="<%= item.link %>" title="<%= item.summary %>" target="_blank"><%= item.title %>"</a></li>

View file

@ -1,10 +1,10 @@
<div class="row">
<div class="span9">
<div class="row">
<div class="span5">
<h2><%= T(@overview.meta.name) %> <small><a href="#" data-type="settings" class="icon-edit"></a></small></h2>
<div class="span6">
<h2><%- T(@overview.meta.name) %> <small><a href="#" data-type="settings" class="icon-edit"></a></small></h2>
</div>
<div class="span4">
<div class="span3">
<div class="pagination">
<ul>
<li>

View file

@ -1,6 +1,6 @@
<div class="modal-header">
<a href="#" class="close">&times;</a>
<h3><%= T('Edit') %>: <%= T(@overview.meta.name) %></h3>
<h3><%- T('Edit') %>: <%- T(@overview.meta.name) %></h3>
</div>
<div class="modal-body">
<form class="form-horizontal">
@ -8,6 +8,6 @@
</form>
</div>
<div class="modal-footer">
<button class="btn btn-primary submit"><%= T('Submit') %></button>
<button class="btn cancel"><%= T('Cancel') %></button>
<button class="btn btn-primary submit"><%- T('Submit') %></button>
<button class="btn cancel"><%- T('Cancel') %></button>
</div>

View file

@ -1,13 +1,13 @@
<form class="form-horizontal">
<div class="modal-header">
<a href="#" class="close">&times;</a>
<h3><%= T(@head) %></h3>
<h3><%- T(@head) %></h3>
</div>
<div class="modal-body">
<%- @form %>
</div>
<div class="modal-footer">
<button class="btn btn-primary submit"><%= T('Submit') %></button>
<button class="btn cancel"><%= T('Cancel') %></button>
<button class="btn btn-primary submit"><%- T('Submit') %></button>
<button class="btn cancel"><%- T('Cancel') %></button>
</div>
</form>

View file

@ -1,5 +1,5 @@
<div class="page-header">
<h1><%= T(@head) %> <small><%= T('Management') %></small></h1>
<h1><%- T(@head) %> <small><%- T('Management') %></small></h1>
</div>
<div class="row">
@ -23,12 +23,12 @@
</ul>
<% for note in @notes: %>
<p><%= T(note) %></p>
<p><%- T(note) %></p>
<% end %>
<% if @buttons: %>
<% for button in @buttons: %>
<p><a data-type="<%= button['data-type'] %>" class="btn <%= button['class'] %>"><%= T(button.name) %></a></p>
<p><a data-type="<%= button['data-type'] %>" class="btn <%= button['class'] %>"><%- T(button.name) %></a></p>
<% end %>
<% end %>

View file

@ -1,13 +1,13 @@
<form class="form-horizontal">
<div class="modal-header">
<a href="#" class="close">&times;</a>
<h3><%= T(@head) %></h3>
<h3><%- T(@head) %></h3>
</div>
<div class="modal-body">
<%- @form %>
</div>
<div class="modal-footer">
<button class="btn btn-primary submit"><%= T('Submit') %></button>
<button class="btn cancel"><%= T('Cancel') %></button>
<button class="btn btn-primary submit"><%- T('Submit') %></button>
<button class="btn cancel"><%- T('Cancel') %></button>
</div>
</form>

View file

@ -1,5 +1,5 @@
<div class="page-header">
<h1><%= T(@page.head) %> <small><%= T(@page.sub_head) %></small></h1>
<h1><%- T(@page.head) %> <small><%- T(@page.sub_head) %></small></h1>
</div>
<div class="row">
@ -7,7 +7,7 @@
<ul class="nav nav-tabs nav-stacked">
<% if @menus: %>
<% for menu in @menus: %>
<li class="<%= menu['class'] %>"><a href="<%= @page.nav %>/<%= menu.target %>" data-toggle="tabnav" data-target="<%= menu['target'] %>" ><%= T(menu.name) %></a></li>
<li class="<%= menu['class'] %>"><a href="<%= @page.nav %>/<%= menu.target %>" data-toggle="tabnav" data-target="<%= menu['target'] %>" ><%- T(menu.name) %></a></li>
<% end %>
<% end %>
</ul>

View file

@ -1,8 +1,8 @@
<div class="control-group <%= @attribute.item_class %>">
<label class="control-label" for="<%= @attribute.id %>"><%= T(@attribute.display) %><% if !@attribute.null: %> *<% end %></label>
<label class="control-label" for="<%= @attribute.id %>"><%- T(@attribute.display) %><% if !@attribute.null: %> *<% end %></label>
<div class="controls">
<%- @item %>
<span class="help-inline"></span>
<span class="help-block"><%= T(@attribute.help) %> <%- @attribute.link %></span>
<span class="help-block"><% if @attribute.help: %><%- T(@attribute.help) + ' ' %><% end %><%- @attribute.link %></span>
</div>
</div>

View file

@ -1,5 +1,5 @@
<div class="hero-unit">
<h2><%= @head %> <small><%= @head_small %></small></h2>
<h2><%- T(@head) %> <small><%- T(@head_small) %></small></h2>
<div class="container">
<p>
<%- @message %>

View file

@ -5,7 +5,7 @@
<th><input type="checkbox" value="" name="bulk_all"/></th>
<% end %>
<% for row in @header: %>
<th><%= T(row) %></th>
<th><%- T(row) %></th>
<% end %>
<!--
<th>Destory</th>
@ -25,7 +25,7 @@
<% if row.link: %>
<a href="#" data-type="edit"><%= object[row.name]['name'] %></a>
<% else: %>
<span <% if row.class: %>class="<%= row.class %>"<% end %> <% if row.data && row.data.id: %>data-id="<%= object[row.name]['id'] %>"<% end %>><%= object[row.name]['name'] %></span>
<span <% if row.class: %>class="<%= row.class %>"<% end %> <% if row.data && row.data.id: %>data-id="<%= object[row.name]['id'] %>"<% end %>><% if row.translate: %><%- T(object[row.name]['name']) %><% else if row.callback: %><%- object[row.name]['name'] %><% else: %><%= object[row.name]['name'] %><% end %></span>
<% end %>
</td>
<% end %>

View file

@ -1,6 +1,6 @@
<ul class="nav nav-tabs">
<% for tab in @tabs: %>
<li><a href="#<%= tab.target %>" data-toggle="tab"><%= tab.name %></a></li>
<li><a href="#<%= tab.target %>" data-toggle="tab"><%- T(tab.name) %></a></li>
<% end %>
</ul>
<div class="tab-content"></div>

View file

@ -1,38 +1,38 @@
<div class="hero-unit">
<h1>Getting started!<small></small></h1>
<h1><%- T('Getting started!') %><small></small></h1>
<div class="container">
<div class="row">
<div class="span12">
<ol>
<li>Create Admin</li>
<li>Invite Agents</li>
<li>Configure Channels</li>
<li><%- T('Create Admin') %></li>
<li><%- T('Invite Agents') %></li>
<li><%- T('Configure Channels') %></li>
</ol>
</div>
</div>
<div class="row">
<% if @master_user: %>
<div class="span6 master_user">
<h2>Master Agent</h2>
<h2>M<%- T('Master Agent') %></h2>
<form class="form-stacked">
<%- @form_master %>
<button class="btn btn-primary submit">Next...</button>
<button class="btn btn-primary submit"><%- T('Next...') %></button>
</form>
</div>
<% end %>
<div class="span6 agent_user hide">
<h2>Invite Agents</h2>
<h2><%- T('Invite Agents') %></h2>
<form class="form-stacked">
<%- @form_agent %>
<button class="btn btn-primary submit">Send Invitation</button>
<button class="btn btn-primary submit"><%- T('Send Invitation') %></button>
</form>
</div>
<div class="span6">
<h2>Tour</h2>
<h2><%- T('Tour') %></h2>
<p>
Learn all about ...
<%- T('Learn all about ...') %>
</p>
</div>
</div>

View file

@ -6,15 +6,15 @@
<div class="container">
<div class="row">
<div class="span12">
<p><%= T('Sign in with') %></p>
<p><%- T('Sign in with') %></p>
<form id="login" class="form-search">
<input name="username" type="text" class="input span3" placeholder="<%= T('Username or email') %>" value="<%= @item.username %>" autocapitalize="off"/>
<input name="password" type="password" class="input span3" placeholder="<%= T('Password') %>"/>
<button class="btn btn-primary" type="submit"><%= T('Sign in') %></button>
<input name="username" type="text" class="input span3" placeholder="<%- Ti('Username or email') %>" value="<%= @item.username %>" autocapitalize="off"/>
<input name="password" type="password" class="input span3" placeholder="<%- Ti('Password') %>"/>
<button class="btn btn-primary" type="submit"><%- T('Sign in') %></button>
<div>
<span class="small"><input name="remember_me" value="1" type="checkbox"/> <%= T('Remember me') %></span>
<span class="small"><input name="remember_me" value="1" type="checkbox"/> <%- T('Remember me') %></span>
<span class="small">&middot;</span>
<a href="#reset_password" class="small"><%= T('Forgot password?') %></a>
<a href="#reset_password" class="small"><%- T('Forgot password?') %></a>
</div>
</form>
</div>
@ -24,16 +24,16 @@
<% if !_.isEmpty(@auth_providers): %>
<div class="row">
<div class="span12">
<p>--- <%= T('or') %> ---</p>
<p>--- <%- T('or') %> ---</p>
</div>
</div>
<div class="row">
<div class="span12">
<p><%= T('Sign in using') %></p>
<p><%- T('Sign in using') %></p>
<ul>
<% for auth_provider in @auth_providers: %>
<li><a href="<%= auth_provider.url %>"><%= T(auth_provider.name) %></a></li>
<li><a href="<%= auth_provider.url %>"><%- T(auth_provider.name) %></a></li>
<% end %>
</ul>
</div>
@ -42,14 +42,14 @@
<div class="row">
<div class="span12">
<p>--- <%= T('or') %> ---</p>
<p>--- <%- T('or') %> ---</p>
</div>
</div>
<div class="row">
<div class="span12">
<p><%= T('New to') %> <%= Config.product_name %>, <%= T('join today!') %></p>
<p><a href="#signup" class="btn"><%= T('Sign up') %></a>
<p><%- T('New to') %> <%= Config.product_name %>, <%- T('join today!') %></p>
<p><a href="#signup" class="btn"><%- T('Sign up') %></a>
</div>
</div>

View file

@ -6,53 +6,53 @@
<% for item in @navbar_left: %>
<% if item.child: %>
<li class="dropdown">
<a href="<%= item.target %>" class="dropdown-toggle" data-toggle="dropdown"><%= T(item.name) %> <b class="caret"></b></a>
<a href="<%= item.target %>" class="dropdown-toggle" data-toggle="dropdown"><%- T(item.name) %> <b class="caret"></b></a>
<ul class="dropdown-menu">
<% for item in item.child: %>
<% if item.divider: %>
<li class="divider"></li>
<% end %>
<% if item.navheader: %>
<li class="nav-header"><%= T(item.navheader) %></li>
<li class="nav-header"><%- T(item.navheader) %></li>
<% end %>
<li><a href="<%= item.target %>"><%= T(item.name) %><% if item['count'] isnt undefined: %> <span class="count">(<%= item['count'] %>)</span><% end %></a></li>
<li><a href="<%= item.target %>"><%- T(item.name) %><% if item['count'] isnt undefined: %> <span class="count">(<%= item['count'] %>)</span><% end %></a></li>
<% end %>
</ul>
</li>
<% else: %>
<li><a href="<%= item.target %>"><%= T(item.name) %></a></li>
<li><a href="<%= item.target %>"><%- T(item.name) %></a></li>
<% end %>
<% end %>
</ul>
<form class="navbar-search pull-left">
<input class="search-query" type="search" value="" placeholder="Search"/>
<input class="search-query" type="search" value="" placeholder="<%- Ti('Search') %>"/>
</form>
<% if @user: %>
<ul class="nav pull-right">
<% for item in @navbar_right: %>
<% if item.child: %>
<li class="dropdown">
<a href="<%= item.target %>" class="dropdown-toggle" data-toggle="dropdown"><%= T(item.name) %> <b class="caret"></b></a>
<a href="<%= item.target %>" class="dropdown-toggle" data-toggle="dropdown"><%- T(item.name) %> <b class="caret"></b></a>
<ul class="dropdown-menu">
<% for item in item.child: %>
<% if item.divider: %>
<li class="divider"></li>
<% end %>
<% if item.navheader: %>
<li class="nav-header"><%= T(item.navheader) %></li>
<li class="nav-header"><%- T(item.navheader) %></li>
<% end %>
<li><a href="<%= item.target %>"><%= T(item.name) %><% if item['count'] isnt undefined: %> <span class="count">(<%= item['count'] %>)</span><% end %></a></li>
<li><a href="<%= item.target %>"><%- T(item.name) %><% if item['count'] isnt undefined: %> <span class="count">(<%= item['count'] %>)</span><% end %></a></li>
<% end %>
</ul>
</li>
<% else: %>
<li><a href="<%= item.target %>"><%= T(item.name) %></a></li>
<li><a href="<%= item.target %>"><%- T(item.name) %></a></li>
<% end %>
<% end %>
</ul>
<% else: %>
<ul class="nav pull-right">
<li><a href="#login"><%= T('Sign in') %></a></li>
<li><a href="#login"><%- T('Sign in') %></a></li>
</ul>
<% end %>
</div>

View file

@ -1,13 +1,13 @@
<div class="hero-unit">
<h2>Forgot your password?<small></small></h2>
<h2><%- T('Forgot your password?') %><small></small></h2>
<div class="container">
<form>
<p>
<%- @form %>
</p>
<a href="#/" class="btn cancel">Cancel</a>
<button class="btn btn-primary submit">Submit</button>
<a href="#/" class="btn cancel"><%- T('Cancel') %></a>
<button class="btn btn-primary submit"><%- T('Submit') %></button>
</form>
</div>
</div>

View file

@ -1,11 +1,11 @@
<div class="hero-unit">
<h2>Choose your new password.<small></small></h2>
<h2><%- T('Choose your new password.') %><small></small></h2>
<div class="container">
<form>
<p>
<%- @form %>
</p>
<button class="btn btn-primary submit">Submit</button>
<button class="btn btn-primary submit"><%- T('Submit') %></button>
</form>
</div>
</div>

View file

@ -1,7 +1,7 @@
<form class="">
<h2><%= T(@setting.title) %></h2>
<p><%= T(@setting.description) %></p>
<h2><%- T(@setting.title) %></h2>
<p><%- T(@setting.description) %></p>
<%- @form %>
<button type="submit" class="btn"><%= T('Submit') %></button>
<button type="submit" class="btn"><%- T('Submit') %></button>
</form>
<hr/>

View file

@ -1,13 +1,13 @@
<div class="hero-unit">
<h1><%= T('Join') %> <%= Config.product_name %><small></small></h1>
<h1><%- T('Join') %> <%= Config.product_name %><small></small></h1>
<div class="container">
<form class="form-horizontal">
<p>
<%- @form %>
</p>
<a href="#/" class="btn cancel"><%= T('Cancel') %></a>
<button class="btn btn-primary submit"><%= T('Create my account') %></button>
<a href="#/" class="btn cancel"><%- T('Cancel') %></a>
<button class="btn btn-primary submit"><%- T('Create my account') %></button>
</form>
</div>
</div>

View file

@ -1,11 +1,11 @@
<div class="well">
<h3>Templates</h3>
<h3><%- T('Templates') %></h3>
<%- @form %>
<!--<button type="submit" class="btn" data-type="template_edit">Edit</button>-->
<button type="submit" class="btn" data-type="template_delete">Delete</button>
<button type="submit" class="btn" data-type="template_select">Apply</button>
<!--<button type="submit" class="btn" data-type="template_edit"><%- T('Edit') %></button>-->
<button type="submit" class="btn" data-type="template_delete"><%- T('Delete') %></button>
<button type="submit" class="btn" data-type="template_select"><%- T('Apply') %></button>
<hr/>
<label class="" for="template_name">Save as Template</label>
<label class="" for="template_name"><%- T('Save as Template') %></label>
<input type="text" name="template_name" id="template_name" class="span2" value="<%= @template.name %>"/>
<button type="submit" class="btn" data-type="template_save">Save</button>
<button type="submit" class="btn" data-type="template_save"><%- T('Save') %></button>
</div>

View file

@ -1,19 +1,19 @@
<div class="well">
<h3><%= T('Customer') %></h3>
<h3><%- T('Customer') %></h3>
<% if @user.image: %>
<img class="thumbnail" src="<%- @user.image %>" alt="">
<% end %>
<div class="row">
<div class="customer-info" title="<%= T('Name') %>"><%= @user['realname'] %></div>
<div class="customer-info" title="<%- Ti('Name') %>"><%= @user['realname'] %></div>
</div>
<% for row in @data: %>
<% if @user[row.name] || row.name is 'note': %>
<div class="row">
<% if row.tag isnt 'textarea': %>
<div class="customer-info" title="<%= T(row.display) %>"><%- window.linkify( @user[row.name] ) %></div>
<div class="customer-info" title="<%- Ti(row.display) %>"><%- window.linkify( @user[row.name] ) %></div>
<% else: %>
<div class="customer-info" title="<%= T(row.display) %>">
<strong><%= T(row.display) %></strong><br/>
<div class="customer-info" title="<%- Ti(row.display) %>">
<strong><%- T(row.display) %></strong><br/>
<textarea class="customer-info" rows="3" name="<%= row.name %>" data-type=edit><%= @user[row.name] %></textarea>
</div>
<% end %>
@ -23,7 +23,7 @@
<% if !_.isEmpty(@user['accounts']): %>
<div class="row">
<div class="customer-info">
<strong><%= T('Linked Accounts') %></strong><br/>
<strong><%- T('Linked Accounts') %></strong><br/>
<% for account of @user['accounts']: %>
<a href="<%= @user['accounts'][account]['link'] %>" target="_blank"><%= account %></a>
<% end %>
@ -34,14 +34,14 @@
<% for link in @user['links']: %>
<div class="row">
<div class="customer-info">
<strong><%= T(link['title']) %></strong><br/>
<strong><%- T(link['title']) %></strong><br/>
<% for item in link['items']: %>
<% if item['url']: %>
<a href="<%= item['url'] %>" title="<%= T(item['title']) %>" style="<%= item['style'] %>" data-type="<%= item['data'] %>" class="<%= item['class'] %>" <% if link.new_window: %>target="_blank"<% end %>>
<a href="<%= item['url'] %>" title="<%- Ti(item['title']) %>" style="<%= item['style'] %>" data-type="<%= item['data'] %>" class="<%= item['class'] %>" <% if link.new_window: %>target="_blank"<% end %>>
<% else: %>
<span title="<%= T(item['title']) %>" style="<%= item['style'] %>" data-type="<%= item['data'] %>" class="<%= item['class'] %>">
<span title="<%- Ti(item['title']) %>" style="<%= item['style'] %>" data-type="<%= item['data'] %>" class="<%= item['class'] %>">
<% end %>
<%= T(item['name']) %> <% if item['count'] isnt undefined: %><span class="count">(<%= item['count'] %>)</span><% end %>
<%- T(item['name']) %> <% if item['count'] isnt undefined: %><span class="count">(<%= item['count'] %>)</span><% end %>
<% if item['url']: %>
</a>
<% else: %>

View file

@ -1,14 +1,14 @@
<% for row in @data: %>
<% if @user[row.name]: %>
<div class="row">
<div class="customer-info" title="<%= T(row.display) %>"><%- window.linkify( @user[row.name] ) %></div>
<div class="customer-info" title="<%- T(row.display) %>"><%- window.linkify( @user[row.name] ) %></div>
</div>
<% end %>
<% end %>
<% if !_.isEmpty(@user['accounts']): %>
<div class="row">
<div class="customer-info">
<strong><%= T('Linked Accounts') %></strong><br/>
<strong><%- T('Linked Accounts') %></strong><br/>
<% for account of @user['accounts']: %>
<a href="<%= @user['accounts'][account]['link'] %>" target="_blank"><%= account %></a>
<% end %>
@ -19,14 +19,14 @@
<% for link in @user['links']: %>
<div class="row">
<div class="customer-info">
<strong><%= T(link['title']) %></strong><br/>
<strong><%- T(link['title']) %></strong><br/>
<% for item in link['items']: %>
<% if item['url']: %>
<a href="<%= item['url'] %>" title="<%= T(item['title']) %>" style="<%= item['style'] %>" data-type="<%= item['data'] %>" class="<%= item['class'] %>" <% if link.new_window: %>target="_blank"<% end %>>
<a href="<%= item['url'] %>" title="<%- T(item['title']) %>" style="<%= item['style'] %>" data-type="<%= item['data'] %>" class="<%= item['class'] %>" <% if link.new_window: %>target="_blank"<% end %>>
<% else: %>
<span title="<%= T(item['title']) %>" style="<%= item['style'] %>" data-type="<%= item['data'] %>" class="<%= item['class'] %>">
<span title="<%- T(item['title']) %>" style="<%= item['style'] %>" data-type="<%= item['data'] %>" class="<%= item['class'] %>">
<% end %>
<%= T(item['name']) %> <% if item['count'] isnt undefined: %><span class="count">(<%= item['count'] %>)</span><% end %>
<%- T(item['name']) %> <% if item['count'] isnt undefined: %><span class="count">(<%= item['count'] %>)</span><% end %>
<% if item['url']: %>
</a>
<% else: %>

View file

@ -189,6 +189,23 @@ footer {
padding-right: 10px;
}
.translation {
border: 1px dotted #F92;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.translation:hover {
}
.translation .icon-edit {
display: none;
}
.translation:hover .icon-edit {
display: inline-block;
}
/*
* noty changes
*/