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| %> -
- <% 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 %> -
+ <% 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 %>
-
+
+
+ <%= link_to 'Cancel', @host.persisted? ? host_path(@host) : clients_path, + class: 'btn btn-danger' %> +
+
<%= f.submit 'Submit', class: 'btn btn-success' %>
- <% if current_user.vima? %> -
- <%= link_to fetch_vima_hosts_path, role: :button, class: 'btn btn-default' do %> - - Fetch Clients - <% end %> -
- <% end %> +
<% 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 @@ -

Edit Client <%= @host.name %>

- -
- <%= render 'form' %> +
+
+
+
+

Edit Client <%= @host.name %>

+
+
+ <%= render 'form' %> +
+
- -<%= 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 @@
-
+
-

New Client

+

New Client + <% if current_user.vima? %> + <%= link_to fetch_vima_hosts_path, role: :button, class: 'btn btn-default right' do %> + + Fetch Clients + <% end %> + <% end %> +


<%= render 'form' %>
- -<%= link_to 'Back', clients_path %>