Browse Source

major refurbish

pull/1/head
Nicolae Claudius 12 years ago
parent
commit
c4d18370bf
  1. 27
      Gemfile
  2. 222
      Gemfile.lock
  3. 2
      README
  4. 21
      app/assets/javascripts/application.js.coffee
  5. 24
      app/assets/javascripts/components/behaviors.js.coffee
  6. 5
      app/assets/javascripts/components/webshims.js.coffee
  7. 15
      app/assets/stylesheets/application.css.scss
  8. 64
      app/assets/stylesheets/bootstrap-custom.css.scss
  9. 21
      app/assets/stylesheets/pages/home.css.scss
  10. 3
      app/assets/stylesheets/theme/logo.css.scss
  11. 11
      app/assets/stylesheets/theme/navbar.css.scss
  12. 6
      app/assets/stylesheets/theme/overrides.css.scss
  13. 26
      app/controllers/application_controller.rb
  14. 0
      app/controllers/concerns/records_controller_common.rb
  15. 4
      app/controllers/dashboard_controller.rb
  16. 11
      app/controllers/public/pages_controller.rb
  17. 3
      app/controllers/public_controller.rb
  18. 2
      app/controllers/users/aaaas_controller.rb
  19. 2
      app/controllers/users/as_controller.rb
  20. 2
      app/controllers/users/cnames_controller.rb
  21. 2
      app/controllers/users/domains_controller.rb
  22. 4
      app/controllers/users/hosts_controller.rb
  23. 2
      app/controllers/users/mxes_controller.rb
  24. 2
      app/controllers/users/ns_controller.rb
  25. 2
      app/controllers/users/permissions_controller.rb
  26. 2
      app/controllers/users/records_controller.rb
  27. 2
      app/controllers/users/soas_controller.rb
  28. 2
      app/controllers/users/srvs_controller.rb
  29. 2
      app/controllers/users/txts_controller.rb
  30. 25
      app/controllers/users_controller.rb
  31. 2
      app/helpers/aaaas_helper.rb
  32. 2
      app/helpers/as_helper.rb
  33. 2
      app/helpers/cnames_helper.rb
  34. 2
      app/helpers/dashboard_helper.rb
  35. 2
      app/helpers/hosts_helper.rb
  36. 2
      app/helpers/mxes_helper.rb
  37. 2
      app/helpers/ns_helper.rb
  38. 2
      app/helpers/pages_helper.rb
  39. 2
      app/helpers/permissions_helper.rb
  40. 5
      app/helpers/public/pages_helper.rb
  41. 5
      app/helpers/records_helper.rb
  42. 2
      app/helpers/soas_helper.rb
  43. 2
      app/helpers/srvs_helper.rb
  44. 2
      app/helpers/txts_helper.rb
  45. 2
      app/helpers/users/aaaas_helper.rb
  46. 2
      app/helpers/users/as_helper.rb
  47. 2
      app/helpers/users/cnames_helper.rb
  48. 4
      app/helpers/users/domains_helper.rb
  49. 2
      app/helpers/users/hosts_helper.rb
  50. 2
      app/helpers/users/mxes_helper.rb
  51. 2
      app/helpers/users/ns_helper.rb
  52. 2
      app/helpers/users/permissions_helper.rb
  53. 5
      app/helpers/users/records_helper.rb
  54. 2
      app/helpers/users/soas_helper.rb
  55. 2
      app/helpers/users/srvs_helper.rb
  56. 2
      app/helpers/users/txts_helper.rb
  57. 2
      app/mailers/permission_mailer.rb
  58. 11
      app/models/admin.rb
  59. 2
      app/models/domain.rb
  60. 2
      app/models/domain/tree_structure.rb
  61. 6
      app/models/permission.rb
  62. 3
      app/models/setting.rb
  63. 13
      app/models/user.rb
  64. 2
      app/models/user_ability.rb
  65. 1
      app/views/dashboard/index.html.erb
  66. 31
      app/views/layouts/admin.html.erb
  67. 2
      app/views/layouts/errors.html.erb
  68. 4
      app/views/layouts/home.html.erb
  69. 7
      app/views/layouts/users.html.erb
  70. 2
      app/views/public/pages/about.html.erb
  71. 2
      app/views/public/pages/contact.html.erb
  72. 0
      app/views/public/pages/contact/_form.html.erb
  73. 7
      app/views/public/pages/donate.html.erb
  74. 0
      app/views/public/pages/help.html.erb
  75. 10
      app/views/public/pages/home.html.erb
  76. 0
      app/views/public/pages/home/_headlines.html.erb
  77. 0
      app/views/public/pages/home/_slides.html.erb
  78. 0
      app/views/public/pages/privacy.html.erb
  79. 0
      app/views/public/pages/shared/_action.html.erb
  80. 0
      app/views/public/pages/shared/_benefits.html.erb
  81. 0
      app/views/public/pages/shared/_features.html.erb
  82. 0
      app/views/public/pages/signed_out.html.erb
  83. 4
      app/views/public/pages/team.html.erb
  84. 0
      app/views/public/pages/team/_clyfe.html.erb
  85. 0
      app/views/public/pages/team/_zooz.html.erb
  86. 0
      app/views/public/pages/terms.html.erb
  87. 4
      app/views/shared/_navigation.html.erb
  88. 6
      app/views/shared/_public_top.html.erb
  89. 1
      app/views/shared/navigation/_users.html.erb
  90. 0
      app/views/users/as/_list_record.html.erb
  91. 0
      app/views/users/as/on_action_update.js.erb
  92. 2
      app/views/users/confirmations/new.html.erb
  93. 0
      app/views/users/domains/_form_association_footer.html.erb
  94. 0
      app/views/users/domains/_horizontal_subform_record.html.erb
  95. 0
      app/views/users/domains/_list_record_columns.html.erb
  96. 0
      app/views/users/mailer/confirmation_instructions.html.erb
  97. 0
      app/views/users/mailer/reset_password_instructions.html.erb
  98. 0
      app/views/users/mailer/unlock_instructions.html.erb
  99. 4
      app/views/users/ns/destroy.js.erb
  100. 2
      app/views/users/passwords/edit.html.erb
  101. Some files were not shown because too many files have changed in this diff Show More

27
Gemfile

@ -1,6 +1,6 @@
source 'http://rubygems.org' source 'http://rubygems.org'
gem 'rails', '3.2.6' gem 'rails', '3.2.8'
# Bundle edge Rails instead: # Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git' # gem 'rails', :git => 'git://github.com/rails/rails.git'
@ -8,14 +8,13 @@ gem 'rails', '3.2.6'
# gem 'pg' # gem 'pg'
gem 'mysql2' gem 'mysql2'
gem 'devise', '~> 2.1.0' gem 'devise', '~> 2.1.0'
gem 'cancan', '~> 1.6.7' gem 'cancan', '= 1.6.7'
gem 'squeel', '~> 1.0.0' gem 'squeel', '~> 1.0.0'
gem 'sentient_user', '~> 0.3.2' gem 'sentient_model', '~> 1.0.4'
gem 'userstamp_basic', '~> 0.1.0' gem 'userstamp', '~> 2.0.2', git: 'https://github.com/delynn/userstamp.git'
gem 'validates_hostname', '~> 1.0.0', git: 'https://github.com/KimNorgaard/validates_hostname.git' gem 'validates_hostname', '~> 1.0.0', git: 'https://github.com/KimNorgaard/validates_hostname.git'
gem 'nilify_blanks', '~> 1.0.0' gem 'nilify_blanks', '~> 1.0.0'
gem 'rails_config', '~> 0.2.4' gem 'rails_config', '~> 0.2.4'
# gem 'rails-settings-cached', :require => 'rails-settings'
gem 'active-model-email-validator', '~> 1.0.2' gem 'active-model-email-validator', '~> 1.0.2'
gem 'mail_form', '~> 1.3.0' gem 'mail_form', '~> 1.3.0'
gem 'switch_user', '~> 0.6.0' gem 'switch_user', '~> 0.6.0'
@ -26,13 +25,18 @@ gem 'rails-backbone', '~> 0.7.0'
gem 'acts_as_nested_interval', '~> 0.0.7' gem 'acts_as_nested_interval', '~> 0.0.7'
# path: '/home/clyfe/dev/acts_as_nested_interval' # path: '/home/clyfe/dev/acts_as_nested_interval'
# git: 'https://github.com/clyfe/acts_as_nested_interval.git' # git: 'https://github.com/clyfe/acts_as_nested_interval.git'
gem 'webshims-rails', '~> 0.2'
gem 'font-awesome-sass-rails', '~> 2.0.0.0'
gem 'seedbank', '~> 0.1.3'
gem 'rails_admin', '~> 0.0.5'
gem 'rails-settings-cached', '~> 0.2.2'
# Gems used only for assets and not required # Gems used only for assets and not required
# in production environments by default. # in production environments by default.
group :assets do group :assets do
gem 'sass-rails', " ~> 3.2.3" gem 'sass-rails', " ~> 3.2.3"
gem 'compass-rails', '~> 1.0.0.rc.2' gem 'compass-rails', '~> 1.0.3'
gem 'bootstrap-sass', '~> 2.0.3' gem 'bootstrap-sass', '~> 2.1.0.0'
gem 'coffee-rails', "~> 3.2.1" gem 'coffee-rails', "~> 3.2.1"
gem 'uglifier', '>= 1.0.3' gem 'uglifier', '>= 1.0.3'
gem 'therubyracer' gem 'therubyracer'
@ -40,21 +44,22 @@ end
gem 'jquery-rails' gem 'jquery-rails'
gem 'dalli', '~> 1.1.3' gem 'dalli', '~> 1.1.3'
# gem 'foreigner' ? gem 'active_scaffold', '~> 3.2.16'
gem 'active_scaffold', '~> 3.2.12', # git: 'https://github.com/activescaffold/active_scaffold.git'
git: 'https://github.com/activescaffold/active_scaffold.git'
# path: '/home/clyfe/dev/active_scaffold' # path: '/home/clyfe/dev/active_scaffold'
gem 'pjax_rails', '~> 0.2.0' gem 'pjax_rails', '~> 0.2.0'
# gem 'foreigner' ?
group :development do group :development do
gem 'capistrano', '~> 2.9.0' gem 'capistrano', '~> 2.9.0'
gem 'capistrano-ext', '~> 1.2.1' gem 'capistrano-ext', '~> 1.2.1'
gem 'mongrel', '>= 1.2.0.pre2' gem 'mongrel', '>= 1.2.0.pre2'
gem 'quiet_assets', '~> 1.0.1'
end end
group :test, :development do group :test, :development do
gem 'sourcify', '~> 0.6.0.rc1' gem 'sourcify', '~> 0.6.0.rc1'
gem 'rspec-rails', '~> 2.8.1' gem 'rspec-rails', '~> 2.10.1'
gem 'faker','~> 1.0.1' gem 'faker','~> 1.0.1'
gem 'factory_girl_rails', '~> 1.6.0' gem 'factory_girl_rails', '~> 1.6.0'
end end

222
Gemfile.lock

@ -5,11 +5,10 @@ GIT
validates_hostname (1.0.0) validates_hostname (1.0.0)
GIT GIT
remote: https://github.com/activescaffold/active_scaffold.git remote: https://github.com/delynn/userstamp.git
revision: 0c01d763cfce3f910368491e672e2a7f493d916e revision: 777633aa564f8457c999ddb96afa4c5ae18d319f
specs: specs:
active_scaffold (3.2.12) userstamp (2.0.2)
rails (>= 3.1.3)
GIT GIT
remote: https://github.com/jejacks0n/navigasmic.git remote: https://github.com/jejacks0n/navigasmic.git
@ -20,15 +19,15 @@ GIT
GEM GEM
remote: http://rubygems.org/ remote: http://rubygems.org/
specs: specs:
actionmailer (3.2.6) actionmailer (3.2.8)
actionpack (= 3.2.6) actionpack (= 3.2.8)
mail (~> 2.4.4) mail (~> 2.4.4)
actionpack (3.2.6) actionpack (3.2.8)
activemodel (= 3.2.6) activemodel (= 3.2.8)
activesupport (= 3.2.6) activesupport (= 3.2.8)
builder (~> 3.0.0) builder (~> 3.0.0)
erubis (~> 2.7.0) erubis (~> 2.7.0)
journey (~> 1.0.1) journey (~> 1.0.4)
rack (~> 1.4.0) rack (~> 1.4.0)
rack-cache (~> 1.2) rack-cache (~> 1.2)
rack-test (~> 0.6.1) rack-test (~> 0.6.1)
@ -36,27 +35,30 @@ GEM
active-model-email-validator (1.0.2) active-model-email-validator (1.0.2)
activemodel activemodel
mail mail
activemodel (3.2.6) active_scaffold (3.2.16)
activesupport (= 3.2.6) rails (>= 3.1.3)
activemodel (3.2.8)
activesupport (= 3.2.8)
builder (~> 3.0.0) builder (~> 3.0.0)
activerecord (3.2.6) activerecord (3.2.8)
activemodel (= 3.2.6) activemodel (= 3.2.8)
activesupport (= 3.2.6) activesupport (= 3.2.8)
arel (~> 3.0.2) arel (~> 3.0.2)
tzinfo (~> 0.3.29) tzinfo (~> 0.3.29)
activeresource (3.2.6) activeresource (3.2.8)
activemodel (= 3.2.6) activemodel (= 3.2.8)
activesupport (= 3.2.6) activesupport (= 3.2.8)
activesupport (3.2.6) activesupport (3.2.8)
i18n (~> 0.6) i18n (~> 0.6)
multi_json (~> 1.0) multi_json (~> 1.0)
acts_as_nested_interval (0.0.7) acts_as_nested_interval (0.0.7)
rails (~> 3.2.1) rails (~> 3.2.1)
addressable (2.2.8) addressable (2.3.2)
arel (3.0.2) arel (3.0.2)
bbenezech-nested_form (0.0.6)
bcrypt-ruby (3.0.1) bcrypt-ruby (3.0.1)
bootstrap-sass (2.0.3.1) bootstrap-sass (2.1.0.0)
builder (3.0.0) builder (3.0.3)
cancan (1.6.7) cancan (1.6.7)
capistrano (2.9.0) capistrano (2.9.0)
highline highline
@ -73,9 +75,9 @@ GEM
rack-test (>= 0.5.4) rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0) selenium-webdriver (~> 2.0)
xpath (~> 0.1.4) xpath (~> 0.1.4)
childprocess (0.3.2) childprocess (0.3.5)
ffi (~> 1.0.6) ffi (~> 1.0, >= 1.0.6)
chunky_png (1.2.5) chunky_png (1.2.6)
coffee-rails (3.2.2) coffee-rails (3.2.2)
coffee-script (>= 2.2.0) coffee-script (>= 2.2.0)
railties (~> 3.2.0) railties (~> 3.2.0)
@ -83,12 +85,12 @@ GEM
coffee-script-source coffee-script-source
execjs execjs
coffee-script-source (1.3.3) coffee-script-source (1.3.3)
compass (0.12.1) compass (0.12.2)
chunky_png (~> 1.2) chunky_png (~> 1.2)
fssm (>= 0.2.7) fssm (>= 0.2.7)
sass (~> 3.1) sass (~> 3.1)
compass-rails (1.0.2) compass-rails (1.0.3)
compass (>= 0.12.0, < 0.14) compass (>= 0.12.2, < 0.14)
concerned_with (0.1.0) concerned_with (0.1.0)
daemons (1.0.10) daemons (1.0.10)
dalli (1.1.5) dalli (1.1.5)
@ -111,11 +113,14 @@ GEM
faker (1.0.1) faker (1.0.1)
i18n (~> 0.4) i18n (~> 0.4)
ffi (1.0.11) ffi (1.0.11)
file-tail (1.0.10) file-tail (1.0.11)
tins (~> 0.4.3) tins (~> 0.5.0)
font-awesome-sass-rails (2.0.0.0)
railties (>= 3.1.1)
sass-rails (>= 3.1.1)
fssm (0.2.9) fssm (0.2.9)
gem_plugin (0.2.3) gem_plugin (0.2.3)
guard (1.1.1) guard (1.3.2)
listen (>= 0.4.2) listen (>= 0.4.2)
thor (>= 0.14.6) thor (>= 0.14.6)
guard-rspec (0.6.0) guard-rspec (0.6.0)
@ -123,29 +128,33 @@ GEM
guard-spork (0.5.2) guard-spork (0.5.2)
guard (>= 0.10.0) guard (>= 0.10.0)
spork (>= 0.8.4) spork (>= 0.8.4)
highline (1.6.13) haml (3.1.7)
highline (1.6.14)
hike (1.2.1) hike (1.2.1)
i18n (0.6.0) i18n (0.6.1)
journey (1.0.4) journey (1.0.4)
jquery-rails (2.0.2) jquery-rails (2.1.2)
railties (>= 3.2.0, < 5.0) railties (>= 3.1.0, < 5.0)
thor (~> 0.14) thor (~> 0.14)
json (1.7.3) jquery-ui-rails (1.1.1)
jquery-rails
railties (>= 3.1.0)
json (1.7.5)
kaminari (0.14.1)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
libnotify (0.7.4) libnotify (0.7.4)
ffi (~> 1.0.11) ffi (~> 1.0.11)
libv8 (3.3.10.4) libv8 (3.3.10.4)
libwebsocket (0.1.3) libwebsocket (0.1.5)
addressable addressable
listen (0.4.6) listen (0.5.0)
rb-fchange (~> 0.0.5)
rb-fsevent (~> 0.9.1)
rb-inotify (~> 0.8.8)
mail (2.4.4) mail (2.4.4)
i18n (>= 0.4.0) i18n (>= 0.4.0)
mime-types (~> 1.16) mime-types (~> 1.16)
treetop (~> 1.4.8) treetop (~> 1.4.8)
mail_form (1.3.0) mail_form (1.3.0)
mime-types (1.18) mime-types (1.19)
mongrel (1.2.0.pre2) mongrel (1.2.0.pre2)
daemons (~> 1.0.10) daemons (~> 1.0.10)
gem_plugin (~> 0.2.3) gem_plugin (~> 0.2.3)
@ -161,79 +170,99 @@ GEM
nilify_blanks (1.0.0) nilify_blanks (1.0.0)
activerecord (>= 3.0.0) activerecord (>= 3.0.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
nokogiri (1.5.4) nokogiri (1.5.5)
orm_adapter (0.1.0) orm_adapter (0.4.0)
pjax_rails (0.2.1) pjax_rails (0.2.2)
jquery-rails jquery-rails
polyamorous (0.5.0) polyamorous (0.5.0)
activerecord (~> 3.0) activerecord (~> 3.0)
polyglot (0.3.3) polyglot (0.3.3)
quiet_assets (1.0.1)
railties (~> 3.1)
rack (1.4.1) rack (1.4.1)
rack-cache (1.2) rack-cache (1.2)
rack (>= 0.4) rack (>= 0.4)
rack-pjax (0.6.0)
nokogiri (~> 1.5)
rack (~> 1.3)
rack-ssl (1.3.2) rack-ssl (1.3.2)
rack rack
rack-test (0.6.1) rack-test (0.6.1)
rack (>= 1.0) rack (>= 1.0)
rails (3.2.6) rails (3.2.8)
actionmailer (= 3.2.6) actionmailer (= 3.2.8)
actionpack (= 3.2.6) actionpack (= 3.2.8)
activerecord (= 3.2.6) activerecord (= 3.2.8)
activeresource (= 3.2.6) activeresource (= 3.2.8)
activesupport (= 3.2.6) activesupport (= 3.2.8)
bundler (~> 1.0) bundler (~> 1.0)
railties (= 3.2.6) railties (= 3.2.8)
rails-backbone (0.7.2) rails-backbone (0.7.2)
coffee-script (~> 2.2.0) coffee-script (~> 2.2.0)
ejs (~> 1.0.0) ejs (~> 1.0.0)
railties (>= 3.1.0) railties (>= 3.1.0)
rails-settings-cached (0.2.2)
rails (>= 3.0.0)
rails_admin (0.0.5)
bbenezech-nested_form (~> 0.0.6)
bootstrap-sass (~> 2.0, >= 2.0.3)
builder (~> 3.0)
coffee-rails (~> 3.1)
haml (~> 3.1)
jquery-rails (>= 1.0.17)
jquery-ui-rails (>= 0.5, < 2)
kaminari (~> 0.12)
rack-pjax (~> 0.5)
rails (~> 3.1)
remotipart (~> 1.0)
sass-rails (~> 3.1)
rails_config (0.2.7) rails_config (0.2.7)
activesupport (>= 3.0) activesupport (>= 3.0)
railties (3.2.6) railties (3.2.8)
actionpack (= 3.2.6) actionpack (= 3.2.8)
activesupport (= 3.2.6) activesupport (= 3.2.8)
rack-ssl (~> 1.3.2) rack-ssl (~> 1.3.2)
rake (>= 0.8.7) rake (>= 0.8.7)
rdoc (~> 3.4) rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0) thor (>= 0.14.6, < 2.0)
rake (0.9.2.2) rake (0.9.2.2)
rb-fchange (0.0.5)
ffi
rb-fsevent (0.9.1)
rb-inotify (0.8.8) rb-inotify (0.8.8)
ffi (>= 0.5.0) ffi (>= 0.5.0)
rdoc (3.12) rdoc (3.12)
json (~> 1.4) json (~> 1.4)
rspec (2.8.0) remotipart (1.0.2)
rspec-core (~> 2.8.0) rspec (2.10.0)
rspec-expectations (~> 2.8.0) rspec-core (~> 2.10.0)
rspec-mocks (~> 2.8.0) rspec-expectations (~> 2.10.0)
rspec-core (2.8.0) rspec-mocks (~> 2.10.0)
rspec-expectations (2.8.0) rspec-core (2.10.1)
diff-lcs (~> 1.1.2) rspec-expectations (2.10.0)
rspec-mocks (2.8.0) diff-lcs (~> 1.1.3)
rspec-rails (2.8.1) rspec-mocks (2.10.1)
rspec-rails (2.10.1)
actionpack (>= 3.0) actionpack (>= 3.0)
activesupport (>= 3.0) activesupport (>= 3.0)
railties (>= 3.0) railties (>= 3.0)
rspec (~> 2.8.0) rspec (~> 2.10.0)
ruby2ruby (1.3.1) ruby2ruby (1.3.1)
ruby_parser (~> 2.0) ruby_parser (~> 2.0)
sexp_processor (~> 3.0) sexp_processor (~> 3.0)
ruby_parser (2.3.1) ruby_parser (2.3.1)
sexp_processor (~> 3.0) sexp_processor (~> 3.0)
rubyzip (0.9.9) rubyzip (0.9.9)
sass (3.1.19) sass (3.2.1)
sass-rails (3.2.5) sass-rails (3.2.5)
railties (~> 3.2.0) railties (~> 3.2.0)
sass (>= 3.1.10) sass (>= 3.1.10)
tilt (~> 1.3) tilt (~> 1.3)
selenium-webdriver (2.24.0) seedbank (0.1.3)
selenium-webdriver (2.25.0)
childprocess (>= 0.2.5) childprocess (>= 0.2.5)
libwebsocket (~> 0.1.3) libwebsocket (~> 0.1.3)
multi_json (~> 1.0) multi_json (~> 1.0)
rubyzip rubyzip
sentient_user (0.3.2) sentient_model (1.0.4)
bundler (>= 1.0)
sexp_processor (3.2.0) sexp_processor (3.2.0)
simple_form (2.0.2) simple_form (2.0.2)
actionpack (~> 3.0) actionpack (~> 3.0)
@ -242,36 +271,37 @@ GEM
multi_json (~> 1.0) multi_json (~> 1.0)
simplecov-html (~> 0.5.3) simplecov-html (~> 0.5.3)
simplecov-html (0.5.3) simplecov-html (0.5.3)
sourcify (0.6.0.rc1) sourcify (0.6.0.rc2)
file-tail (>= 1.0.5) file-tail (~> 1.0.10)
ruby2ruby (>= 1.2.5) ruby2ruby (~> 1.3.1)
ruby_parser (>= 2.0.5) ruby_parser (~> 2.3.1)
sexp_processor (>= 3.0.5) sexp_processor (~> 3.2.0)
spork (1.0.0rc3) spork (1.0.0rc3)
sprockets (2.1.3) sprockets (2.1.3)
hike (~> 1.2) hike (~> 1.2)
rack (~> 1.0) rack (~> 1.0)
tilt (~> 1.1, != 1.3.0) tilt (~> 1.1, != 1.3.0)
squeel (1.0.6) squeel (1.0.11)
activerecord (~> 3.0) activerecord (~> 3.0)
activesupport (~> 3.0) activesupport (~> 3.0)
polyamorous (~> 0.5.0) polyamorous (~> 0.5.0)
switch_user (0.6.0) switch_user (0.6.0)
therubyracer (0.10.1) therubyracer (0.10.2)
libv8 (~> 3.3.10) libv8 (~> 3.3.10)
thor (0.15.3) thor (0.16.0)
tilt (1.3.3) tilt (1.3.3)
tins (0.4.3) tins (0.5.4)
treetop (1.4.9) treetop (1.4.10)
polyglot
polyglot (>= 0.3.1) polyglot (>= 0.3.1)
tzinfo (0.3.33) tzinfo (0.3.33)
uglifier (1.2.5) uglifier (1.3.0)
execjs (>= 0.3.0) execjs (>= 0.3.0)
multi_json (~> 1.3) multi_json (~> 1.0, >= 1.0.2)
userstamp_basic (0.1.0)
sentient_user (>= 0.1.0)
warden (1.2.1) warden (1.2.1)
rack (>= 1.0) rack (>= 1.0)
webshims-rails (0.3)
rails (> 3.1.0)
xpath (0.1.4) xpath (0.1.4)
nokogiri (~> 1.3) nokogiri (~> 1.3)
@ -280,21 +310,22 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
active-model-email-validator (~> 1.0.2) active-model-email-validator (~> 1.0.2)
active_scaffold (~> 3.2.12)! active_scaffold (~> 3.2.16)
acts_as_nested_interval (~> 0.0.7) acts_as_nested_interval (~> 0.0.7)
bootstrap-sass (~> 2.0.3) bootstrap-sass (~> 2.1.0.0)
cancan (~> 1.6.7) cancan (= 1.6.7)
capistrano (~> 2.9.0) capistrano (~> 2.9.0)
capistrano-ext (~> 1.2.1) capistrano-ext (~> 1.2.1)
capybara (~> 1.1.1) capybara (~> 1.1.1)
coffee-rails (~> 3.2.1) coffee-rails (~> 3.2.1)
compass-rails (~> 1.0.0.rc.2) compass-rails (~> 1.0.3)
concerned_with (~> 0.1.0) concerned_with (~> 0.1.0)
dalli (~> 1.1.3) dalli (~> 1.1.3)
database_cleaner (~> 0.7.1) database_cleaner (~> 0.7.1)
devise (~> 2.1.0) devise (~> 2.1.0)
factory_girl_rails (~> 1.6.0) factory_girl_rails (~> 1.6.0)
faker (~> 1.0.1) faker (~> 1.0.1)
font-awesome-sass-rails (~> 2.0.0.0)
guard-rspec (~> 0.6.0) guard-rspec (~> 0.6.0)
guard-spork (~> 0.5.1) guard-spork (~> 0.5.1)
jquery-rails jquery-rails
@ -305,13 +336,17 @@ DEPENDENCIES
navigasmic (~> 0.5.6)! navigasmic (~> 0.5.6)!
nilify_blanks (~> 1.0.0) nilify_blanks (~> 1.0.0)
pjax_rails (~> 0.2.0) pjax_rails (~> 0.2.0)
rails (= 3.2.6) quiet_assets (~> 1.0.1)
rails (= 3.2.8)
rails-backbone (~> 0.7.0) rails-backbone (~> 0.7.0)
rails-settings-cached (~> 0.2.2)
rails_admin (~> 0.0.5)
rails_config (~> 0.2.4) rails_config (~> 0.2.4)
rb-inotify (~> 0.8.8) rb-inotify (~> 0.8.8)
rspec-rails (~> 2.8.1) rspec-rails (~> 2.10.1)
sass-rails (~> 3.2.3) sass-rails (~> 3.2.3)
sentient_user (~> 0.3.2) seedbank (~> 0.1.3)
sentient_model (~> 1.0.4)
simple_form (~> 2.0.0) simple_form (~> 2.0.0)
simplecov simplecov
sourcify (~> 0.6.0.rc1) sourcify (~> 0.6.0.rc1)
@ -320,5 +355,6 @@ DEPENDENCIES
switch_user (~> 0.6.0) switch_user (~> 0.6.0)
therubyracer therubyracer
uglifier (>= 1.0.3) uglifier (>= 1.0.3)
userstamp_basic (~> 0.1.0) userstamp (~> 2.0.2)!
validates_hostname (~> 1.0.0)! validates_hostname (~> 1.0.0)!
webshims-rails (~> 0.2)

2
README

@ -5,7 +5,7 @@ A DNS users frontend.
## Initialize for development ## Initialize for development
# create config/database.yml and config/settings.yml from the samples # create config/database.yml and config/settings.yml from the samples
> bundle exec rake db:create db:migrate db:seed db:samples > bundle exec rake db:drop db:create db:migrate db:seed:development
## Tests ## Tests

21
app/assets/javascripts/application.js.coffee

@ -7,25 +7,10 @@
#= require jquery #= require jquery
#= require jquery-ui #= require jquery-ui
#= require jquery_ujs #= require jquery_ujs
## require jquery.pjax #= require jquery.pjax
## require pjax/page_triggers #= require pjax/page_triggers
#= require slides #= require slides
#= require bootstrap #= require bootstrap
#= require active_scaffold #= require active_scaffold
#= require_tree ./components
#= require_self #= require_self
$ ->
$(document).popover(selector: '[rel=popover]')
$(document).tooltip(selector: '[rel=tooltip]')
# pjaxContainer = '[data-pjax-container]'
# $('.pjax-nav a:not([data-remote]):not([data-behavior]):not([data-skip-pjax])').pjax(pjaxContainer)
# $pjaxContainer = $(pjaxContainer)
# $pjaxContainerParent = $(pjaxContainer).parent()
# $pjaxContainer.on 'pjax:success', (event, data, status, xhr, options) ->
# $('.pjax-nav').find('li.active').removeClass 'active'
# $(".pjax-nav a[href=\"#{window.location.pathname}\"]").parents('li').addClass 'active'
# if $pjaxContainer.find('.container').length > 0
# $pjaxContainerParent.removeClass 'container'
# else
# $pjaxContainerParent.addClass 'container'

24
app/assets/javascripts/components/behaviors.js.coffee

@ -0,0 +1,24 @@
$ ->
$(document).popover(selector: '[rel=popover]')
$(document).tooltip(selector: '[rel=tooltip]')
pjaxContainer = '[data-pjax-container]'
$pjaxContainer = $(pjaxContainer)
$pjaxContainerParent = $(pjaxContainer).parent()
$body = $('body')
fixLayout = ->
if $pjaxContainer.find('.container').length > 0
$pjaxContainerParent.removeClass 'container'
else
$pjaxContainerParent.addClass 'container'
if $body.has('.page-home-section').length > 0
$body.addClass('with-home-section')
else
$body.removeClass('with-home-section')
fixLayout()
$('.pjax-nav a:not([data-remote]):not([data-behavior]):not([data-skip-pjax])').pjax(pjaxContainer)
$pjaxContainer.on 'pjax:success', (event, data, status, xhr, options) ->
$('.pjax-nav').find('li.active').removeClass 'active'
$(".pjax-nav a[href=\"#{window.location.pathname}\"]").parents('li').addClass 'active'
fixLayout()

5
app/assets/javascripts/components/webshims.js.coffee

@ -0,0 +1,5 @@
#= require webshims/minified/extras/modernizr-custom
#= require webshims/minified/polyfiller
$.webshims.setOptions('basePath', '/assets/webshims/minified/shims/')
$.webshims.polyfill()

15
app/assets/stylesheets/application.css.scss

@ -3,18 +3,13 @@
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at * 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. * the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*= require theme/logo
*= require theme/layout
*= require pages/domains
*= require pages/home
*= require pages/donate
*= require slides *= require slides
*= require_self
*/ */
@import "bootstrap"; @import "bootstrap-custom";
@import "bootstrap-responsive"; @import "bootstrap-responsive";
@import 'font-awesome';
@import "active_scaffold"; @import "active_scaffold";
@import "theme/overrides"; @import "theme/*";
@import "theme/errors"; @import "pages/*";

64
app/assets/stylesheets/bootstrap-custom.css.scss

@ -0,0 +1,64 @@
//
// Remove icons since we use font-awesome
//
//
// Bootstrap v2.1.0
//
// Copyright 2012 Twitter, Inc
// Licensed under the Apache License v2.0
// http://www.apache.org/licenses/LICENSE-2.0
//
// Designed and built with all the love in the world @twitter by @mdo and @fat.
// Converted to Sass by @thomasmcdonald_, and distributed as bootstrap-sass
// Core variables and mixins
@import "bootstrap/variables"; // Modify this for custom colors, font-sizes, etc
@import "bootstrap/mixins";
// CSS Reset
@import "bootstrap/reset";
// Grid system and page structure
@import "bootstrap/scaffolding";
@import "bootstrap/grid";
@import "bootstrap/layouts";
// Base CSS
@import "bootstrap/type";
@import "bootstrap/code";
@import "bootstrap/forms";
@import "bootstrap/tables";
// Components: common
@import "bootstrap/dropdowns";
@import "bootstrap/wells";
@import "bootstrap/component-animations";
@import "bootstrap/close";
// Components: Buttons & Alerts
@import "bootstrap/buttons";
@import "bootstrap/button-groups";
@import "bootstrap/alerts"; // Note: alerts share common CSS with buttons and thus have styles in _buttons.scss
// Components: Nav
@import "bootstrap/navs";
@import "bootstrap/navbar";
@import "bootstrap/breadcrumbs";
@import "bootstrap/pagination";
@import "bootstrap/pager";
// Components: Popovers
@import "bootstrap/modals";
@import "bootstrap/tooltip";
@import "bootstrap/popovers";
// Components: Misc
@import "bootstrap/thumbnails";
@import "bootstrap/labels-badges";
@import "bootstrap/progress-bars";
@import "bootstrap/accordion";
@import "bootstrap/carousel";
@import "bootstrap/hero-unit";
// Utility classes
@import "bootstrap/utilities"; // Has to be last to override when necessary

21
app/assets/stylesheets/pages/home.css.scss

@ -16,7 +16,7 @@
.page-home-header { .page-home-header {
@include background(image-url("page-home-incentives.png"), @include background(image-url("page-home-incentives.png"),
radial-gradient(color-stops(#fff, #c1f1ff), bottom)); radial-gradient(color-stops(#fff, #c1f1ff), bottom));
border-bottom: 1px solid #B9DCFF; border-bottom: 1px solid #B9DCFF;
.page-header { .page-header {
small { small {
@ -30,7 +30,7 @@
.page-home-incentives { .page-home-incentives {
border-top: 1px solid lighten(#DAFFCD, 5%); border-top: 1px solid lighten(#DAFFCD, 5%);
@include background(image-url("marketing/square_bg.png"), @include background(image-url("marketing/square_bg.png"),
radial-gradient(#fff, darken(#DAFFCD, 10%))); radial-gradient(#fff, darken(#DAFFCD, 10%)));
padding-top: 17px; padding-top: 17px;
padding-bottom: 17px; padding-bottom: 17px;
border-bottom: 1px solid darken(#DAFFCD, 15%); border-bottom: 1px solid darken(#DAFFCD, 15%);
@ -52,3 +52,20 @@
.page-home-extra { .page-home-extra {
padding-top: 17px; padding-top: 17px;
} }
@media (max-width: 767px) {
body.with-home-section {
padding-left: 0px;
padding-right: 0px;
.navbar-fixed-top,
.navbar-fixed-bottom {
margin-left: 0px;
margin-right: 0px;
}
.page-home-section {
padding-left: 20px;
padding-right: 20px;
}
}
}

3
app/assets/stylesheets/theme/logo.css.scss

@ -8,4 +8,7 @@
0 1px 0 rgba(0, 0, 0, 0.6), 0 1px 0 rgba(0, 0, 0, 0.6),
0 0 10px rgba(143, 181, 200, .7) 0 0 10px rgba(143, 181, 200, .7)
); );
&:hover {
color: #53d4ff;
}
} }

11
app/assets/stylesheets/theme/navbar.css.scss

@ -0,0 +1,11 @@
.navbar-inverse .nav {
li.highlight a {
color: darken(yellow, 10%);
&:hover {
color: yellow;
}
}
li.highlight.active a {
color: yellow;
}
}

6
app/assets/stylesheets/theme/overrides.css.scss

@ -10,8 +10,10 @@
padding-top: 2px; padding-top: 2px;
padding-bottom: 1px; padding-bottom: 1px;
} }
input, select, textarea { form.as_form.search {
margin-bottom: 0; input, select, textarea {
margin-bottom: 0;
}
} }
a.as_cancel { a.as_cancel {
vertical-align: middle; vertical-align: middle;

26
app/controllers/application_controller.rb

@ -1,15 +1,9 @@
class ApplicationController < ActionController::Base class ApplicationController < ActionController::Base
before_filter :authenticate_user!
include SentientController
protect_from_forgery protect_from_forgery
before_filter :check_honeypot before_filter :check_honeypot
helper_method :client_remote_ip, :respond_to helper_method :client_remote_ip
layout :scoped_layout
rescue_from CanCan::AccessDenied, ActiveScaffold::ActionNotAllowed do |exception|
flash.now[:error] = exception.message
render_access_denied
end
rescue_from ActiveScaffold::ActionNotAllowed do |exception| rescue_from ActiveScaffold::ActionNotAllowed do |exception|
flash.now[:error] = I18n.t("errors.action_not_allowed") flash.now[:error] = I18n.t("errors.action_not_allowed")
render_access_denied render_access_denied
@ -17,15 +11,17 @@ class ApplicationController < ActionController::Base
protected protected
def scoped_layout
return false if request.xhr?
return 'admin' if devise_controller? && resource_name == :admin
user_signed_in? ? 'users' : 'public'
end
def render_access_denied def render_access_denied
layout = request.xhr? ? false : 'errors' layout = request.xhr? ? false : 'errors'
render :template => 'errors/access_denied', :layout => layout render :template => 'errors/access_denied', :layout => layout
end end
def ensure_nested_under_domain
raise CanCan::AccessDenied, "not found" unless nested? and nested_parent_record.is_a?(Domain)
end
def client_remote_ip def client_remote_ip
@client_remote_ip ||= request.env["HTTP_X_FORWARDED_FOR"] @client_remote_ip ||= request.env["HTTP_X_FORWARDED_FOR"]
end end
@ -39,4 +35,8 @@ class ApplicationController < ActionController::Base
page_path('signed_out') page_path('signed_out')
end end
def current_ability
@current_ability ||= ::UserAbility.new(current_user)
end
end end

0
app/controllers/records_controller_common.rb → app/controllers/concerns/records_controller_common.rb

4
app/controllers/dashboard_controller.rb

@ -1,4 +0,0 @@
class DashboardController < ApplicationController
def index
end
end

11
app/controllers/pages_controller.rb → app/controllers/public/pages_controller.rb

@ -1,9 +1,4 @@
class PagesController < ApplicationController class Public::PagesController < PublicController
skip_before_filter :authenticate_user!
layout proc{|controller|
return false if request.xhr?
user_signed_in? ? 'application' : 'public'
}
rescue_from ActionView::MissingTemplate do |exception| rescue_from ActionView::MissingTemplate do |exception|
if exception.message =~ %r{Missing template pages/} if exception.message =~ %r{Missing template pages/}
@ -36,7 +31,7 @@ class PagesController < ApplicationController
def contact def contact
@contact_form = ContactForm.new(params[:contact_form]) @contact_form = ContactForm.new(params[:contact_form])
if !@contact_form.deliver if !@contact_form.deliver
render :template => 'pages/contact' render :template => 'public/pages/contact'
else else
redirect_to :back, :notice => 'Your notification has been sent!' redirect_to :back, :notice => 'Your notification has been sent!'
end end
@ -45,7 +40,7 @@ class PagesController < ApplicationController
protected protected
def current_page def current_page
@current_page ||= "pages/#{clean_path}" @current_page ||= "public/pages/#{clean_path}"
end end
def clean_path def clean_path

3
app/controllers/public_controller.rb

@ -0,0 +1,3 @@
class PublicController < ApplicationController
layout :scoped_layout
end

2
app/controllers/aaaas_controller.rb → app/controllers/users/aaaas_controller.rb

@ -1,4 +1,4 @@
class AaaasController < ApplicationController class Users::AaaasController < UsersController
active_scaffold :aaaa do |conf| active_scaffold :aaaa do |conf|
conf.columns = [:name, :type, :content, :ttl, :prio, :change_date, :authentication_token] conf.columns = [:name, :type, :content, :ttl, :prio, :change_date, :authentication_token]
conf.create.columns = [:name, :content, :ttl,] conf.create.columns = [:name, :content, :ttl,]

2
app/controllers/as_controller.rb → app/controllers/users/as_controller.rb

@ -1,4 +1,4 @@
class AsController < ApplicationController class Users::AsController < UsersController
active_scaffold :a do |conf| active_scaffold :a do |conf|
conf.columns = [:name, :type, :content, :ttl, :prio, :change_date, :authentication_token] conf.columns = [:name, :type, :content, :ttl, :prio, :change_date, :authentication_token]
conf.create.columns = [:name, :content, :ttl,] conf.create.columns = [:name, :content, :ttl,]

2
app/controllers/cnames_controller.rb → app/controllers/users/cnames_controller.rb

@ -1,4 +1,4 @@
class CnamesController < ApplicationController class Users::CnamesController < UsersController
active_scaffold :cname do |conf| active_scaffold :cname do |conf|
conf.columns = [:name, :type, :content, :ttl, :prio, :change_date, :authentication_token] conf.columns = [:name, :type, :content, :ttl, :prio, :change_date, :authentication_token]
conf.create.columns = [:name, :content, :ttl] conf.create.columns = [:name, :content, :ttl]

2
app/controllers/domains_controller.rb → app/controllers/users/domains_controller.rb

@ -1,4 +1,4 @@
class DomainsController < ApplicationController class Users::DomainsController < UsersController
active_scaffold :domain do |conf| active_scaffold :domain do |conf|
conf.columns = [:name, :ip, :records, :soa_record, :ns_records, :apply_subdomains] conf.columns = [:name, :ip, :records, :soa_record, :ns_records, :apply_subdomains]
conf.list.columns = [:name, :records, :permissions] conf.list.columns = [:name, :records, :permissions]

4
app/controllers/hosts_controller.rb → app/controllers/users/hosts_controller.rb

@ -1,4 +1,4 @@
class HostsController < ApplicationController class Users::HostsController < UsersController
active_scaffold :a do |conf| active_scaffold :a do |conf|
conf.columns = [:name, :host_domain, :content, :ttl, :change_date, :authentication_token] conf.columns = [:name, :host_domain, :content, :ttl, :change_date, :authentication_token]
conf.list.columns = [:name, :content, :ttl, :change_date, :authentication_token] conf.list.columns = [:name, :content, :ttl, :change_date, :authentication_token]
@ -41,7 +41,7 @@ class HostsController < ApplicationController
end end
def beginning_of_chain def beginning_of_chain
super.includes(:domain).where(:domains => {:name => Settings.host_domains}) super.includes(:domain).where(:domains => {:name => Settings.host_domains}).readonly(false)
end end
def before_create_save(record) def before_create_save(record)

2
app/controllers/mxes_controller.rb → app/controllers/users/mxes_controller.rb

@ -1,4 +1,4 @@
class MxesController < ApplicationController class Users::MxesController < UsersController
active_scaffold :mx do |conf| active_scaffold :mx do |conf|
conf.columns = [:name, :type, :content, :ttl, :prio, :change_date, :authentication_token] conf.columns = [:name, :type, :content, :ttl, :prio, :change_date, :authentication_token]
conf.create.columns = [:content, :ttl, :prio] conf.create.columns = [:content, :ttl, :prio]

2
app/controllers/ns_controller.rb → app/controllers/users/ns_controller.rb

@ -1,4 +1,4 @@
class NsController < ApplicationController class Users::NsController < UsersController
active_scaffold :ns do |conf| active_scaffold :ns do |conf|
conf.columns = [:name, :type, :content, :ttl, :prio, :change_date, :authentication_token] conf.columns = [:name, :type, :content, :ttl, :prio, :change_date, :authentication_token]
conf.create.columns = [:name, :content, :ttl] conf.create.columns = [:name, :content, :ttl]

2
app/controllers/permissions_controller.rb → app/controllers/users/permissions_controller.rb

@ -1,4 +1,4 @@
class PermissionsController < ApplicationController class Users::PermissionsController < UsersController
active_scaffold :permission do |conf| active_scaffold :permission do |conf|
conf.actions.exclude :show, :search conf.actions.exclude :show, :search
conf.columns = [:domain, :user, :user_email] conf.columns = [:domain, :user, :user_email]

2
app/controllers/records_controller.rb → app/controllers/users/records_controller.rb

@ -1,4 +1,4 @@
class RecordsController < ApplicationController class Users::RecordsController < UsersController
# override so SOA's cannot be created by themselves # override so SOA's cannot be created by themselves
def self._add_sti_create_links def self._add_sti_create_links
new_action_link = active_scaffold_config.action_links.collection['new'] new_action_link = active_scaffold_config.action_links.collection['new']

2
app/controllers/soas_controller.rb → app/controllers/users/soas_controller.rb

@ -1,4 +1,4 @@
class SoasController < ApplicationController class Users::SoasController < UsersController
active_scaffold :soa do |conf| active_scaffold :soa do |conf|
conf.columns = [:name, :type, :content, :ttl, :prio, :change_date, :authentication_token] conf.columns = [:name, :type, :content, :ttl, :prio, :change_date, :authentication_token]
conf.create.columns = [:contact, :ttl] conf.create.columns = [:contact, :ttl]

2
app/controllers/srvs_controller.rb → app/controllers/users/srvs_controller.rb

@ -1,4 +1,4 @@
class SrvsController < ApplicationController class Users::SrvsController < UsersController
active_scaffold :srv do |conf| active_scaffold :srv do |conf|
conf.columns = [:name, :type, :content, :weight, :port, :host, :ttl, :prio, :change_date, :authentication_token] conf.columns = [:name, :type, :content, :weight, :port, :host, :ttl, :prio, :change_date, :authentication_token]
conf.columns = [:name, :type, :content, :ttl, :prio, :change_date, :authentication_token] conf.columns = [:name, :type, :content, :ttl, :prio, :change_date, :authentication_token]

2
app/controllers/txts_controller.rb → app/controllers/users/txts_controller.rb

@ -1,4 +1,4 @@
class TxtsController < ApplicationController class Users::TxtsController < UsersController
active_scaffold :txt do |conf| active_scaffold :txt do |conf|
conf.columns = [:name, :type, :content, :ttl, :prio, :change_date, :authentication_token] conf.columns = [:name, :type, :content, :ttl, :prio, :change_date, :authentication_token]
conf.create.columns = [:name, :content, :ttl] conf.create.columns = [:name, :content, :ttl]

25
app/controllers/users_controller.rb

@ -0,0 +1,25 @@
class UsersController < ApplicationController
before_filter :authenticate_user!
before_filter :set_stampers
include Userstamp
layout :scoped_layout
rescue_from CanCan::AccessDenied, ActiveScaffold::ActionNotAllowed do |exception|
flash.now[:error] = exception.message
render_access_denied
end
protected
def set_stampers
User.current = current_user
User.stamper = current_user
end
def ensure_nested_under_domain
unless nested? && nested_parent_record.is_a?(Domain)
raise CanCan::AccessDenied, "not found"
end
end
end

2
app/helpers/aaaas_helper.rb

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

2
app/helpers/as_helper.rb

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

2
app/helpers/cnames_helper.rb

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

2
app/helpers/dashboard_helper.rb

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

2
app/helpers/hosts_helper.rb

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

2
app/helpers/mxes_helper.rb

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

2
app/helpers/ns_helper.rb

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

2
app/helpers/pages_helper.rb

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

2
app/helpers/permissions_helper.rb

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

5
app/helpers/public/pages_helper.rb

@ -0,0 +1,5 @@
module Public::PagesHelper
def progress_size(size)
size.to_i <= 10 ? 10 : size
end
end

5
app/helpers/records_helper.rb

@ -1,5 +0,0 @@
module RecordsHelper
def record_authentication_token_column(record)
record.type == 'A' ? record.authentication_token : '-'
end
end

2
app/helpers/soas_helper.rb

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

2
app/helpers/srvs_helper.rb

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

2
app/helpers/txts_helper.rb

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

2
app/helpers/users/aaaas_helper.rb

@ -0,0 +1,2 @@
module Users::AaaasHelper
end

2
app/helpers/users/as_helper.rb

@ -0,0 +1,2 @@
module Users::AsHelper
end

2
app/helpers/users/cnames_helper.rb

@ -0,0 +1,2 @@
module Users::CnamesHelper
end

4
app/helpers/domains_helper.rb → app/helpers/users/domains_helper.rb

@ -1,4 +1,4 @@
module DomainsHelper module Users::DomainsHelper
def domain_list_row_class(record) def domain_list_row_class(record)
cannot?(:crud_permissions, record) ? "shared-domain" : '' cannot?(:crud_permissions, record) ? "shared-domain" : ''
end end
@ -6,7 +6,7 @@ module DomainsHelper
# Indents and dedents to create a tree structure, # Indents and dedents to create a tree structure,
# assuming that the records are sorted in preorder. # assuming that the records are sorted in preorder.
# Adds a visual cue if the record is shared via permissions feature. # Adds a visual cue if the record is shared via permissions feature.
def domain_name_column(record) def domain_name_column(record, column)
elements = [] elements = []
depth = record.depth depth = record.depth
if depth > 1 if depth > 1

2
app/helpers/users/hosts_helper.rb

@ -0,0 +1,2 @@
module Users::HostsHelper
end

2
app/helpers/users/mxes_helper.rb

@ -0,0 +1,2 @@
module Users::MxesHelper
end

2
app/helpers/users/ns_helper.rb

@ -0,0 +1,2 @@
module Users::NsHelper
end

2
app/helpers/users/permissions_helper.rb

@ -0,0 +1,2 @@
module Users::PermissionsHelper
end

5
app/helpers/users/records_helper.rb

@ -0,0 +1,5 @@
module Users::RecordsHelper
def record_authentication_token_column(record, column)
record.type == 'A' ? record.authentication_token : '-'
end
end

2
app/helpers/users/soas_helper.rb

@ -0,0 +1,2 @@
module Users::SoasHelper
end

2
app/helpers/users/srvs_helper.rb

@ -0,0 +1,2 @@
module Users::SrvsHelper
end

2
app/helpers/users/txts_helper.rb

@ -0,0 +1,2 @@
module Users::TxtsHelper
end

2
app/mailers/permission_mailer.rb

@ -1,4 +1,4 @@
class PermissionMailer < ActionMailer::Base class Users::PermissionMailer < ActionMailer::Base
layout "emails" layout "emails"
default from: Settings.support_mail default from: Settings.support_mail

11
app/models/admin.rb

@ -0,0 +1,11 @@
class Admin < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me
# attr_accessible :title, :body
end

2
app/models/domain.rb

@ -1,5 +1,5 @@
class Domain < ActiveRecord::Base class Domain < ActiveRecord::Base
self.inheritance_column = "sti_disabled" self.inheritance_column = :sti_disabled
nilify_blanks nilify_blanks
stampable stampable

2
app/models/domain/tree_structure.rb

@ -29,7 +29,7 @@ class Domain < ActiveRecord::Base
# If current user not present, just allow (rake tasks etc) # If current user not present, just allow (rake tasks etc)
def can_be_managed_by_current_user? def can_be_managed_by_current_user?
return true if User.current.nil? return true if User.current.nil?
Ability::CRUD.all?{|operation| User.current.can?(operation, self)} UserAbility::CRUD.all?{|operation| User.current.can?(operation, self)}
end end
# Returns the first immediate parent, if exists (and caches the search) # Returns the first immediate parent, if exists (and caches the search)

6
app/models/permission.rb

@ -18,13 +18,13 @@ class Permission < ActiveRecord::Base
end end
after_create do after_create do
PermissionMailer.created(self).deliver Users::PermissionMailer.created(self).deliver
end end
after_update do after_update do
PermissionMailer.created(self).deliver if user_id_changed? Users::PermissionMailer.created(self).deliver if user_id_changed?
end end
after_destroy do after_destroy do
PermissionMailer.destroyed(self).deliver Users::PermissionMailer.destroyed(self).deliver
end end
def user_email def user_email

3
app/models/setting.rb

@ -0,0 +1,3 @@
class Setting < RailsSettings::CachedSettings
attr_accessible :var, :value
end

13
app/models/user.rb

@ -1,5 +1,6 @@
class User < ActiveRecord::Base class User < ActiveRecord::Base
include SentientUser include SentientModel
model_stamper
stampable stampable
# Include default devise modules. Others available are: # Include default devise modules. Others available are:
@ -42,10 +43,18 @@ class User < ActiveRecord::Base
options[:reload] ? _ability : (@ability ||= _ability) options[:reload] ? _ability : (@ability ||= _ability)
end end
def self.do_as(user)
self.current = user
self.stamper = user
yield
self.current = nil
self.reset_stamper
end
protected protected
def _ability def _ability
Ability.new(self) UserAbility.new(self)
end end
end end

2
app/models/ability.rb → app/models/user_ability.rb

@ -1,4 +1,4 @@
class Ability class UserAbility
CRUD = [:read, :create, :update, :destroy] CRUD = [:read, :create, :update, :destroy]
include CanCan::Ability include CanCan::Ability

1
app/views/dashboard/index.html.erb

@ -1 +0,0 @@
Some dashboard here

31
app/views/layouts/admin.html.erb

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><%= content_for?(:title) ? yield(:title) : "EntryDNS" %></title>
<%= stylesheet_link_tag "application" %>
<!--[if lte IE 8]>
<%= stylesheet_link_tag "application-ie", :media => "all" %>
<![endif]-->
<%= javascript_include_tag "application" %>
<%= csrf_meta_tag %>
</head>
<body class="users">
<div class="container" id="main">
<div data-pjax-container="true">
<%= flash_display 'flash' %>
<%= yield %>
</div>
</div>
<div class="container">
<%= render 'shared/bottom' %>
</div>
</body>
</html>

2
app/views/layouts/errors.html.erb

@ -12,7 +12,7 @@
<%= csrf_meta_tag %> <%= csrf_meta_tag %>
</head> </head>
<body class="errors"> <body class="errors">
<%= render 'shared/top' %> <%= render 'shared/public_top' %>
<div class="container" id="main"> <div class="container" id="main">
<div data-pjax-container="true"> <div data-pjax-container="true">

4
app/views/layouts/home.html.erb

@ -1,6 +1,6 @@
<%= render 'shared/public_top' %> <%= render 'shared/public_top' %>
<body class="public"> <body class="public with-home-section">
<%= render 'shared/navigation' %> <%= render 'shared/navigation' %>
<div id="main"> <div id="main">
@ -14,4 +14,4 @@
<%= render 'shared/bottom' %> <%= render 'shared/bottom' %>
</div> </div>
</body> </body>
</html> </html>

7
app/views/layouts/application.html.erb → app/views/layouts/users.html.erb

@ -8,11 +8,14 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><%= content_for?(:title) ? yield(:title) : "EntryDNS" %></title> <title><%= content_for?(:title) ? yield(:title) : "EntryDNS" %></title>
<%= stylesheet_link_tag "application" %> <%= stylesheet_link_tag "application" %>
<!--[if lte IE 8]>
<%= stylesheet_link_tag "application-ie", :media => "all" %>
<![endif]-->
<%= javascript_include_tag "application" %> <%= javascript_include_tag "application" %>
<%= csrf_meta_tag %> <%= csrf_meta_tag %>
</head> </head>
<body class="application"> <body class="users">
<%= render 'shared/navigation' %> <%= render 'shared/navigation' %>
<div class="container" id="main"> <div class="container" id="main">

2
app/views/pages/about.html.erb → app/views/public/pages/about.html.erb

@ -20,7 +20,7 @@
<h4>How can you benefit from this</h4> <h4>How can you benefit from this</h4>
<%= render 'pages/shared/benefits' %> <%= render 'public/pages/shared/benefits' %>
<p> <p>
We are open to new ideas or suggestions how to make the service better for you to use. We are open to new ideas or suggestions how to make the service better for you to use.

2
app/views/pages/contact.html.erb → app/views/public/pages/contact.html.erb

@ -7,5 +7,5 @@
or you can contact us using the form below: or you can contact us using the form below:
</p> </p>
<%= render :partial => 'pages/contact/form' %> <%= render :partial => 'public/pages/contact/form' %>

0
app/views/pages/contact/_form.html.erb → app/views/public/pages/contact/_form.html.erb

7
app/views/pages/donate.html.erb → app/views/public/pages/donate.html.erb

@ -3,6 +3,13 @@
<small>How do I contribute?</small> <small>How do I contribute?</small>
</div> </div>
<div class="progress progress-striped">
<% size = Setting['public.donations.progress'] %>
<div class="bar" style="width: <%= progress_size(size) %>%;">
<%= size -%>% Progress
</div>
</div>
<p> <p>
EntryDNS is a free service for everyone, but contribution is more than welcome. EntryDNS is a free service for everyone, but contribution is more than welcome.
Like every service, it needs some hardware to run on, requires network bandwidth and maintenance. Like every service, it needs some hardware to run on, requires network bandwidth and maintenance.

0
app/views/pages/help.html.erb → app/views/public/pages/help.html.erb

10
app/views/pages/home.html.erb → app/views/public/pages/home.html.erb

@ -25,11 +25,11 @@
<div class="row"> <div class="row">
<div class="span5"> <div class="span5">
<%= render 'pages/home/headlines' %> <%= render 'public/pages/home/headlines' %>
<%= render 'pages/shared/action' %> <%= render 'public/pages/shared/action' %>
</div> </div>
<div class="span7"> <div class="span7">
<%= render 'pages/home/slides' %> <%= render 'public/pages/home/slides' %>
</div> </div>
</div> </div>
@ -59,7 +59,7 @@
<div class="span6"> <div class="span6">
<h3>Benefits</h3> <h3>Benefits</h3>
<%= render 'pages/shared/benefits' %> <%= render 'public/pages/shared/benefits' %>
<%= link_to new_user_registration_path do %> <%= link_to new_user_registration_path do %>
<i class="icon-arrow-right"></i> <i class="icon-arrow-right"></i>
<strong>Create an Account Now</strong> <strong>Create an Account Now</strong>
@ -67,7 +67,7 @@
</div> </div>
<div class="span6"> <div class="span6">
<h3>Features</h3> <h3>Features</h3>
<%= render 'pages/shared/features' %> <%= render 'public/pages/shared/features' %>
</div> </div>
</div> </div>

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

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

0
app/views/pages/privacy.html.erb → app/views/public/pages/privacy.html.erb

0
app/views/pages/shared/_action.html.erb → app/views/public/pages/shared/_action.html.erb

0
app/views/pages/shared/_benefits.html.erb → app/views/public/pages/shared/_benefits.html.erb

0
app/views/pages/shared/_features.html.erb → app/views/public/pages/shared/_features.html.erb

0
app/views/pages/signed_out.html.erb → app/views/public/pages/signed_out.html.erb

4
app/views/pages/team.html.erb → app/views/public/pages/team.html.erb

@ -4,9 +4,9 @@
<div class="row"> <div class="row">
<div class="span6"> <div class="span6">
<%= render :partial => 'pages/team/zooz' %> <%= render :partial => 'public/pages/team/zooz' %>
</div> </div>
<div class="span6"> <div class="span6">
<%= render :partial => 'pages/team/clyfe' %> <%= render :partial => 'public/pages/team/clyfe' %>
</div> </div>
</div> </div>

0
app/views/pages/team/_clyfe.html.erb → app/views/public/pages/team/_clyfe.html.erb

0
app/views/pages/team/_zooz.html.erb → app/views/public/pages/team/_zooz.html.erb

0
app/views/pages/terms.html.erb → app/views/public/pages/terms.html.erb

4
app/views/shared/_navigation.html.erb

@ -1,4 +1,4 @@
<div class="navbar navbar-fixed-top"> <div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner"> <div class="navbar-inner">
<div class="container pjax-nav"> <div class="container pjax-nav">
@ -12,7 +12,7 @@
<div class="nav-collapse"> <div class="nav-collapse">
<% if user_signed_in? %> <% if user_signed_in? %>
<%= render 'shared/navigation/application' %> <%= render 'shared/navigation/users' %>
<% else %> <% else %>
<%= render 'shared/navigation/public' %> <%= render 'shared/navigation/public' %>
<% end %> <% end %>

6
app/views/shared/_public_top.html.erb

@ -3,6 +3,7 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><%= content_for?(:title) ? yield(:title) : "EntryDNS free DNS service and dynamic DNS" %></title> <title><%= content_for?(:title) ? yield(:title) : "EntryDNS free DNS service and dynamic DNS" %></title>
@ -11,7 +12,10 @@
<meta name="keywords" content="<%= content_for?(:keywords) ? yield(:keywords) : "DNS, free, service, dynamic, management, hosting" %>" /> <meta name="keywords" content="<%= content_for?(:keywords) ? yield(:keywords) : "DNS, free, service, dynamic, management, hosting" %>" />
<meta name="author" content="EntryDNS Team" /> <meta name="author" content="EntryDNS Team" />
<%= stylesheet_link_tag "application" %> <%= stylesheet_link_tag "application" %>
<!--[if lte IE 8]>
<%= stylesheet_link_tag "application-ie", :media => "all" %>
<![endif]-->
<%= javascript_include_tag "application" %> <%= javascript_include_tag "application" %>
<%= csrf_meta_tag %> <%= csrf_meta_tag %>
</head> </head>

1
app/views/shared/navigation/_application.html.erb → app/views/shared/navigation/_users.html.erb

@ -1,5 +1,4 @@
<% semantic_navigation :application_nav, html: { class: 'nav' } do |n| %> <% semantic_navigation :application_nav, html: { class: 'nav' } do |n| %>
<%#= link_to('Dashboard', dashboard_path, :data => {:pjax => '#main'}) %>
<%= n.item '', link: domains_path do %> <%= n.item '', link: domains_path do %>
<i class="icon-white icon-th-list"></i> My Domains <i class="icon-white icon-th-list"></i> My Domains
<% end %> <% end %>

0
app/views/as/_list_record.html.erb → app/views/users/as/_list_record.html.erb

0
app/views/as/on_action_update.js.erb → app/views/users/as/on_action_update.js.erb

2
app/views/devise/confirmations/new.html.erb → app/views/users/confirmations/new.html.erb

@ -1,4 +1,4 @@
<%= render :partial => "devise/shared/links" %> <%= render :partial => "users/shared/links" %>
<%= simple_form_for(resource, <%= simple_form_for(resource,
as: resource_name, as: resource_name,

0
app/views/domains/_form_association_footer.html.erb → app/views/users/domains/_form_association_footer.html.erb

0
app/views/domains/_horizontal_subform_record.html.erb → app/views/users/domains/_horizontal_subform_record.html.erb

0
app/views/domains/_list_record_columns.html.erb → app/views/users/domains/_list_record_columns.html.erb

0
app/views/devise/mailer/confirmation_instructions.html.erb → app/views/users/mailer/confirmation_instructions.html.erb

0
app/views/devise/mailer/reset_password_instructions.html.erb → app/views/users/mailer/reset_password_instructions.html.erb

0
app/views/devise/mailer/unlock_instructions.html.erb → app/views/users/mailer/unlock_instructions.html.erb

4
app/views/ns/destroy.js.erb → app/views/users/ns/destroy.js.erb

@ -1,5 +1,5 @@
<%# show errors in nested %> <%# show errors in nested %>
<% messages_id ||= nested? ? "as_domains-#{nested.parent_id}-records-messages" : active_scaffold_messages_id -%> <% messages_id ||= nested? ? "as_users__domains-#{nested.parent_id}-users__records-messages" : active_scaffold_messages_id -%>
<% if controller.send(:successful?) %> <% if controller.send(:successful?) %>
<% if render_parent? %> <% if render_parent? %>
@ -19,7 +19,7 @@
<% elsif (active_scaffold_config.delete.refresh_list) %> <% elsif (active_scaffold_config.delete.refresh_list) %>
<%= render :partial => 'refresh_list' %> <%= render :partial => 'refresh_list' %>
<% else %> <% else %>
<% row_id = "as_domains-#{nested.parent_id}-records-list-#{params[:id]}-row" %> <% row_id = "as_users__domains-#{nested.parent_id}-users__records-list-#{params[:id]}-row" %>
ActiveScaffold.delete_record_row('<%= row_id %>', '<%= url_for(params_for(:action => :index, :id => nil, :page => [active_scaffold_config.list.user.page.to_i - 1, 1].max)) %>'); ActiveScaffold.delete_record_row('<%= row_id %>', '<%= url_for(params_for(:action => :index, :id => nil, :page => [active_scaffold_config.list.user.page.to_i - 1, 1].max)) %>');
<%= render :partial => 'update_calculations', :formats => [:js] %> <%= render :partial => 'update_calculations', :formats => [:js] %>
<% end %> <% end %>

2
app/views/devise/passwords/edit.html.erb → app/views/users/passwords/edit.html.erb

@ -21,4 +21,4 @@
</div> </div>
<% end %> <% end %>
<%= render :partial => "devise/shared/links" %> <%= render :partial => "users/shared/links" %>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save