Browse Source

pages, updates

pull/1/head
Nicolae Claudius 13 years ago
parent
commit
d8c33542d1
  1. 8
      app/controllers/home_controller.rb
  2. 22
      app/controllers/pages_controller.rb
  3. 2
      app/helpers/home_helper.rb
  4. 2
      app/helpers/pages_helper.rb
  5. 13
      app/views/fragments/_analytics.html.erb
  6. 4
      app/views/fragments/_bottom.html.erb
  7. 1
      app/views/fragments/_top.html.erb
  8. 1
      app/views/pages/about.html.erb
  9. 4
      app/views/pages/home.html.erb
  10. 0
      app/views/pages/home/_headlines.html.erb
  11. 0
      app/views/pages/home/_slides.html.erb
  12. 2
      config/deploy.rb
  13. 5
      config/routes.rb
  14. 1
      config/settings.yml
  15. 2
      spec/controllers/pages_controller_spec.rb
  16. 6
      spec/helpers/pages_helper_spec.rb

8
app/controllers/home_controller.rb

@ -1,8 +0,0 @@
class HomeController < ApplicationController
skip_before_filter :authenticate_user!
layout proc{|controller| request.xhr? ? false : 'marketing'}
def index
redirect_to domains_path if user_signed_in?
end
end

22
app/controllers/pages_controller.rb

@ -0,0 +1,22 @@
class PagesController < ApplicationController
skip_before_filter :authenticate_user!
layout proc{|controller| request.xhr? ? false : 'marketing'}
rescue_from ActionView::MissingTemplate do |exception|
if exception.message =~ %r{Missing template pages/}
raise ActionController::RoutingError, "No such page: #{params[:id]}"
else
raise exception
end
end
def show
# redirect_to domains_path if user_signed_in? # for home page only
render :template => current_page
end
protected
def current_page; "pages/#{clean_path}" end
def clean_path; Pathname.new("/#{params[:id]}").cleanpath.to_s[1..-1] end
end

2
app/helpers/home_helper.rb

@ -1,2 +0,0 @@
module HomeHelper
end

2
app/helpers/pages_helper.rb

@ -0,0 +1,2 @@
module PagesHelper
end

13
app/views/fragments/_analytics.html.erb

@ -0,0 +1,13 @@
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-26239372-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>

4
app/views/fragments/_bottom.html.erb

@ -7,4 +7,6 @@
&copy; <%= Time.now.year %> EntryDNS Team
</p>
</div>
</div>
</div>
<%= render :partial => 'fragments/analytics' %>

1
app/views/fragments/_top.html.erb

@ -8,6 +8,7 @@
<li><%= link_to 'Manage Domains', domains_path, :data => {:pjax => '#main'} %></li>
<% else %>
<li><%= link_to('Home', root_path, :data => {:pjax => '#main'}) %></li>
<li><%= link_to('About', page_path('about'), :data => {:pjax => '#main'}) %></li>
<li><%#= link_to('About us', root_path, :data => {:pjax => '#main'}) %></li>
<% end %>
<li><%#= link_to('Help & Support', root_path, :data => {:pjax => '#main'}) %></li>

1
app/views/pages/about.html.erb

@ -0,0 +1 @@
TODO

4
app/views/home/index.html.erb → app/views/pages/home.html.erb

@ -6,10 +6,10 @@
<table class="marketing-duo">
<tr>
<td class="marketing-text">
<%= render :partial => 'headlines' %>
<%= render :partial => 'pages/home/headlines' %>
</td>
<td class="marketing-images">
<%= render :partial => 'slides' %>
<%= render :partial => 'pages/home/slides' %>
</td>
</tr>
</table>

0
app/views/home/_headlines.html.erb → app/views/pages/home/_headlines.html.erb

0
app/views/home/_slides.html.erb → app/views/pages/home/_slides.html.erb

2
config/deploy.rb

@ -2,7 +2,7 @@ require 'bundler/capistrano'
default_run_options[:pty] = true
set :application, 'entrydns'
set :domain, 'zooz.dyndns.org'
set :domain, 'n0.entrydns.net'
set :repository, "git@bitbucket.org:clyfe/entrydns.git"
set :deploy_to, '/srv/www/apps/entrydns'
set :user, 'clyfe'

5
config/routes.rb

@ -38,7 +38,10 @@ Entrydns::Application.routes.draw do
end
get '/dashboard', :to => 'dashboard#index', :as => :dashboard
root :to => 'home#index'
resources :pages, :only => :show
root :to => 'pages#show', :id => 'home'
# The priority is based upon order of creation:
# first created -> highest priority.

1
config/settings.yml

@ -1,4 +1,3 @@
master: 1.1.1.1
default_ttl: 2000
min_ttl: 1000
ns:

2
spec/controllers/home_controller_spec.rb → spec/controllers/pages_controller_spec.rb

@ -1,5 +1,5 @@
require 'spec_helper'
describe HomeController do
describe PagesController do
end

6
spec/helpers/home_helper_spec.rb → spec/helpers/pages_helper_spec.rb

@ -1,15 +1,15 @@
require 'spec_helper'
# Specs in this file have access to a helper object that includes
# the HomeHelper. For example:
# the PagesHelper. For example:
#
# describe HomeHelper do
# describe PagesHelper do
# describe "string concat" do
# it "concats two strings with spaces" do
# helper.concat_strings("this","that").should == "this that"
# end
# end
# end
describe HomeHelper do
describe PagesHelper do
pending "add some examples to (or delete) #{__FILE__}"
end
Loading…
Cancel
Save