diff --git a/app/controllers/assets_controller.rb b/app/controllers/assets_controller.rb index c56cacdd9..94492948c 100644 --- a/app/controllers/assets_controller.rb +++ b/app/controllers/assets_controller.rb @@ -68,12 +68,14 @@ class AssetsController < ApplicationController def edit @action_url = @asset.get_action_url(current_user, 'edit', false) + @favicon_url = @asset.favicon_url('edit') @token = current_user.get_wopi_token @ttl = (current_user.wopi_token_ttl * 1000).to_s end def view @action_url = @asset.get_action_url(current_user, 'view', false) + @favicon_url = @asset.favicon_url('view') @token = current_user.get_wopi_token @ttl = (current_user.wopi_token_ttl * 1000).to_s end diff --git a/app/models/asset.rb b/app/models/asset.rb index e82467a10..6ec1964b2 100644 --- a/app/models/asset.rb +++ b/app/models/asset.rb @@ -335,6 +335,12 @@ class Asset < ActiveRecord::Base end end + def favicon_url(action) + file_ext = file_file_name.split('.').last + action = get_action(file_ext, action) + action.wopi_app.icon if action.wopi_app + end + # locked?, lock_asset and refresh_lock rely on the asset # being locked in the database to prevent race conditions def locked? diff --git a/app/views/assets/edit.erb b/app/views/assets/edit.erb index 72f39b1f8..ea03dede1 100644 --- a/app/views/assets/edit.erb +++ b/app/views/assets/edit.erb @@ -11,8 +11,7 @@ - +
+ - + - - - - - + +