mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-10 06:37:32 +08:00
Add model name to the archive folders in export-all ZIP structure [SCI-2817]
This commit is contained in:
parent
57dbd63aa3
commit
dea4ed4e15
1 changed files with 10 additions and 5 deletions
|
@ -144,14 +144,19 @@ class TeamZipExport < ZipExport
|
||||||
# Create directory for project, experiment, or module
|
# Create directory for project, experiment, or module
|
||||||
def make_model_dir(parent_path, model, index)
|
def make_model_dir(parent_path, model, index)
|
||||||
# For MyModule, the index indicates its position in project sidebar
|
# For MyModule, the index indicates its position in project sidebar
|
||||||
model_name = format(
|
if model.class == MyModule
|
||||||
model.class == MyModule ? '(%<idx>s) %<name>s' : '%<name>s (%<idx>s)',
|
class_name = 'module'
|
||||||
idx: index, name: to_filesystem_name(model.name)
|
model_format = '(%<idx>s) %<name>s'
|
||||||
)
|
else
|
||||||
|
class_name = model.class.to_s.downcase.pluralize
|
||||||
|
model_format = '%<name>s (%<idx>s)'
|
||||||
|
end
|
||||||
|
model_name =
|
||||||
|
format(model_format, idx: index, name: to_filesystem_name(model.name))
|
||||||
|
|
||||||
model_path = parent_path
|
model_path = parent_path
|
||||||
if model.archived
|
if model.archived
|
||||||
model_path += '/Archived'
|
model_path += "/Archived #{class_name}"
|
||||||
FileUtils.mkdir_p(model_path)
|
FileUtils.mkdir_p(model_path)
|
||||||
end
|
end
|
||||||
model_path += "/#{model_name}"
|
model_path += "/#{model_name}"
|
||||||
|
|
Loading…
Reference in a new issue