mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-12-09 13:46:21 +08:00
Merge pull request #7884 from aignatov-bio/ai-sci-11084-add-storage-location-banner-to-item-card
Add placeholder for disabled storage locations to item card [SCI-11084]
This commit is contained in:
commit
a70b081c38
5 changed files with 14 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ class RepositoryRowsController < ApplicationController
|
|||
include ApplicationHelper
|
||||
include MyModulesHelper
|
||||
include RepositoryDatatableHelper
|
||||
include StorageLocationsHelper
|
||||
|
||||
before_action :load_repository, except: %i(show print rows_to_print print_zpl validate_label_template_columns)
|
||||
before_action :load_repository_or_snapshot, only: %i(show print rows_to_print print_zpl
|
||||
|
|
|
|||
7
app/helpers/storage_locations_helper.rb
Normal file
7
app/helpers/storage_locations_helper.rb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
module StorageLocationsHelper
|
||||
def storage_locations_placeholder
|
||||
"<div class=\"p-4 rounded bg-sn-super-light-blue\">
|
||||
#{I18n.t('storage_locations.storage_locations_disabled')}
|
||||
</div>"
|
||||
end
|
||||
end
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
{{ i18n.t('repositories.locations.assign') }}
|
||||
</button>
|
||||
</div>
|
||||
<template v-for="(location, index) in repositoryRow.storage_locations.locations" :key="location.id">
|
||||
<template v-if="repositoryRow.storage_locations.enabled" v-for="(location, index) in repositoryRow.storage_locations.locations" :key="location.id">
|
||||
<div>
|
||||
<div class="sci-divider my-4" v-if="index > 0"></div>
|
||||
<div class="flex gap-2 mb-3">
|
||||
|
|
@ -30,6 +30,9 @@
|
|||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<div v-else>
|
||||
<div v-html="repositoryRow.storage_locations.placeholder"></div>
|
||||
</div>
|
||||
<Teleport to="body">
|
||||
<AssignModal
|
||||
v-if="openAssignModal"
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ json.storage_locations do
|
|||
end
|
||||
)
|
||||
json.enabled StorageLocation.storage_locations_enabled?
|
||||
json.placeholder storage_locations_placeholder
|
||||
end
|
||||
|
||||
json.default_columns do
|
||||
|
|
|
|||
|
|
@ -2670,6 +2670,7 @@ en:
|
|||
errors:
|
||||
my_module_references_missing: 'Task references are not set'
|
||||
storage_locations:
|
||||
storage_locations_disabled: "<b>Storage locations are disabled</b>"
|
||||
container: 'box'
|
||||
location: 'location'
|
||||
show:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue