Skip to content

Commit

Permalink
Merge pull request #1701 from codebar/bootstrap-new-meetings-page
Browse files Browse the repository at this point in the history
Bootstrap new meetings page and edit page
  • Loading branch information
KimberleyCook committed Apr 5, 2022
2 parents 25c9a29 + c497663 commit 34f63fe
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 31 deletions.
36 changes: 17 additions & 19 deletions app/views/admin/meetings/_form.html.haml
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
= simple_form_for [:admin, @meeting] do |f|
.row
.large-12.columns
.row
.medium-6.columns
= f.input :name, required: true
.medium-6.columns
= f.input :slug
.row
.medium-6.columns.admin_margin
.col
= f.input :name, required: true
.row
.col-12.col-md-6
= f.input :slug, required: true
.col-12.col-md-6
= f.input :local_date, as: :string, required: true, input_html: { data: { value: @meeting.date_and_time.try(:strftime, '%d/%m/%Y') } }
.row
.medium-6.columns
.col-12.col-md-6
= f.input :local_time, as: :string, required: true, input_html: { data: { value: @meeting.time.try(:strftime, '%H:%M') } }
.medium-6.columns
.col-12.col-md-6
= f.input :local_end_time, label: 'Ends at', as: :string, required: true, input_html: { data: { value: @meeting.ends_at.try(:strftime, '%H:%M') } }
.row
.large-12.columns.admin_margin
.col
= f.input :description, placeholder: 'Supports HTML', as: :text, input_html: { style: 'height: 300px;' }
.row
.large-3.columns
.col-12.col-md-6
= f.input :spaces, as: :integer
.row
.large-3.columns
.col-12.col-md-6
= f.association :venue, input_html: { data: { placeholder: 'Select venue' }}, required: true
.row
.large-6.columns.admin_margin
.col-12.col-md-6.mt-3
%label Organisers
= f.collection_select :organisers, Member.all, :id, :full_name, { selected: @meeting.organisers.map(&:id) }, { multiple: true }
.row
.large-6.columns.admin_margin
.col-12.col-md-6.mt-3
%label Chapters
= f.collection_select :chapters, Chapter.all, :id, :name, { selected: @meeting.chapters.map(&:id) }, { multiple: true }
.row
.large-6.columns.admin_margin
.col-12.col-md-6.mt-3
= f.input :invitable, as: :boolean, hint: 'Allow members to RSVP'
.row
.large-12.columns.text-right
= f.submit 'Update', class: 'button'
.row.float-right
.col
= f.button :button, 'Save', class: 'btn btn-primary'
9 changes: 5 additions & 4 deletions app/views/admin/meetings/edit.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
%section#banner
.container-fluid
.row
.medium-12.columns
%h2 Edit Monthly
.col
%h1 Edit Monthly

.row
.col
= render partial: 'form'
%br
9 changes: 5 additions & 4 deletions app/views/admin/meetings/new.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
%section#banner
.container-fluid
.row
.medium-12.columns
%h2 Create Monthly
.col
%h1 New Monthly

.row
.col
= render partial: 'form'
%br
8 changes: 4 additions & 4 deletions spec/features/admin/meeting_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
fill_in 'Local time', with: '11:30'
fill_in 'Ends at', with: '12:00'
select venue.name
click_on 'Update'
click_on 'Save'

expect(page).to have_content('Meeting successfully created')
expect(page.current_path)
Expand All @@ -31,7 +31,7 @@
scenario 'renders an error when no chapter has been selected' do
visit new_admin_meeting_path

click_on 'Update'
click_on 'Save'

expect(page).to have_content('Venue can\'t be blank')
end
Expand All @@ -45,7 +45,7 @@
visit edit_admin_meeting_path(meeting)
fill_in 'Slug', with: "#{I18n.l(meeting.date_and_time, format: :year_month).downcase}-august-meeting-1"

click_on 'Update'
click_on 'Save'

expect(page).to have_content('Slug has already been taken')
end
Expand All @@ -57,7 +57,7 @@
fill_in 'Name', with: "March Meeting"
unselect permissions.members.first.full_name

click_on 'Update'
click_on 'Save'

expect(page).to have_content('You have successfully updated the details of this meeting')
expect(page).to have_css(%(span[title="#{permissions.members.last.full_name}"]))
Expand Down

0 comments on commit 34f63fe

Please sign in to comment.