mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-29 23:46:32 +08:00
Fix merging issues
This commit is contained in:
parent
ffd415d409
commit
ba1d6d45ca
6 changed files with 11 additions and 20 deletions
|
|
@ -572,7 +572,7 @@ var FilePreviewModal = (function() {
|
|||
modal.find('.file-preview-container')
|
||||
.append($('<img>')
|
||||
.attr('src', data['large-preview-url'])
|
||||
.attr('alt', data.name)
|
||||
.attr('alt', data.file_name)
|
||||
.click(function(ev) {
|
||||
ev.stopPropagation();
|
||||
}));
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ class AssetsController < ApplicationController
|
|||
elsif @assoc.class == RepositoryCell
|
||||
can_manage_repository_rows?(@repository.team)
|
||||
end
|
||||
|
||||
if response_json['type'] == 'image'
|
||||
if ['image/jpeg', 'image/pjpeg'].include? @asset.file.content_type
|
||||
response_json['quality'] = @asset.file_image_quality || 90
|
||||
|
|
|
|||
|
|
@ -27,19 +27,10 @@ class MarvinJsAssetsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
asset = current_team.marvin_js_assets.find_by_id(params[:id])
|
||||
if asset.destroy
|
||||
render json: { id: asset.id }
|
||||
else
|
||||
render json: { error: t('marvinjs.no_sketches_found') }, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
asset = MarvinJsService.update_sketch(marvin_params, current_user)
|
||||
if asset
|
||||
render json: { url: asset.url, id: asset.id }
|
||||
render json: { url: asset.medium_preview, id: asset.id }
|
||||
else
|
||||
render json: { error: t('marvinjs.no_sketches_found') }, status: :unprocessable_entity
|
||||
end
|
||||
|
|
|
|||
|
|
@ -198,13 +198,13 @@ class Asset < ApplicationRecord
|
|||
end
|
||||
|
||||
def medium_preview
|
||||
return file.variant(resize: Constants::MEDIUM_PIC_FORMAT) if previewable_image?
|
||||
return file.variant(resize: Constants::MEDIUM_PIC_FORMAT).processed.service_url if previewable_image?
|
||||
|
||||
file.preview(resize: Constants::MEDIUM_PIC_FORMAT)
|
||||
end
|
||||
|
||||
def large_preview
|
||||
return file.variant(resize: Constants::LARGE_PIC_FORMAT) if previewable_image?
|
||||
return file.variant(resize: Constants::LARGE_PIC_FORMAT).processed.service_url if previewable_image?
|
||||
|
||||
file.preview(resize: Constants::LARGE_PIC_FORMAT)
|
||||
end
|
||||
|
|
@ -257,7 +257,7 @@ class Asset < ApplicationRecord
|
|||
end
|
||||
|
||||
def image?
|
||||
content_type == %r{^image/#{Regexp.union(Constants::WHITELISTED_IMAGE_TYPES)}}
|
||||
content_type =~ %r{^image/#{Regexp.union(Constants::WHITELISTED_IMAGE_TYPES)}}
|
||||
end
|
||||
|
||||
def text?
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class Team < ApplicationRecord
|
|||
has_many :repositories, dependent: :destroy
|
||||
has_many :reports, inverse_of: :team, dependent: :destroy
|
||||
has_many :activities, inverse_of: :team, dependent: :destroy
|
||||
has_many :marvin_js_assets, inverse_of: :team, dependent: :destroy
|
||||
has_many :assets, inverse_of: :team, dependent: :destroy
|
||||
|
||||
attr_accessor :without_templates
|
||||
attr_accessor :without_intro_demo
|
||||
|
|
|
|||
|
|
@ -1765,10 +1765,11 @@ en:
|
|||
complete_title: "Complete Step"
|
||||
uncomplete_title: "Uncomplete Step"
|
||||
attachments:
|
||||
sort_new: "Newest first ↓"
|
||||
sort_old: "Oldest first ↑"
|
||||
sort_atoz: "Name ↓"
|
||||
sort_ztoa: "Name ↑"
|
||||
sort:
|
||||
new_html: "Newest first ↓"
|
||||
old_html: "Oldest first ↑"
|
||||
atoz_html: "Name ↓"
|
||||
ztoa_html: "Name ↑"
|
||||
new:
|
||||
add_step_title: "Add new step"
|
||||
tab_checklists: "Checklists"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue