diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb deleted file mode 100644 index 671a672..0000000 --- a/app/controllers/home_controller.rb +++ /dev/null @@ -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 diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb new file mode 100644 index 0000000..703e19f --- /dev/null +++ b/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 diff --git a/app/helpers/home_helper.rb b/app/helpers/home_helper.rb deleted file mode 100644 index 23de56a..0000000 --- a/app/helpers/home_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module HomeHelper -end diff --git a/app/helpers/pages_helper.rb b/app/helpers/pages_helper.rb new file mode 100644 index 0000000..2c057fd --- /dev/null +++ b/app/helpers/pages_helper.rb @@ -0,0 +1,2 @@ +module PagesHelper +end diff --git a/app/views/fragments/_analytics.html.erb b/app/views/fragments/_analytics.html.erb new file mode 100644 index 0000000..e49ae24 --- /dev/null +++ b/app/views/fragments/_analytics.html.erb @@ -0,0 +1,13 @@ + diff --git a/app/views/fragments/_bottom.html.erb b/app/views/fragments/_bottom.html.erb index 2918d79..5b1c023 100644 --- a/app/views/fragments/_bottom.html.erb +++ b/app/views/fragments/_bottom.html.erb @@ -7,4 +7,6 @@ © <%= Time.now.year %> EntryDNS Team

- \ No newline at end of file + + +<%= render :partial => 'fragments/analytics' %> diff --git a/app/views/fragments/_top.html.erb b/app/views/fragments/_top.html.erb index 3640564..327660e 100644 --- a/app/views/fragments/_top.html.erb +++ b/app/views/fragments/_top.html.erb @@ -8,6 +8,7 @@
  • <%= link_to 'Manage Domains', domains_path, :data => {:pjax => '#main'} %>
  • <% else %>
  • <%= link_to('Home', root_path, :data => {:pjax => '#main'}) %>
  • +
  • <%= link_to('About', page_path('about'), :data => {:pjax => '#main'}) %>
  • <%#= link_to('About us', root_path, :data => {:pjax => '#main'}) %>
  • <% end %>
  • <%#= link_to('Help & Support', root_path, :data => {:pjax => '#main'}) %>
  • diff --git a/app/views/pages/about.html.erb b/app/views/pages/about.html.erb new file mode 100644 index 0000000..30404ce --- /dev/null +++ b/app/views/pages/about.html.erb @@ -0,0 +1 @@ +TODO \ No newline at end of file diff --git a/app/views/home/index.html.erb b/app/views/pages/home.html.erb similarity index 76% rename from app/views/home/index.html.erb rename to app/views/pages/home.html.erb index 4a40974..ac08f37 100644 --- a/app/views/home/index.html.erb +++ b/app/views/pages/home.html.erb @@ -6,10 +6,10 @@
    - <%= render :partial => 'headlines' %> + <%= render :partial => 'pages/home/headlines' %> - <%= render :partial => 'slides' %> + <%= render :partial => 'pages/home/slides' %>
    diff --git a/app/views/home/_headlines.html.erb b/app/views/pages/home/_headlines.html.erb similarity index 100% rename from app/views/home/_headlines.html.erb rename to app/views/pages/home/_headlines.html.erb diff --git a/app/views/home/_slides.html.erb b/app/views/pages/home/_slides.html.erb similarity index 100% rename from app/views/home/_slides.html.erb rename to app/views/pages/home/_slides.html.erb diff --git a/config/deploy.rb b/config/deploy.rb index 1d0c168..3bb1c86 100644 --- a/config/deploy.rb +++ b/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' diff --git a/config/routes.rb b/config/routes.rb index d852ee4..4a5aac5 100644 --- a/config/routes.rb +++ b/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. diff --git a/config/settings.yml b/config/settings.yml index 666025a..04e592b 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -1,4 +1,3 @@ -master: 1.1.1.1 default_ttl: 2000 min_ttl: 1000 ns: diff --git a/spec/controllers/home_controller_spec.rb b/spec/controllers/pages_controller_spec.rb similarity index 50% rename from spec/controllers/home_controller_spec.rb rename to spec/controllers/pages_controller_spec.rb index 9d48b6a..9c1cf55 100644 --- a/spec/controllers/home_controller_spec.rb +++ b/spec/controllers/pages_controller_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -describe HomeController do +describe PagesController do end diff --git a/spec/helpers/home_helper_spec.rb b/spec/helpers/pages_helper_spec.rb similarity index 79% rename from spec/helpers/home_helper_spec.rb rename to spec/helpers/pages_helper_spec.rb index 4a37633..4f75448 100644 --- a/spec/helpers/home_helper_spec.rb +++ b/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