-
Notifications
You must be signed in to change notification settings - Fork 0
/
_form.haml
30 lines (30 loc) · 1.43 KB
/
_form.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
= form_with(:model => tournament) do |f|
.row
.col-md-5
.field.form-group
= f.label :name, t("tournaments.edit.name")
= f.text_field :name, :class => "form-control"
.field.form-group
= f.label :date, t("tournaments.edit.date")
= f.date_field :date, :class => "form-control", :min => Date.new(2017, 01, 02), :max => Date.today + 1.year
.field.form-group
= f.label :season, t("tournaments.edit.season")
= f.select :season, Season.all.reverse.collect { |s| [s.name, s.id] }, {:prompt => t("misc.prompt.season")}, :class => "form-control"
= f.label :tournament_banner, t("tournaments.edit.banner")
.field.file-input-group
= f.hidden_field :tournament_banner, :value => tournament.cached_tournament_banner_data, :id => nil
= f.file_field :tournament_banner, :accept => "image/png, image/jpeg", :class => "form-control-file"
.field.form-group
= f.label :format, t("tournaments.edit.format")
= f.text_area :format, :class => "form-control"
.actions
= f.button t("tournaments.edit.save"), :type => "submit", :"data-turbo" => false, :class => "btn"
.col-md-7
- if tournament.errors.any?
#error-explanation
%h2
= pluralize(tournament.errors.count, "error")
= t("tournaments.edit.error")
%ul
- tournament.errors.each do |error|
%li= error.full_message