Skip to content

Commit

Permalink
Start primerized create form
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverguenther committed Oct 2, 2024
1 parent 54b83ed commit df1adef
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 9 deletions.
8 changes: 0 additions & 8 deletions modules/meeting/app/forms/recurring_meeting/title_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ class RecurringMeeting::TitleForm < ApplicationForm
include OpenProject::StaticRouting::UrlHelpers

form do |form|
form.text_field(
name: :title,
input_width: :medium,
placeholder: RecurringMeeting.human_attribute_name(:title),
label: RecurringMeeting.human_attribute_name(:title),
required: true,
autofocus: true
)
end

Check warning on line 33 in modules/meeting/app/forms/recurring_meeting/title_form.rb

View workflow job for this annotation

GitHub Actions / rubocop

[rubocop] modules/meeting/app/forms/recurring_meeting/title_form.rb#L32-L33 <Lint/EmptyBlock>

Empty block detected.
Raw output
modules/meeting/app/forms/recurring_meeting/title_form.rb:32:3: W: Lint/EmptyBlock: Empty block detected.

def initialize(meeting:)
Expand Down
36 changes: 35 additions & 1 deletion modules/meeting/app/views/recurring_meetings/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,40 @@ See COPYRIGHT and LICENSE files for more details.

<%= error_messages_for 'recurring_meeting' %>

<%= render(RecurringMeeting::TitleForm.new(f, meeting: @meeting)) %>
<%=
primer_form_with(url: "/foo") do |form_builder|
render_inline_form(form_builder) do |form|
form.text_field(
name: :title,
input_width: :medium,
placeholder: RecurringMeeting.human_attribute_name(:title),
label: RecurringMeeting.human_attribute_name(:title),
required: true,
autofocus: true
)

form.group(layout: :horizontal) do |date_form|
date_form.text_field(
name: :start_date,
full_width: false,
input_width: :medium,
placeholder: RecurringMeeting.human_attribute_name(:start_date),
label: RecurringMeeting.human_attribute_name(:start_date),
required: true
)

date_form.text_field(
type: :time,
name: :start_time,
full_width: false,
input_width: :medium,
placeholder: RecurringMeeting.human_attribute_name(:start_time),
label: RecurringMeeting.human_attribute_name(:start_time),
required: true
)
end
end
end
%>

<%= render(RecurringMeeting::ScheduleForm.new(f, meeting: @meeting)) %>

0 comments on commit df1adef

Please sign in to comment.