mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +08:00
Add editnew action for editing new office files
Closes SCI-3380
This commit is contained in:
parent
55bb9d06c4
commit
ed003aca13
2 changed files with 4 additions and 2 deletions
|
@ -128,8 +128,9 @@ class AssetsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
|
action = @asset.file_file_size.zero? && !@asset.locked? ? 'editnew' : 'edit'
|
||||||
@action_url = append_wd_params(@asset
|
@action_url = append_wd_params(@asset
|
||||||
.get_action_url(current_user, 'edit', false))
|
.get_action_url(current_user, action, false))
|
||||||
@favicon_url = @asset.favicon_url('edit')
|
@favicon_url = @asset.favicon_url('edit')
|
||||||
tkn = current_user.get_wopi_token
|
tkn = current_user.get_wopi_token
|
||||||
@token = tkn.token
|
@token = tkn.token
|
||||||
|
|
|
@ -55,7 +55,8 @@ module WopiUtil
|
||||||
wopi_app.save!
|
wopi_app.save!
|
||||||
app.xpath('action').each do |action|
|
app.xpath('action').each do |action|
|
||||||
name = action.xpath('@name').first.value
|
name = action.xpath('@name').first.value
|
||||||
next unless %w(view edit wopitest).include?(name)
|
next unless %w(view edit editnew wopitest).include?(name)
|
||||||
|
|
||||||
wopi_action = WopiAction.new
|
wopi_action = WopiAction.new
|
||||||
wopi_action.action = name
|
wopi_action.action = name
|
||||||
wopi_action.extension = action.xpath('@ext').first.value
|
wopi_action.extension = action.xpath('@ext').first.value
|
||||||
|
|
Loading…
Reference in a new issue