Commit 8a40ffb5

mo k <mo@mokhan.ca>
2012-06-02 13:35:53
tidy up some of the page headers and create route alias for login, logout
1 parent 8db18c1
app/controllers/registrations_controller.rb
@@ -1,4 +1,5 @@
 class RegistrationsController < Devise::RegistrationsController
+  #force_ssl
   def edit
     @user = current_user
   end
app/views/creations/index.html.erb
@@ -3,14 +3,12 @@
     <h1>Welcome cake enthusiast!</h1>
     <p><strong>Make</strong> cakes, <strong>sell</strong> cakes, or just <strong>love</strong> eating them? You've come to the right place!</p>
     <p>CakeSide is a free site to <strong>share</strong> your cake <strong>creations</strong> and <strong>ideas</strong> with other cake fanatics like yourself!</p>
-
     <div class="row">
       <div class="span12">
         <a href="<%= url_for new_user_session_path %>" class="btn btn-large">Sign me up &raquo;</a>
       </div>
     </div>
   </div>
-
   <div class="marketing">
     <div class="row">
       <div class="span4">
@@ -35,11 +33,9 @@
       </p>
     </div>
     <hr>
-    <div class="row">
-      <div class="span12">
-        <h2>Recently uploaded creations</h2>
-      </div>
-    </div>	
   </div>
 <% end %>
+<div class="page-header">
+  <h1>Recently uploaded creations</h1>
+</div>	
 <%= render "shared/a_12_column_gallery" %>
app/views/creations/show.html.erb
@@ -1,5 +1,4 @@
 <% provide(:title, "#{@creation.name} by #{@creation.user.name}") -%>
-
 <div class="page-header">
   <h1>
     <%= @creation.name %> 
@@ -10,12 +9,11 @@
       <% end %>
       submitted by <%= link_to @creation.user.name, profile_path(@creation.user) %> 
   </small> 
-  </h1>
-  <% @creation.categories.each do |category| %>
-    <span class="label"><a href="/categories/<%= category.slug %>"><%= category.name %></a></span>
-  <% end %> 
+</h1>
+<% @creation.categories.each do |category| %>
+  <span class="label"><a href="/categories/<%= category.slug %>"><%= category.name %></a></span>
+<% end %> 
 </div>
-
 <div class="row">
   <div class="span12">
     <p> 
@@ -24,11 +22,9 @@
     </p>
   </div>
 </div>
-
 <div class="row">
   <div class="span6"> 
-    <iframe src="http://www.facebook.com/plugins/like.php?href=<%= request.url %>" scrolling="no" frameborder="0" style="border:none; width:350px; height:30px; float:left;">
-    </iframe>
+    <iframe src="http://www.facebook.com/plugins/like.php?href=<%= request.url %>" scrolling="no" frameborder="0" style="border:none; width:350px; height:30px; float:left;"></iframe>
   </div>
   <div class="span2">
     <% if user_signed_in? %>
@@ -36,11 +32,10 @@
         <%= button_to "Add to favorites", creation_favorites_path(:creation_id => @creation.id), :method => :post, :class => 'btn btn-primary' %>
       <% end %>
     <% else %>
-        <%= button_to "Add to favorites", creation_favorites_path(:creation_id => @creation.id), :method => :post, :class => 'btn btn-primary' %>
+      <%= button_to "Add to favorites", creation_favorites_path(:creation_id => @creation.id), :method => :post, :class => 'btn btn-primary' %>
     <% end %>
   </div>
 </div>
-
 <div class="row">
   <div class="span12">
     <ul class="thumbnails">
@@ -55,7 +50,6 @@
     </ul>
   </div>
 </div>
-
 <div class="row">
   <div class="span12">
     <h3>Description</h3>
app/views/devise/sessions/new.html.erb
@@ -1,6 +1,5 @@
 <% content_for :head do %>
 <% end %>
-
 <script type="text/javascript">
   $(document).ready(function(){
     $('#accepted').click(function(){
@@ -13,7 +12,6 @@
     });
   });
 </script>
-
 <div class="row">
   <div class="span12">
     <div class="row">
app/views/favorites/index.html.erb
@@ -1,7 +1,6 @@
 <% content_for :title do %>
   <%= @creation.name %> by <%= @creation.user.name %> - fanclub
 <% end %>
-
 <div class="page-header">
   <h1> fans of  <%= link_to @creation.name, creation_path(@creation) %> <small> submitted by <%= link_to @creation.user.name, profile_path(@creation.user) %> </small> </h1>
   <% @creation.categories.each do |category| %>
app/views/profiles/favorites.html.erb
@@ -1,14 +1,12 @@
 <% content_for :title do %>
   My Favorites
 <% end %>
-
 <ul class="nav nav-tabs">
   <li> <%= link_to "Profile", profiles_mine_path %></li>
   <li class="active"> <%= link_to "Favorites", profiles_favorites_path %></li>
   <li> <%= link_to "Add Creation", new_creation_path %></li>
   <li> <%= link_to "Settings", edit_user_registration_path %> </li>
 </ul>
-
 <div class="row">
   <div class="span3">
     <div class="media-grid">
app/views/profiles/index.html.erb
@@ -1,15 +1,22 @@
 <% content_for :title do %>
   <%= pluralize @profiles.length, "artist" %>
 <% end %>
-
+<div class="page-header">
+  <h1><%= pluralize @profiles.length, "artist" %></h1>
+</div>
 <div class="row">
   <div class="span12">
-    <h1><%= pluralize @profiles.length, "artist" %></h1>
-    <table class="bordered-table zebra-striped">
+    <table class="table table-striped table-bordered">
       <thead>
         <tr>
           <th></th>
           <th>name</th>
+          <th>location</th>
+          <th>latitude</th>
+          <th>longitude</th>
+          <th>twitter</th>
+          <th>facebook</th>
+          <th>website</th>
           <th>creations</th>
           <th>member since</th>
         </tr>
@@ -18,7 +25,7 @@
         <% @profiles.each do |profile| %>
           <tr>
             <td>
-              <ul class="media-grid">
+              <ul class="thumbnails">
                 <li>
                 <a href="<%= url_for profile_path(profile) %>">
                   <%= image_tag avatar_url(profile), :class => "thumbnail", :alt => profile.name %>
@@ -27,6 +34,12 @@
               </ul>
             </td>
             <td><%= link_to profile.name, profile_path(profile) %></td>
+            <td><%= profile.city %></td>
+            <td><%= profile.latitude %></td>
+            <td><%= profile.longitude %></td>
+            <td><%= profile.twitter %></td>
+            <td><%= profile.facebook %></td>
+            <td><%= profile.website %></td>
             <td><a href="<%= url_for profile_path(profile) %>"><%= profile.creations.length %> creations</a></td>
             <td><%= profile.created_at.to_s :foomat %></td>
           </tr>
config/routes.rb
@@ -23,7 +23,6 @@ Cake::Application.routes.draw do
   get "profiles/favorites"
   get "profiles/mine"
   match 'profiles/:id' => 'profiles#show', :as => 'profile', :method => 'GET'
-  match 'profiles/show/:id' => 'profiles#show', :as => 'profile', :method => 'GET'
   match 'profiles/mine' => 'profiles#mine', :as => 'profiles_mine', :method => 'GET'
 
   # /artists
@@ -39,5 +38,5 @@ Cake::Application.routes.draw do
 
   # /users
   devise_for :users, :controllers => {:registrations => 'registrations'}
-
+  devise_for :user, :path => '', :path_names => { :sign_in => "login", :sign_out => "logout", :sign_up => "register" }
 end