Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the workshop edit to use the form partial #1155

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
43 changes: 0 additions & 43 deletions app/views/admin/workshops/_edit_form.html.haml

This file was deleted.

4 changes: 3 additions & 1 deletion app/views/admin/workshops/_form.html.haml
@@ -1,4 +1,4 @@
= simple_form_for [:admin, @workshop], url: :admin_workshops do |f|
= simple_form_for [:admin, @workshop], html: { novalidate: true } do |f|
Copy link
Contributor

@notapatch notapatch Nov 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked at this yet but I did a quick search for novalidate so my first question is going to be "why novalidate isn't used in any other forms?" So I can be reassured that introducing something new is the only option. A consistent project is an "easy" to maintain project and exceptions in the code makes maintenance harder.

.row
.medium-6.columns
= f.association :chapter, as: :select, collection: Chapter.available_to_user(current_user)
Expand Down Expand Up @@ -35,6 +35,8 @@
= f.input :rsvp_open_local_time, as: :string, input_html: { data: { value: @workshop.rsvp_opens_at.try(:time).try(:strftime, '%H:%M') } }
.row
.large-6.columns
%label Organisers
= f.collection_select :organisers, Member.all, :id, :full_name, { selected: @workshop.organisers.map(&:id) }, { multiple: true }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, my first PR to the project was accepted in September. I say this because I have no project/business knowledge to fall back on.

We are making a change in the behaviour of the code. Before Create was different from Update and with this commit they are the same. It is unusual that we have differences in forms but it's not unheard of. So, have you understood the reasons @ + despo (an original commiter but no longer active) wrote the behaviour the way they did and allowed for that? I say this because the maintainers are going to ask.

= f.input :invitable
.row
.large-12.columns.text-right
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/workshops/edit.html.haml
Expand Up @@ -2,4 +2,4 @@
.row
.medium-12.columns
%h2 Edit Workshop
= render partial: 'edit_form'
= render partial: 'form'