Added action links.

This commit is contained in:
Martin Edenhofer 2012-12-27 21:57:58 +01:00
parent 7b629e48e6
commit 6c0e3a1afc
3 changed files with 22 additions and 1 deletions

View file

@ -6,6 +6,9 @@ class Index extends App.Controller
# check authentication
return if !@authenticate()
# set title
@title 'Packages'
App.Com.ajax(
id: 'packages',
type: 'GET',
@ -18,6 +21,15 @@ class Index extends App.Controller
render: (data) ->
for item in data.packages
item.action = []
if item.state == 'installed'
item.action = ['uninstall', 'deactivate']
else if item.state == 'uninstalled'
item.action = ['install']
else if item.state == 'deactivate'
item.action = ['uninstall', 'activate']
@html App.view('package')(
head: 'Dashboard'
packages: data.packages

View file

@ -18,6 +18,7 @@
<th><%- @T('Name') %></th>
<th><%- @T('Version') %></th>
<th><%- @T('Vendor') %></th>
<th><%- @T('State') %></th>
<th><%- @T('Action') %></th>
</tr>
</thead>
@ -27,7 +28,8 @@
<td><%= item.name %></td>
<td><%= item.version %></td>
<td><a href="<%- item.url %>" target="_blank"><%= item.vendor %></a></td>
<td>-</td>
<td><%- @T(item.state) %></td>
<td><% for action in item.action: %><a href="#"><%- @T(action) %></a><br/><% end %></td>
</tr>
<% end %>
</tbody>

View file

@ -1846,6 +1846,13 @@ Translation.create( :locale => 'de', :source => "Closed", :target => "Geschlosse
Translation.create( :locale => 'de', :source => "Re-Open", :target => "Wiedereröffnet", :updated_by_id => 1, :created_by_id => 1 )
Translation.create( :locale => 'de', :source => "Day", :target => "Tag", :updated_by_id => 1, :created_by_id => 1 )
Translation.create( :locale => 'de', :source => "First Solution", :target => "Erstlösung", :updated_by_id => 1, :created_by_id => 1 )
Translation.create( :locale => 'de', :source => "Vendor", :target => "Hersteller", :updated_by_id => 1, :created_by_id => 1 )
Translation.create( :locale => 'de', :source => "Action", :target => "Aktion", :updated_by_id => 1, :created_by_id => 1 )
Translation.create( :locale => 'de', :source => "uninstall", :target => "deinstallieren", :updated_by_id => 1, :created_by_id => 1 )
Translation.create( :locale => 'de', :source => "install", :target => "installieren", :updated_by_id => 1, :created_by_id => 1 )
Translation.create( :locale => 'de', :source => "reinstall", :target => "erneut installieren", :updated_by_id => 1, :created_by_id => 1 )
Translation.create( :locale => 'de', :source => "deactivate", :target => "deaktivieren", :updated_by_id => 1, :created_by_id => 1 )
Translation.create( :locale => 'de', :source => "activate", :target => "aktivieren", :updated_by_id => 1, :created_by_id => 1 )
#Translation.create( :locale => 'de', :source => "", :target => "", :updated_by_id => 1, :created_by_id => 1 )