mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Merge pull request #2476 from differentreality/url_helpers_in_switch_checkbox
Use helpers instead of URLs in switch checkboxes
This commit is contained in:
commit
f7d7bfb2e2
4 changed files with 6 additions and 9 deletions
|
|
@ -14,10 +14,7 @@
|
|||
%td= link_to user.email, admin_user_path(user.id)
|
||||
%td= user.created_at.strftime('%m/%d/%Y')
|
||||
%td
|
||||
= check_box_tag user.id, user.id, user.confirmed?,
|
||||
url: "/admin/users/#{user.id}/toggle_confirmation?user[to_confirm]=",
|
||||
class: 'switch-checkbox',
|
||||
readonly: true
|
||||
= user.confirmed? ? 'Yes' : 'No'
|
||||
- else
|
||||
%h5.text-warning.text-center
|
||||
No sign ups!
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
%td= event_registration.email
|
||||
%td= event_registration.created_at
|
||||
%td
|
||||
= check_box_tag @conference.short_title, @event.id, event_registration.attended, class: 'switch-checkbox', url: "/admin/conferences/#{@conference.short_title}/program/events/#{@event.id}/toggle_attendance?events_registration_id=#{event_registration.id}&&event_registration[attended]="
|
||||
= check_box_tag @conference.short_title, @event.id, event_registration.attended, class: 'switch-checkbox', url: "#{toggle_attendance_admin_conference_program_event_path(@conference, @event, events_registration_id: event_registration)}&&event_registration[attended]="
|
||||
%td
|
||||
- if event_registration.registration.attended
|
||||
%i.fa.fa-check.text-success
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@
|
|||
Confirmed?
|
||||
- if can? :toggle_confirmation, @user
|
||||
= check_box_tag @user.id, @user.id, @user.confirmed?,
|
||||
url: "/admin/users/#{@user.id}/toggle_confirmation?user[to_confirm]=",
|
||||
url: "#{toggle_confirmation_admin_user_path(@user.id)}?user[to_confirm]=",
|
||||
class: 'switch-checkbox',
|
||||
readonly: false
|
||||
- else
|
||||
= check_box_tag @user.id, @user.id, @user.confirmed?,
|
||||
url: "/admin/users/#{@user.id}/toggle_confirmation?user[to_confirm]=",
|
||||
url: "#{toggle_confirmation_admin_user_path(@user.id)}?user[to_confirm]=",
|
||||
class: 'switch-checkbox',
|
||||
readonly: true
|
||||
= f.input :is_admin, hint: 'An admin can create a new conference, manage users and make other users admins.'
|
||||
|
|
|
|||
|
|
@ -36,12 +36,12 @@
|
|||
%td
|
||||
- if can? :toggle_confirmation, @user
|
||||
= check_box_tag @user.id, @user.id, @user.confirmed?,
|
||||
url: "/admin/users/#{@user.id}/toggle_confirmation?user[to_confirm]=",
|
||||
url: "#{toggle_confirmation_admin_user_path(@user)}?user[to_confirm]=",
|
||||
class: 'switch-checkbox',
|
||||
readonly: false
|
||||
- else
|
||||
= check_box_tag @user.id, @user.id, @user.confirmed?,
|
||||
url: "/admin/users/#{@user.id}/toggle_confirmation?user[to_confirm]=",
|
||||
url: "#{toggle_confirmation_admin_user_path(@user)}?user[to_confirm]=",
|
||||
class: 'switch-checkbox',
|
||||
readonly: true
|
||||
- else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue