Skip to content
Browse files

Google search and revised nav bar with tip and pitch creation

  • Loading branch information...
1 parent 40a1ea6 commit 016fe7f5b06bb77e9b699d405d339b4d3b3502fd @spherop spherop committed
View
1 app/controllers/homes_controller.rb
@@ -2,7 +2,6 @@ class HomesController < ApplicationController
# caches_page :show
def show
@featured = Pitch.featured_by_network(current_network)
- # @featured = Pitch.featured
end
def start_story
View
7 app/controllers/pitches_controller.rb
@@ -1,8 +1,9 @@
class PitchesController < ApplicationController
before_filter :store_location, :only => :show
- before_filter :login_required, :only => [:apply_to_contribute]
+ before_filter :login_required, :only => [:new, :create, :update, :apply_to_contribute]
before_filter :organization_required, :only => [:half_fund, :fully_fund, :show_support]
before_filter :set_meta_tags, :only => [:show]
+ before_filter :select_tab, :only => [:new]
resources_controller_for :pitch
@@ -117,5 +118,9 @@ def set_meta_tags
pitch = find_resource
html_meta_tags(pitch.short_description,pitch.keywords) if pitch
end
+
+ def select_tab
+ @selected_tab = "start_story"
+ end
end
View
6 app/controllers/tips_controller.rb
@@ -2,6 +2,7 @@ class TipsController < ApplicationController
resources_controller_for :tip, :except => :destroy
before_filter :block_if_donated_to, :only => :edit
+ before_filter :login_required, :only => [:new, :create, :update]
bounce_bots(:send_bots, :tip, :blog_url)
before_filter :select_tab, :only => [:new]
before_filter :set_meta_tags, :only => [:show]
@@ -30,7 +31,8 @@ def can_edit?
end
def can_create?
- access_denied unless Tip.createable_by?(current_user)
+ true
+ #access_denied unless Tip.createable_by?(current_user)
end
def new_resource
@@ -42,7 +44,7 @@ def new_resource
protected
def select_tab
- @selected_tab = "start_story"
+ @selected_tab = "suggest_story"
end
def set_meta_tags
View
3 app/models/pitch.rb
@@ -190,7 +190,8 @@ def self.with_sort(sort='desc')
end
def self.createable_by?(user)
- user && user.reporter? || user.organization?
+ !user.nil?
+ #user && user.reporter? || user.organization?
end
def featured?
View
3 app/views/layouts/_header.html.haml
@@ -5,7 +5,8 @@
= link_to "<span class='hide'>Spot.us - Community Funded Reporting</span>", "/", :class => "logo-link", :title => "Spot.us - Community Funded Reporting"
.nav-container
%ul#main-nav
- %li{:class=>"start_story#{check_if_tab("start_story",@selected_tab)}"}= facebox_login_link_to "Start a Story", start_story_path
+ %li{:class=>"suggest_story#{check_if_tab("suggest_story",@selected_tab)}"}= facebox_login_link_to "Suggest a Story", new_tip_path
+ %li{:class=>"start_story#{check_if_tab("start_story",@selected_tab)}"}= facebox_login_link_to "Start a Story", new_pitch_path
%li{:class=>"fund_story#{check_if_tab("pitches",@selected_tab)}"}= link_to "Search Pitches", news_items_path
%li{:class=>"read_story#{check_if_tab("stories",@selected_tab)}"}= link_to "Read a Story", stories_path
%li{:class=>"about_spotus#{check_if_tab("about",@selected_tab)}"}= link_to "About", page_path('about')
View
BIN public/images/spotus_wide_nav_bg.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
3 public/javascripts/auth.js
@@ -52,7 +52,8 @@ jQuery(document).ready(function($){
else
$(document).trigger('close.facebox');
renderUserHeader();
- $("li.start_story a.authbox").removeClass("authbox").removeAttr("return_to").attr("href","/start_story");
+ $("li.start_story a.authbox").removeClass("authbox").removeAttr("return_to").attr("href","/pitches/new");
+ $("li.suggest_story a.authbox").removeClass("authbox").removeAttr("return_to").attr("href","/tips/new");
if($("#flash").length > 0){
$("#flash").html("");
}
View
8 public/stylesheets/screen_spotus.css
@@ -230,10 +230,10 @@ body {
}
#header .nav-container {
float: right;
- background: url(/images/spotus_nav_bg.gif) no-repeat 0 bottom;
+ background: url(/images/spotus_wide_nav_bg.gif) no-repeat 0 bottom;
padding: 6px 0 0 0;
height: 26px;
- width: 506px;
+ width: 659px;
}
#header .nav-container ul {
margin: 0;
@@ -256,6 +256,10 @@ body {
#main-nav li.start_story, #main-nav li.fund_story, #main-nav li.read_story, #main-nav li.about_spotus {
text-align: center;
}
+#main-nav li.suggest_story {
+ width: 132px;
+ margin-left:21px;
+}
#main-nav li.start_story {
width: 118px;
}

0 comments on commit 016fe7f

Please sign in to comment.
Something went wrong with that request. Please try again.