mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 01:01:39 -05:00
* Implement OmniAuth GitHub authentication * Fix omniauth GitHub scope to include user email access * Remove margin-bottom * Implement Google OAuth2 authentication * Implement OIDC authentication for Dawarich using omniauth_openid_connect gem. * Add patreon account linking and patron checking service * Update docker-compose.yml to use boolean values instead of strings * Add support for KML files * Add tests * Update changelog * Remove patreon OAuth integration * Move omniauthable to a concern * Update an icon in integrations * Update changelog * Update app version * Fix family location sharing toggle * Move family location sharing to its own controller * Update changelog * Implement basic tagging functionality for places, allowing users to categorize and label places with custom tags. * Add places management API and tags feature * Add some changes related to places management feature * Fix some tests * Fix sometests * Add places layer * Update places layer to use Leaflet.Control.Layers.Tree for hierarchical layer control * Rework tag form * Add hashtag * Add privacy zones to tags * Add notes to places and manage place tags * Update changelog * Update e2e tests * Extract tag serializer to its own file * Fix some tests * Fix tags request specs * Fix some tests * Fix rest of the tests * Revert some changes * Add missing specs * Revert changes in place export/import code * Fix some specs * Fix PlaceFinder to only consider global places when finding existing places * Fix few more specs * Fix visits creator spec * Fix last tests * Update place creating modal * Add home location based on "Home" tagged place * Save enabled tag layers * Some fixes * Fix bug where enabling place tag layers would trigger saving enabled layers, overwriting with incomplete data * Update migration to use disable_ddl_transaction! and add up/down methods * Fix tag layers restoration and filtering logic * Update OIDC auto-registration and email/password registration settings * Fix potential xss
126 lines
5.8 KiB
Text
126 lines
5.8 KiB
Text
<% content_for :title, 'Account' %>
|
|
|
|
<div class="hero min-h-content bg-base-200">
|
|
<div class="hero-content flex-col lg:flex-row-reverse w-full my-5">
|
|
<div class="text-center lg:text-left">
|
|
<h1 class="text-5xl font-bold mb-5">Edit your account!</h1>
|
|
<%= render 'devise/registrations/api_key' %>
|
|
<% if current_user.trial? %>
|
|
<p>Your trial period ends at <%= human_datetime current_user.active_until %>.</p>
|
|
<p>
|
|
<%= link_to 'Subscribe', "#{MANAGER_URL}/auth/dawarich?token=#{current_user.generate_subscription_token}", class: 'btn btn-sm btn-success glass' %> to continue using Dawarich after your trial ends.
|
|
</p>
|
|
<% end %>
|
|
<% if !DawarichSettings.self_hosted? %>
|
|
<%= render 'devise/registrations/points_usage' %>
|
|
<% end %>
|
|
</div>
|
|
<div class="card flex-shrink-0 w-full max-w-sm shadow-2xl bg-base-100 px-5 py-5">
|
|
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), class: 'form-body', method: :put, data: { turbo_method: :put, turbo: false }) do |f| %>
|
|
<%= render "devise/shared/error_messages", resource: resource %>
|
|
|
|
<div class="form-control">
|
|
<%= f.label :email, class: 'label' do %>
|
|
<span class="label-text">Email</span>
|
|
<% end %>
|
|
<%= f.email_field :email, autofocus: true, autocomplete: "email", class: 'input input-bordered' %>
|
|
</div>
|
|
|
|
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
|
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
|
|
<% end %>
|
|
|
|
<div class="form-control mt-5">
|
|
<%= f.label :password, class: 'label' do %>
|
|
<span class="label-text">Password <i>(leave blank if you don't want to change it)</i></span>
|
|
<% end %>
|
|
<% if @minimum_password_length %>
|
|
<em class='text-xs'>(<%= @minimum_password_length %> characters minimum)</em>
|
|
<% end %>
|
|
<%= f.password_field :password, autocomplete: "new-password", class: 'input input-bordered' %>
|
|
</div>
|
|
|
|
<div class="form-control mt-5">
|
|
<%= f.label :password_confirmation, class: 'label' do %>
|
|
<span class="label-text">Password confirmation</span>
|
|
<% end %>
|
|
<% if @minimum_password_length %>
|
|
<em class='text-xs'>(<%= @minimum_password_length %> characters minimum)</em>
|
|
<% end %>
|
|
<%= f.password_field :password_confirmation, autocomplete: "new-password", class: 'input input-bordered' %>
|
|
</div>
|
|
|
|
<div class="form-control mt-5">
|
|
<%= f.label :current_password, class: 'label' do %>
|
|
<span class="label-text">Current password</span>
|
|
<% end %>
|
|
<% if @minimum_password_length %>
|
|
<em class='text-xs'>(<%= @minimum_password_length %> characters minimum)</em>
|
|
<% end %><br />
|
|
<i class='text-xs'>(we need your current password to confirm your changes)</i>
|
|
<%= f.password_field :current_password, autocomplete: "current-password", class: 'input input-bordered' %>
|
|
</div>
|
|
|
|
<div class="form-control mt-6">
|
|
<%= f.submit "Update", class: 'btn btn-primary' %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<%= render "devise/shared/links" %>
|
|
|
|
<p class='mt-3'>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), data: { turbo_confirm: "Are you sure?", turbo_method: :delete }, method: :delete, class: 'btn' %></p>
|
|
<div class="divider"></div>
|
|
<p class='mt-3 flex flex-col gap-2'>
|
|
<%= link_to "Export my data", export_settings_users_path, class: 'btn btn-primary', data: {
|
|
turbo_confirm: "Are you sure you want to export your data?",
|
|
turbo_method: :get
|
|
} %>
|
|
<button class='btn btn-primary' onclick="import_modal.showModal()">Import my data</button>
|
|
</p>
|
|
|
|
<!-- Import Data Modal -->
|
|
<dialog id="import_modal" class="modal">
|
|
<div class="modal-box">
|
|
<h3 class="font-bold text-lg mb-4">Import your data</h3>
|
|
<p class="mb-4 text-sm text-gray-600">Upload a ZIP file containing your exported Dawarich data to restore your points, trips, and settings.</p>
|
|
|
|
<%= form_with url: import_settings_users_path, method: :post, multipart: true, class: 'space-y-4', data: {
|
|
turbo: false,
|
|
controller: "user-data-archive-direct-upload",
|
|
user_data_archive_direct_upload_url_value: rails_direct_uploads_url,
|
|
user_data_archive_direct_upload_user_trial_value: current_user.trial?,
|
|
user_data_archive_direct_upload_target: "form"
|
|
} do |f| %>
|
|
<div class="form-control">
|
|
<%= f.label :archive, class: 'label' do %>
|
|
<span class="label-text">Select ZIP archive</span>
|
|
<% end %>
|
|
<%= f.file_field :archive,
|
|
accept: '.zip',
|
|
required: true,
|
|
direct_upload: true,
|
|
class: 'file-input file-input-bordered w-full',
|
|
data: { user_data_archive_direct_upload_target: "input" } %>
|
|
<div class="text-sm text-gray-500 mt-2">
|
|
File will be uploaded directly to storage. Please be patient during upload.
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal-action">
|
|
<%= f.submit "Import Data",
|
|
class: 'btn btn-primary',
|
|
data: {
|
|
disable_with: 'Importing...',
|
|
user_data_archive_direct_upload_target: "submit"
|
|
} %>
|
|
<button type="button" class="btn" onclick="import_modal.close()">Cancel</button>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<form method="dialog" class="modal-backdrop">
|
|
<button>close</button>
|
|
</form>
|
|
</dialog>
|
|
</div>
|
|
</div>
|
|
</div>
|