Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed host page templates and designs.

  • Loading branch information...
commit e4c7d97eb9ecd6f33eb7bf30ad36ea52c64c9f35 1 parent c89322b
@kentaro authored
View
7 app/views/hosts/_form.html.erb
@@ -0,0 +1,7 @@
+<div class="control-group">
+ <%= form.label :name, class: "control-label" %>
+ <div class="controls">
+ <%= form.text_field :name, :style => 'width: 330px' %>
+ DNS name or IP address
+ </div>
+</div>
View
43 app/views/hosts/_stages.html.erb
@@ -1,24 +1,27 @@
<% if @stages.empty? %>
- No deployments for this host.
+ <p>No deployments for this host.</p>
<% else %>
- <table class="sortable">
- <tr>
- <th>Project</th>
- <th>Stage</th>
- <th>Role</th>
- </tr>
- <% for stage in @stages %>
- <tr class="<%= cycle :even, :odd, :name => 'stages' %>">
- <td valign="top"><%= link_to stage.project.name, stage.project %></td>
- <td valign="top"><%= link_to stage.name, [stage.project, stage] %></td>
- <td valign="top">
- <% for role in stage.roles.find(:all, :conditions => ['host_id = ?', @host.id]) %>
- <%= role.name %>
- <%= role.role_attribute_hash.inspect unless role.role_attribute_hash.blank? %>
- <br />
- <% end %>
- </td>
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ <th>Project</th>
+ <th>Stage</th>
+ <th>Role</th>
</tr>
- <% end %>
+ </thead>
+ <tbody>
+ <% @stages.each do |stage| %>
+ <tr>
+ <td><%= link_to stage.project.name, stage.project %></td>
+ <td><%= link_to stage.name, [stage.project, stage] %></td>
+ <td>
+ <% stage.roles.find(:all, :conditions => ['host_id = ?', @host.id]).each do |role| %>
+ <%= role.name %>
+ <%= role.role_attribute_hash.inspect unless role.role_attribute_hash.blank? %>
+ <% end %>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
</table>
-<% end %>
+<% end %>
View
40 app/views/hosts/edit.html.erb
@@ -1,28 +1,26 @@
-<% flashed_errors(:host) %>
-
-<%= form_for(:host, :url => host_path(@host), :html => { :method => :put }) do |f| %>
- <p>
- <b>Name (DNS name or IP address)</b><br />
- <%= f.text_field :name, :style => 'width: 330px' %>
- </p>
-
- <%= link_to 'Back to host', @host, :class => 'arrow_link ontheright', :style => 'margin-right: 330px' %>
-
- <p>
- <%= submit_tag "Update" %>
- </p>
+<% content_for :page_title do %>
+ <% @page_title = "Edit host #{@host.name}" %>
+ <h1>Edit host <%= @host.name %></h1>
<% end %>
-<% content_for(:breadcrumb) do %>
+<% content_for :breadcrumb do %>
<%= breadcrumb_box do %>
- <%= link_to "Back to host", @host, :style => "float:right", :class => "arrow_link" %>
- <%= link_to "Hosts", hosts_path %> &gt;
- Host <%= link_to @host.name, @host %> &gt;
+ <%= link_to "Hosts", hosts_path %>
+ <span class="divider">&raquo;</span>
+ <%= link_to @host.name, @host %>
+ <span class="divider">&raquo;</span>
Edit
<% end %>
<% end %>
-<% content_for(:page_title) do %>
- <% @page_title = "Edit host #{@host.name}" %>
- <h2>Edit host <%= @host.name %></h2>
-<% end %>
+<% flashed_errors(:host) %>
+
+<section>
+ <%= form_for @host, html: { class: "form-horizontal" } do |f| %>
+ <%= render partial: 'form', locals: { form: f } %>
+ <div class="form-actions">
+ <%= f.submit class: "btn btn-primary" %>
+ <%= link_to 'Back to host', host_path(@host), :class => 'btn' %>
+ </div>
+ <% end %>
+</section>
View
62 app/views/hosts/index.html.erb
@@ -1,36 +1,40 @@
-<h2>Hosts</h2>
-
-<fieldset class="fieldset">
- <legend> <%= pluralize(Host.count, 'Host')%> listed</legend>
-
-<table class="sortable">
- <tr>
- <th width="34%">Name</th>
- <th width="33%">#Stages</th>
- <th width="33%">#Roles</th>
- </tr>
- <% for host in @hosts %>
- <tr class="<%= cycle :even, :odd %>">
- <td><%= link_to host.name, host %></td>
- <td><%= host.stages.count %></td>
- <td><%= host.roles.count %></td>
- <% if current_user.admin? %>
- <td><%= link_to 'Edit', [:edit, host] %></td>
- <td><%= link_to 'Delete', host, :data => { :confirm => 'Are you sure?' }, :method => :delete %></td>
- <% end %>
- </tr>
- <% end %>
-</table>
+<% content_for :page_title do %>
+ <% @page_title = "Hosts" %>
+ <h1>Hosts</h1>
+<% end %>
-<% content_for(:breadcrumb) do %>
+<% content_for :breadcrumb do %>
<%= breadcrumb_box do %>
<%= link_to "Hosts", hosts_path %>
<% end %>
<% end %>
-<% if current_user.admin? %>
- <br />
- <%= link_to 'New host', new_host_path, :class => 'arrow_link' %>
-<% end %>
+<section>
+ <h2><%= pluralize(Host.count, 'Host')%> listed</h2>
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ <th>Name</th>
+ <th>Stages</th>
+ <th>Roles</th>
+ </tr>
+ </thead>
+ <tbody>
+ <% @hosts.each do |host| %>
+ <tr>
+ <td><%= link_to host.name, host %></td>
+ <td><%= host.stages.count %></td>
+ <td><%= host.roles.count %></td>
+ <% if current_user.admin? %>
+ <td><%= link_to 'Edit', [:edit, host] %></td>
+ <td><%= link_to 'Delete', host, data: { confirm: 'Are you sure?' }, method: :delete %></td>
+ <% end %>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
-</fieldset>
+ <% if current_user.admin? %>
+ <p><%= link_to 'New host', new_host_path %></p>
+ <% end %>
+</section>
View
37 app/views/hosts/new.html.erb
@@ -1,27 +1,24 @@
-<% flashed_errors(:host) %>
-
-<%= form_for(:host, :url => hosts_path) do |f| %>
- <p>
- <b>Name (DNS name or IP address)</b><br />
- <%= f.text_field :name, :style => 'width: 330px' %>
- </p>
-
- <%= link_to 'Back to hosts', hosts_path, :class => 'arrow_link ontheright', :style => 'margin-right: 330px' %>
-
- <p>
- <%= submit_tag "Create host" %>
- </p>
-<% end %>
-
-<% content_for(:breadcrumb) do %>
+<% content_for :breadcrumb do %>
<%= breadcrumb_box do %>
- <%= link_to "Manage hosts", hosts_path, :style => "float:right", :class => "arrow_link" %>
- <%= link_to "Hosts", hosts_path %> &gt;
+ <%= link_to "Hosts", hosts_path %>
+ <span class="divider">&raquo;</span>
New
<% end %>
<% end %>
-<% content_for(:page_title) do %>
+<% content_for :page_title do %>
<% @page_title = "New host" %>
- <h2>New host</h2>
+ <h1>New host</h1>
<% end %>
+
+<% flashed_errors(:host) %>
+
+<section>
+ <%= form_for @host, html: { class: "form-horizontal" } do |f| %>
+ <%= render partial: 'form', locals: { form: f } %>
+ <div class="form-actions">
+ <%= f.submit class: "btn btn-primary" %>
+ <%= link_to 'Back to host', hosts_path, :class => 'btn' %>
+ </div>
+ <% end %>
+</section>
View
59 app/views/hosts/show.html.erb
@@ -1,46 +1,37 @@
-<div class="special_box">
- <div class="special_box_top"></div>
- <div class="special_box_middle host_box"></div>
- <div class="special_box_bottom"></div>
-</div>
+<% content_for :page_title do %>
+ <% @page_title = "Host #{@host.name}" %>
+ <h1>Host <%= @host.name %></h1>
+<% end %>
-<div class="box">
- <dl>
+<% content_for :breadcrumb do %>
+ <%= breadcrumb_box do %>
+ <%= link_to "Hosts", hosts_path %>
+ <span class="divider">&raquo;</span>
+ <%= link_to @host.name, host_path(@host) %>
+ <% end %>
+<% end %>
+
+<section>
+ <dl class="dl-horizontal">
<dt>Name:</dt>
<dd><%= @host.name %></dd>
- <dt>#Stages:</dt>
+ <dt>Stages:</dt>
<dd><%= @host.stages.uniq.size %></dd>
- <dt>#Roles:</dt>
+ <dt>Roles:</dt>
<dd><%= @host.roles.count %></dd>
</dl>
<% if current_user.admin? %>
- <p>
- <%= link_to 'Edit Host', edit_host_path(@host), :class => 'arrow_link' %> |
- <%= link_to 'Delete', host_path(@host), :data => { :confirm => 'Are you sure?' }, :method => :delete, :class => 'arrow_link' %>
- </p>
- <% end %>
-</div>
-
-<div class="clear"></div>
-<br>
-
-<fieldset class="fieldset">
- <legend>Stages</legend>
- <%= render(:partial => 'stages')%>
-</fieldset>
-
-<% content_for(:breadcrumb) do %>
- <%= breadcrumb_box do %>
- <%= link_to "Manage hosts", hosts_path, :style => "float:right", :class => "arrow_link" %>
- <%= link_to "Hosts", hosts_path %> &gt;
- Host <%= link_to @host.name, host_path(@host) %>
+ <div>
+ <%= link_to 'Edit Host', edit_host_path(@host), :class => 'arrow_link' %> |
+ <%= link_to 'Delete', host_path(@host), :data => { :confirm => 'Are you sure?' }, :method => :delete, :class => 'arrow_link' %>
+ </div>
<% end %>
-<% end %>
+</section>
-<% content_for(:page_title) do %>
- <% @page_title = "Host #{@host.name}" %>
- <h2>Host <%= @host.name %></h2>
-<% end %>
+<section>
+ <h2>Stages</h2>
+ <%= render partial: 'stages' %>
+</section>
View
2  app/views/layouts/application.html.erb
@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Peritor Webistrano - Capristrano Deployment the easy way" />
<meta name="keywords" content="rubyonrails ruby rails capistrano deployment" />
- <link href="images/favicon.ico" rel="shortcut icon">
+ <link href="/favicon.ico" rel="shortcut icon">
<title><%= content_for?(:title) ? yield(:title) : "Webistrano" %></title>
<%= csrf_meta_tags %>
View
1  spec/factories
Please sign in to comment.
Something went wrong with that request. Please try again.