knitkit 3.0.0 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. checksums.yaml +4 -4
  2. data/{public → app/assets}/images/check.png +0 -0
  3. data/{public → app/assets}/images/credit_card.png +0 -0
  4. data/{public → app/assets}/images/inline_edit/close.png +0 -0
  5. data/{public → app/assets}/images/knitkit/icons/document.png +0 -0
  6. data/{public → app/assets}/images/knitkit/icons/multi_doc.png +0 -0
  7. data/{public → app/assets}/images/knitkit/logo.png +0 -0
  8. data/{public → app/assets}/images/knitkit/splash/images/add-site.png +0 -0
  9. data/app/assets/images/knitkit/splash/images/add_website_105x105-active.png +0 -0
  10. data/app/assets/images/knitkit/splash/images/add_website_105x105.png +0 -0
  11. data/{public → app/assets}/images/knitkit/splash/images/adjust-site.png +0 -0
  12. data/{public → app/assets}/images/knitkit/splash/images/browse-site.png +0 -0
  13. data/app/assets/images/knitkit/splash/images/browse_db_105x105-active.png +0 -0
  14. data/app/assets/images/knitkit/splash/images/browse_db_105x105.png +0 -0
  15. data/app/assets/images/knitkit/splash/images/console_105x105-active.png +0 -0
  16. data/app/assets/images/knitkit/splash/images/console_105x105.png +0 -0
  17. data/{public → app/assets}/images/knitkit/splash/images/find-themes.png +0 -0
  18. data/app/assets/images/knitkit/splash/images/find_themes_105x105-active.png +0 -0
  19. data/app/assets/images/knitkit/splash/images/find_themes_105x105.png +0 -0
  20. data/app/assets/images/knitkit/splash/images/learn_more_105x105-active.png +0 -0
  21. data/app/assets/images/knitkit/splash/images/learn_more_105x105.png +0 -0
  22. data/{public → app/assets}/images/knitkit/splash/images/settings.png +0 -0
  23. data/{public → app/assets}/images/knitkit/splash/images/tutorials.png +0 -0
  24. data/app/assets/images/knitkit/splash/splash.png +0 -0
  25. data/app/assets/images/widgets/manage_profile/contact_information.png +0 -0
  26. data/app/assets/images/widgets/manage_profile/password.png +0 -0
  27. data/app/assets/images/widgets/manage_profile/user_information.png +0 -0
  28. data/app/assets/javascripts/erp_app/desktop/applications/knitkit/app.js +24 -0
  29. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/articles_grid_panel.js +15 -12
  30. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/center_region.js +69 -48
  31. data/app/assets/javascripts/erp_app/desktop/applications/knitkit/comments_grid_panel.js +214 -0
  32. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/east_region.js +0 -0
  33. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/file_assets_panel.js +17 -19
  34. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/image_assets_data_view.js +13 -3
  35. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/image_assets_panel.js +59 -48
  36. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/widgets_panel.js +0 -0
  37. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/inquiries_grid_panel.js +2 -2
  38. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/module.js +2 -2
  39. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/publish_window.js +0 -0
  40. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/published_grid_panel.js +1 -1
  41. data/app/assets/javascripts/erp_app/desktop/applications/knitkit/splash_screen.js +268 -0
  42. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/top_menu/main_menu.js +85 -33
  43. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/top_menu/websites_combo.js +0 -0
  44. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/versions_grid_panel.js +5 -28
  45. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/article.js +22 -8
  46. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/document.js +143 -25
  47. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/host.js +5 -1
  48. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/menu.js +2 -0
  49. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/section.js +181 -65
  50. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/website_nav_items.js +0 -0
  51. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/hosts_tree_panel.js +0 -0
  52. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/menu_tree_panel.js +0 -0
  53. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/site_contents_tree_panel.js +121 -116
  54. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/themes_tree_panel.js +101 -10
  55. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/west_region.js +9 -5
  56. data/app/assets/javascripts/knitkit-web.js +22 -0
  57. data/app/assets/javascripts/knitkit/additional-methods.min.js +4 -0
  58. data/app/assets/javascripts/knitkit/bootstrap.min.js +7 -0
  59. data/app/assets/javascripts/knitkit/captcha.js +154 -0
  60. data/{public → app/assets}/javascripts/knitkit/confirm-bootstrap.js +1 -1
  61. data/{public → app/assets}/javascripts/knitkit/inline_editing.js +1 -1
  62. data/{public → app/assets}/javascripts/knitkit/jquery.maskedinput.min.js +0 -0
  63. data/app/assets/javascripts/knitkit/jquery.validate.min.js +4 -0
  64. data/app/assets/javascripts/knitkit/js.cookie.js +145 -0
  65. data/{public → app/assets}/javascripts/knitkit/theme.js +0 -0
  66. data/app/assets/stylesheets/erp_app/desktop/applications/knitkit/app.css +12 -0
  67. data/{public → app/assets}/stylesheets/erp_app/desktop/applications/knitkit/knitkit.css +23 -33
  68. data/app/assets/stylesheets/erp_app/shared/knitkit_shared.css +21 -0
  69. data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.eot +0 -0
  70. data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.svg +288 -0
  71. data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.ttf +0 -0
  72. data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.woff +0 -0
  73. data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.woff2 +0 -0
  74. data/app/assets/stylesheets/knitkit-web.css +16 -0
  75. data/app/assets/stylesheets/knitkit/bootstrap.min.css +5 -0
  76. data/app/assets/stylesheets/knitkit/captcha.css +59 -0
  77. data/app/assets/stylesheets/knitkit/custom.css +144 -0
  78. data/{public → app/assets}/stylesheets/knitkit/inline_editing.css +0 -0
  79. data/app/assets/stylesheets/knitkit/submenu.css +93 -0
  80. data/app/controllers/api/v1/websites_controller.rb +14 -0
  81. data/app/controllers/captcha_controller.rb +53 -0
  82. data/app/controllers/knitkit/base_controller.rb +1 -5
  83. data/app/controllers/knitkit/erp_app/desktop/app_controller.rb +2 -9
  84. data/app/controllers/knitkit/erp_app/desktop/articles_controller.rb +20 -7
  85. data/app/controllers/knitkit/erp_app/desktop/file_assets_controller.rb +38 -28
  86. data/app/controllers/knitkit/erp_app/desktop/image_assets_controller.rb +16 -9
  87. data/app/controllers/knitkit/erp_app/desktop/online_document_sections_controller.rb +69 -15
  88. data/app/controllers/knitkit/erp_app/desktop/position_controller.rb +45 -58
  89. data/app/controllers/knitkit/erp_app/desktop/theme_controller.rb +64 -29
  90. data/app/controllers/knitkit/erp_app/desktop/website_controller.rb +36 -13
  91. data/app/controllers/knitkit/erp_app/desktop/website_host_controller.rb +12 -0
  92. data/app/controllers/knitkit/erp_app/desktop/website_nav_controller.rb +4 -11
  93. data/app/controllers/knitkit/erp_app/desktop/website_nav_item_controller.rb +2 -9
  94. data/app/controllers/knitkit/erp_app/desktop/website_section_controller.rb +56 -20
  95. data/app/controllers/knitkit/online_document_sections_controller.rb +9 -3
  96. data/app/mailers/website_inquiry_mailer.rb +11 -3
  97. data/app/models/content.rb +16 -6
  98. data/app/models/documented_item.rb +12 -1
  99. data/app/models/online_document_section.rb +54 -20
  100. data/app/models/published_website.rb +16 -0
  101. data/app/models/theme.rb +53 -47
  102. data/app/models/website.rb +172 -191
  103. data/app/models/website_section.rb +64 -30
  104. data/app/views/knitkit/blogs/show.html.erb +5 -2
  105. data/app/views/layouts/knitkit/base.html.erb +54 -51
  106. data/app/views/menus/knitkit/_default_menu.html.erb +11 -11
  107. data/app/views/menus/knitkit/_default_section_menu.html.erb +2 -2
  108. data/app/views/menus/knitkit/_default_sub_menu.erb +27 -0
  109. data/app/views/menus/knitkit/_default_sub_section_menu.html.erb +30 -0
  110. data/app/views/website_inquiry_mailer/inquiry.html.erb +266 -0
  111. data/app/widgets/contact_us/base.rb +26 -16
  112. data/app/widgets/contact_us/javascript/contact_us.js +1 -1
  113. data/app/widgets/contact_us/views/error.html.erb +7 -3
  114. data/app/widgets/contact_us/views/index.html.erb +36 -28
  115. data/app/widgets/google_map/javascript/google_map.js +1 -1
  116. data/app/widgets/google_map/views/index.html.erb +1 -1
  117. data/app/widgets/login/javascript/login.js +1 -1
  118. data/app/widgets/login/views/index.html.erb +1 -1
  119. data/app/widgets/manage_profile/base.rb +141 -112
  120. data/app/widgets/manage_profile/javascript/manage_profile.js +2 -2
  121. data/app/widgets/manage_profile/views/_password_form.html.erb +1 -1
  122. data/app/widgets/manage_profile/views/_user_information_form.html.erb +1 -30
  123. data/app/widgets/manage_profile/views/index.html.erb +42 -40
  124. data/app/widgets/reset_password/base.rb +39 -8
  125. data/app/widgets/reset_password/javascript/reset_password.js +1 -1
  126. data/app/widgets/reset_password/views/index.html.erb +3 -3
  127. data/app/widgets/reset_password/views/invalid_reset_token.html.erb +7 -0
  128. data/app/widgets/reset_password/views/layouts/base.html.erb +1 -1
  129. data/app/widgets/reset_password/views/reset_password.html.erb +39 -0
  130. data/app/widgets/reset_password/views/reset_success.html.erb +5 -0
  131. data/app/widgets/search/base.rb +5 -5
  132. data/app/widgets/search/javascript/search.js +6 -6
  133. data/app/widgets/search/views/_inline_search_form.html.erb +23 -12
  134. data/app/widgets/search/views/_search_form.html.erb +34 -30
  135. data/app/widgets/search/views/layouts/base.html.erb +6 -1
  136. data/app/widgets/signup/base.rb +73 -30
  137. data/app/widgets/signup/javascript/signup.js +1 -1
  138. data/app/widgets/signup/views/_signup_form.html.erb +2 -1
  139. data/app/widgets/signup/views/layouts/base.html.erb +1 -1
  140. data/app/widgets/signup/views/success.html.erb +2 -3
  141. data/config/routes.rb +25 -4
  142. data/db/data_migrations/20110509223702_add_publisher_role.rb +0 -2
  143. data/db/data_migrations/20110816153456_add_knitkit_application.rb +7 -15
  144. data/db/data_migrations/20120127150505_create_website_default_configuration.rb +63 -3
  145. data/db/data_migrations/20150118180450_add_website_member_roles.rb +12 -0
  146. data/db/data_migrations/20150414150359_nest_knitkit_security_roles.rb +35 -0
  147. data/db/data_migrations/20150414173437_move_website_roles_under_website_builder.rb +19 -0
  148. data/db/migrate/20110211002317_setup_knitkit.rb +86 -39
  149. data/lib/knitkit.rb +8 -2
  150. data/lib/knitkit/config.rb +2 -3
  151. data/lib/knitkit/engine.rb +35 -4
  152. data/lib/knitkit/extensions.rb +2 -1
  153. data/lib/knitkit/extensions/action_controller/theme_support/acts_as_themed_controller.rb +1 -1
  154. data/lib/knitkit/extensions/action_mailer/theme_support/acts_as_themed_mailer.rb +1 -1
  155. data/lib/knitkit/extensions/compass_ae/mailers/user_mailer.rb +31 -0
  156. data/lib/knitkit/extensions/compass_ae/widgets/base.rb +1 -1
  157. data/lib/knitkit/extensions/railties/action_controller/captcha_helper.rb +43 -0
  158. data/lib/knitkit/extensions/railties/action_view/helpers/content_helper.rb +1 -1
  159. data/lib/knitkit/extensions/railties/action_view/helpers/menu_helper.rb +11 -1
  160. data/lib/knitkit/extensions/railties/theme_support/asset_tag_helper.rb +83 -0
  161. data/lib/knitkit/routing_filter/section_router.rb +24 -14
  162. data/lib/knitkit/version.rb +1 -1
  163. data/lib/tasks/knitkit_tasks.rake +89 -4
  164. data/lib/tasks/theme_parser.rake +85 -0
  165. data/public/fonts/glyphicons-halflings-regular.eot +0 -0
  166. data/public/fonts/glyphicons-halflings-regular.svg +288 -0
  167. data/public/fonts/glyphicons-halflings-regular.ttf +0 -0
  168. data/public/fonts/glyphicons-halflings-regular.woff +0 -0
  169. data/public/fonts/glyphicons-halflings-regular.woff2 +0 -0
  170. data/public/paypal-button.min.js +7 -0
  171. metadata +161 -82
  172. data/app/assets/javascripts/knitkit/application.js +0 -9
  173. data/app/assets/stylesheets/knitkit/application.css +0 -7
  174. data/app/mailers/document_mailer.rb +0 -10
  175. data/app/views/document_mailer/email_document.html.erb +0 -12
  176. data/app/views/knitkit/mobile/index.html.erb +0 -162
  177. data/app/views/knitkit/online_document_sections/index.html.erb +0 -279
  178. data/app/views/layouts/knitkit/online_document_sections.html.erb +0 -80
  179. data/app/views/website_inquiry_mailer/inquiry.erb +0 -24
  180. data/db/data_migrations/20120127150506_add_primary_host_to_website_configuration.rb +0 -33
  181. data/db/data_migrations/20120316150424_add_is_template_to_default_website_config.rb +0 -16
  182. data/db/data_migrations/20120809020508_update_website_and_configuration.rb +0 -82
  183. data/db/data_migrations/20121129185611_upgrade_website_role_iid.rb +0 -20
  184. data/db/migrate/20130405184234_add_use_markdown_to_section.rb +0 -19
  185. data/db/migrate/20131112013052_add_knitkit_missing_indexes.rb +0 -33
  186. data/db/migrate/20140622212723_update_website_inquiries.rb +0 -22
  187. data/db/migrate/20140911185022_add_publishing_to_website.rb +0 -5
  188. data/db/migrate/20141013073349_add_custom_fields_to_documents.rb +0 -12
  189. data/db/migrate/20141016101936_upgrade_remove_dynamic_attributes.rb +0 -13
  190. data/lib/knitkit/extensions/railties/theme_support/theme_file_resolver.rb +0 -49
  191. data/public/images/knitkit/close_window.png +0 -0
  192. data/public/images/knitkit/splash/splash.png +0 -0
  193. data/public/javascripts/erp_app/desktop/applications/knitkit/comments_grid_panel.js +0 -215
  194. data/public/javascripts/erp_app/desktop/applications/knitkit/select_roles_window.js +0 -108
  195. data/public/javascripts/erp_app/desktop/applications/knitkit/splash_screen.js +0 -170
  196. data/public/javascripts/knitkit/bootstrap-datepicker.js +0 -474
  197. data/public/javascripts/knitkit/bootstrap.min.js +0 -7
  198. data/public/javascripts/knitkit/mobile/app/view/Main.js +0 -108
  199. data/public/javascripts/knitkit/mobile/ux/slidenavigation/View.js +0 -734
  200. data/public/stylesheets/knitkit/bootstrap-responsive.min.css +0 -10
  201. data/public/stylesheets/knitkit/bootstrap.min.css +0 -7
  202. data/public/stylesheets/knitkit/custom.css +0 -122
  203. data/public/stylesheets/knitkit/datepicker.css +0 -182
@@ -11,4 +11,9 @@
11
11
  # per_page: Number of results per page
12
12
  %>
13
13
  <%= render_widget :search %>
14
- </div>
14
+ </div>
15
+
16
+
17
+
18
+
19
+
@@ -1,6 +1,7 @@
1
1
  module Widgets
2
2
  module Signup
3
3
  class Base < ErpApp::Widgets::Base
4
+
4
5
  def index
5
6
  @login_url = params[:login_url]
6
7
  @user = User.new
@@ -13,28 +14,66 @@ module Widgets
13
14
  @configuration = @website.configurations.first
14
15
  password_config_option = @configuration.get_item(ConfigurationItemType.find_by_internal_identifier('password_strength_regex')).options.first
15
16
  primary_host = @configuration.get_item(ConfigurationItemType.find_by_internal_identifier('primary_host')).options.first
16
-
17
17
  @email = params[:email]
18
- @user = User.new(
19
- :email => @email,
20
- :username => params[:username],
21
- :password => params[:password],
22
- :password_confirmation => params[:password_confirmation]
23
- )
24
- @user.password_validator = {:regex => password_config_option.value, :error_message => password_config_option.comment}
25
- #set this to tell activation where to redirect_to for login and temp password
26
- @user.add_instance_attribute(:login_url,params[:login_url])
27
- @user.add_instance_attribute(:temp_password, params[:password])
28
- @user.add_instance_attribute(:domain, primary_host.value)
18
+
29
19
  begin
30
- if @user.save
31
- individual = Individual.create(:current_first_name => params[:first_name], :current_last_name => params[:last_name])
32
- @user.party = individual.party
33
- @user.add_role(@website.role)
34
- @user.save
35
- render :update => {:id => "#{@uuid}_result", :view => :success}
36
- else
37
- render :update => {:id => "#{@uuid}_result", :view => :error}
20
+ ActiveRecord::Base.transaction do
21
+ @user = User.new(
22
+ :email => @email,
23
+ :username => params[:username],
24
+ :password => params[:password],
25
+ :password_confirmation => params[:password_confirmation]
26
+ )
27
+ @user.password_validator = {:regex => password_config_option.value, :error_message => password_config_option.comment}
28
+ #set this to tell activation where to redirect_to for login and temp password
29
+ @user.add_instance_attribute(:login_url, params[:login_url])
30
+ @user.add_instance_attribute(:domain, primary_host.value)
31
+
32
+ if @user.save
33
+
34
+ # check if there is already a party with that email if there is tie the party to the user
35
+ party = Party.find_by_email(@email, 'billing')
36
+ if party
37
+ @user.party = party
38
+ else
39
+ individual = Individual.create(:current_first_name => params[:first_name], :current_last_name => params[:last_name])
40
+ @user.party = individual.party
41
+ end
42
+
43
+ # add website security role to user
44
+ @user.add_role(@website.role)
45
+
46
+ # create website_party_role for this user as a member of the site
47
+ WebsitePartyRole.create(party: @user.party, website: @website, role_type: RoleType.find_by_ancestor_iids(['website', 'member']))
48
+
49
+ @user.save
50
+ party = @user.party
51
+
52
+ # add party roles to party if present
53
+ unless params[:party_roles].blank?
54
+ params[:party_roles].split(',').each do |role_type|
55
+ party.add_role_type(role_type)
56
+ end
57
+
58
+ party.save
59
+ end
60
+
61
+ # associate the new party to the dba_organization of the current website
62
+ @dba_party = @website.website_party_roles.where('role_type_id' => RoleType.iid('dba_org')).first.party
63
+ party.party_roles.collect(&:role_type).each do |role_type|
64
+ relationship_type = RelationshipType.find_or_create(RoleType.iid('dba_org'), role_type)
65
+
66
+ party.create_relationship(relationship_type.description,
67
+ @dba_party.id,
68
+ relationship_type)
69
+ end
70
+
71
+ after_registration
72
+
73
+ render :update => {:id => "#{@uuid}_result", :view => :success}
74
+ else
75
+ render :update => {:id => "#{@uuid}_result", :view => :error}
76
+ end
38
77
  end
39
78
  rescue => ex
40
79
  logger.error ex.message
@@ -43,32 +82,36 @@ module Widgets
43
82
  end
44
83
  end
45
84
 
46
- #should not be modified
47
- #modify at your own risk
85
+ def after_registration
86
+ # override in your code to do special registration logic
87
+ end
88
+
89
+ # should not be modified
90
+ # modify at your own risk
48
91
  def locate
49
92
  File.dirname(__FILE__)
50
93
  end
51
-
94
+
52
95
  class << self
53
96
  def title
54
97
  "Sign Up"
55
98
  end
56
-
99
+
57
100
  def widget_name
58
101
  File.basename(File.dirname(__FILE__))
59
102
  end
60
-
103
+
61
104
  def base_layout
62
105
  begin
63
- file = File.join(File.dirname(__FILE__),"/views/layouts/base.html.erb")
106
+ file = File.join(File.dirname(__FILE__), "/views/layouts/base.html.erb")
64
107
  IO.read(file)
65
108
  rescue
66
109
  return nil
67
110
  end
68
111
  end
112
+
69
113
  end
70
-
71
- end
72
- end
73
- end
74
114
 
115
+ end # Base
116
+ end # Signup
117
+ end # Widgets
@@ -7,7 +7,7 @@ Compass.ErpApp.Widgets.Signup = {
7
7
 
8
8
  Compass.ErpApp.Widgets.AvailableWidgets.push({
9
9
  name: 'Signup',
10
- iconUrl: '/images/icons/sign_up/sign_up_48x48.png',
10
+ iconUrl: '/assets/icons/sign_up/sign_up_48x48.png',
11
11
  onClick: Compass.ErpApp.Widgets.Signup.addSignup,
12
12
  about: 'This widget allows users to sign up.'
13
13
  });
@@ -1,4 +1,4 @@
1
- <%= form_remote_tag build_widget_url(:new), :class => "form-signin", :style => 'max-width: 500px;' do %>
1
+ <%= form_remote_tag build_widget_url(:new), :class => "form-signin" do %>
2
2
  <div class="form_settings">
3
3
 
4
4
  <div class="form-group">
@@ -23,6 +23,7 @@
23
23
  <div class="form-group">
24
24
  <label for="password">Enter a password</label>
25
25
  <%= password_field_tag :password, nil, :class => "form-control", :placeholder => "", :required => true %>
26
+ <span>Password must be between 8 and 20 characters with no spaces</span>
26
27
  </div>
27
28
 
28
29
  <div class="form-group">
@@ -3,7 +3,7 @@
3
3
  <div class="col-md-6 col-md-offset-3" style="margin: 0 auto;float:none;">
4
4
  <h2><%= @website_section.title %></h2>
5
5
 
6
- <%= render_widget :signup, :params => {:login_url => "/login"} %>
6
+ <%= render_widget :signup, :params => {:login_url => "/login", :party_roles => 'customer'} %>
7
7
 
8
8
  </div>
9
9
  </div>
@@ -1,5 +1,4 @@
1
1
  <div class="alert alert-success">
2
- <h2>Sign up Successful</h2>
3
-
4
- <p>You will receive an email at <%= @email %> to activate your account</p>
2
+ <h2>Success</h2>
5
3
  </div>
4
+ <p>You will receive an email at <%= @email %> to activate your account</p>
@@ -4,7 +4,7 @@ Rails.application.routes.draw do
4
4
  get 'knitkit_mobile' => 'knitkit/mobile#index'
5
5
  match 'pages/:section_id' => 'knitkit/website_sections#index', :as => 'page'
6
6
  get 'onlinedocumentsections/:section_id' => 'knitkit/online_document_sections#index', :as => 'document'
7
- #get 'onlinedocumentsections/:section_id/:id' => 'knitkit/online_document_sections#show', :as => 'document'
7
+ get 'onlinedocumentsections/:section_id/show' => 'knitkit/online_document_sections#show'
8
8
  get 'blogs/:section_id(.:format)' => 'knitkit/blogs#index', :as => 'blogs'
9
9
  get 'blogs/:section_id/:id' => 'knitkit/blogs#show', :as => 'blog_article'
10
10
  get 'blogs/:section_id/tag/:tag_id(.:format)' => 'knitkit/blogs#tag', :as => 'blog_tag'
@@ -13,6 +13,20 @@ Rails.application.routes.draw do
13
13
  match '/unauthorized' => 'knitkit/unauthorized#index', :as => 'knitkit/unauthorized'
14
14
  match '/view_current_publication' => 'knitkit/base#view_current_publication'
15
15
  match '/online_document_sections(/:action)' => 'knitkit/online_document_sections'
16
+
17
+ namespace :api do
18
+ namespace :v1 do
19
+
20
+ resources :websites, defaults: { :format => 'json' }
21
+
22
+ end
23
+ end
24
+
25
+ get '/captcha/start/:how_many' => 'captcha#start'
26
+ get '/captcha/audio(/:type)' => 'captcha#audio'
27
+ get '/captcha/image/:index' => 'captcha#image'
28
+ put '/captcha/validate' => 'captcha#validate'
29
+
16
30
  end
17
31
 
18
32
  Knitkit::Engine.routes.draw do
@@ -25,10 +39,19 @@ Knitkit::Engine.routes.draw do
25
39
  resources :website_nav
26
40
  resources :website_nav_item do
27
41
  member do
28
- post :update_security
42
+ put :update_security
29
43
  end
30
44
  end
31
45
  resources :website_host
46
+ resources :online_document_sections do
47
+ collection do
48
+ post :copy
49
+ get :existing_documents
50
+ end
51
+ member do
52
+ get :content
53
+ end
54
+ end
32
55
 
33
56
  match '/:action' => 'app'
34
57
  match '/image_assets/:context/:action' => 'image_assets'
@@ -41,8 +64,6 @@ Knitkit::Engine.routes.draw do
41
64
  match '/site(/:action)' => 'website'
42
65
  #section
43
66
  match '/section/:action' => 'website_section'
44
- #document
45
- match '/online_document_sections/:action' => 'online_document_sections'
46
67
  #theme
47
68
  match '/theme/:action' => 'theme'
48
69
  #version
@@ -4,7 +4,6 @@ class AddPublisherRole
4
4
  SecurityRole.create(:internal_identifier => 'publisher', :description => 'Publisher')
5
5
  SecurityRole.create(:internal_identifier => 'content_author', :description => 'Content Author')
6
6
  SecurityRole.create(:internal_identifier => 'layout_author', :description => 'Layout Author')
7
- SecurityRole.create(:internal_identifier => 'editor', :description => 'Editor')
8
7
  SecurityRole.create(:internal_identifier => 'designer', :description => 'Designer')
9
8
  SecurityRole.create(:internal_identifier => 'website_author', :description => 'Website Author')
10
9
  end
@@ -13,7 +12,6 @@ class AddPublisherRole
13
12
  SecurityRole.iid('publisher').destroy
14
13
  SecurityRole.iid('content_author').destroy
15
14
  SecurityRole.iid('layout_author').destroy
16
- SecurityRole.iid('editor').destroy
17
15
  SecurityRole.iid('designer').destroy
18
16
  SecurityRole.iid('website_author').destroy
19
17
  end
@@ -1,29 +1,21 @@
1
1
  class AddKnitkitApplication
2
-
2
+
3
3
  def self.up
4
4
  if DesktopApplication.find_by_internal_identifier('knitkit').nil?
5
- knikit_app = DesktopApplication.create(
5
+ app = DesktopApplication.create(
6
6
  :description => 'KnitKit',
7
7
  :icon => 'icon-palette',
8
- :javascript_class_name => 'Compass.ErpApp.Desktop.Applications.Knitkit',
9
- :internal_identifier => 'knitkit',
10
- :shortcut_id => 'knitkit-win'
8
+ :internal_identifier => 'knitkit'
11
9
  )
12
10
 
13
- knikit_app.preference_types << PreferenceType.iid('desktop_shortcut')
14
- knikit_app.preference_types << PreferenceType.iid('autoload_application')
15
- knikit_app.save
16
-
17
11
  admin_user = User.find_by_username('admin')
18
- admin_user.desktop.applications << knikit_app
12
+ admin_user.desktop_applications << app
19
13
  admin_user.save
20
-
21
- truenorth_user = User.find_by_username('truenorth')
22
- truenorth_user.desktop.applications << knikit_app
23
- truenorth_user.save
14
+
15
+ app.add_party_with_role(admin_user.party.dba_organization, RoleType.iid('dba_org'))
24
16
  end
25
17
  end
26
-
18
+
27
19
  def self.down
28
20
  DesktopApplication.find_by_internal_identifier('knitkit').destroy
29
21
  end
@@ -3,6 +3,21 @@ class CreateWebsiteDefaultConfiguration
3
3
  def self.up
4
4
  unless ::Configuration.find_template('default_website_configuration')
5
5
  website_setup_category = Category.create(:description => 'Website Setup', :internal_identifier => 'website_setup')
6
+ content_work_flow_category = Category.create(:description => 'Content Workflow', :internal_identifier => 'content_workflow')
7
+
8
+ yes_option = ConfigurationOption.find_by_internal_identifier('yes')
9
+ yes_option = ConfigurationOption.create(
10
+ :description => 'Yes',
11
+ :internal_identifier => 'yes',
12
+ :value => 'yes'
13
+ ) if yes_option.nil?
14
+
15
+ no_option = ConfigurationOption.find_by_internal_identifier('no')
16
+ no_option = ConfigurationOption.create(
17
+ :description => 'No',
18
+ :internal_identifier => 'no',
19
+ :value => 'no'
20
+ ) if no_option.nil?
6
21
 
7
22
  #configuration
8
23
  configuration = Configuration.create(
@@ -11,6 +26,7 @@ class CreateWebsiteDefaultConfiguration
11
26
  :is_template => true
12
27
  )
13
28
 
29
+ # login url
14
30
  login_url_config_item_type = ConfigurationItemType.create(
15
31
  :description => 'Login Url',
16
32
  :internal_identifier => 'login_url',
@@ -19,6 +35,16 @@ class CreateWebsiteDefaultConfiguration
19
35
  CategoryClassification.create(:category => website_setup_category, :classification => login_url_config_item_type)
20
36
  configuration.configuration_item_types << login_url_config_item_type
21
37
 
38
+ # primary host
39
+ primary_host_config_item_type = ConfigurationItemType.create(
40
+ :description => 'Primary Host',
41
+ :internal_identifier => 'primary_host',
42
+ :allow_user_defined_options => true
43
+ )
44
+ CategoryClassification.create(:category => website_setup_category, :classification => primary_host_config_item_type)
45
+ configuration.configuration_item_types << primary_host_config_item_type
46
+
47
+ # homepage url
22
48
  home_page_url_config_item_type = ConfigurationItemType.create(
23
49
  :description => 'Homepage Url',
24
50
  :internal_identifier => 'homepage_url',
@@ -27,6 +53,7 @@ class CreateWebsiteDefaultConfiguration
27
53
  CategoryClassification.create(:category => website_setup_category, :classification => home_page_url_config_item_type)
28
54
  configuration.configuration_item_types << home_page_url_config_item_type
29
55
 
56
+ # contact us email
30
57
  contact_us_email_address_item_type = ConfigurationItemType.create(
31
58
  :description => 'Contact Us Email',
32
59
  :internal_identifier => 'contact_us_email_address',
@@ -34,13 +61,46 @@ class CreateWebsiteDefaultConfiguration
34
61
  )
35
62
  CategoryClassification.create(:category => website_setup_category, :classification => contact_us_email_address_item_type)
36
63
  configuration.configuration_item_types << contact_us_email_address_item_type
37
-
64
+
65
+ #add email inquiries config
66
+ email_inquiries_config_item_type = ConfigurationItemType.create(
67
+ :description => 'Email inquiries',
68
+ :internal_identifier => 'email_inquiries'
69
+ )
70
+ email_inquiries_config_item_type.configuration_options << yes_option
71
+ email_inquiries_config_item_type.add_default_option(no_option)
72
+ CategoryClassification.create(:category => website_setup_category, :classification => email_inquiries_config_item_type)
73
+
74
+ configuration.configuration_item_types << email_inquiries_config_item_type
75
+
76
+ #add auto activate publications
77
+ auto_activate_config_item_type = ConfigurationItemType.create(
78
+ :description => 'Auto activate publications',
79
+ :internal_identifier => 'auto_active_publications'
80
+ )
81
+ auto_activate_config_item_type.configuration_options << no_option
82
+ auto_activate_config_item_type.add_default_option(yes_option)
83
+ CategoryClassification.create(:category => content_work_flow_category, :classification => auto_activate_config_item_type)
84
+
85
+ configuration.configuration_item_types << auto_activate_config_item_type
86
+
87
+ #add auto publish on save
88
+ publish_on_save_config_item_type = ConfigurationItemType.create(
89
+ :description => 'Publish on save',
90
+ :internal_identifier => 'publish_on_save'
91
+ )
92
+ publish_on_save_config_item_type.configuration_options << no_option
93
+ publish_on_save_config_item_type.add_default_option(yes_option)
94
+ CategoryClassification.create(:category => content_work_flow_category, :classification => publish_on_save_config_item_type)
95
+
96
+ configuration.configuration_item_types << publish_on_save_config_item_type
97
+
38
98
  #password strength
39
99
  simple_password_option = ConfigurationOption.create(
40
100
  :description => 'Simple password',
41
- :comment => 'must be at least 8 characters long and start and end with a letter',
101
+ :comment => 'must be between 8 and 20 characters with no spaces',
42
102
  :internal_identifier => 'simple_password_regex',
43
- :value => '^[A-Za-z]\w{6,}[A-Za-z]$'
103
+ :value => '^\S{8,20}$'
44
104
  )
45
105
 
46
106
  complex_password_option = ConfigurationOption.create(
@@ -0,0 +1,12 @@
1
+ class AddWebsiteMemberRoles
2
+
3
+ def self.up
4
+ website_role_type_parent = RoleType.find_or_create('website', 'Website')
5
+ RoleType.find_or_create('member', 'Member', website_role_type_parent)
6
+ end
7
+
8
+ def self.down
9
+ RoleType.iid('website').destroy_all
10
+ end
11
+
12
+ end
@@ -0,0 +1,35 @@
1
+ class NestKnitkitSecurityRoles
2
+
3
+ def self.up
4
+ website_author = SecurityRole.find_by_internal_identifier('website_author')
5
+ layout_author = SecurityRole.find_by_internal_identifier('layout_author')
6
+ content_author = SecurityRole.find_by_internal_identifier('content_author')
7
+ designer = SecurityRole.find_by_internal_identifier('designer')
8
+ publisher = SecurityRole.find_by_internal_identifier('publisher')
9
+
10
+ website_builder = SecurityRole.create(:internal_identifier => 'website_builder', :description => 'Website Builder')
11
+
12
+ website_author.move_to_child_of(website_builder)
13
+ layout_author.move_to_child_of(website_builder)
14
+ content_author.move_to_child_of(website_builder)
15
+ designer.move_to_child_of(website_builder)
16
+ publisher.move_to_child_of(website_builder)
17
+ end
18
+
19
+ def self.down
20
+ website_author = SecurityRole.find_by_internal_identifier('website_author')
21
+ layout_author = SecurityRole.find_by_internal_identifier('layout_author')
22
+ content_author = SecurityRole.find_by_internal_identifier('content_author')
23
+ designer = SecurityRole.find_by_internal_identifier('designer')
24
+ publisher = SecurityRole.find_by_internal_identifier('publisher')
25
+
26
+ website_author.move_to_child_of(nil)
27
+ layout_author.move_to_child_of(nil)
28
+ content_author.move_to_child_of(nil)
29
+ designer.move_to_child_of(nil)
30
+ publisher.move_to_child_of(nil)
31
+
32
+ SecurityRole.find_by_internal_identifier('website_builder').destroy
33
+ end
34
+
35
+ end