Permalink
Browse files

tag clouds and add banners

  • Loading branch information...
1 parent 7fcde20 commit 621f9dd241a215ef04f0b4ec03ec909070e1a016 @voodoo-chile committed Jan 25, 2012
@@ -2,9 +2,13 @@ class PagesController < ApplicationController
def index
@featured_news = NewsItem.find(:first, :conditions => {:featured => true})
@latest_news = NewsItem.find(:all, :order => "created_at DESC", :limit => 4, :conditions => {:featured => false})
+ @tags = Specialty.tag_counts_on(:tags)
end
def faq
end
+ def banners
+ end
+
end
@@ -1,6 +1,6 @@
class SpecialtiesController < ApplicationController
load_and_authorize_resource
- skip_load_resource :only => :search
+ skip_load_resource :only => [:search, :tag]
def index
end
@@ -40,5 +40,10 @@ def search
@location = params[:location]
@near_specialties = Specialty.near(@location, 30)
end
+
+ def tag
+ @specialties = Specialty.tagged_with(params[:id])
+ @tag = params[:id]
+ end
end
@@ -1,4 +1,5 @@
module PagesHelper
+ include ActsAsTaggableOn::TagsHelper
def get_featured_listings
@specialties = Specialty.find(:all, :order => "created_at DESC", :limit => 5)
View
@@ -101,6 +101,7 @@ def initialize(user)
can :activate, User
can :trust_links, User
can :search, Specialty
+ can :tag, Specialty
can :show, NewsItem
end
@@ -15,10 +15,20 @@
<%= content_tag :div, msg, :id => "flash_#{name}" %>
<%- end -%>
<div id="logo">
- <%= link_to image_tag('/images/BNY.png', :alt =>"Black and Yellow Pages"), root_url %>
- <div id="search">
- <%= render :partial => 'specialties/advanced_search' %>
- </div>
+ <table>
+ <tr>
+ <td>
+ <%= link_to image_tag('/images/byp_rondel.png', :alt =>"Black and Yellow Pages"), root_url %>
+ </td>
+ <td>
+ <%= link_to image_tag('/images/BNY2.png', :alt =>"Black and Yellow Pages"), root_url %>
+ <div id="search">
+ <%= render :partial => 'specialties/advanced_search' %>
+ </div>
+ </td>
+ <td><a target="_blank" href="http://agorism.info"><img src='/images/a3_rondel.png'></a></td>
+ </tr>
+ </table>
</div>
<div id="agorist_nav">
<% if current_user %>
@@ -47,5 +57,7 @@
<%= yield %>
</div>
</div>
+ <div id="footer">
+ </div>
</body>
</html>
@@ -11,6 +11,9 @@
</div>
<p>Please send your feedback, comments, bug reports, or suggestions to
<%= mail_to 'admin@blackandyellowpages.com', 'admin@blackandyellowpages.com', :encode => :hex %>!</p>
+<% tag_cloud(@tags, %w(css1 css2 css3 css4)) do |tag, css_class| %>
+ <%= link_to tag.name, { :controller => :specialties, :action => :tag, :id => tag.name }, :class => css_class %>
+<% end %>
<div class="column_header">
<h3>Latest News</h3>
</div>
View
@@ -9,9 +9,12 @@
get "pages/faq"
+ get "pages/banners"
+
resources :specialties do
collection do
post 'search'
+ get 'tag'
end
end
@@ -28,6 +28,19 @@ a {
border: solid 1px black;
margin-top: 20px;
overflow: auto;
+ background-image: url('/images/top_bkg.png');
+ background-repeat: repeat-x;
+}
+
+#footer {
+ width: 1100px;
+ margin: 0 auto;
+ background-color: #FFF;
+ padding: 12px 30px;
+ border: solid 1px black;
+ overflow: auto;
+ background-image: url('/images/top_bkg.png');
+ background-repeat: repeat-x;
}
#flash_notice, #flash_alert {
@@ -87,10 +100,12 @@ a {
#agorist_nav {
float: right;
font-size: 12px;
+ margin-top: 7px;
}
#logo {
float: left;
+ margin-top: 5px;
}
#content {
@@ -180,14 +195,16 @@ a {
.listing {
clear: both;
- background-color: #f3f393;
+ /* background-color: #f3f393; */
+ background-color: #f8f17a;
border: solid 2px black;
width: 400px;
}
.search_listing {
clear: both;
- background-color: #f3f393;
+ /* background-color: #f3f393; */
+ background-color: #f8f17a;
border: solid 2px black;
width: 400px;
height: 195px;
@@ -313,4 +330,28 @@ a {
#currency_badges {
margin-left: 3px;
+}
+
+.css1 a {
+ font-size: 0.8em;
+ color: #000;
+ text-decoration: none;
+}
+
+.css2 {
+ font-size: 1.0em;
+ color: #000;
+ text-decoration: none;
+}
+
+.css3 {
+ font-size: 1.3em;
+ color: #000;
+ text-decoration: none;
+}
+
+.css4 {
+ font-size: 1.7em;
+ color: #000;
+ text-decoration: none;
}

0 comments on commit 621f9dd

Please sign in to comment.