From 3ae1275fb5a18d9e6c54aa6ffe8b286538c3f21b Mon Sep 17 00:00:00 2001 From: Andrew Kvalheim Date: Wed, 14 Sep 2022 10:50:55 -0700 Subject: [PATCH] Restore views for Admin::EventsController#new and Admin::UsersController#edit 1. Restore views lost during 81853d1: git restore --source 4a16836 \ app/views/admin/users/_form.html.haml \ app/views/application/edit.html.haml \ app/views/application/new.html.haml mv app/views/application/edit.html.haml app/views/admin/users/ mv app/views/application/new.html.haml app/views/admin/events/ 2. Convert from Formtastic: - app/views/admin/users/_form.html.haml 3. Add header as in 81853d1: - app/views/admin/events/new.html.haml 4. Substitute partial unified in 88b5596: - app/views/admin/events/new.html.haml resolves #2975 --- app/views/admin/events/new.html.haml | 10 ++++++ app/views/admin/users/_form.html.haml | 44 +++++++++++++++++++++++++++ app/views/admin/users/edit.html.haml | 1 + 3 files changed, 55 insertions(+) create mode 100644 app/views/admin/events/new.html.haml create mode 100644 app/views/admin/users/_form.html.haml create mode 100644 app/views/admin/users/edit.html.haml diff --git a/app/views/admin/events/new.html.haml b/app/views/admin/events/new.html.haml new file mode 100644 index 0000000000..edf9a1d0fe --- /dev/null +++ b/app/views/admin/events/new.html.haml @@ -0,0 +1,10 @@ +.row + .col-md-12 + .page-header + %h1 + New Event +.row + .col-md-8 + = form_for(@event, url: @url) do |f| + = render partial: 'proposals/form', locals: { f: f } + = render partial: 'shared/user_selectize' diff --git a/app/views/admin/users/_form.html.haml b/app/views/admin/users/_form.html.haml new file mode 100644 index 0000000000..51a50069ae --- /dev/null +++ b/app/views/admin/users/_form.html.haml @@ -0,0 +1,44 @@ += form_for [:admin, @user] do |f| + %h4 Basic Information + - unless @user.new_record? + .pull-right + %b + Confirmed? + - if can? :toggle_confirmation, @user + = check_box_tag @user.id, @user.id, @user.confirmed?, + 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: "#{toggle_confirmation_admin_user_path(@user.id)}?user[to_confirm]=", + class: 'switch-checkbox', + readonly: true + .checkbox + %label + = f.check_box :is_admin + Is admin + %span.help-block An admin can create a new conference, manage users and make other users admins. + .form-group + = f.label :name + = f.text_field :name, class: 'form-control' + - if @user.new_record? + .form-group + = label_tag :username + = text_field_tag :username, class: 'form-control' + .form-group + = f.label :email, required: true + %abbr{title: 'This field is required'} * + = f.email_field :email, required: true, class: 'form-control' + - if @user.new_record? + .form-group + = f.label :password + = f.password_field :password, class: 'form-control' + .form-group + = f.label :affiliation + = f.text_field :affiliation, class: 'form-control' + .form-group + = f.label :biography + = f.text_area :biography, rows: 10, data: { provide: 'markdown' }, class: 'form-control' + %span.help-block= markdown_hint + = f.submit nil, class: 'btn btn-primary' diff --git a/app/views/admin/users/edit.html.haml b/app/views/admin/users/edit.html.haml new file mode 100644 index 0000000000..729927996a --- /dev/null +++ b/app/views/admin/users/edit.html.haml @@ -0,0 +1 @@ += render partial: 'form'