diff --git a/app/assets/stylesheets/partials/_inline_editing.scss b/app/assets/stylesheets/partials/_inline_editing.scss index f49832ab0..b10a2e8ba 100644 --- a/app/assets/stylesheets/partials/_inline_editing.scss +++ b/app/assets/stylesheets/partials/_inline_editing.scss @@ -69,12 +69,19 @@ cursor: pointer; line-height: 26px; margin-left: -5px; + min-height: 30px; overflow: hidden; padding: 2px 4px; padding-right: 36px; text-overflow: ellipsis; white-space: nowrap; width: calc(100% - 32px); + + &:empty:not(:focus):before{ + color: $color-silver-chalice; + content:attr(data-placeholder); + font-weight: normal; + } } input { @@ -88,6 +95,11 @@ padding-right: 36px; width: calc(100% - 32px); + &::placeholder { + color: $color-silver-chalice; + font-weight: normal; + } + &:focus { outline: 0; } diff --git a/app/views/protocols/_header.html.erb b/app/views/protocols/_header.html.erb index 9853feabc..375eb37b6 100644 --- a/app/views/protocols/_header.html.erb +++ b/app/views/protocols/_header.html.erb @@ -57,6 +57,4 @@ -<%= render partial: "protocols/header/edit_metadata_modal.html.erb" %> - <%= javascript_include_tag "protocols/header" %> diff --git a/app/views/protocols/header/_authors_label.html.erb b/app/views/protocols/header/_authors_label.html.erb index 92ec4b2d1..2006a4606 100644 --- a/app/views/protocols/header/_authors_label.html.erb +++ b/app/views/protocols/header/_authors_label.html.erb @@ -1,18 +1,15 @@ -<% if @protocol.authors.present? %> - <% if can_manage_protocol_in_repository?(@protocol) && editable %> - <%= render partial: "shared/inline_editing.html.erb", - locals: { - initial_value: @protocol.authors, - config: { - field_to_udpate: 'authors', - params_group: 'protocol', - path_to_update: authors_protocol_path(@protocol) - } - } %> - <% else %> - <%= @protocol.authors %> - <% end %> - +<% if can_manage_protocol_in_repository?(@protocol) && editable %> + <%= render partial: "shared/inline_editing.html.erb", + locals: { + initial_value: @protocol.authors, + config: { + field_to_udpate: 'authors', + params_group: 'protocol', + placeholder: t("protocols.header.no_authors"), + path_to_update: authors_protocol_path(@protocol) + } + } + %> <% else %> - <%= t("protocols.header.no_authors") %> -<% end %> \ No newline at end of file + <%= @protocol.authors || t("protocols.header.no_authors") %> +<% end %> diff --git a/app/views/protocols/header/_edit_authors_modal_body.html.erb b/app/views/protocols/header/_edit_authors_modal_body.html.erb deleted file mode 100644 index c6d28e46d..000000000 --- a/app/views/protocols/header/_edit_authors_modal_body.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= bootstrap_form_for @protocol, url: metadata_protocol_path(@protocol, format: :json), remote: :true do |f| %> - <%= f.smart_text_area :authors, label: t("protocols.header.edit_authors_modal.label") %> -<% end %> \ No newline at end of file diff --git a/app/views/protocols/header/_edit_metadata_modal.html.erb b/app/views/protocols/header/_edit_metadata_modal.html.erb deleted file mode 100644 index 73d775d27..000000000 --- a/app/views/protocols/header/_edit_metadata_modal.html.erb +++ /dev/null @@ -1,15 +0,0 @@ -