muck-engine 0.2.16 → 0.2.17
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/controllers/muck/helper_controller.rb +15 -0
- data/app/helpers/muck_custom_form_builder.rb +1 -1
- data/config/muck_engine_routes.rb +3 -0
- data/lib/muck_engine/initialize_routes.rb +8 -0
- data/lib/muck_engine/tasks.rb +220 -160
- data/lib/test/muck_factories.rb +1 -1
- data/muck-engine.gemspec +8 -2
- data/public/javascripts/muck.js +48 -2
- data/rails/init.rb +2 -1
- metadata +5 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.17
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class HelperController < ApplicationController
|
2
|
+
|
3
|
+
def load_states_for_country
|
4
|
+
country_id = params[:id]
|
5
|
+
@states = State.find(:all, :select => 'id, name', :conditions => ["country_id = ?", country_id], :order => "name" )
|
6
|
+
label, prompt = Country.build_state_prompts(country_id, true)
|
7
|
+
@states.insert(0, State.new(:name => prompt)) if @states.length > 0
|
8
|
+
# set cookies so we can remember the last value the user selected
|
9
|
+
cookies[:prefered_country_id] = country_id
|
10
|
+
respond_to do |format|
|
11
|
+
format.js { render :json => {:states => @states, :label => label, :prompt => prompt}.as_json }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
@@ -121,7 +121,7 @@ class MuckCustomFormBuilder < ActionView::Helpers::FormBuilder
|
|
121
121
|
# creates a select control with languages. Default id is 'languages'. If 'retain' is passed for the class value the value of this
|
122
122
|
# control will be written into a cookie with the key 'languages'.
|
123
123
|
def language_select(method, options = {}, html_options = {}, additional_language = nil)
|
124
|
-
@languages ||= (
|
124
|
+
@languages ||= (additional_language ? [additional_language] : []) + Language.find(:all, :order => 'name asc')
|
125
125
|
self.menu_select(method, I18n.t('muck.engine.choose_language'), @languages, options.merge(:prompt => I18n.t('muck.engine.select_language_prompt'), :wrapper_id => 'languages-container'), html_options.merge(:id => 'languages'))
|
126
126
|
end
|
127
127
|
|
@@ -0,0 +1,8 @@
|
|
1
|
+
class ActionController::Routing::RouteSet
|
2
|
+
def load_routes_with_muck_engine!
|
3
|
+
muck_engine_routes = File.join(File.dirname(__FILE__), *%w[.. .. config muck_engine_routes.rb])
|
4
|
+
add_configuration_file(muck_engine_routes) unless configuration_files.include? muck_engine_routes
|
5
|
+
load_routes_without_muck_engine!
|
6
|
+
end
|
7
|
+
alias_method_chain :load_routes!, :muck_engine
|
8
|
+
end
|
data/lib/muck_engine/tasks.rb
CHANGED
@@ -681,167 +681,227 @@ class MuckEngine
|
|
681
681
|
['Wyoming', 'WY', us_id]
|
682
682
|
].each {|s| State.create(:name => s[0], :abbreviation => s[1], :country_id => s[2]) unless State.find_by_name(s[0]) }
|
683
683
|
|
684
|
-
#
|
685
|
-
|
686
|
-
#
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
#
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
684
|
+
# The UK
|
685
|
+
ireland_id = Country.find_by_abbreviation('IE').id
|
686
|
+
#northern_ireland_id = Country.find_by_abbreviation('NIR').id
|
687
|
+
scotland_id = Country.find_by_abbreviation('SCT').id
|
688
|
+
england_id = Country.find_by_abbreviation('ENG').id
|
689
|
+
wales_id = Country.find_by_abbreviation('WAL').id
|
690
|
+
#channel_islands_id = Country.find_by_abbreviation('CHI').id
|
691
|
+
[
|
692
|
+
# Scotland
|
693
|
+
#['Aberdeen', 'ABD', scotland_id],
|
694
|
+
['Aberdeenshire', 'ABD', scotland_id],
|
695
|
+
['Angus (Forfarshire)', 'ANS', scotland_id],
|
696
|
+
#['Argyllshire', 'ARL', scotland_id],
|
697
|
+
['Argyll', '', scotland_id],
|
698
|
+
#['Argyll and Bute', 'BUT', scotland_id],
|
699
|
+
['Ayrshire', 'AYR', scotland_id],
|
700
|
+
['Banffshire', 'BAN', scotland_id],
|
701
|
+
['Berwickshire', 'BEW', scotland_id],
|
702
|
+
#['Borders', 'BOR', scotland_id],
|
703
|
+
['Bute', 'BUT', scotland_id],
|
704
|
+
['Caithness', 'CAI', scotland_id],
|
705
|
+
#['Central', 'CEN', scotland_id],
|
706
|
+
['Clackmannanshire', 'CLK', scotland_id],
|
707
|
+
['Dumfries-shire', 'DFS', scotland_id],
|
708
|
+
#['Dumfries and Galloway', 'DGY', scotland_id],
|
709
|
+
['Dunbartonshire', 'DNB', scotland_id],
|
710
|
+
#['Dundee', '', scotland_id],
|
711
|
+
#['East Ayrshire', '', scotland_id],
|
712
|
+
#['East Dunbartonshire', '', scotland_id],
|
713
|
+
['East Lothian', 'ELN', scotland_id],
|
714
|
+
#['East Renfrewshire', '', scotland_id],
|
715
|
+
#['Edinburgh', '', scotland_id],
|
716
|
+
#['Falkirk', '', scotland_id],
|
717
|
+
['Fife', 'FIF', scotland_id],
|
718
|
+
#['Glasgow', '', scotland_id],
|
719
|
+
#['Grampian', 'GMP', scotland_id],
|
720
|
+
#['Highland', 'HLD', scotland_id],
|
721
|
+
['Inverness-shire', 'INV', scotland_id],
|
722
|
+
['Inverclyde', '', scotland_id],
|
723
|
+
['Kincardineshire', 'KCD', scotland_id],
|
724
|
+
['Kirkcudbrightshire', 'KKD', scotland_id],
|
725
|
+
['Kinross-shire', 'KRS', scotland_id],
|
726
|
+
['Lanarkshire (Glasgow)', 'LKS', scotland_id],
|
727
|
+
#['Lothian', 'LTN', scotland_id],
|
728
|
+
['Midlothian (Edinburgh)', 'MLN', scotland_id],
|
729
|
+
['Moray', '', scotland_id],
|
730
|
+
#['Morayshire', 'MOR', scotland_id],
|
731
|
+
#['North Ayrshire', '', scotland_id],
|
732
|
+
#['North Lanarkshire', '', scotland_id],
|
733
|
+
#['Nairn', 'NAI', scotland_id],
|
734
|
+
['Nairnshire', 'NAI', scotland_id],
|
735
|
+
['Orkney', 'OKI', scotland_id],
|
736
|
+
['Peeblesshire', 'PEE', scotland_id],
|
737
|
+
['Perthshire', 'PER', scotland_id],
|
738
|
+
#['Perth and Kinross', '', scotland_id],
|
739
|
+
['Renfrewshire', 'RFW', scotland_id],
|
740
|
+
['Ross and Cromarty', 'ROC', scotland_id],
|
741
|
+
['Roxburghshire', 'ROX', scotland_id],
|
742
|
+
#['Scottish Borders', '', scotland_id],
|
743
|
+
['Selkirkshire', 'SEL', scotland_id],
|
744
|
+
['Shetland', 'SHI', scotland_id],
|
745
|
+
#['South Ayrshire', '', scotland_id],
|
746
|
+
#['South Lanarkshire', '', scotland_id],
|
747
|
+
#['Strathclyde', 'STD', scotland_id],
|
748
|
+
#['Stirling', 'STI', scotland_id],
|
749
|
+
['Stirlingshire', 'STI', scotland_id],
|
750
|
+
['Sutherland', 'SUT', scotland_id],
|
751
|
+
#['Tayside', 'TAY', scotland_id],
|
752
|
+
#['Wigtownshire', 'WIG', scotland_id],
|
753
|
+
['Western Isles', 'WIS', scotland_id],
|
754
|
+
#['West Dunbartonshire', '', scotland_id],
|
755
|
+
['West Lothian', 'WLN', scotland_id],
|
756
|
+
['Wigtownshire', '', scotland_id],
|
757
|
+
|
758
|
+
# Wales
|
759
|
+
#['Anglesey', 'AGY', wales_id],
|
760
|
+
#['Breconshire', 'BRE', wales_id],
|
761
|
+
#['Caernarvonshire', 'CAE', wales_id],
|
762
|
+
#['Cardiganshire', 'CGN', wales_id],
|
763
|
+
#['Carmarthenshire', 'CMN', wales_id],
|
764
|
+
['Clwyd', 'CWD', wales_id],
|
765
|
+
#['Denbighshire', 'DEN', wales_id],
|
766
|
+
['Dyfed', 'DFD', wales_id],
|
767
|
+
#['Flintshire', 'FLN', wales_id],
|
768
|
+
#['Glamorgan', 'GLA', wales_id],
|
769
|
+
['Gwent', 'GNT', wales_id],
|
770
|
+
['Gwynedd', 'GWN', wales_id],
|
771
|
+
#['Merionethshire', 'MER', wales_id],
|
772
|
+
['Mid Glamorgan', 'MGM', wales_id],
|
773
|
+
#['Montgomeryshire', 'MGY', wales_id],
|
774
|
+
#['Monmouthshire', 'MON', wales_id],
|
775
|
+
#['Pembrokeshire', 'PEM', wales_id],
|
776
|
+
['Powys', 'POW', wales_id],
|
777
|
+
#['Radnorshire', 'RAD', wales_id],
|
778
|
+
['South Glamorgan', 'SGM', wales_id],
|
779
|
+
['West Glamorgan', 'WGM', wales_id],
|
780
|
+
|
781
|
+
# Channel Islands
|
782
|
+
# ['Alderney', 'ALD', channel_islands_id],
|
783
|
+
# ['Guernsey', 'GSY', channel_islands_id],
|
784
|
+
# ['Jersey', 'JSY', channel_islands_id],
|
785
|
+
# ['Sark', 'SRK', channel_islands_id],
|
786
|
+
|
787
|
+
# England
|
788
|
+
#['Avon', 'AVN', england_id],
|
789
|
+
['Bedfordshire', 'BDF', england_id],
|
790
|
+
['Buckinghamshire', 'BKM', england_id],
|
791
|
+
['Berkshire', 'BRK', england_id],
|
792
|
+
['Bristol', 'BST', england_id],
|
793
|
+
['Cambridgeshire', 'CAM', england_id],
|
794
|
+
['Cheshire', 'CHS', england_id],
|
795
|
+
#['Cleveland', 'CLV', england_id],
|
796
|
+
['Cumbria', 'CMA', england_id],
|
797
|
+
['Cornwall', 'CON', england_id],
|
798
|
+
#['Cumberland', 'CUL', england_id],
|
799
|
+
['Derbyshire', 'DBY', england_id],
|
800
|
+
['Devon', 'DEV', england_id],
|
801
|
+
['Dorset', 'DOR', england_id],
|
802
|
+
['Durham', 'DUR', england_id],
|
803
|
+
['East Riding of Yorkshire', 'ERY', england_id],
|
804
|
+
['East Sussex', 'SXE', england_id],
|
805
|
+
['Essex', 'ESS', england_id],
|
806
|
+
['Gloucestershire', 'GLS', england_id],
|
807
|
+
['Greater London', '', england_id],
|
808
|
+
['Greater Manchester', 'GTM', england_id],
|
809
|
+
['Hampshire', 'HAM', england_id],
|
810
|
+
['Herefordshire', 'HEF', england_id],
|
811
|
+
['Hertfordshire', 'HRT', england_id],
|
812
|
+
#['Humberside', 'HUM', england_id],
|
813
|
+
#['Huntingdonshire', 'HUN', england_id],
|
814
|
+
#['Hereford and Worcester', 'HWR', england_id],
|
815
|
+
['Isle of Wight', 'IOW', england_id],
|
816
|
+
['Kent', 'KEN', england_id],
|
817
|
+
['Lancashire', 'LAN', england_id],
|
818
|
+
['Leicestershire', 'LEI', england_id],
|
819
|
+
['Lincolnshire', 'LIN', england_id],
|
820
|
+
['London', '', england_id],
|
821
|
+
['Merseyside', 'MSY', england_id],
|
822
|
+
['Northumberland', 'NBL', england_id],
|
823
|
+
['Norfolk', 'NFK', england_id],
|
824
|
+
#['North Riding of Yorkshire', 'NRY', england_id],
|
825
|
+
['Northamptonshire', 'NTH', england_id],
|
826
|
+
['Nottinghamshire', 'NTT', england_id],
|
827
|
+
['North Yorkshire', 'NYK', england_id],
|
828
|
+
['Oxfordshire', 'OXF', england_id],
|
829
|
+
['Rutland', 'RUT', england_id],
|
830
|
+
['Shropshire', 'SAL', england_id],
|
831
|
+
['Suffolk', 'SFK', england_id],
|
832
|
+
['Somerset', 'SOM', england_id],
|
833
|
+
['South Yorkshire', 'SYK', england_id],
|
834
|
+
['Surrey', 'SRY', england_id],
|
835
|
+
#['Sussex', 'SSX', england_id],
|
836
|
+
['Staffordshire', 'STS', england_id],
|
837
|
+
['Tyne and Wear', 'TWR', england_id],
|
838
|
+
['Warwickshire', 'WAR', england_id],
|
839
|
+
#['Westmorland', 'WES', england_id],
|
840
|
+
['West Sussex', 'SXW', england_id],
|
841
|
+
['West Midlands', 'WMD', england_id],
|
842
|
+
#['West Riding of Yorkshire', 'WRY', england_id],
|
843
|
+
['West Yorkshire', 'WYK', england_id],
|
844
|
+
['Worcestershire', 'WOR', england_id],
|
845
|
+
['Wiltshire', 'WIL', england_id],
|
846
|
+
#['Yorkshire', 'YKS', england_id],
|
847
|
+
|
848
|
+
# Northern Ireland - Listed under Ireland
|
849
|
+
['Antrim', 'ANT', ireland_id],
|
850
|
+
['Armagh', 'ARM', ireland_id],
|
851
|
+
['Down', 'DOW', ireland_id],
|
852
|
+
['Fermanagh', 'FER', ireland_id],
|
853
|
+
['Londonderry', 'LDY', ireland_id],
|
854
|
+
['Tyrone', 'TYR', ireland_id],
|
844
855
|
|
856
|
+
# Ireland
|
857
|
+
['Carlow', 'CAR', ireland_id],
|
858
|
+
['Cavan', 'CAV', ireland_id],
|
859
|
+
['Clare', 'CLA', ireland_id],
|
860
|
+
['Cork', 'COR', ireland_id],
|
861
|
+
['Donegal', 'DON', ireland_id],
|
862
|
+
['Dublin', 'DUB', ireland_id],
|
863
|
+
['Galway', 'GAL', ireland_id],
|
864
|
+
['Kerry', 'KER', ireland_id],
|
865
|
+
['Kildare', 'KID', ireland_id],
|
866
|
+
['Kilkenny', 'KIK', ireland_id],
|
867
|
+
['Leitrim', 'LET', ireland_id],
|
868
|
+
['Laois', 'LEX', ireland_id],
|
869
|
+
['Limerick', 'LIM', ireland_id],
|
870
|
+
['Longford', 'LOG', ireland_id],
|
871
|
+
['Louth', 'LOU', ireland_id],
|
872
|
+
['Mayo', 'MAY', ireland_id],
|
873
|
+
['Meath', 'MEA', ireland_id],
|
874
|
+
['Monaghan', 'MOG', ireland_id],
|
875
|
+
['Offaly', 'OFF', ireland_id],
|
876
|
+
['Roscommon', 'ROS', ireland_id],
|
877
|
+
['Sligo', 'SLI', ireland_id],
|
878
|
+
['Tipperary', 'TIP', ireland_id],
|
879
|
+
['Waterford', 'WAT', ireland_id],
|
880
|
+
['Westmeath', 'WEM', ireland_id],
|
881
|
+
['Wexford', 'WEX', ireland_id],
|
882
|
+
['Wicklow', 'WIC', ireland_id]
|
883
|
+
].each {|s| State.create(:name => s[0], :abbreviation => s[1], :country_id => s[2]) unless State.find_by_name(s[0]) }
|
884
|
+
|
885
|
+
# Canadian Provinces
|
886
|
+
ca_id = Country.find_by_abbreviation('CA').id
|
887
|
+
[
|
888
|
+
['Alberta', 'AB', ca_id],
|
889
|
+
['British Columbia', 'BC', ca_id],
|
890
|
+
['Manitoba', 'MB', ca_id],
|
891
|
+
['New Brunswick', 'NB', ca_id],
|
892
|
+
['Newfoundland and Labrador', 'NL', ca_id],
|
893
|
+
['Northwest Territories', 'NT', ca_id],
|
894
|
+
['Nova Scotia', 'NS', ca_id],
|
895
|
+
['Nunavut', 'NU', ca_id],
|
896
|
+
['Ontario', 'ON', ca_id],
|
897
|
+
['Prince Edward Island', 'PE', ca_id],
|
898
|
+
['Quebec', 'QC', ca_id],
|
899
|
+
['Saskatchewan', 'SK', ca_id],
|
900
|
+
['Yukon Territory', 'YT', ca_id],
|
901
|
+
].each {|s| State.create(:name => s[0], :abbreviation => s[1], :country_id => s[2]) unless State.find_by_name(s[0]) }
|
902
|
+
|
903
|
+
|
904
|
+
# Languages
|
845
905
|
[
|
846
906
|
['Afar', 'Afaraf', false, 'aa', false],
|
847
907
|
['Аҧсуа', 'Abkhazian', false, 'ab', false],
|
data/lib/test/muck_factories.rb
CHANGED
data/muck-engine.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{muck-engine}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.17"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Justin Ball", "Joel Duffin"]
|
12
|
-
s.date = %q{2009-11-
|
12
|
+
s.date = %q{2009-11-30}
|
13
13
|
s.description = %q{The base engine for the muck system. Contains common tables, custom for, css and javascript.}
|
14
14
|
s.email = %q{justin@tatemae.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -23,6 +23,8 @@ Gem::Specification.new do |s|
|
|
23
23
|
"VERSION",
|
24
24
|
"app/controllers/admin/muck/base_controller.rb",
|
25
25
|
"app/controllers/admin/muck/base_controller.rb",
|
26
|
+
"app/controllers/muck/helper_controller.rb",
|
27
|
+
"app/controllers/muck/helper_controller.rb",
|
26
28
|
"app/helpers/muck_custom_form_builder.rb",
|
27
29
|
"app/helpers/muck_custom_form_builder.rb",
|
28
30
|
"app/helpers/muck_engine_helper.rb",
|
@@ -85,6 +87,8 @@ Gem::Specification.new do |s|
|
|
85
87
|
"app/views/shared/_growl_box.html.erb",
|
86
88
|
"app/views/shared/_no_result.html.erb",
|
87
89
|
"app/views/shared/_no_result.html.erb",
|
90
|
+
"config/muck_engine_routes.rb",
|
91
|
+
"config/muck_engine_routes.rb",
|
88
92
|
"db/migrate/20090402234137_create_languages.rb",
|
89
93
|
"db/migrate/20090402234137_create_languages.rb",
|
90
94
|
"db/migrate/20090426041056_create_countries.rb",
|
@@ -98,6 +102,8 @@ Gem::Specification.new do |s|
|
|
98
102
|
"lib/active_record/muck_model.rb",
|
99
103
|
"lib/muck_engine.rb",
|
100
104
|
"lib/muck_engine.rb",
|
105
|
+
"lib/muck_engine/initialize_routes.rb",
|
106
|
+
"lib/muck_engine/initialize_routes.rb",
|
101
107
|
"lib/muck_engine/tasks.rb",
|
102
108
|
"lib/muck_engine/tasks.rb",
|
103
109
|
"lib/muck_test_helper.rb",
|
data/public/javascripts/muck.js
CHANGED
@@ -51,6 +51,47 @@ function show_hide_obj (ary_objs_to_show, ary_objs_to_hide)
|
|
51
51
|
}
|
52
52
|
}
|
53
53
|
|
54
|
+
function setup_country(force_load){
|
55
|
+
|
56
|
+
var country_id = jQuery("#countries").val();
|
57
|
+
var state_id = jQuery("#states").val();
|
58
|
+
|
59
|
+
if (country_id == undefined){
|
60
|
+
return;
|
61
|
+
}
|
62
|
+
|
63
|
+
if (country_id == '-1'){
|
64
|
+
jQuery("#states").val('-1');
|
65
|
+
jQuery("#counties").val('-1');
|
66
|
+
}
|
67
|
+
|
68
|
+
if (country_id == '-1' || country_id == ''){
|
69
|
+
jQuery("#states-container").hide();
|
70
|
+
jQuery("#counties-container").hide();
|
71
|
+
return;
|
72
|
+
}
|
73
|
+
|
74
|
+
if(force_load || state_id == '' || state_id == null || state_id == -1) {
|
75
|
+
jQuery.getJSON("/helper/load_states_for_country/" + country_id + ".js", function(data){
|
76
|
+
var options = '';
|
77
|
+
jQuery("#counties-container").hide();
|
78
|
+
jQuery('#states-container label').html(data.label);
|
79
|
+
states = data.states;
|
80
|
+
if(states.length > 0){
|
81
|
+
for (var i = 0; i < states.length; i++) {
|
82
|
+
var state_id = states[i].state.id;
|
83
|
+
if(state_id == undefined) { state_id = ''; }
|
84
|
+
options += '<option value="' + state_id + '">' + states[i].state.name + '</option>';
|
85
|
+
}
|
86
|
+
jQuery("#states-container").show();
|
87
|
+
jQuery("select#states").html(options);
|
88
|
+
} else {
|
89
|
+
jQuery("#states-container").hide();
|
90
|
+
}
|
91
|
+
});
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
54
95
|
jQuery.jGrowl.defaults.position = 'center';
|
55
96
|
|
56
97
|
jQuery.jGrowl.info = function(msg){
|
@@ -69,13 +110,18 @@ jQuery(document).ready(function() {
|
|
69
110
|
jQuery("#global-login").focus(function() {
|
70
111
|
jQuery("#global-login").val("");
|
71
112
|
});
|
72
|
-
|
73
113
|
jQuery("#global-password").focus(function() {
|
74
114
|
jQuery("#global-password").val("");
|
75
115
|
});
|
76
|
-
|
77
116
|
jQuery("#quick-login-submit").click(function() {
|
78
117
|
jQuery("#quick-login").submit();
|
79
118
|
});
|
80
119
|
|
120
|
+
jQuery("#countries-container select").change(function() {
|
121
|
+
setup_country(true);
|
122
|
+
});
|
123
|
+
if(jQuery("#states").val() == '' || jQuery("#states").val() == null) {
|
124
|
+
jQuery("#states-container").hide();
|
125
|
+
}
|
126
|
+
setup_country(false);
|
81
127
|
});
|
data/rails/init.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: muck-engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Ball
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-11-
|
13
|
+
date: 2009-11-30 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -58,6 +58,7 @@ files:
|
|
58
58
|
- Rakefile
|
59
59
|
- VERSION
|
60
60
|
- app/controllers/admin/muck/base_controller.rb
|
61
|
+
- app/controllers/muck/helper_controller.rb
|
61
62
|
- app/helpers/muck_custom_form_builder.rb
|
62
63
|
- app/helpers/muck_engine_helper.rb
|
63
64
|
- app/models/basic_mailer.rb
|
@@ -89,6 +90,7 @@ files:
|
|
89
90
|
- app/views/shared/_growl.html.erb
|
90
91
|
- app/views/shared/_growl_box.html.erb
|
91
92
|
- app/views/shared/_no_result.html.erb
|
93
|
+
- config/muck_engine_routes.rb
|
92
94
|
- db/migrate/20090402234137_create_languages.rb
|
93
95
|
- db/migrate/20090426041056_create_countries.rb
|
94
96
|
- db/migrate/20090426041103_create_states.rb
|
@@ -96,6 +98,7 @@ files:
|
|
96
98
|
- lib/action_controller/muck_application.rb
|
97
99
|
- lib/active_record/muck_model.rb
|
98
100
|
- lib/muck_engine.rb
|
101
|
+
- lib/muck_engine/initialize_routes.rb
|
99
102
|
- lib/muck_engine/tasks.rb
|
100
103
|
- lib/muck_test_helper.rb
|
101
104
|
- lib/test/muck_factories.rb
|