85 lines
3.2 KiB
Text
85 lines
3.2 KiB
Text
.server_template_show
|
|
h2 = @server_template.name
|
|
= link_to "Edit", edit_server_template_path(@server_template), class: "btn btn--small"
|
|
= link_to "Delete", server_template_path(@server_template), method: :delete, data: { confirm: "Sure?" }, class: "btn btn--small btn--danger"
|
|
= link_to "Spawn Server", new_server_path(server_template_id: @server_template.id), class: "btn btn--primary"
|
|
|
|
section.overlays
|
|
h3 Overlays
|
|
= form_with url: server_template_overlays_path(@server_template), method: :post, local: true do |f|
|
|
.form-group
|
|
= f.label "Select Overlay"
|
|
= f.select :overlay_id, options_from_collection_for_select(@overlays, :id, :name), { prompt: "Choose overlay" }, class: "form-control"
|
|
|
|
= f.submit "Add Overlay", class: "btn btn--small"
|
|
|
|
- if @server_template.overlays.any?
|
|
ol.overlays-list
|
|
- @server_template.template_overlays.ordered.each do |to|
|
|
li
|
|
= to.overlay.name
|
|
span.small
|
|
| (dir: /opt/l4d2/overlays/#{to.overlay.slug})
|
|
= link_to "Remove", server_template_overlay_path(@server_template, to.overlay), method: :delete, data: { confirm: "Sure?" }, class: "btn btn--small btn--danger"
|
|
- else
|
|
p No overlays selected.
|
|
|
|
section.config-options
|
|
h3 Config Options
|
|
= form_with url: server_template_config_options_path(@server_template), method: :post, local: true do |f|
|
|
.form-group
|
|
= f.label "Key"
|
|
= f.text_field :config_key, placeholder: "e.g., sv_pure"
|
|
|
|
.form-group
|
|
= f.label "Value"
|
|
= f.text_field :config_value, placeholder: "e.g., 2"
|
|
|
|
= f.submit "Add Option", class: "btn btn--small"
|
|
|
|
- if @server_template.config_options.any?
|
|
table
|
|
thead
|
|
tr
|
|
th Key
|
|
th Value
|
|
th Actions
|
|
tbody
|
|
- @server_template.config_options.each do |opt|
|
|
tr
|
|
td = opt.config_key
|
|
td = opt.config_value
|
|
td = link_to "Delete", server_template_config_option_path(@server_template, opt), method: :delete, data: { confirm: "Sure?" }, class: "btn btn--small btn--danger"
|
|
- else
|
|
p No config options yet.
|
|
|
|
section.startup-params
|
|
h3 Startup Parameters
|
|
= form_with url: server_template_startup_params_path(@server_template), method: :post, local: true do |f|
|
|
.form-group
|
|
= f.label "Key"
|
|
= f.text_field :param_key, placeholder: "e.g., +map"
|
|
|
|
.form-group
|
|
= f.label "Value"
|
|
= f.text_field :param_value, placeholder: "e.g., c1m1_hotel"
|
|
|
|
= f.submit "Add Parameter", class: "btn btn--small"
|
|
|
|
- if @server_template.startup_params.any?
|
|
table
|
|
thead
|
|
tr
|
|
th Key
|
|
th Value
|
|
th Actions
|
|
tbody
|
|
- @server_template.startup_params.each do |param|
|
|
tr
|
|
td = param.param_key
|
|
td = param.param_value
|
|
td = link_to "Delete", server_template_startup_param_path(@server_template, param), method: :delete, data: { confirm: "Sure?" }, class: "btn btn--small btn--danger"
|
|
- else
|
|
p No startup parameters yet.
|
|
|
|
= link_to "Back", server_templates_path, class: "btn"
|