knitkit 3.0.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{public → app/assets}/images/check.png +0 -0
- data/{public → app/assets}/images/credit_card.png +0 -0
- data/{public → app/assets}/images/inline_edit/close.png +0 -0
- data/{public → app/assets}/images/knitkit/icons/document.png +0 -0
- data/{public → app/assets}/images/knitkit/icons/multi_doc.png +0 -0
- data/{public → app/assets}/images/knitkit/logo.png +0 -0
- data/{public → app/assets}/images/knitkit/splash/images/add-site.png +0 -0
- data/app/assets/images/knitkit/splash/images/add_website_105x105-active.png +0 -0
- data/app/assets/images/knitkit/splash/images/add_website_105x105.png +0 -0
- data/{public → app/assets}/images/knitkit/splash/images/adjust-site.png +0 -0
- data/{public → app/assets}/images/knitkit/splash/images/browse-site.png +0 -0
- data/app/assets/images/knitkit/splash/images/browse_db_105x105-active.png +0 -0
- data/app/assets/images/knitkit/splash/images/browse_db_105x105.png +0 -0
- data/app/assets/images/knitkit/splash/images/console_105x105-active.png +0 -0
- data/app/assets/images/knitkit/splash/images/console_105x105.png +0 -0
- data/{public → app/assets}/images/knitkit/splash/images/find-themes.png +0 -0
- data/app/assets/images/knitkit/splash/images/find_themes_105x105-active.png +0 -0
- data/app/assets/images/knitkit/splash/images/find_themes_105x105.png +0 -0
- data/app/assets/images/knitkit/splash/images/learn_more_105x105-active.png +0 -0
- data/app/assets/images/knitkit/splash/images/learn_more_105x105.png +0 -0
- data/{public → app/assets}/images/knitkit/splash/images/settings.png +0 -0
- data/{public → app/assets}/images/knitkit/splash/images/tutorials.png +0 -0
- data/app/assets/images/knitkit/splash/splash.png +0 -0
- data/app/assets/images/widgets/manage_profile/contact_information.png +0 -0
- data/app/assets/images/widgets/manage_profile/password.png +0 -0
- data/app/assets/images/widgets/manage_profile/user_information.png +0 -0
- data/app/assets/javascripts/erp_app/desktop/applications/knitkit/app.js +24 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/articles_grid_panel.js +15 -12
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/center_region.js +69 -48
- data/app/assets/javascripts/erp_app/desktop/applications/knitkit/comments_grid_panel.js +214 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/east_region.js +0 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/file_assets_panel.js +17 -19
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/image_assets_data_view.js +13 -3
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/image_assets_panel.js +59 -48
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/widgets_panel.js +0 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/inquiries_grid_panel.js +2 -2
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/module.js +2 -2
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/publish_window.js +0 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/published_grid_panel.js +1 -1
- data/app/assets/javascripts/erp_app/desktop/applications/knitkit/splash_screen.js +268 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/top_menu/main_menu.js +85 -33
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/top_menu/websites_combo.js +0 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/versions_grid_panel.js +5 -28
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/article.js +22 -8
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/document.js +143 -25
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/host.js +5 -1
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/menu.js +2 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/section.js +181 -65
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/website_nav_items.js +0 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/hosts_tree_panel.js +0 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/menu_tree_panel.js +0 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/site_contents_tree_panel.js +121 -116
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/themes_tree_panel.js +101 -10
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/west_region.js +9 -5
- data/app/assets/javascripts/knitkit-web.js +22 -0
- data/app/assets/javascripts/knitkit/additional-methods.min.js +4 -0
- data/app/assets/javascripts/knitkit/bootstrap.min.js +7 -0
- data/app/assets/javascripts/knitkit/captcha.js +154 -0
- data/{public → app/assets}/javascripts/knitkit/confirm-bootstrap.js +1 -1
- data/{public → app/assets}/javascripts/knitkit/inline_editing.js +1 -1
- data/{public → app/assets}/javascripts/knitkit/jquery.maskedinput.min.js +0 -0
- data/app/assets/javascripts/knitkit/jquery.validate.min.js +4 -0
- data/app/assets/javascripts/knitkit/js.cookie.js +145 -0
- data/{public → app/assets}/javascripts/knitkit/theme.js +0 -0
- data/app/assets/stylesheets/erp_app/desktop/applications/knitkit/app.css +12 -0
- data/{public → app/assets}/stylesheets/erp_app/desktop/applications/knitkit/knitkit.css +23 -33
- data/app/assets/stylesheets/erp_app/shared/knitkit_shared.css +21 -0
- data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.svg +288 -0
- data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.woff2 +0 -0
- data/app/assets/stylesheets/knitkit-web.css +16 -0
- data/app/assets/stylesheets/knitkit/bootstrap.min.css +5 -0
- data/app/assets/stylesheets/knitkit/captcha.css +59 -0
- data/app/assets/stylesheets/knitkit/custom.css +144 -0
- data/{public → app/assets}/stylesheets/knitkit/inline_editing.css +0 -0
- data/app/assets/stylesheets/knitkit/submenu.css +93 -0
- data/app/controllers/api/v1/websites_controller.rb +14 -0
- data/app/controllers/captcha_controller.rb +53 -0
- data/app/controllers/knitkit/base_controller.rb +1 -5
- data/app/controllers/knitkit/erp_app/desktop/app_controller.rb +2 -9
- data/app/controllers/knitkit/erp_app/desktop/articles_controller.rb +20 -7
- data/app/controllers/knitkit/erp_app/desktop/file_assets_controller.rb +38 -28
- data/app/controllers/knitkit/erp_app/desktop/image_assets_controller.rb +16 -9
- data/app/controllers/knitkit/erp_app/desktop/online_document_sections_controller.rb +69 -15
- data/app/controllers/knitkit/erp_app/desktop/position_controller.rb +45 -58
- data/app/controllers/knitkit/erp_app/desktop/theme_controller.rb +64 -29
- data/app/controllers/knitkit/erp_app/desktop/website_controller.rb +36 -13
- data/app/controllers/knitkit/erp_app/desktop/website_host_controller.rb +12 -0
- data/app/controllers/knitkit/erp_app/desktop/website_nav_controller.rb +4 -11
- data/app/controllers/knitkit/erp_app/desktop/website_nav_item_controller.rb +2 -9
- data/app/controllers/knitkit/erp_app/desktop/website_section_controller.rb +56 -20
- data/app/controllers/knitkit/online_document_sections_controller.rb +9 -3
- data/app/mailers/website_inquiry_mailer.rb +11 -3
- data/app/models/content.rb +16 -6
- data/app/models/documented_item.rb +12 -1
- data/app/models/online_document_section.rb +54 -20
- data/app/models/published_website.rb +16 -0
- data/app/models/theme.rb +53 -47
- data/app/models/website.rb +172 -191
- data/app/models/website_section.rb +64 -30
- data/app/views/knitkit/blogs/show.html.erb +5 -2
- data/app/views/layouts/knitkit/base.html.erb +54 -51
- data/app/views/menus/knitkit/_default_menu.html.erb +11 -11
- data/app/views/menus/knitkit/_default_section_menu.html.erb +2 -2
- data/app/views/menus/knitkit/_default_sub_menu.erb +27 -0
- data/app/views/menus/knitkit/_default_sub_section_menu.html.erb +30 -0
- data/app/views/website_inquiry_mailer/inquiry.html.erb +266 -0
- data/app/widgets/contact_us/base.rb +26 -16
- data/app/widgets/contact_us/javascript/contact_us.js +1 -1
- data/app/widgets/contact_us/views/error.html.erb +7 -3
- data/app/widgets/contact_us/views/index.html.erb +36 -28
- data/app/widgets/google_map/javascript/google_map.js +1 -1
- data/app/widgets/google_map/views/index.html.erb +1 -1
- data/app/widgets/login/javascript/login.js +1 -1
- data/app/widgets/login/views/index.html.erb +1 -1
- data/app/widgets/manage_profile/base.rb +141 -112
- data/app/widgets/manage_profile/javascript/manage_profile.js +2 -2
- data/app/widgets/manage_profile/views/_password_form.html.erb +1 -1
- data/app/widgets/manage_profile/views/_user_information_form.html.erb +1 -30
- data/app/widgets/manage_profile/views/index.html.erb +42 -40
- data/app/widgets/reset_password/base.rb +39 -8
- data/app/widgets/reset_password/javascript/reset_password.js +1 -1
- data/app/widgets/reset_password/views/index.html.erb +3 -3
- data/app/widgets/reset_password/views/invalid_reset_token.html.erb +7 -0
- data/app/widgets/reset_password/views/layouts/base.html.erb +1 -1
- data/app/widgets/reset_password/views/reset_password.html.erb +39 -0
- data/app/widgets/reset_password/views/reset_success.html.erb +5 -0
- data/app/widgets/search/base.rb +5 -5
- data/app/widgets/search/javascript/search.js +6 -6
- data/app/widgets/search/views/_inline_search_form.html.erb +23 -12
- data/app/widgets/search/views/_search_form.html.erb +34 -30
- data/app/widgets/search/views/layouts/base.html.erb +6 -1
- data/app/widgets/signup/base.rb +73 -30
- data/app/widgets/signup/javascript/signup.js +1 -1
- data/app/widgets/signup/views/_signup_form.html.erb +2 -1
- data/app/widgets/signup/views/layouts/base.html.erb +1 -1
- data/app/widgets/signup/views/success.html.erb +2 -3
- data/config/routes.rb +25 -4
- data/db/data_migrations/20110509223702_add_publisher_role.rb +0 -2
- data/db/data_migrations/20110816153456_add_knitkit_application.rb +7 -15
- data/db/data_migrations/20120127150505_create_website_default_configuration.rb +63 -3
- data/db/data_migrations/20150118180450_add_website_member_roles.rb +12 -0
- data/db/data_migrations/20150414150359_nest_knitkit_security_roles.rb +35 -0
- data/db/data_migrations/20150414173437_move_website_roles_under_website_builder.rb +19 -0
- data/db/migrate/20110211002317_setup_knitkit.rb +86 -39
- data/lib/knitkit.rb +8 -2
- data/lib/knitkit/config.rb +2 -3
- data/lib/knitkit/engine.rb +35 -4
- data/lib/knitkit/extensions.rb +2 -1
- data/lib/knitkit/extensions/action_controller/theme_support/acts_as_themed_controller.rb +1 -1
- data/lib/knitkit/extensions/action_mailer/theme_support/acts_as_themed_mailer.rb +1 -1
- data/lib/knitkit/extensions/compass_ae/mailers/user_mailer.rb +31 -0
- data/lib/knitkit/extensions/compass_ae/widgets/base.rb +1 -1
- data/lib/knitkit/extensions/railties/action_controller/captcha_helper.rb +43 -0
- data/lib/knitkit/extensions/railties/action_view/helpers/content_helper.rb +1 -1
- data/lib/knitkit/extensions/railties/action_view/helpers/menu_helper.rb +11 -1
- data/lib/knitkit/extensions/railties/theme_support/asset_tag_helper.rb +83 -0
- data/lib/knitkit/routing_filter/section_router.rb +24 -14
- data/lib/knitkit/version.rb +1 -1
- data/lib/tasks/knitkit_tasks.rake +89 -4
- data/lib/tasks/theme_parser.rake +85 -0
- data/public/fonts/glyphicons-halflings-regular.eot +0 -0
- data/public/fonts/glyphicons-halflings-regular.svg +288 -0
- data/public/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/public/fonts/glyphicons-halflings-regular.woff +0 -0
- data/public/fonts/glyphicons-halflings-regular.woff2 +0 -0
- data/public/paypal-button.min.js +7 -0
- metadata +161 -82
- data/app/assets/javascripts/knitkit/application.js +0 -9
- data/app/assets/stylesheets/knitkit/application.css +0 -7
- data/app/mailers/document_mailer.rb +0 -10
- data/app/views/document_mailer/email_document.html.erb +0 -12
- data/app/views/knitkit/mobile/index.html.erb +0 -162
- data/app/views/knitkit/online_document_sections/index.html.erb +0 -279
- data/app/views/layouts/knitkit/online_document_sections.html.erb +0 -80
- data/app/views/website_inquiry_mailer/inquiry.erb +0 -24
- data/db/data_migrations/20120127150506_add_primary_host_to_website_configuration.rb +0 -33
- data/db/data_migrations/20120316150424_add_is_template_to_default_website_config.rb +0 -16
- data/db/data_migrations/20120809020508_update_website_and_configuration.rb +0 -82
- data/db/data_migrations/20121129185611_upgrade_website_role_iid.rb +0 -20
- data/db/migrate/20130405184234_add_use_markdown_to_section.rb +0 -19
- data/db/migrate/20131112013052_add_knitkit_missing_indexes.rb +0 -33
- data/db/migrate/20140622212723_update_website_inquiries.rb +0 -22
- data/db/migrate/20140911185022_add_publishing_to_website.rb +0 -5
- data/db/migrate/20141013073349_add_custom_fields_to_documents.rb +0 -12
- data/db/migrate/20141016101936_upgrade_remove_dynamic_attributes.rb +0 -13
- data/lib/knitkit/extensions/railties/theme_support/theme_file_resolver.rb +0 -49
- data/public/images/knitkit/close_window.png +0 -0
- data/public/images/knitkit/splash/splash.png +0 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/comments_grid_panel.js +0 -215
- data/public/javascripts/erp_app/desktop/applications/knitkit/select_roles_window.js +0 -108
- data/public/javascripts/erp_app/desktop/applications/knitkit/splash_screen.js +0 -170
- data/public/javascripts/knitkit/bootstrap-datepicker.js +0 -474
- data/public/javascripts/knitkit/bootstrap.min.js +0 -7
- data/public/javascripts/knitkit/mobile/app/view/Main.js +0 -108
- data/public/javascripts/knitkit/mobile/ux/slidenavigation/View.js +0 -734
- data/public/stylesheets/knitkit/bootstrap-responsive.min.css +0 -10
- data/public/stylesheets/knitkit/bootstrap.min.css +0 -7
- data/public/stylesheets/knitkit/custom.css +0 -122
- data/public/stylesheets/knitkit/datepicker.css +0 -182
@@ -2,10 +2,11 @@ class WebsiteSection < ActiveRecord::Base
|
|
2
2
|
attr_protected :created_at, :updated_at
|
3
3
|
|
4
4
|
after_create :update_paths # must happen after has_roles so that after_create :save_secured_model fires first
|
5
|
-
before_save
|
5
|
+
before_save :update_path, :check_internal_identifier
|
6
6
|
|
7
7
|
extend FriendlyId
|
8
8
|
friendly_id :title, :use => [:slugged, :scoped], :slug_column => :permalink, :scope => [:website_id, :parent_id]
|
9
|
+
|
9
10
|
def should_generate_new_friendly_id?
|
10
11
|
new_record?
|
11
12
|
end
|
@@ -38,6 +39,35 @@ class WebsiteSection < ActiveRecord::Base
|
|
38
39
|
end
|
39
40
|
end
|
40
41
|
|
42
|
+
def copy(title=nil, copy_articles=false, copy_children=false)
|
43
|
+
new_section = WebsiteSection.new
|
44
|
+
|
45
|
+
new_section.title = title.nil? ? self.title : title
|
46
|
+
new_section.layout = self.layout
|
47
|
+
new_section.in_menu = self.in_menu
|
48
|
+
new_section.render_base_layout = self.render_base_layout
|
49
|
+
new_section.website_id = self.website_id
|
50
|
+
|
51
|
+
new_section.save!
|
52
|
+
|
53
|
+
# copy attached articles
|
54
|
+
if copy_articles
|
55
|
+
self.articles.readonly(false).each do |article|
|
56
|
+
article.website_sections << new_section
|
57
|
+
article.save
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
if copy_children
|
62
|
+
self.children.each do |child_section|
|
63
|
+
new_child_section = child_section.copy(nil, copy_articles, copy_children)
|
64
|
+
new_child_section.move_to_child_of(new_section)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
new_section
|
69
|
+
end
|
70
|
+
|
41
71
|
def is_blog?
|
42
72
|
self.is_a?(Blog) || self.attributes['type'] == 'Blog'
|
43
73
|
end
|
@@ -68,7 +98,11 @@ class WebsiteSection < ActiveRecord::Base
|
|
68
98
|
end
|
69
99
|
|
70
100
|
def positioned_children
|
71
|
-
children.
|
101
|
+
children.order('position')
|
102
|
+
end
|
103
|
+
|
104
|
+
def children_in_menu
|
105
|
+
positioned_children.where('in_menu = ?', true)
|
72
106
|
end
|
73
107
|
|
74
108
|
def paths
|
@@ -77,13 +111,13 @@ class WebsiteSection < ActiveRecord::Base
|
|
77
111
|
end
|
78
112
|
|
79
113
|
def child_by_path(path)
|
80
|
-
self.descendants.detect{|child| child.path == path}
|
114
|
+
self.descendants.detect { |child| child.path == path }
|
81
115
|
end
|
82
116
|
|
83
117
|
def type
|
84
118
|
read_attribute(:type) || 'Page'
|
85
119
|
end
|
86
|
-
|
120
|
+
|
87
121
|
def is_section?
|
88
122
|
['Page', 'Blog'].include? type
|
89
123
|
end
|
@@ -91,7 +125,7 @@ class WebsiteSection < ActiveRecord::Base
|
|
91
125
|
def display_in_menu?
|
92
126
|
self.in_menu
|
93
127
|
end
|
94
|
-
|
128
|
+
|
95
129
|
def is_secured?
|
96
130
|
self.protected_with_capability?('view')
|
97
131
|
end
|
@@ -101,17 +135,17 @@ class WebsiteSection < ActiveRecord::Base
|
|
101
135
|
end
|
102
136
|
|
103
137
|
def create_layout
|
104
|
-
self.layout = IO.read(File.join(WEBSITE_SECTIONS_TEMP_LAYOUT_PATH,"index.html.erb"))
|
138
|
+
self.layout = IO.read(File.join(WEBSITE_SECTIONS_TEMP_LAYOUT_PATH, "index.html.erb"))
|
105
139
|
self.save
|
106
140
|
end
|
107
141
|
|
108
142
|
def get_published_layout(active_publication)
|
143
|
+
layout_content = nil
|
144
|
+
|
109
145
|
published_website_id = active_publication.id
|
110
146
|
published_element = PublishedElement.includes([:published_website]).where('published_websites.id = ? and published_element_record_id = ? and published_element_record_type = ?', published_website_id, self.id, 'WebsiteSection').first
|
111
147
|
unless published_element.nil?
|
112
148
|
layout_content = WebsiteSection::Version.where('version = ? and website_section_id = ?', published_element.version, published_element.published_element_record_id).first.layout
|
113
|
-
else
|
114
|
-
layout_content = IO.read(File.join(WEBSITE_SECTIONS_TEMP_LAYOUT_PATH,"index.html.erb"))
|
115
149
|
end
|
116
150
|
layout_content
|
117
151
|
end
|
@@ -133,7 +167,7 @@ class WebsiteSection < ActiveRecord::Base
|
|
133
167
|
# ORDER BY tags.name ASC"
|
134
168
|
# ActsAsTaggableOn::Tag.find_by_sql(sql)
|
135
169
|
|
136
|
-
self.contents.tag_counts_on(:tags).sort_by{|t| t.name }
|
170
|
+
self.contents.tag_counts_on(:tags).sort_by { |t| t.name }
|
137
171
|
end
|
138
172
|
|
139
173
|
def update_path!
|
@@ -141,39 +175,39 @@ class WebsiteSection < ActiveRecord::Base
|
|
141
175
|
self.path = new_path unless self.path == new_path
|
142
176
|
self.save
|
143
177
|
end
|
144
|
-
|
178
|
+
|
145
179
|
def build_section_hash
|
146
180
|
section_hash = {
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
181
|
+
:name => self.title,
|
182
|
+
:has_layout => !self.layout.blank?,
|
183
|
+
:type => self.class.to_s,
|
184
|
+
:in_menu => self.in_menu,
|
185
|
+
:articles => [],
|
186
|
+
:roles => self.roles.collect(&:internal_identifier),
|
187
|
+
:path => self.path,
|
188
|
+
:permalink => self.permalink,
|
189
|
+
:internal_identifier => self.internal_identifier,
|
190
|
+
:render_base_layout => self.render_base_layout,
|
191
|
+
:position => self.position,
|
192
|
+
:sections => self.children.each.map { |child| child.build_section_hash }
|
159
193
|
}
|
160
194
|
|
161
195
|
self.contents.each do |content|
|
162
196
|
content_area = content.content_area_by_website_section(self)
|
163
197
|
position = content.position_by_website_section(self)
|
164
198
|
section_hash[:articles] << {
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
199
|
+
:name => content.title,
|
200
|
+
:tag_list => content.tag_list.join(', '),
|
201
|
+
:content_area => content_area,
|
202
|
+
:position => position,
|
203
|
+
:display_title => content.display_title,
|
204
|
+
:internal_identifier => content.internal_identifier
|
171
205
|
}
|
172
206
|
end
|
173
207
|
|
174
208
|
section_hash
|
175
209
|
end
|
176
|
-
|
210
|
+
|
177
211
|
|
178
212
|
protected
|
179
213
|
|
@@ -198,7 +232,7 @@ class WebsiteSection < ActiveRecord::Base
|
|
198
232
|
def check_internal_identifier
|
199
233
|
self.internal_identifier = self.permalink if self.internal_identifier.blank?
|
200
234
|
end
|
201
|
-
|
235
|
+
|
202
236
|
private
|
203
237
|
|
204
238
|
def self.get_published_version(active_publication, content)
|
@@ -1,6 +1,11 @@
|
|
1
|
+
|
1
2
|
<div class="container">
|
3
|
+
|
4
|
+
|
2
5
|
<div class="page-header">
|
3
6
|
|
7
|
+
<%= link_to "Back", @blog.path %>
|
8
|
+
|
4
9
|
<h1><%= @blog.title %></h1>
|
5
10
|
|
6
11
|
<h3><%= @published_content.title %></h3>
|
@@ -18,8 +23,6 @@
|
|
18
23
|
<br/>
|
19
24
|
<%= blog_recent_approved_comments %>
|
20
25
|
|
21
|
-
<p class="text-center"><%= link_to "Home", @blog.path %></p>
|
22
|
-
|
23
26
|
<br/>
|
24
27
|
</div>
|
25
28
|
<hr/>
|
@@ -9,26 +9,22 @@
|
|
9
9
|
|
10
10
|
<%= javascript_include_tag :application %>
|
11
11
|
|
12
|
-
|
13
|
-
<%=
|
14
|
-
<%=
|
15
|
-
<%= static_javascript_include_tag 'knitkit/bootstrap-datepicker.js' %>
|
16
|
-
<%= static_javascript_include_tag 'knitkit/confirm-bootstrap.js' %>
|
17
|
-
|
18
|
-
<%= static_stylesheet_link_tag 'knitkit/bootstrap.min.css' %>
|
19
|
-
<%= static_stylesheet_link_tag 'knitkit/bootstrap-responsive.min.css' %>
|
20
|
-
<%= static_stylesheet_link_tag 'knitkit/datepicker.css' %>
|
21
|
-
<%= static_stylesheet_link_tag 'knitkit/custom.css' %>
|
22
|
-
<!-- end bootstrap -->
|
23
|
-
|
24
|
-
<%= static_javascript_include_tag 'erp_app/utility.js' %>
|
25
|
-
<%= static_javascript_include_tag 'erp_app/jquery_support.js' %>
|
26
|
-
<%= static_javascript_include_tag 'erp_app/widgets.js' %>
|
27
|
-
<%= static_javascript_include_tag 'knitkit/inline_editing.js' %>
|
28
|
-
<%= static_javascript_include_tag 'knitkit/jquery.maskedinput.min.js' %>
|
12
|
+
<%= javascript_include_tag 'erp_app/utility' %>
|
13
|
+
<%= javascript_include_tag 'erp_app/jquery_support' %>
|
14
|
+
<%= javascript_include_tag 'erp_app/widgets' %>
|
29
15
|
|
16
|
+
<!-- Knitkit Helpers -->
|
17
|
+
<%= javascript_include_tag 'knitkit-web' %>
|
18
|
+
<%= stylesheet_link_tag 'knitkit-web' %>
|
19
|
+
<!-- end -->
|
20
|
+
|
21
|
+
<!-- Bootstrap theme helpers -->
|
22
|
+
<%= javascript_include_tag 'knitkit/theme' %>
|
23
|
+
<%= stylesheet_link_tag 'knitkit/custom' %>
|
24
|
+
<!-- end -->
|
25
|
+
|
26
|
+
<!-- code mirror -->
|
30
27
|
<%= include_code_mirror_library %>
|
31
|
-
<%= static_stylesheet_link_tag 'knitkit/inline_editing.css' %>
|
32
28
|
|
33
29
|
<%= setup_js_authentication %>
|
34
30
|
|
@@ -36,48 +32,55 @@
|
|
36
32
|
</head>
|
37
33
|
<body>
|
38
34
|
|
39
|
-
<div id="wrap">
|
35
|
+
<div id="wrap">
|
40
36
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
37
|
+
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
|
38
|
+
<div class="navbar-header pull-left">
|
39
|
+
<a class="navbar-brand" href="/home"><img src="/assets/knitkit/logo.png" alt="Logo"/></a>
|
40
|
+
</div>
|
45
41
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
42
|
+
<div class="navbar-header pull-right">
|
43
|
+
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
44
|
+
<span class="icon-bar"></span>
|
45
|
+
<span class="icon-bar"></span>
|
46
|
+
<span class="icon-bar"></span>
|
47
|
+
</button>
|
48
|
+
</div>
|
49
|
+
|
50
|
+
<%= render_widget :search,
|
51
|
+
:action => :index,
|
52
|
+
:params => {:redirect_results => true, :results_permalink => '/search-results'} %>
|
53
53
|
|
54
|
-
<%= render_widget :login,
|
55
|
-
:action => :login_header,
|
56
|
-
:params => {:login_url => '/login', :signup_url => '/sign-up'} %>
|
57
54
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
55
|
+
<%= render_widget :login,
|
56
|
+
:action => :login_header,
|
57
|
+
:params => {:login_url => '/login', :signup_url => '/sign-up'} %>
|
58
|
+
|
59
|
+
<div class="container-fluid">
|
60
|
+
<div class="navbar-collapse collapse">
|
61
|
+
<ul class="nav navbar-nav">
|
62
|
+
<%= content_for?(:menu) ? yield(:menu) : render_menu(@contents) %>
|
63
|
+
</ul>
|
64
|
+
</div>
|
63
65
|
</div>
|
64
|
-
</div>
|
65
|
-
</nav>
|
66
66
|
|
67
|
-
|
67
|
+
</nav>
|
68
|
+
|
69
|
+
<div class="content-area">
|
70
|
+
<%= content_for?(:sub_menu) ? yield(:sub_menu) : render_sub_menu(@contents) %>
|
71
|
+
|
72
|
+
<%= yield %>
|
73
|
+
</div>
|
68
74
|
|
69
|
-
<div class="content-area">
|
70
|
-
<%= yield %>
|
71
75
|
</div>
|
72
76
|
|
73
|
-
|
77
|
+
<div class="footer">
|
78
|
+
<%= content_for?(:footer) ? yield(:footer) : (render :partial => 'shared/knitkit/footer') %>
|
79
|
+
<%= yield :foot %>
|
80
|
+
</div>
|
81
|
+
<%= set_authenticity_token %>
|
82
|
+
<%= set_session_timeout %>
|
83
|
+
<%= setup_inline_editing %>
|
74
84
|
|
75
|
-
<div class="footer">
|
76
|
-
<%= content_for?(:footer) ? yield(:footer) : (render :partial => 'shared/knitkit/footer') %>
|
77
|
-
<%= yield :foot %>
|
78
|
-
</div>
|
79
|
-
<%= set_authenticity_token %>
|
80
|
-
<%= set_session_timeout %>
|
81
|
-
<%= setup_inline_editing %>
|
82
85
|
</body>
|
83
86
|
</html>
|
@@ -1,18 +1,18 @@
|
|
1
1
|
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
2
2
|
<ul class="nav navbar-nav">
|
3
|
-
|
3
|
+
<%- selected_menu_item = nil
|
4
4
|
menu_items.each do |menu_item|
|
5
5
|
if menu_item.allow_access?(current_user, :view)
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
6
|
+
if menu_item_selected(menu_item)
|
7
|
+
selected_menu_item = menu_item %>
|
8
|
+
<li class="active">
|
9
|
+
<%- else %>
|
10
|
+
<li>
|
11
|
+
<%- end %>
|
12
|
+
<a href="<%= menu_item.path %>"><%= menu_item.title %></a>
|
13
|
+
</li>
|
14
|
+
<%- end %>
|
15
|
+
<%- end %>
|
16
16
|
</ul>
|
17
17
|
</div>
|
18
18
|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<% @website_sections.each do |section|
|
8
8
|
if section.display_in_menu?
|
9
9
|
if section.allow_access?(current_user, :view)
|
10
|
-
if (
|
10
|
+
if menu_active?(section, selected_section_parent) %>
|
11
11
|
<li class="active">
|
12
12
|
<%
|
13
13
|
selected_section_parent = section
|
@@ -21,6 +21,6 @@
|
|
21
21
|
<% end %>
|
22
22
|
<% end %>
|
23
23
|
</ul>
|
24
|
-
</div>
|
25
24
|
<% end %>
|
25
|
+
</div>
|
26
26
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<% if menu_items.count > 0 %>
|
2
|
+
|
3
|
+
<!-- Sidebar -->
|
4
|
+
<div id="sidebar-wrapper" class="expanded">
|
5
|
+
<ul class="sidebar-nav">
|
6
|
+
<%- menu_items.each do |child_menu_item|
|
7
|
+
if child_menu_item.allow_access?(current_user, :view)
|
8
|
+
if menu_item_selected(child_menu_item) %>
|
9
|
+
<li class="active">
|
10
|
+
<%- else %>
|
11
|
+
<li>
|
12
|
+
<%- end %>
|
13
|
+
|
14
|
+
<a href="<%= child_menu_item.path %>"><%= child_menu_item.title %></a>
|
15
|
+
</li>
|
16
|
+
|
17
|
+
<%- end %>
|
18
|
+
<%- end %>
|
19
|
+
|
20
|
+
</ul>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
<script type='text/javascript'>
|
24
|
+
$('.content-area').addClass('side-bar-content-wrapper');
|
25
|
+
</script>
|
26
|
+
|
27
|
+
<% end %>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<% if @website_section.children_in_menu.count > 0 || !@website_section.parent.nil? %>
|
2
|
+
|
3
|
+
<!-- Sidebar -->
|
4
|
+
<div id="sidebar-wrapper" class="expanded">
|
5
|
+
<ul class="sidebar-nav">
|
6
|
+
<%- section = @website_section.parent ? @website_section.parent : @website_section %>
|
7
|
+
|
8
|
+
<%- section.children_in_menu.each do |child_section|
|
9
|
+
if child_section.allow_access?(current_user, :view)
|
10
|
+
if menu_active?(child_section, @website_section) %>
|
11
|
+
<li class="active">
|
12
|
+
<%- else %>
|
13
|
+
<li>
|
14
|
+
<%- end %>
|
15
|
+
|
16
|
+
<a href="<%= child_section.path %>"><%= child_section.title %></a>
|
17
|
+
</li>
|
18
|
+
|
19
|
+
<%- end %>
|
20
|
+
<%- end %>
|
21
|
+
|
22
|
+
</ul>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<script type='text/javascript'>
|
26
|
+
$('.content-area').addClass('side-bar-content-wrapper');
|
27
|
+
</script>
|
28
|
+
|
29
|
+
<% end %>
|
30
|
+
|
@@ -0,0 +1,266 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"/>
|
7
|
+
<title>Website Inquiry</title>
|
8
|
+
<style type="text/css">
|
9
|
+
.ReadMsgBody {
|
10
|
+
width: 100%;
|
11
|
+
background-color: #ffffff;
|
12
|
+
}
|
13
|
+
|
14
|
+
.ExternalClass {
|
15
|
+
width: 100%;
|
16
|
+
background-color: #ffffff;
|
17
|
+
}
|
18
|
+
|
19
|
+
html {
|
20
|
+
width: 100%;
|
21
|
+
}
|
22
|
+
|
23
|
+
body {
|
24
|
+
-webkit-text-size-adjust: none;
|
25
|
+
-ms-text-size-adjust: none;
|
26
|
+
margin: 0;
|
27
|
+
padding: 0;
|
28
|
+
}
|
29
|
+
|
30
|
+
table {
|
31
|
+
border-spacing: 0;
|
32
|
+
border-collapse: collapse;
|
33
|
+
}
|
34
|
+
|
35
|
+
img {
|
36
|
+
display: block !important;
|
37
|
+
}
|
38
|
+
|
39
|
+
table td {
|
40
|
+
border-collapse: collapse;
|
41
|
+
}
|
42
|
+
|
43
|
+
.top-margin {
|
44
|
+
height: 50px;
|
45
|
+
}
|
46
|
+
|
47
|
+
.main-header {
|
48
|
+
padding: 50px 100px;
|
49
|
+
background: rgba(0, 0, 0, 0.5);
|
50
|
+
font-weight: 300;
|
51
|
+
}
|
52
|
+
|
53
|
+
.footer {
|
54
|
+
margin-top: 20px;
|
55
|
+
}
|
56
|
+
|
57
|
+
/* ----------- media queries (responsive) ----------- */
|
58
|
+
|
59
|
+
@media only screen and (max-width: 640px) {
|
60
|
+
body .show {
|
61
|
+
display: block !important;
|
62
|
+
}
|
63
|
+
|
64
|
+
body .hide {
|
65
|
+
display: none !important;
|
66
|
+
}
|
67
|
+
|
68
|
+
body .container590 {
|
69
|
+
width: 440px !important;
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
@media only screen and (max-width: 480px) {
|
74
|
+
body .show {
|
75
|
+
display: block !important;
|
76
|
+
}
|
77
|
+
|
78
|
+
body .hide {
|
79
|
+
display: none !important;
|
80
|
+
}
|
81
|
+
|
82
|
+
body .container590 {
|
83
|
+
width: 280px !important;
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
87
|
+
</style>
|
88
|
+
</head>
|
89
|
+
|
90
|
+
<body>
|
91
|
+
|
92
|
+
<div class="top-margin"></div>
|
93
|
+
|
94
|
+
<table border="0" width="100%" cellpadding="0" cellspacing="0">
|
95
|
+
<tr>
|
96
|
+
<td align="center" bgcolor="323232"
|
97
|
+
style="background-image: url('https://truenorthtechnology.com/download/life3.jpg?path=&disposition=inline'); background-size: cover; background-position: top center; background-repeat: repeat;">
|
98
|
+
|
99
|
+
<table border="0" align="center" cellpadding="0" cellspacing="0" class="container590">
|
100
|
+
|
101
|
+
<tr>
|
102
|
+
<td height="25" style="font-size: 25px; line-height: 25px;"> </td>
|
103
|
+
</tr>
|
104
|
+
|
105
|
+
|
106
|
+
<tr>
|
107
|
+
<td height="30" style="font-size: 30px; line-height: 30px;"> </td>
|
108
|
+
</tr>
|
109
|
+
<tr>
|
110
|
+
<td height="50" style="font-size: 50px; line-height: 50px;"> </td>
|
111
|
+
</tr>
|
112
|
+
|
113
|
+
<tr>
|
114
|
+
<td class="main-header" align="center" height="42"
|
115
|
+
style="color: #ffffff; font-size: 32px; font-family: 'Open Sans', Calibri, sans-serif; mso-line-height-rule: exactly; line-height: 40px;">
|
116
|
+
|
117
|
+
<!-- ============ title header ============ -->
|
118
|
+
|
119
|
+
<div style="line-height: 34px;">
|
120
|
+
<span>
|
121
|
+
<multiline>
|
122
|
+
<strong><%= @website_inquiry.website.title %> has had an Inquiry</strong>
|
123
|
+
</multiline>
|
124
|
+
</span>
|
125
|
+
</div>
|
126
|
+
</td>
|
127
|
+
</tr>
|
128
|
+
|
129
|
+
<tr>
|
130
|
+
<td height="10" style="font-size: 10px; line-height: 10px;"> </td>
|
131
|
+
</tr>
|
132
|
+
|
133
|
+
|
134
|
+
<tr>
|
135
|
+
<td height="50" style="font-size: 50px; line-height: 50px;"> </td>
|
136
|
+
</tr>
|
137
|
+
|
138
|
+
<tr>
|
139
|
+
<td align="center">
|
140
|
+
|
141
|
+
<table class="cta-button" border="0" align="center" width="163" cellpadding="0" cellspacing="0"
|
142
|
+
style="border: none">
|
143
|
+
<tr>
|
144
|
+
<td height="10" style="font-size: 10px; line-height: 10px;"> </td>
|
145
|
+
</tr>
|
146
|
+
|
147
|
+
<tr>
|
148
|
+
<td>
|
149
|
+
<table border="0" align="center" cellpadding="0" cellspacing="0">
|
150
|
+
<tr>
|
151
|
+
<td align="center"
|
152
|
+
style="color: #ffffff; font-size: 13px; font-family: 'Open Sans', Calibri, sans-serif; font-weight: 600; line-height: 24px;">
|
153
|
+
<!-- ============ headline button ============ -->
|
154
|
+
</td>
|
155
|
+
|
156
|
+
<td width="14" align="right" valign="middle">
|
157
|
+
|
158
|
+
</td>
|
159
|
+
</tr>
|
160
|
+
</table>
|
161
|
+
</td>
|
162
|
+
</tr>
|
163
|
+
|
164
|
+
<tr>
|
165
|
+
<td height="10" style="font-size: 10px; line-height: 10px;"> </td>
|
166
|
+
</tr>
|
167
|
+
|
168
|
+
</table>
|
169
|
+
</td>
|
170
|
+
</tr>
|
171
|
+
|
172
|
+
<tr>
|
173
|
+
<td height="115" style="font-size: 115px; line-height: 115px;"> </td>
|
174
|
+
</tr>
|
175
|
+
|
176
|
+
</table>
|
177
|
+
</td>
|
178
|
+
</tr>
|
179
|
+
|
180
|
+
</table>
|
181
|
+
|
182
|
+
|
183
|
+
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
|
184
|
+
<tr>
|
185
|
+
<td height="50"> </td>
|
186
|
+
</tr>
|
187
|
+
|
188
|
+
<tr>
|
189
|
+
<td>
|
190
|
+
<table class="container590" border="0" align="center" width="590" cellpadding="0" cellspacing="0">
|
191
|
+
<tr>
|
192
|
+
<td>
|
193
|
+
<p class="instructions" style="color: #555; font-size: 24px; font-family: 'Open Sans', Calibri, sans-serif; mso-line-height-rule: exactly; line-height: 42px;">
|
194
|
+
<span>First Name: </span><span><%= @website_inquiry.first_name %></span>
|
195
|
+
<br/>
|
196
|
+
<span>Last Name: </span><span><%= @website_inquiry.last_name %></span>
|
197
|
+
<br/>
|
198
|
+
<span>Email: </span><span><%= @website_inquiry.email %></span>
|
199
|
+
<% if @website_inquiry.created_by %>
|
200
|
+
<br/>
|
201
|
+
<span>Username: </span><span><%= @website_inquiry.created_by.username %></span>
|
202
|
+
<% end %>
|
203
|
+
<br/>
|
204
|
+
<p style="color: #555; font-size: 24px; font-family: 'Open Sans', Calibri, sans-serif; mso-line-height-rule: exactly; line-height: 42px;"><%= @website_inquiry.message %></p>
|
205
|
+
</p>
|
206
|
+
</td>
|
207
|
+
</tr>
|
208
|
+
</table>
|
209
|
+
|
210
|
+
</td>
|
211
|
+
</tr>
|
212
|
+
|
213
|
+
<tr>
|
214
|
+
<td height="100" style="font-size: 100px; line-height: 100px;"> </td>
|
215
|
+
</tr>
|
216
|
+
|
217
|
+
</table>
|
218
|
+
|
219
|
+
|
220
|
+
<table class="footer" border="0" width="100%" cellpadding="0" cellspacing="0" bgcolor="2d2d2d">
|
221
|
+
|
222
|
+
<tr>
|
223
|
+
<td height="20" style="font-size: 20px; line-height: 20px;"> </td>
|
224
|
+
</tr>
|
225
|
+
|
226
|
+
<tr>
|
227
|
+
<td align="center">
|
228
|
+
|
229
|
+
<table border="0" align="center" width="590" class="container590" cellpadding="0" cellspacing="0">
|
230
|
+
|
231
|
+
<tr>
|
232
|
+
<td align="center">
|
233
|
+
|
234
|
+
<table border="0" class="container590" align="center" cellpadding="0" cellspacing="0">
|
235
|
+
<tr>
|
236
|
+
<td align="center"
|
237
|
+
style="color: #717171; font-size: 14px; font-family: 'Open Sans', Calibri, sans-serif; line-height: 25px;">
|
238
|
+
<div style=" line-height: 25px;">
|
239
|
+
<span>
|
240
|
+
<multiline>
|
241
|
+
© <%= Time.now.year %> Copyright. All Rights Reserved.
|
242
|
+
</multiline>
|
243
|
+
</span>
|
244
|
+
</div>
|
245
|
+
</td>
|
246
|
+
</tr>
|
247
|
+
|
248
|
+
</table>
|
249
|
+
|
250
|
+
</td>
|
251
|
+
</tr>
|
252
|
+
|
253
|
+
</table>
|
254
|
+
</td>
|
255
|
+
</tr>
|
256
|
+
|
257
|
+
<tr>
|
258
|
+
<td height="20" style="font-size: 20px; line-height: 20px;"> </td>
|
259
|
+
</tr>
|
260
|
+
|
261
|
+
</table>
|
262
|
+
|
263
|
+
|
264
|
+
</body>
|
265
|
+
</html>
|
266
|
+
|