Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class UsersController < ApplicationController
before_action :set_user, only: [ :show, :edit, :update, :destroy, :generate_facilitator, :toggle_lock_status ]
before_action :set_user, only: [ :show, :edit, :update, :destroy, :generate_facilitator, :toggle_lock_status, :send_reset_password_instructions ]

def index
return redirect_to root_path unless current_user.super_user?
Expand Down Expand Up @@ -97,6 +97,11 @@ def generate_facilitator
end
end

def send_reset_password_instructions
@user.send_reset_password_instructions
redirect_to users_path, notice: "Reset password instructions sent to #{@user.email}."
end

def toggle_lock_status
return redirect_to users_path, alert: "You don't have permission to perform this action." unless current_user.super_user?

Expand Down
2 changes: 1 addition & 1 deletion app/views/events/_card.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<!-- 4️⃣ FULL-WIDTH CALENDAR LINKS ROW -->
<% if event.event_registrations.exists?(registrant_id: current_user.id) %>
<div class="flex gap-2 items-center justify-center w-full text-sm text-gray-700 mt-2">
<!-- <span class="font-semibold">Calendar:</span> -->
<span class="font-semibold">Add to your calendar:</span>
<%= event.calendar_links %>
</div>
<% end %>
Expand Down
1 change: 1 addition & 0 deletions app/views/events/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<!-- ⭐ CALENDAR LINKS -->
<% if registered %>
<div class="flex gap-2 items-center text-sm text-gray-700">
<span class="font-semibold">Add to your calendar:</span>
<%= @event.calendar_links %>
</div>
<% end %>
Expand Down
4 changes: 4 additions & 0 deletions app/views/users/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<%= render "lock_status_indicator", user: @user %>
</div>
<div class="flex space-x-2">
<%= button_to "Reset password",
send_reset_password_instructions_user_path(@user),
method: :post,
class: "btn btn-secondary-outline" %>
<% if current_user == @user %>
<%= link_to "Change password",
change_password_path,
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
resources :users, only: [ :new, :index, :show, :edit, :update, :create, :destroy ] do
member do
get :generate_facilitator
post :send_reset_password_instructions
post :toggle_lock_status
end
end
Expand Down