Commit 335629fdb57679ee2db165378b72964523ff9d3a

Authored by Rafael Manzo
1 parent e1eeb836

Layout for Repository show

app/views/projects/index.html.erb
... ... @@ -7,7 +7,7 @@
7 7 <tr>
8 8 <th>Name</th>
9 9 <th>Description</th>
10   - <th>Options</th>
  10 + <th colspan="2">Options</th>
11 11 </tr>
12 12 </thead>
13 13  
... ...
app/views/projects/show.html.erb
... ... @@ -10,28 +10,31 @@
10 10  
11 11 <h2>Repositories</h2>
12 12  
13   -<% if project_owner? @project.id %><%= link_to 'New Repository', new_project_repository_path(@project)%><% end %>
  13 +<% if project_owner? @project.id %><%= link_to 'New Repository', new_project_repository_path(@project,), class: 'btn btn-primary' %><% end %>
14 14  
15   -<table border="1" width="30%">
  15 +<table class="table table-hover">
16 16 <thead>
17 17 <tr>
18 18 <th>Name</th>
19 19 <th>Type</th>
20 20 <th>Address</th>
21   - <% if project_owner? @project.id %><th>Options</th><% end %>
  21 + <th colspan="2">Options</th>
22 22 </tr>
23 23 </thead>
24 24  
25 25 <tbody>
26 26 <% @project_repositories.each do |repository| %>
27 27 <tr>
28   - <td align="center"><%= repository.name %></td>
29   - <td align="center"><%= repository.type %></td>
30   - <td align="center"><%= repository.address %></td>
31   - <% if project_owner? @project.id %>
32   - <td align="center">
  28 + <td><%= repository.name %></td>
  29 + <td><%= repository.type %></td>
  30 + <td><%= repository.address %></td>
  31 + <td>
  32 + <% if project_owner? @project.id %>
33 33 <%= link_to 'Edit', edit_project_repository_path(@project, repository.id) %>
34   - <%= link_to 'Destroy', project_repository_path(@project, repository.id), method: :delete, data: { confirm: 'Are you sure?' } %></td>
  34 + <% end %>
  35 + </td>
  36 + <td>
  37 + <%= link_to 'Show', project_repository_path(@project, repository.id), class: 'btn btn-info' %></td>
35 38 </td>
36 39 <% end %>
37 40 </tr>
... ...
app/views/repositories/show.html.erb
1   -<p id="notice"><%= notice %></p>
2   -
3   -<p>
4   - <strong>Name:</strong>
5   - <%= @repository.name %>
6   -</p>
  1 +<h1><%= @repository.name %></h1>
7 2  
8 3 <p>
9 4 <strong>Description:</strong>
... ... @@ -41,4 +36,7 @@
41 36 <% end %>
42 37 <% end %>
43 38  
44   -<%= link_to 'Back', project_path(@project_id) %>
  39 +<%= link_to 'Back', project_path(@repository.project_id), class: 'btn btn-default' %>
  40 +<% if project_owner? @repository.project_id %>
  41 + <%= link_to 'Destroy', project_repository_path(@repository.project_id, @repository.id), method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' %>
  42 +<% end %>
... ...