* Update data exporter to handle admin send * Match button with everything else * Use proper redirect path * Stub SiteConfig definition instead of setting it Co-authored-by: Mac Siri <krairit.siri@gmail.com> * Removed if statement by accident oops * Remove non-functional boolean param and pass email directly * Use refinement to conv to boolean instead of JSON.parse * Rename to StringToBoolean * Use 'using' in proper scope (not in method) * Rename to_bool to to_boolean * Refactor if statement, thanks rhymes! * Fix small bugs in tests * Remove tracking for export_email b/c no @user Co-authored-by: Mac Siri <krairit.siri@gmail.com>
21 lines
1.3 KiB
Text
21 lines
1.3 KiB
Text
<div class="crayons-card p-6">
|
|
<div>
|
|
<h2 class="d-inline">Data Export</h2>
|
|
<button type="button" data-toggle="collapse" data-target="#data-export-row" class="crayons-btn float-right">Toggle</button>
|
|
</div>
|
|
<div class="crayons-card__body collapse" id="data-export-row">
|
|
<p>
|
|
You can export a user's data here. Currently we only support exporting a user's posts and comments.
|
|
</p>
|
|
<p>
|
|
You have the option of exporting to your admin account to send to the user, or exporting to the user directly.
|
|
</p>
|
|
<p>
|
|
Exporting the data to your admin account will send it to your default admin email (<%= SiteConfig.email_addresses[:default] %>), and exporting to the user will send it to their email (<%= @user.email %>).
|
|
</p>
|
|
<div style="display: flex;">
|
|
<%= button_to "Export to Admin", export_data_admin_user_path(@user.id), data: { confirm: "Are you sure you want to export this user's content to the ADMIN?" }, class: "crayons-btn", params: { send_to_admin: true }, style: "margin-right: 8px;" %>
|
|
<%= button_to "Export to User", export_data_admin_user_path(@user.id), data: { confirm: "Are you sure you want to export this user's content to the USER?" }, class: "crayons-btn", params: { send_to_admin: false } %>
|
|
</div>
|
|
</div>
|
|
</div>
|