From 0345f80786d063f331c346108c9131222e4c9616 Mon Sep 17 00:00:00 2001 From: Nicolae Claudius Date: Sun, 2 Oct 2011 10:17:23 -0700 Subject: [PATCH] updates --- app/assets/images/arrow.png | Bin 0 -> 349 bytes app/assets/images/bgd.jpg | Bin 0 -> 1979 bytes app/assets/images/boxbar-background.png | Bin 0 -> 6112 bytes .../images/button-background-active.png | Bin 0 -> 6105 bytes app/assets/images/button-background.png | Bin 0 -> 6130 bytes app/assets/images/messages/error.png | Bin 0 -> 454 bytes app/assets/images/messages/notice.png | Bin 0 -> 604 bytes app/assets/images/messages/warning.png | Bin 0 -> 404 bytes app/assets/stylesheets/application.css | 2 +- app/assets/stylesheets/marketing.css.scss | 1 + app/assets/stylesheets/theme/default.css | 438 ++++++++++++++++++ app/controllers/application_controller.rb | 5 + app/controllers/domains_controller.rb | 4 + app/controllers/mxes_controller.rb | 43 ++ app/controllers/ns_controller.rb | 10 +- app/controllers/records_controller.rb | 29 +- app/controllers/soas_controller.rb | 9 +- app/helpers/application_helper.rb | 5 + app/helpers/mxes_helper.rb | 2 + app/models/domain.rb | 14 +- app/models/mx.rb | 13 +- app/models/ns.rb | 2 + app/models/record.rb | 3 + app/models/soa.rb | 2 +- app/views/fragments/_top.html.erb | 2 +- app/views/layouts/application.html.erb | 2 +- app/views/layouts/errors.html.erb | 2 +- app/views/layouts/marketing.html.erb | 2 +- .../records/_list_record_columns.html.erb | 13 - config/routes.rb | 4 + config/settings.yml | 3 +- spec/controllers/mxes_controller_spec.rb | 157 +++++++ spec/helpers/mxes_helper_spec.rb | 15 + spec/requests/mxes_spec.rb | 11 + spec/routing/mxes_routing_spec.rb | 35 ++ spec/views/mxes/edit.html.erb_spec.rb | 15 + spec/views/mxes/index.html.erb_spec.rb | 14 + spec/views/mxes/new.html.erb_spec.rb | 15 + spec/views/mxes/show.html.erb_spec.rb | 11 + 39 files changed, 824 insertions(+), 59 deletions(-) create mode 100644 app/assets/images/arrow.png create mode 100644 app/assets/images/bgd.jpg create mode 100644 app/assets/images/boxbar-background.png create mode 100644 app/assets/images/button-background-active.png create mode 100644 app/assets/images/button-background.png create mode 100644 app/assets/images/messages/error.png create mode 100644 app/assets/images/messages/notice.png create mode 100644 app/assets/images/messages/warning.png create mode 100644 app/assets/stylesheets/theme/default.css create mode 100644 app/controllers/mxes_controller.rb create mode 100644 app/helpers/mxes_helper.rb delete mode 100644 app/views/records/_list_record_columns.html.erb create mode 100644 spec/controllers/mxes_controller_spec.rb create mode 100644 spec/helpers/mxes_helper_spec.rb create mode 100644 spec/requests/mxes_spec.rb create mode 100644 spec/routing/mxes_routing_spec.rb create mode 100644 spec/views/mxes/edit.html.erb_spec.rb create mode 100644 spec/views/mxes/index.html.erb_spec.rb create mode 100644 spec/views/mxes/new.html.erb_spec.rb create mode 100644 spec/views/mxes/show.html.erb_spec.rb diff --git a/app/assets/images/arrow.png b/app/assets/images/arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..d5c4235d6efbeae7265ec67dcbb5f6daacf63677 GIT binary patch literal 349 zcmV-j0iyniP)({S7m^_L?MMXtDAo!}P zs``KW^yxq~|91j02Zmy4X=x`-P0eR2Dk}fm+S*_WQ4E7~)YaAB0yX@1a&r3r_U+r# zFw>A}xZ;Bc5B@PXH~%jsCG{VuaT>BB7#pq_C{TRz}6v1d@ z#UOU-rcImvft>ppcB+5(N@DSM2 zECwYM?HaIX5v(0SD$r>wh$iA9SfHX{dB`KBfIKBM1>iaFGZE zlt?C#$ws4?m{KVenhBXqHK)={&2Uku7Ibqny3sc-Vob-gh$u=lqmU`ai2qGkBcPLk z7>E(b0l;(!p+ndmz{EKTc;Aez`&|%>padcbuZfBWd}9G%2ti;J!Ry732|9_-1C&m% zwC8OluG)2gf97nFy7;q_bLYP( zzjXP_iYt{>H8*O%xmj1=@a^s9J9o9ZdoA}nI=g;))cyEL&)~D6;gM1OFJr$>8(z-L z&b^vnSTu6s{rL^+E!m&A=r|XQq6kVdazSu1ZU`ME*z<^%TX&HTNLM+yW|FP86<(}v zqOjdUr>qakel%I_=sxH)ZA4ok`|rTA{x7n(V1ID+02%_}%|qxw2$rm(Z(sNdo@q*# zkGIS{aG27`M(R#JODnAyD(qei^gEjul;P%B3B=;jUN}pjPonMMQ ze2U*QB;;;XosjlgJ!qN_>-ma=&e|$`O4a-Z)7<0sdos_C^ji6>q8mqeGl zom>Qh0nc=rLQ@NduAeE_WS<`7-}O8J0{&vH&wi|M;UdR^M0>*`p6|~yRKSnJ!br-I zAO*7U5TUM)ZB=**QwrWppO63gU=qz58nz=(E(zPMJxq#af0z6u6SiZZszl5?b>Chu z)h*!X@er=EkEl;-X)|Y?P?YZ5u%-G2v#4fnm}}Rsf0PeW`Yvb(|26XMRPf-#QPpSB zg!a}`tMwT!{5R7kaz-O$bZL>s~j9l{w`r!~CJ=!wf*)Lp5=z`Wr1gJ7wf^7!~d=o!1P z$hB-n3_|L4|M^M!l|E0YmOQTM>(|$o4HVShqq!!^l^FiRjl84Otv#2!ovvBX8GQO` zE9^x&uZAu1{tEqAV1IQ)#?@lhOfpof&lxaJ(2Gn7@MuKN#EDW#>B|S! zo~^AO3z;5M00Y9|T_Sp&rLz@*s;dh)YGRkMe3Wq#YVh z61Cy;#DT<=7Yk`2aFn63*yeCI? zUQ;A?qXUA$L%w{7csDz3zeOo4fpE0 z!ts`CdGlRY>$7v&Uy>PY)_HE3Nz?U!V!85A=gs(ZwQmpcUYl8(#&;eAi@$u4!RUx2 zdgXE0Ukh{w_s?}Dn{y?FS&EPMamz^0*YmPOriRz+@~zKZ{8_6-kdAyVbftaxX5*(X RRb+;@rSP)VE)f%Z@*lbX_z(a9 literal 0 HcmV?d00001 diff --git a/app/assets/images/boxbar-background.png b/app/assets/images/boxbar-background.png new file mode 100644 index 0000000000000000000000000000000000000000..7a9986ac56cd1acac14680674f3f206b3cfd1d32 GIT binary patch literal 6112 zcmV<67a!<}P)4Tx0C)k_S!GyN&$pg^`W(7L;?PJ)w{(YqNJ|~M8w5m3L+Zd!PI5e!25JXY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(^8NFF#DOpd&aW4AAE3VY+Q5VRf0q9OiR+cKOKJ`%00009a7bBm000XU z000XU0RWnu7ytkOFG)l}R0thoxOC|f6Aup$6C)!d7&8F@j18jE`5-X{1_rPi5RD7} f`}Ys091cAIAX)|k9v)ce00000NkvXXu0mjfV?Fk$ literal 0 HcmV?d00001 diff --git a/app/assets/images/button-background.png b/app/assets/images/button-background.png new file mode 100644 index 0000000000000000000000000000000000000000..d19090c434f8d50d014ed49b992b6dc1edfef750 GIT binary patch literal 6130 zcmV4Tx0C)k_S!GyN&$pg^`W(7L;?PJ)w{(YqNJ|~M8w5m3L+Zd!PI5e!25JXYY5e(O;qprKKo{2UP0j45z=7Gr zt(mgZ9x?xGw?7Ruu5KYN06?bjqqA#>iyw>|06_4%1O|r!fEi2V{WDi%X|j_M@}LIdjLRzg6oOlE*`KR3SIy(wEnJM{s7R) z!&t?|ljI5jO9U(<;^!A|fXiSk==>jgJpKcdNY4N0B#}J+!GGQb?gON#vc z@PB#n^9_U7>vy4nujKx|#s{`xgnyH+BrQYu&IbQB1ATwnj22!`N;iLt6L8%DCi(;z zn!%VH#**&AItLi;3#kN#nwtNG&7(XujsKGIb_>z|yKlHR$>6|Fl(77T;4m`_7{hA` z<%EQv(1tPWMNn&$r@7T%GEZIIwEnIiclXlK|4U}kD^&krEP7b}dtj)>!5o-jo09`W z;0xS97zl>1{y-EM0ZpLw*Hsj_0}|X44!4B>AMg>zesGTfxK99#iGRsy{`Z=pmFAUy zTK{My0vA{+?4Qy8t|h^82mKGm4{`KL_*d)S5(oW$k0)Lwz9jzhZ@nmflq5<9rGZjL zsh|`95ygmN1)?ZvlsrlurHWF5+Z2Ef_yBA6`1`#M^!wGhhvx=FDq4ENtp{)C{C6v` z{4MSE&-4G70r2|kjsMK~&nkEUR}c{D76JP?0Ga`Tk-=Ubo}ol_cxSqa5cU0Cj))K? z#U&&Tn*ZOFgKyHG$$l~W{jGr*pZ{AI+ycN+W%ygM^>3XMD**NB0MPjTTgQupT~r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Wxd65{IOUp9_Wd`G634l=krL{^&!85 z-EN1!%?*_)VQZRpdn)>MHS{hpj^j*#A@7PyWSh-q>UrL*Uax1!MB*5TL{Suu$Kwew wilTIpy9r=J!2u$^%}1~4z)a+IHqmGuD7i5x)80KvUeLS(P_85pp zmjm(NynV+7w8Vnx-`_tB*sz4C$aiOZt5x^!KirH>9wY_?;w=AwreOpB{(%*|x^wTI z024C{HYH#&mj8eMJ^+Tj0!|e`38-x-N<@T(zJUao{{H>70h<#+{se)4f3SPe!o=VO zQ2Hek!`D9z%*;&RKwd${A3uEpyZhgNP~t+B<6vj|U0YUg3uwRza8fp~bPD_M@zY9> zjl_VC#_H1%p@DaSYLmf9`NHvit6ZJz%GlXhfByxBE-nm`Z)>OmX?_XRJOPNm!7~%c z=JV$-InP|MXxfRBXJnx93=(Dl1(=PM#fzqz@>@bef**iFAk8O1awrCX1b_gPK%#)y q0*J+d7zRMLo&e%yKn#unkOTnY9FkB9^Pmp^00000XbOJV-*A{)`w_EkbQl9$)p;xAEbTDmMtqm7{q?^ z|y6NIuNW%u?`xB7p(Spw9rjbLY@s<1Nbo0000 'errors/access_denied', :layout => 'errors' end + protected + + def ensure_nested_under_domain + raise CanCan::AccessDenied, "not found" unless nested? and nested_parent_record.is_a?(Domain) + end end diff --git a/app/controllers/domains_controller.rb b/app/controllers/domains_controller.rb index 262debc..2ec5238 100644 --- a/app/controllers/domains_controller.rb +++ b/app/controllers/domains_controller.rb @@ -5,8 +5,11 @@ class DomainsController < ApplicationController conf.list.columns = [:name, :soa_record, :ns_records, :records] conf.create.columns = [:name, :soa_record, :ns_records] conf.update.columns = [:name, :soa_record, :ns_records] + conf.columns[:name].description = 'yourdomain.com' + conf.columns[:ns_records].show_blank_record = false conf.actions.exclude :show conf.list.sorting = { :name => :asc } + conf.create.link.label = "Add Domain" conf.columns[:records].label = 'All Records' end @@ -25,6 +28,7 @@ class DomainsController < ApplicationController def after_create_save(record) session[:sample_ns] = nil + @record.reload end def sample_ns diff --git a/app/controllers/mxes_controller.rb b/app/controllers/mxes_controller.rb new file mode 100644 index 0000000..73e2d7a --- /dev/null +++ b/app/controllers/mxes_controller.rb @@ -0,0 +1,43 @@ +class MxesController < ApplicationController + active_scaffold :mx do |conf| + conf.list.columns = [:name, :type, :content, :ttl, :prio, :change_date] + conf.create.columns = [:name, :content, :ttl, :prio] + conf.update.columns = [:name, :content, :ttl, :prio] + conf.columns[:content].label = 'MX' + conf.columns[:name].description = 'Ex: mail or mx etc' + conf.columns[:change_date].list_ui = :timestamp + conf.actions.exclude :show + end + before_filter :ensure_nested_under_domain + + protected + + def do_new + super + @record.prio ||= begin + maximum = nested_parent_record.mx_records.maximum(:prio) + maximum.nil? ? Settings.default_prio : maximum + 10 + end + end + + # override to use :mx_records instead of :records assoc + def beginning_of_chain + if nested? && nested.association && nested.association.collection? && nested.association.name == :records + nested.parent_scope.mx_records + else + super + end + end + + # override, we make our own sti logic + def new_model + model = beginning_of_chain + model.new + end + + # override to close create form after success + def render_parent? + nested_singular_association? # || params[:parent_sti] + end + +end diff --git a/app/controllers/ns_controller.rb b/app/controllers/ns_controller.rb index 2ee841c..57e9911 100644 --- a/app/controllers/ns_controller.rb +++ b/app/controllers/ns_controller.rb @@ -1,15 +1,11 @@ class NsController < ApplicationController active_scaffold :ns do |conf| - conf.columns = [:name, :content, :ttl] + conf.list.columns = [:name, :type, :content, :ttl, :prio, :change_date] conf.create.columns = [:content, :ttl] conf.update.columns = [:content, :ttl] conf.columns[:content].label = 'NS' + conf.columns[:change_date].list_ui = :timestamp conf.actions.exclude :show end - - protected - - def beginning_of_chain - super.readonly(false) - end + before_filter :ensure_nested_under_domain end diff --git a/app/controllers/records_controller.rb b/app/controllers/records_controller.rb index 3ffd764..6347416 100644 --- a/app/controllers/records_controller.rb +++ b/app/controllers/records_controller.rb @@ -1,18 +1,25 @@ class RecordsController < ApplicationController + # override so SOA's cannot be created by themselves + def self._add_sti_create_links + new_action_link = active_scaffold_config.action_links.collection['new'] + unless new_action_link.nil? || active_scaffold_config.sti_children.empty? + active_scaffold_config.action_links.collection.delete('new') + sti_children = active_scaffold_config.sti_children - [:SOA] + sti_children.each do |child| + new_sti_link = Marshal.load(Marshal.dump(new_action_link)) # deep clone + new_sti_link.label = child.to_s.camelize.constantize.model_name.human + new_sti_link.parameters = {:parent_sti => controller_path} + new_sti_link.controller = Proc.new { active_scaffold_controller_for(child.to_s.camelize.constantize).controller_path } + active_scaffold_config.action_links.collection.create.add(new_sti_link) + end + end + end + active_scaffold :record do |conf| - conf.sti_children = [:SOA, :NS] + conf.sti_children = [:SOA, :NS, :MX] conf.columns = [:name, :type, :content, :ttl, :prio, :change_date] + conf.columns[:change_date].list_ui = :timestamp conf.actions.exclude :show end before_filter :ensure_nested_under_domain - - protected - - def beginning_of_chain - super.readonly(false) - end - - def ensure_nested_under_domain - raise CanCan::AccessDenied, "not found" unless nested? and nested_parent_record.is_a?(Domain) - end end diff --git a/app/controllers/soas_controller.rb b/app/controllers/soas_controller.rb index 36e3c47..d0c2a47 100644 --- a/app/controllers/soas_controller.rb +++ b/app/controllers/soas_controller.rb @@ -1,14 +1,9 @@ class SoasController < ApplicationController active_scaffold :soa do |conf| - conf.columns = [:name, :primary_ns, :contact, :ttl] + conf.list.columns = [:name, :type, :content, :ttl, :prio, :change_date] conf.create.columns = [:contact, :ttl] conf.update.columns = [:contact, :ttl] + conf.columns[:change_date].list_ui = :timestamp conf.actions.exclude :delete, :show end - - protected - - def beginning_of_chain - super.readonly(false) - end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index bd17d72..eb2f86a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -14,4 +14,9 @@ module ApplicationHelper end end + def active_scaffold_column_timestamp(column, record) + value = record.send(column.name) + value.nil? ? nil : Time.at(value) + end + end diff --git a/app/helpers/mxes_helper.rb b/app/helpers/mxes_helper.rb new file mode 100644 index 0000000..daefa67 --- /dev/null +++ b/app/helpers/mxes_helper.rb @@ -0,0 +1,2 @@ +module MxesHelper +end \ No newline at end of file diff --git a/app/models/domain.rb b/app/models/domain.rb index 24f4c4d..c3b7abf 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -30,19 +30,13 @@ class Domain < ActiveRecord::Base def setup(email, sample_ns) build_soa_record + soa = soa_record + soa.contact ||= email + ns_records.build - ns_records.build - + ns_records.build ns1, ns2 = ns_records - soa = soa_record - ns1.content = sample_ns.first - ns1.ttl ||= Settings.default_ttl - ns2.content = sample_ns.second - ns2.ttl ||= Settings.default_ttl - - soa.contact ||= email - soa.ttl ||= Settings.default_ttl end end diff --git a/app/models/mx.rb b/app/models/mx.rb index 611f562..7606bf4 100644 --- a/app/models/mx.rb +++ b/app/models/mx.rb @@ -7,9 +7,14 @@ # Obtained from http://www.zytrax.com/books/dns/ch8/mx.html # class MX < Record - validates :prio, - :numericality => {:greater_than_or_equal_to => 0, :less_than_or_equal_to => 65535, :only_integer => true} + validates :prio, :numericality => { + :greater_than_or_equal_to => 0, + :less_than_or_equal_to => 65535, + :only_integer => true + } validates :content, :presence => true, :hostname => true - - def supports_prio?; true end + + def supports_priority?; true end end + +Mx = MX \ No newline at end of file diff --git a/app/models/ns.rb b/app/models/ns.rb index 6cc684c..8b1f83f 100644 --- a/app/models/ns.rb +++ b/app/models/ns.rb @@ -22,6 +22,8 @@ class NS < Record validates :content, :presence => true, :hostname => true + def to_label; "#{content}" end + end Ns = NS diff --git a/app/models/record.rb b/app/models/record.rb index 5c80290..bea2c6a 100644 --- a/app/models/record.rb +++ b/app/models/record.rb @@ -16,6 +16,9 @@ class Record < ActiveRecord::Base before_validation :prepare_name! before_save :update_change_date after_save :update_soa_serial + after_initialize do + self.ttl ||= Settings.default_ttl + end # By default records don't support priorities. # Those who do can overwrite this in their own classes. diff --git a/app/models/soa.rb b/app/models/soa.rb index 50b55d5..06155cb 100644 --- a/app/models/soa.rb +++ b/app/models/soa.rb @@ -58,7 +58,7 @@ class SOA < Record save end - def to_label; "#{type} #{primary_ns} #{contact}" end + def to_label; "#{primary_ns} #{contact}" end private diff --git a/app/views/fragments/_top.html.erb b/app/views/fragments/_top.html.erb index 909bec8..308ad11 100644 --- a/app/views/fragments/_top.html.erb +++ b/app/views/fragments/_top.html.erb @@ -1,6 +1,6 @@