Skip to content

Commit

Permalink
Updated views with glyphicons
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil Gehani committed Nov 5, 2013
1 parent 373dd4c commit 8c94e7d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
12 changes: 10 additions & 2 deletions app/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,16 @@
</ul>
<ul class="nav navbar-nav navbar-right">
<% if user_signed_in? %>
<li><%= link_to "Add +", new_pin_path %></li>
<li><%= link_to "Account Settings", edit_user_registration_path %></li>
<li>
<%= link_to new_pin_path do %>
<span class="glyphicon glyphicon-plus-sign"></span> New Pin
<% end %>
</li>
<li>
<%= link_to edit_user_registration_path do %>
<span class="glyphicon glyphicon-user"></span> Account Settings
<% end %>
</li>
<li><%= link_to "Log out", destroy_user_session_path, method: :delete %></li>
<% else %>
<li><%= link_to 'Log in', new_user_session_path %></li>
Expand Down
8 changes: 6 additions & 2 deletions app/views/pins/_pin.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
<strong><%= pin.user.name if pin.user %></strong>
<% if current_user == pin.user %>
<div class="actions">
<%= link_to 'Edit', edit_pin_path(pin) %>
<%= link_to 'Destroy', pin, method: :delete, data: { confirm: 'Are you sure?' } %>
<%= link_to edit_pin_path(pin) do %>
<span class="glyphicon glyphicon-edit"></span> Edit
<% end %>
<%= link_to pin, method: :delete, data: { confirm: 'Are you sure?' } do %>
<span class="glyphicon glyphicon-remove-circle"></span> Remove
<% end %>
</div>
<% end %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/pins/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%# render includes partials that begin with _*.html.erb %>
<%# means look in pages subfolder for _home.html.erb %>
<%= render 'pages/home' %>
<%= render 'pages/home' unless user_signed_in? %>
<div id="pins" class="transitions-enabled">
<%= render @pins %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/pins/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1>New pin</h1>
<h1>New image</h1>

<%= render 'form' %>

Expand Down
4 changes: 3 additions & 1 deletion app/views/pins/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
<p><%= @pin.description %></p>
<p><strong><%= @pin.user.name if @pin.user %></strong></p>
<% if current_user == @pin.user %>
<%= link_to 'Edit', edit_pin_path(@pin) %> |
<%= link_to edit_pin_path(@pin) do %>
<span class="glyphicon glyphicon-edit"></span> Change
<% end %>
<% end %>
</div>
</div>
Expand Down

0 comments on commit 8c94e7d

Please sign in to comment.