diff --git a/app/views/hosts/_form.html.erb b/app/views/hosts/_form.html.erb index c8d3a1f..0a035b4 100644 --- a/app/views/hosts/_form.html.erb +++ b/app/views/hosts/_form.html.erb @@ -1,34 +1,30 @@ <%= bootstrap_form_for(@host, layout: :horizontal, label_col: 'col-xs-3', control_col: 'col-xs-8') do |f| %> - <div> - <% if current_user.needs_host_list? %> - <%= f.select :fqdn, options_for_select(@hosts_of_user, @host.fqdn), {}, - disabled: @host.persisted? %> - <% else %> - <%= f.text_field :fqdn, disabled: @host.persisted? %> - <% end %> - <% if @host.persisted? %> - <%= f.password_field :password, label: 'Token', value: @host.password %> - <%= f.number_field :port, min: 1 %> - <% end %> - <% emails = (@host.users.pluck(:email) + @host.email_recipients).uniq.select(&:present?) %> - <%= f.select :email_recipients, options_for_select(emails, @host.email_recipients), {}, - multiple: true %> - </div> + <% if current_user.needs_host_list? %> + <%= f.select :fqdn, options_for_select(@hosts_of_user, @host.fqdn), {}, + disabled: @host.persisted? %> + <% else %> + <%= f.text_field :fqdn, disabled: @host.persisted? %> + <% end %> + <% if @host.persisted? %> + <%= f.password_field :password, label: 'Token', value: @host.password %> + <%= f.number_field :port, min: 1 %> + <% end %> + <% emails = (@host.users.pluck(:email) + @host.email_recipients).uniq.select(&:present?) %> + <%= f.select :email_recipients, options_for_select(emails, @host.email_recipients), {}, + multiple: true %> <div class="form-group"> - <div class="col-xs-offset-3 col-xs-2"> + <div class='row'> + <div class="col-xs-offset-5 col-xs-2 text-right"> + <%= link_to 'Cancel', @host.persisted? ? host_path(@host) : clients_path, + class: 'btn btn-danger' %> + </div> + <div class="col-xs-2 text-right"> <%= f.submit 'Submit', class: 'btn btn-success' %> </div> - <% if current_user.vima? %> - <div class="col-xs-offset-3 col-xs-2"> - <%= link_to fetch_vima_hosts_path, role: :button, class: 'btn btn-default' do %> - <label class="glyphicon glyphicon-refresh text-primary"></label> - Fetch Clients - <% end %> - </div> - <% end %> + </div> </div> <% end %> diff --git a/app/views/hosts/edit.html.erb b/app/views/hosts/edit.html.erb index c9cc1b6..947894e 100644 --- a/app/views/hosts/edit.html.erb +++ b/app/views/hosts/edit.html.erb @@ -1,7 +1,11 @@ -<h1>Edit Client <%= @host.name %></h1> - -<div class="container graybox"> - <%= render 'form' %> +<div class="row"> + <div class="col-xs-6"> + <div class="panel panel-default"> + <div class="panel-heading"> + <h3>Edit Client <%= @host.name %></h3> + </div> + <br /> + <%= render 'form' %> + </div> + </div> </div> - -<%= link_to 'Back', host_path(@host) %> diff --git a/app/views/hosts/new.html.erb b/app/views/hosts/new.html.erb index c2309b4..2abcc6a 100644 --- a/app/views/hosts/new.html.erb +++ b/app/views/hosts/new.html.erb @@ -1,13 +1,18 @@ <div class="row"> - <div class="col-xs-4"> + <div class="col-xs-6"> <div class="panel panel-default"> <div class="panel-heading"> - <h3>New Client</h3> + <h3>New Client + <% if current_user.vima? %> + <%= link_to fetch_vima_hosts_path, role: :button, class: 'btn btn-default right' do %> + <label class="glyphicon glyphicon-refresh text-primary"></label> + Fetch Clients + <% end %> + <% end %> + </h3> </div> <br /> <%= render 'form' %> </div> </div> </div> - -<%= link_to 'Back', clients_path %>