From f53aaf6091ef826bada7358e5f5ea87f6c4c5fea Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 2 Jul 2022 06:15:50 +0200 Subject: [PATCH] Move and combine export settings template --- app/views/settings/{_export.haml => export/index.haml} | 5 ++++- app/views/tabs/_settings.haml | 2 +- app/views/user/export.haml | 4 ---- 3 files changed, 5 insertions(+), 6 deletions(-) rename app/views/settings/{_export.haml => export/index.haml} (82%) delete mode 100644 app/views/user/export.haml diff --git a/app/views/settings/_export.haml b/app/views/settings/export/index.haml similarity index 82% rename from app/views/settings/_export.haml rename to app/views/settings/export/index.haml index 8ad94678..76e7b6db 100644 --- a/app/views/settings/_export.haml +++ b/app/views/settings/export/index.haml @@ -4,7 +4,7 @@ = t(".body_html") - if current_user.can_export? - %form{ action: begin_user_export_path, method: :post } + %form{ action: settings_export_path, method: :post } %p.text-center %button.btn.btn-lg.btn-primary#export-btn{ type: :submit }= t(".export") = hidden_field_tag :authenticity_token, form_authenticity_token @@ -18,3 +18,6 @@ = t(".export_url.present", time: current_user.export_created_at) %a{ href: current_user.export_url } = File.basename current_user.export_url + +- provide(:title, generate_title(t(".title"))) +- parent_layout "user/settings" diff --git a/app/views/tabs/_settings.haml b/app/views/tabs/_settings.haml index 6ed1d2cf..920b8965 100644 --- a/app/views/tabs/_settings.haml +++ b/app/views/tabs/_settings.haml @@ -9,6 +9,6 @@ = list_group_item t(".blocks"), edit_user_blocks_path = list_group_item t(".theme"), settings_theme_path = list_group_item t(".data"), user_data_path - = list_group_item t(".export"), user_export_path + = list_group_item t(".export"), settings_export_path .d-none.d-sm-block= render "shared/links" diff --git a/app/views/user/export.haml b/app/views/user/export.haml deleted file mode 100644 index 3f2c9262..00000000 --- a/app/views/user/export.haml +++ /dev/null @@ -1,4 +0,0 @@ -= render "settings/export" - -- provide(:title, generate_title(t(".title"))) -- parent_layout "user/settings"