diff --git a/app/assets/stylesheets/my_modules/protocols/index.scss b/app/assets/stylesheets/my_modules/protocols/index.scss index 605f46f32..a336bec0e 100644 --- a/app/assets/stylesheets/my_modules/protocols/index.scss +++ b/app/assets/stylesheets/my_modules/protocols/index.scss @@ -86,6 +86,16 @@ } } } + + .dropdown-menu { + a { + padding: 8px 20px; + } + + .fas { + padding-right: 5px; + } + } } } } diff --git a/app/assets/stylesheets/themes/scinote.scss b/app/assets/stylesheets/themes/scinote.scss index 8626e39c7..4cfeefd70 100644 --- a/app/assets/stylesheets/themes/scinote.scss +++ b/app/assets/stylesheets/themes/scinote.scss @@ -921,13 +921,6 @@ ul.content-activities { flex-wrap: wrap; margin-bottom: 5px; - .protocol-button { - - .sci-btn-group { - float: left; - } - } - .protocol-status-bar { display: flex; height: 40px; diff --git a/app/views/my_modules/_my_module_protocol.html.erb b/app/views/my_modules/_my_module_protocol.html.erb index 8d605604e..5c9ebe20c 100644 --- a/app/views/my_modules/_my_module_protocol.html.erb +++ b/app/views/my_modules/_my_module_protocol.html.erb @@ -2,7 +2,6 @@
<%= render partial: "my_modules/protocols/protocol_status_bar.html.erb" %>
- <%= render partial: "my_modules/protocols/protocol_buttons.html.erb" %> <% if can_manage_protocol_in_module?(@protocol) %> <%= render partial: "my_modules/recent_protocol_dropdown.html.erb", locals: {protocol: @my_module.protocol}%> <% end %> diff --git a/app/views/my_modules/protocols.html.erb b/app/views/my_modules/protocols.html.erb index 76ebaa98f..959dd324b 100644 --- a/app/views/my_modules/protocols.html.erb +++ b/app/views/my_modules/protocols.html.erb @@ -69,6 +69,9 @@

<%= t('my_modules.protocol.title') %>

+
+ <%= render partial: "my_modules/protocols/protocol_options_dropdown" %> +
<%= render partial: "my_module_protocol" %> diff --git a/app/views/my_modules/protocols/_protocol_buttons.html.erb b/app/views/my_modules/protocols/_protocol_buttons.html.erb deleted file mode 100644 index 327956e9c..000000000 --- a/app/views/my_modules/protocols/_protocol_buttons.html.erb +++ /dev/null @@ -1,41 +0,0 @@ -
-
- - - <% if can_read_experiment?(@my_module.experiment) %> - <%= link_to raw(" " + t('my_modules.protocols.buttons.export') + ""), export_protocols_path(protocol_ids: @protocol.id, my_module_id: @my_module.id), class: "btn btn-secondary", data: { turbolinks: false } %> - <% else %> -  <%= t("my_modules.protocols.buttons.export") %> - <% end %> - <% if can_read_protocol_in_module?(@protocol) && can_create_protocols_in_repository?(@protocol.team) %> - -  <%= t("my_modules.protocols.buttons.copy_to_repository") %> - - <% else %> -  <%= t("my_modules.protocols.buttons.copy_to_repository") %> - <% end %> -
-
diff --git a/app/views/my_modules/protocols/_protocol_options_dropdown.html.erb b/app/views/my_modules/protocols/_protocol_options_dropdown.html.erb new file mode 100644 index 000000000..3d46474a9 --- /dev/null +++ b/app/views/my_modules/protocols/_protocol_options_dropdown.html.erb @@ -0,0 +1,51 @@ +<% protocol_readable = can_read_protocol_in_module?(@protocol) %> +<% protocol_editable = can_manage_protocol_in_module?(@protocol) %> +<% protocol_savable_to_repo = can_read_protocol_in_module?(@protocol) && can_create_protocols_in_repository?(@protocol.team) %> + + diff --git a/config/locales/en.yml b/config/locales/en.yml index da2915641..36c7ae591 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -607,6 +607,12 @@ en: assign_from: "Assign from" protocol: title: "Protocol" + options_dropdown: + title: "Protocol options" + load_from_repo: "Load from repository" + import: "Import protocol" + export: "Export protocol" + save_to_repo: "Save to repository" buttons: complete: "Complete Task" uncomplete: "Uncomplete Task" @@ -687,12 +693,6 @@ en: btns_parent_and_self_newer: title: "Newer version in repository and task" text: "There is a newer version of this protocol in the repository. This version of protocol is newer than the version stored in protocol repository." - buttons: - load_protocol: "Load Protocol" - load_protocol_from_repository: "from repository" - load_protocol_from_file: "from computer" - export: "Export Protocol" - copy_to_repository: "Copy To Protocol Repository" confirm_link_update_modal: unlink_title: "Unlink protocol" unlink_message: "Are you sure you want to unlink the task protocol from the repository version? This will stop any tracking of changes."