blob: 98dd972cf40160827f073d579fc486e793d3ccce (
plain) (
tree)
|
|
<hr>
<h3>Create a new event</h3>
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="home-tab" data-bs-toggle="tab" data-bs-target="#home" type="button" role="tab" aria-controls="home" aria-selected="true">Inspection</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#profile" type="button" role="tab" aria-controls="profile" aria-selected="false">Meeting</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#contact" type="button" role="tab" aria-controls="contact" aria-selected="false">Other</button>
</li>
</ul>
<div class="tab-content" id="myTabContent">
<div class="tab-pane active mt-2" id="home" role="tabpanel" aria-labelledby="home-tab">
<%= form_with(model: event) do |form| %>
<% if event.errors.any? %>
<div style="color: red">
<h2><%= pluralize(event.errors.count, "error") %> prohibited this event from being saved:</h2>
<ul>
<% event.errors.each do |error| %>
<li><%= error.full_message %></li>
<% end %>
</ul>
</div>
<% end %>
<div>
<%= form.label :date, style: "display: block" %>
<%= form.date_field :date %>
</div>
<div>
<%= form.label "Event name", style: "display: block" %>
<%= form.text_field :name %>
</div>
<div>
<%= form.label "Organisation", style: "display: block" %>
<%= form.select :organisation, Organisation.all.collect { |o| [ o.name, o.id ] }, include_blank: true %>
</div>
<div>
<%= form.submit style: "background: green; color: white; margin-top: 1.1em;"%>
</div>
<% end %>
</div>
<div class="tab-pane mt-2" id="profile" role="tabpanel" aria-labelledby="profile-tab">
<%= form_with(model: event) do |form| %>
<% if event.errors.any? %>
<div style="color: red">
<h2><%= pluralize(event.errors.count, "error") %> prohibited this event from being saved:</h2>
<ul>
<% event.errors.each do |error| %>
<li><%= error.full_message %></li>
<% end %>
</ul>
</div>
<% end %>
<div>
<%= form.label :date, style: "display: block" %>
<%= form.date_field :date %>
</div>
<div>
<%= form.label "Event name", style: "display: block" %>
<%= form.text_field :name %>
</div>
<div>
<%= form.submit style: "background: green; color: white; margin-top: 1.1em;"%>
</div>
<% end %>
</div>
<div class="tab-pane mt-2" id="contact" role="tabpanel" aria-labelledby="contact-tab">
<%= form_with(model: event) do |form| %>
<% if event.errors.any? %>
<div style="color: red">
<h2><%= pluralize(event.errors.count, "error") %> prohibited this event from being saved:</h2>
<ul>
<% event.errors.each do |error| %>
<li><%= error.full_message %></li>
<% end %>
</ul>
</div>
<% end %>
<div>
<%= form.label :date, style: "display: block" %>
<%= form.date_field :date %>
</div>
<div>
<%= form.label "Event name", style: "display: block" %>
<%= form.text_field :name %>
</div>
<div>
<%= form.submit style: "background: green; color: white; margin-top: 1.1em;"%>
</div>
<% end %>
</div>
</div>
<hr>
|