Sha256: 471decc0904e181724321090ab3d135f4a28ac060a66841a8df3c1abef0f8365

Contents?: true

Size: 1.87 KB

Versions: 3

Compression:

Stored size: 1.87 KB

Contents

<form class="command <% unless defined?(command_options)%>new<% end %>" data-command="<%= command.name %>" style="<% unless defined?(command_options) %>display: none<% end %>" method="POST" action="<%= action %>">
    <h1><%= command.human_name %></h1>
    <p><%= command.description %></p>
    <input type="hidden" name="command" value="<%= command.name.demodulize %>">

    <% unless command.options.empty? %>
        <% command.options.each do |option| %>
            <p>
                <label for="<%= option.name %>"><%= option.name.to_s.humanize %>:</label>
                <span>
                    <% if option.boolean? %>
                        <select name="options[<%= option.name %>]">
                            <% if defined?(command_options) %>
                                <option <%= 'selected' if command_options[option.name.to_s] %>>true</option>
                                <option <%= 'selected' if !command_options[option.name.to_s] %>>false</option>
                            <% else %>
                                <option <%= 'selected' if option.default %>>true</option>
                                <option <%= 'selected' if !option.default%>>false</option>
                            <% end %>
                        </select>
                    <% else %>
                        <input type="text" name="options[<%= option.name %>]" placeholder="<%= option.default %>" value="<%= command_options[option.name.to_s] if defined?(command_options) %>">
                    <% end %>
                </span>
            </p>
        <% end %>
    <% end %>

    <p class="actions">
        <% if defined?(command_options)%>
            <input type="submit" name="action" value="Delete">
            <input type="submit" name="action" value="Update">
        <% else %>
            <input type="submit" name="action" value="Add">
        <% end %>
    </p>
</form>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
perus-0.1.2 lib/perus/server/views/command_config.erb
perus-0.1.1 lib/perus/server/views/command_config.erb
perus-0.1.0 lib/perus/server/views/command_config.erb