From ca72bc94587dfe50c75c4988f5e2c0a24f377597 Mon Sep 17 00:00:00 2001 From: Nicolae Claudius Date: Sun, 18 Sep 2011 03:02:02 -0700 Subject: [PATCH] home, dashboard --- app/assets/stylesheets/application.css.erb | 22 +++++++++++-------- app/controllers/dashboard_controller.rb | 4 ++++ app/controllers/domains_controller.rb | 1 + app/controllers/home_controller.rb | 8 +++++++ app/controllers/records_controller.rb | 1 + app/controllers/supermasters_controller.rb | 1 + app/helpers/dashboard_helper.rb | 2 ++ app/helpers/home_helper.rb | 2 ++ app/views/dashboard/index.html.erb | 1 + app/views/fragments/_sidebar.html.erb | 1 + app/views/home/index.html.erb | 15 +++++++++++++ app/views/layouts/home.html.erb | 21 ++++++++++++++++++ config/routes.rb | 4 +++- spec/controllers/dashboard_controller_spec.rb | 5 +++++ spec/controllers/home_controller_spec.rb | 5 +++++ spec/helpers/dashboard_helper_spec.rb | 15 +++++++++++++ spec/helpers/home_helper_spec.rb | 15 +++++++++++++ 17 files changed, 113 insertions(+), 10 deletions(-) create mode 100644 app/controllers/dashboard_controller.rb create mode 100644 app/controllers/home_controller.rb create mode 100644 app/helpers/dashboard_helper.rb create mode 100644 app/helpers/home_helper.rb create mode 100644 app/views/dashboard/index.html.erb create mode 100644 app/views/home/index.html.erb create mode 100644 app/views/layouts/home.html.erb create mode 100644 spec/controllers/dashboard_controller_spec.rb create mode 100644 spec/controllers/home_controller_spec.rb create mode 100644 spec/helpers/dashboard_helper_spec.rb create mode 100644 spec/helpers/home_helper_spec.rb diff --git a/app/assets/stylesheets/application.css.erb b/app/assets/stylesheets/application.css.erb index 89b95e5..5742cf7 100644 --- a/app/assets/stylesheets/application.css.erb +++ b/app/assets/stylesheets/application.css.erb @@ -1,19 +1,23 @@ /* - * This is a manifest file that'll automatically include all the stylesheets available in this directory - * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at - * the top of the compiled file, but it's generally better to create a new file per style scope. - *= require web-app-theme/base - *= require web-app-theme/themes/default/style.css - *= require active_scaffold - *= require_self +* This is a manifest file that'll automatically include all the stylesheets available in this directory +* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at +* the top of the compiled file, but it's generally better to create a new file per style scope. +*= require web-app-theme/base +*= require web-app-theme/themes/default/style.css +*= require active_scaffold +*= require_self */ #main .block .content h2 { - margin-left: 0; + margin-left: 0; } #main .block .content .active-scaffold-header h2 { - font-size: 200%; + font-size: 200%; +} + +#main .active-scaffold th a { + text-shadow: none; } .flash .alert { diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb new file mode 100644 index 0000000..391fa2e --- /dev/null +++ b/app/controllers/dashboard_controller.rb @@ -0,0 +1,4 @@ +class DashboardController < ApplicationController + def index + end +end diff --git a/app/controllers/domains_controller.rb b/app/controllers/domains_controller.rb index fdbb737..578d937 100644 --- a/app/controllers/domains_controller.rb +++ b/app/controllers/domains_controller.rb @@ -1,4 +1,5 @@ class DomainsController < ApplicationController active_scaffold :domain do |conf| + conf.columns = [:name, :master, :last_check, :type, :notified_serial, :account] end end diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb new file mode 100644 index 0000000..813c214 --- /dev/null +++ b/app/controllers/home_controller.rb @@ -0,0 +1,8 @@ +class HomeController < ApplicationController + skip_before_filter :authenticate_user! + layout 'home' + + def index + redirect_to dashboard_path if user_signed_in? + end +end diff --git a/app/controllers/records_controller.rb b/app/controllers/records_controller.rb index e670c17..8aa611a 100644 --- a/app/controllers/records_controller.rb +++ b/app/controllers/records_controller.rb @@ -1,4 +1,5 @@ class RecordsController < ApplicationController active_scaffold :record do |conf| + conf.columns = [:name, :type, :content, :ttl, :prio, :change_date] end end diff --git a/app/controllers/supermasters_controller.rb b/app/controllers/supermasters_controller.rb index 156bc03..47930e3 100644 --- a/app/controllers/supermasters_controller.rb +++ b/app/controllers/supermasters_controller.rb @@ -1,4 +1,5 @@ class SupermastersController < ApplicationController active_scaffold :supermaster do |conf| + conf.columns = [:nameserver, :account] end end diff --git a/app/helpers/dashboard_helper.rb b/app/helpers/dashboard_helper.rb new file mode 100644 index 0000000..a94ddfc --- /dev/null +++ b/app/helpers/dashboard_helper.rb @@ -0,0 +1,2 @@ +module DashboardHelper +end diff --git a/app/helpers/home_helper.rb b/app/helpers/home_helper.rb new file mode 100644 index 0000000..23de56a --- /dev/null +++ b/app/helpers/home_helper.rb @@ -0,0 +1,2 @@ +module HomeHelper +end diff --git a/app/views/dashboard/index.html.erb b/app/views/dashboard/index.html.erb new file mode 100644 index 0000000..61c6e44 --- /dev/null +++ b/app/views/dashboard/index.html.erb @@ -0,0 +1 @@ +Some dashboard here \ No newline at end of file diff --git a/app/views/fragments/_sidebar.html.erb b/app/views/fragments/_sidebar.html.erb index 14c97d3..984ab5c 100644 --- a/app/views/fragments/_sidebar.html.erb +++ b/app/views/fragments/_sidebar.html.erb @@ -3,6 +3,7 @@

Menu