diff --git a/app/views/zizia/csv_imports/_form.html.erb b/app/views/zizia/csv_imports/_form.html.erb index 8e14018..9cf1b99 100644 --- a/app/views/zizia/csv_imports/_form.html.erb +++ b/app/views/zizia/csv_imports/_form.html.erb @@ -1,101 +1,5 @@ -<%= form_with(model: csv_import, local: true, html: { multipart: true }, url: preview_csv_import_path) do |form| %> - <%= form.hidden_field :manifest_cache %> -
-
-
-
-

1 Prepare Your Content

-
-

A

-
- Read the Metadata Field Guide to learn what fields are available for import. -
- -
-
-

B

-
- Download a CSV template and start filling in your metadata. -
- -
-
-

C

-
- Upload your files over SFTP, using a tool like FileZilla to transfer files. -
-
-
-
-

2 Upload Your Files

- <% if collections? %> -
-

A

-
- Upload a CSV that lists the metadata and files you want to import. -
-
- <%= render "file_upload", form: form %> -
-
-
-

B

-
- Choose a collection that you'd like your new works to be associated with. -
-
- <%= render "collection_selection", form: form %> -
-
-
-

C

-
- Select update behavior. New works will always be added to the repository. Existing works can be overwritten, updated, - or ignored. -
-
- <%= render "update_actor_stack", form: form %> -
-
-
-

D

-
- Preview your import and start the import if everything looks good. - or overwritten -
-
- <%= render "actions", form: form %> -
-
- <% else %> -
-

A

-
- You must create a collection before importing content. -
-
- <% end %> -
-
-

3 Monitor Your Progress

-
-

A

-
- Check the status of batches that have been submitted for import. -
- -
-
-
-
- <%= render "error", csv_import: csv_import %> -
-
-
-<% end %> +<% if Flipflop.new_zizia_ui? %> + <%= render 'import_form', csv_import: @csv_import %> +<% else %> + <%= render 'old_form', csv_import: @csv_import %> +<% end %> \ No newline at end of file diff --git a/app/views/zizia/csv_imports/_import_form.html.erb b/app/views/zizia/csv_imports/_import_form.html.erb new file mode 100644 index 0000000..5486145 --- /dev/null +++ b/app/views/zizia/csv_imports/_import_form.html.erb @@ -0,0 +1,62 @@ +<%= form_with(model: csv_import, local: true, html: { multipart: true }, url: preview_csv_import_path) do |form| %> + <%= form.hidden_field :manifest_cache %> +
+
+
+ +
+ <% if collections? %> +
+

A

+
+ Upload a CSV that lists the metadata and files you want to import. +
+
+ <%= render "file_upload", form: form %> +
+
+ +
+

B

+
+ Select update behavior. New works will always be added to the repository. Existing works can be overwritten, updated, + or ignored. +
+
+ <%= render "update_actor_stack", form: form %> +
+
+
+

C

+
+ Preview your import and start the import if everything looks good. + or overwritten +
+
+ <%= render "actions", form: form %> +
+
+ <% else %> +
+

A

+
+ You must create a collection before importing content. +
+
+ <% end %> +
+
+
+ <%= render "error", csv_import: csv_import %> +
+
+
+<% end %> diff --git a/app/views/zizia/csv_imports/_old_form.html.erb b/app/views/zizia/csv_imports/_old_form.html.erb new file mode 100644 index 0000000..8e14018 --- /dev/null +++ b/app/views/zizia/csv_imports/_old_form.html.erb @@ -0,0 +1,101 @@ +<%= form_with(model: csv_import, local: true, html: { multipart: true }, url: preview_csv_import_path) do |form| %> + <%= form.hidden_field :manifest_cache %> +
+
+
+
+

1 Prepare Your Content

+
+

A

+
+ Read the Metadata Field Guide to learn what fields are available for import. +
+ +
+
+

B

+
+ Download a CSV template and start filling in your metadata. +
+ +
+
+

C

+
+ Upload your files over SFTP, using a tool like FileZilla to transfer files. +
+
+
+
+

2 Upload Your Files

+ <% if collections? %> +
+

A

+
+ Upload a CSV that lists the metadata and files you want to import. +
+
+ <%= render "file_upload", form: form %> +
+
+
+

B

+
+ Choose a collection that you'd like your new works to be associated with. +
+
+ <%= render "collection_selection", form: form %> +
+
+
+

C

+
+ Select update behavior. New works will always be added to the repository. Existing works can be overwritten, updated, + or ignored. +
+
+ <%= render "update_actor_stack", form: form %> +
+
+
+

D

+
+ Preview your import and start the import if everything looks good. + or overwritten +
+
+ <%= render "actions", form: form %> +
+
+ <% else %> +
+

A

+
+ You must create a collection before importing content. +
+
+ <% end %> +
+
+

3 Monitor Your Progress

+
+

A

+
+ Check the status of batches that have been submitted for import. +
+ +
+
+
+
+ <%= render "error", csv_import: csv_import %> +
+
+
+<% end %> diff --git a/config/features.rb b/config/features.rb new file mode 100644 index 0000000..648f247 --- /dev/null +++ b/config/features.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true +Flipflop.configure do + feature :new_zizia_ui, + default: false, + description: "Show new UI features and workflows in Zizia importer." +end diff --git a/lib/zizia/engine.rb b/lib/zizia/engine.rb index 97ffb35..807ee25 100644 --- a/lib/zizia/engine.rb +++ b/lib/zizia/engine.rb @@ -20,6 +20,10 @@ class Engine < ::Rails::Engine app.config.assets.precompile << %w[zizia/application.js zizia/application.css] end + initializer "load_features" do + Flipflop::FeatureLoader.current.append(self) + end + initializer :append_migrations do |app| unless app.root.to_s.match root.to_s config.paths['db/migrate'].expanded.each do |expanded_path|