diff --git a/app/views/fluentd/index.html.haml b/app/views/fluentd/index.html.haml index 15b5ab9..2ab90cb 100644 --- a/app/views/fluentd/index.html.haml +++ b/app/views/fluentd/index.html.haml @@ -19,8 +19,17 @@ = "fluentd ##{d.id}" - unless d.agent.running? = link_to t(".edit"), edit_fluentd_path(d) - = link_to t(".destroy"), fluentd_path(d), method: :delete + %button{class: "btn btn-danger", data: {toggle: "modal", target:" #modal-destroy"}} + = t ".destroy" %div.panel-body + :ruby + locals = { + head: t('.destroy_confirm_title', target: d.label), + body: t('.destroy_confirm_body'), + primary_button: link_to(t(".destroy"), fluentd_path(d), method: :delete, class: "btn btn-danger") + } + = render partial: "shared/modal", locals: locals + %h4 - if d.agent.running? = icon("fa-play") diff --git a/app/views/shared/_modal.html.erb b/app/views/shared/_modal.html.erb new file mode 100644 index 0000000..d14cf93 --- /dev/null +++ b/app/views/shared/_modal.html.erb @@ -0,0 +1,25 @@ +<% primary_button ||= "Save changes" %> + + + + diff --git a/config/locales/translation_en.yml b/config/locales/translation_en.yml index a3f636d..189f4a6 100644 --- a/config/locales/translation_en.yml +++ b/config/locales/translation_en.yml @@ -27,6 +27,9 @@ en: installing: "Installing: %{target}" uninstalling: "Uninstalling: %{target}" search: Search + destroy_confirm_title: "%{target} Deletion" + destroy_confirm_body: | + Really delete? plugins: common: &plugin_common diff --git a/config/locales/translation_ja.yml b/config/locales/translation_ja.yml index 0a6a3f2..841e677 100644 --- a/config/locales/translation_ja.yml +++ b/config/locales/translation_ja.yml @@ -27,6 +27,9 @@ ja: installing: "インストール中: %{target}" uninstalling: "アンインストール中: %{target}" search: 検索 + destroy_confirm_title: "%{target}を削除" + destroy_confirm_body: | + 削除しますか? plugins: common: &plugin_common