Added action links.
This commit is contained in:
parent
7b629e48e6
commit
6c0e3a1afc
3 changed files with 22 additions and 1 deletions
|
@ -6,6 +6,9 @@ class Index extends App.Controller
|
||||||
# check authentication
|
# check authentication
|
||||||
return if !@authenticate()
|
return if !@authenticate()
|
||||||
|
|
||||||
|
# set title
|
||||||
|
@title 'Packages'
|
||||||
|
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'packages',
|
id: 'packages',
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
|
@ -18,6 +21,15 @@ class Index extends App.Controller
|
||||||
|
|
||||||
render: (data) ->
|
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')(
|
@html App.view('package')(
|
||||||
head: 'Dashboard'
|
head: 'Dashboard'
|
||||||
packages: data.packages
|
packages: data.packages
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
<th><%- @T('Name') %></th>
|
<th><%- @T('Name') %></th>
|
||||||
<th><%- @T('Version') %></th>
|
<th><%- @T('Version') %></th>
|
||||||
<th><%- @T('Vendor') %></th>
|
<th><%- @T('Vendor') %></th>
|
||||||
|
<th><%- @T('State') %></th>
|
||||||
<th><%- @T('Action') %></th>
|
<th><%- @T('Action') %></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -27,7 +28,8 @@
|
||||||
<td><%= item.name %></td>
|
<td><%= item.name %></td>
|
||||||
<td><%= item.version %></td>
|
<td><%= item.version %></td>
|
||||||
<td><a href="<%- item.url %>" target="_blank"><%= item.vendor %></a></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>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -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 => "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 => "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 => "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 )
|
#Translation.create( :locale => 'de', :source => "", :target => "", :updated_by_id => 1, :created_by_id => 1 )
|
||||||
|
|
Loading…
Reference in a new issue