l4d.tools/app/views/servers/new.html.slim

26 lines
978 B
Text

.server_form
h2 Spawn New Server
= form_with model: @server, url: servers_path, method: :post, local: true do |f|
- if @server.errors.any?
.alert.alert--error
h4 = pluralize(@server.errors.count, "error")
ul
- @server.errors.full_messages.each do |msg|
li = msg
.form-group
= f.label :server_template_id, "Template"
= f.select :server_template_id, options_from_collection_for_select(@server_templates, :id, :name, @server.server_template_id), { prompt: "Select a template" }, class: "form-control", required: true
.form-group
= f.label :name
= f.text_field :name, placeholder: "e.g., server1"
.form-group
= f.label :port, "Port (optional, auto-assigned if blank)"
= f.number_field :port, placeholder: "Auto: 27016-27999", min: 27016, max: 27999
.form-actions
= f.submit "Spawn Server", class: "btn btn--primary"
= link_to "Back", servers_path, class: "btn"