knitkit 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/GPL-3-LICENSE +674 -0
- data/README.md +6 -0
- data/Rakefile +30 -0
- data/app/assets/javascripts/knitkit/application.js +9 -0
- data/app/assets/stylesheets/knitkit/application.css +7 -0
- data/app/controllers/knitkit/articles_controller.rb +7 -0
- data/app/controllers/knitkit/base_controller.rb +45 -0
- data/app/controllers/knitkit/blogs_controller.rb +27 -0
- data/app/controllers/knitkit/comments_controller.rb +18 -0
- data/app/controllers/knitkit/erp_app/desktop/app_controller.rb +135 -0
- data/app/controllers/knitkit/erp_app/desktop/articles_controller.rb +144 -0
- data/app/controllers/knitkit/erp_app/desktop/comments_controller.rb +43 -0
- data/app/controllers/knitkit/erp_app/desktop/content_controller.rb +27 -0
- data/app/controllers/knitkit/erp_app/desktop/file_assets_controller.rb +145 -0
- data/app/controllers/knitkit/erp_app/desktop/image_assets_controller.rb +28 -0
- data/app/controllers/knitkit/erp_app/desktop/inquiries_controller.rb +68 -0
- data/app/controllers/knitkit/erp_app/desktop/position_controller.rb +20 -0
- data/app/controllers/knitkit/erp_app/desktop/theme_controller.rb +272 -0
- data/app/controllers/knitkit/erp_app/desktop/versions_controller.rb +135 -0
- data/app/controllers/knitkit/erp_app/desktop/website_controller.rb +177 -0
- data/app/controllers/knitkit/erp_app/desktop/website_nav_controller.rb +143 -0
- data/app/controllers/knitkit/erp_app/desktop/website_section_controller.rb +116 -0
- data/app/controllers/knitkit/unauthorized_controller.rb +8 -0
- data/app/controllers/knitkit/website_sections_controller.rb +17 -0
- data/app/helpers/application_helper.rb +132 -0
- data/app/models/article.rb +14 -0
- data/app/models/blog.rb +21 -0
- data/app/models/comment.rb +24 -0
- data/app/models/content.rb +158 -0
- data/app/models/extensions/user.rb +5 -0
- data/app/models/published_element.rb +9 -0
- data/app/models/published_website.rb +118 -0
- data/app/models/theme.rb +239 -0
- data/app/models/website.rb +457 -0
- data/app/models/website_host.rb +3 -0
- data/app/models/website_inquiry.rb +11 -0
- data/app/models/website_inquiry_mailer.rb +12 -0
- data/app/models/website_nav.rb +17 -0
- data/app/models/website_nav_item.rb +21 -0
- data/app/models/website_section.rb +152 -0
- data/app/models/website_section_content.rb +4 -0
- data/app/views/knitkit/articles/index.html.erb +3 -0
- data/app/views/knitkit/articles/show.html.erb +4 -0
- data/app/views/knitkit/blogs/_add_comment.html.erb +28 -0
- data/app/views/knitkit/blogs/_comment.html.erb +8 -0
- data/app/views/knitkit/blogs/index.html.erb +51 -0
- data/app/views/knitkit/blogs/index.rss.builder +23 -0
- data/app/views/knitkit/blogs/show.html.erb +22 -0
- data/app/views/knitkit/unauthorized/index.html.erb +4 -0
- data/app/views/knitkit/website_sections/index.html.erb +6 -0
- data/app/views/layouts/knitkit/base.html.erb +59 -0
- data/app/views/menus/knitkit/_default_menu.html.erb +23 -0
- data/app/views/menus/knitkit/_default_section_menu.html.erb +27 -0
- data/app/views/menus/knitkit/_default_sub_menu.html.erb +45 -0
- data/app/views/menus/knitkit/_default_sub_section_menu.html.erb +49 -0
- data/app/views/shared/knitkit/_bread_crumb.html.erb +7 -0
- data/app/views/shared/knitkit/_footer.html.erb +3 -0
- data/app/views/website_inquiry_mailer/inquiry.erb +3 -0
- data/app/widgets/contact_us/base.rb +86 -0
- data/app/widgets/contact_us/javascript/contact_us.js +13 -0
- data/app/widgets/contact_us/views/_contact_form.html.erb +36 -0
- data/app/widgets/contact_us/views/error.html.erb +10 -0
- data/app/widgets/contact_us/views/index.html.erb +1 -0
- data/app/widgets/contact_us/views/layouts/base.html.erb +7 -0
- data/app/widgets/contact_us/views/success.html.erb +4 -0
- data/app/widgets/google_map/base.rb +48 -0
- data/app/widgets/google_map/javascript/google_map.js +174 -0
- data/app/widgets/google_map/views/index.html.erb +41 -0
- data/app/widgets/login/base.rb +61 -0
- data/app/widgets/login/javascript/login.js +162 -0
- data/app/widgets/login/views/index.html.erb +37 -0
- data/app/widgets/login/views/layouts/base.html.erb +14 -0
- data/app/widgets/login/views/login_header.html.erb +9 -0
- data/app/widgets/login/views/reset_password.html.erb +26 -0
- data/app/widgets/manage_profile/base.rb +327 -0
- data/app/widgets/manage_profile/javascript/manage_profile.js +11 -0
- data/app/widgets/manage_profile/views/_contact_information_form.html.erb +180 -0
- data/app/widgets/manage_profile/views/_password_form.html.erb +20 -0
- data/app/widgets/manage_profile/views/_user_information_form.html.erb +30 -0
- data/app/widgets/manage_profile/views/contact_type_in_use.html.erb +4 -0
- data/app/widgets/manage_profile/views/default_type_error.html.erb +5 -0
- data/app/widgets/manage_profile/views/error.html.erb +3 -0
- data/app/widgets/manage_profile/views/index.html.erb +46 -0
- data/app/widgets/manage_profile/views/layouts/base.html.erb +1 -0
- data/app/widgets/manage_profile/views/password_blank.html.erb +4 -0
- data/app/widgets/manage_profile/views/password_invalid.html.erb +4 -0
- data/app/widgets/manage_profile/views/password_success.html.erb +3 -0
- data/app/widgets/manage_profile/views/success.html.erb +3 -0
- data/app/widgets/reset_password/base.rb +42 -0
- data/app/widgets/reset_password/javascript/reset_password.js +13 -0
- data/app/widgets/reset_password/views/index.html.erb +31 -0
- data/app/widgets/reset_password/views/layouts/base.html.erb +1 -0
- data/app/widgets/search/base.rb +80 -0
- data/app/widgets/search/javascript/search.js +31 -0
- data/app/widgets/search/views/_search.html.erb +39 -0
- data/app/widgets/search/views/index.html.erb +3 -0
- data/app/widgets/search/views/layouts/base.html.erb +24 -0
- data/app/widgets/search/views/show.html.erb +48 -0
- data/app/widgets/signup/base.rb +72 -0
- data/app/widgets/signup/javascript/signup.js +13 -0
- data/app/widgets/signup/views/_signup_form.html.erb +36 -0
- data/app/widgets/signup/views/error.html.erb +11 -0
- data/app/widgets/signup/views/index.html.erb +1 -0
- data/app/widgets/signup/views/layouts/base.html.erb +7 -0
- data/app/widgets/signup/views/success.html.erb +4 -0
- data/config/environment.rb +0 -0
- data/config/routes.rb +41 -0
- data/db/data_migrations/20110509223702_add_publisher_role.rb +11 -0
- data/db/data_migrations/20110816153456_add_knitkit_application.rb +31 -0
- data/db/data_migrations/upgrade/20111011203718_create_paths_for_sections.rb +13 -0
- data/db/data_migrations/upgrade/20111216192114_add_secured_models_to_menu_items.rb +18 -0
- data/db/data_migrations/upgrade/20111216202819_set_contents_iid_to_permalink_where_null.rb +12 -0
- data/db/migrate/20110211002317_setup_knitkit.rb +259 -0
- data/db/migrate/upgrade/20111014190442_update_contents.rb +25 -0
- data/db/migrate/upgrade/20111014201502_add_published_by_to_published_elements.rb +22 -0
- data/db/migrate/upgrade/20111017133851_add_iid_to_section.rb +21 -0
- data/db/migrate/upgrade/20111027145006_add_in_menu_to_section.rb +19 -0
- data/lib/knitkit.rb +12 -0
- data/lib/knitkit/engine.rb +26 -0
- data/lib/knitkit/extensions.rb +18 -0
- data/lib/knitkit/extensions/action_controller/theme_support/acts_as_themed_controller.rb +88 -0
- data/lib/knitkit/extensions/active_record/acts_as_commentable.rb +28 -0
- data/lib/knitkit/extensions/active_record/acts_as_publishable.rb +38 -0
- data/lib/knitkit/extensions/active_record/theme_support/has_many_themes.rb +34 -0
- data/lib/knitkit/extensions/compass/widgets/base.rb +53 -0
- data/lib/knitkit/extensions/core/array.rb +5 -0
- data/lib/knitkit/extensions/railties/action_view.rb +187 -0
- data/lib/knitkit/extensions/railties/theme_support/asset_tag_helper.rb +198 -0
- data/lib/knitkit/extensions/railties/theme_support/theme_file_resolver.rb +44 -0
- data/lib/knitkit/routing_filter/section_router.rb +55 -0
- data/lib/knitkit/syntax_validator.rb +32 -0
- data/lib/knitkit/version.rb +3 -0
- data/lib/tasks/knitkit_tasks.rake +4 -0
- data/public/images/knitkit/bullet.png +0 -0
- data/public/images/knitkit/content.png +0 -0
- data/public/images/knitkit/footer.png +0 -0
- data/public/images/knitkit/graphic.png +0 -0
- data/public/images/knitkit/greyFadeDown.png +0 -0
- data/public/images/knitkit/link.png +0 -0
- data/public/images/knitkit/logo.png +0 -0
- data/public/images/knitkit/menu.png +0 -0
- data/public/images/knitkit/menu_select.png +0 -0
- data/public/images/knitkit/search.png +0 -0
- data/public/javascripts/datepicker.js +440 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/articles_grid_panel.js +473 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/center_region.js +576 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/comments_grid_panel.js +217 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/east_region.js +26 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/file_assets_panel.js +109 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/image_assets_data_view.js +30 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/image_assets_panel.js +160 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/inquiries_grid_panel.js +46 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/module.js +46 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/publish_window.js +92 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/published_grid_panel.js +220 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/section_articles_grid_panel.js +613 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/themes_tree_panel.js +573 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/versions_grid_panel.js +664 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/west_region.js +2161 -0
- data/public/javascripts/erp_app/desktop/applications/knitkit/widgets_panel.js +52 -0
- data/public/stylesheets/datepicker.css +121 -0
- data/public/stylesheets/erp_app/desktop/applications/knitkit/knitkit.css +114 -0
- data/public/stylesheets/extjs/resources/css/knitkit_extjs_4.css +219 -0
- data/public/stylesheets/knitkit/style.css +394 -0
- metadata +289 -0
@@ -0,0 +1,12 @@
|
|
1
|
+
class WebsiteInquiryMailer < ActionMailer::Base
|
2
|
+
|
3
|
+
def inquiry(website_inquiry)
|
4
|
+
@website_inquiry = website_inquiry
|
5
|
+
mail( :to => website_inquiry.website.email,
|
6
|
+
:from => website_inquiry.data.dyn_email,
|
7
|
+
:subject => "#{website_inquiry.website.title} Inquiry",
|
8
|
+
:content_type => 'text/plain'
|
9
|
+
)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class WebsiteNav < ActiveRecord::Base
|
2
|
+
belongs_to :website
|
3
|
+
|
4
|
+
validates_uniqueness_of :name, :scope => [:website_id], :message => "That Name is Already in Use"
|
5
|
+
|
6
|
+
has_many :website_nav_items, :dependent => :destroy do
|
7
|
+
def positioned
|
8
|
+
where('parent_id is null').order('position')
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def all_menu_items
|
13
|
+
self.website_nav_items.collect{|item| item.self_and_descendants}.flatten
|
14
|
+
end
|
15
|
+
|
16
|
+
alias :items :website_nav_items
|
17
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class WebsiteNavItem < ActiveRecord::Base
|
2
|
+
belongs_to :website_nav
|
3
|
+
belongs_to :linked_to_item, :polymorphic => true
|
4
|
+
|
5
|
+
has_roles
|
6
|
+
acts_as_nested_set
|
7
|
+
include ErpTechSvcs::Utils::DefaultNestedSetMethods
|
8
|
+
|
9
|
+
def path
|
10
|
+
linked_to_item.nil? ? url : linked_to_item.path
|
11
|
+
end
|
12
|
+
|
13
|
+
def positioned_children
|
14
|
+
children.sort_by{|child| [child.position]}
|
15
|
+
end
|
16
|
+
|
17
|
+
def website_nav
|
18
|
+
website_nav_id.nil? ? self.parent.website_nav : WebsiteNav.find(website_nav_id)
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -0,0 +1,152 @@
|
|
1
|
+
class WebsiteSection < ActiveRecord::Base
|
2
|
+
before_destroy :destroy_content # only destroy content that does not belong to another section, NOTE: this callback must be declared before the associations or it will not work
|
3
|
+
|
4
|
+
has_permalink :title, :url_attribute => :permalink, :sync_url => true, :only_when_blank => true, :scope => [:website_id, :parent_id]
|
5
|
+
acts_as_nested_set
|
6
|
+
include ErpTechSvcs::Utils::DefaultNestedSetMethods
|
7
|
+
acts_as_versioned :table_name => :website_section_versions, :non_versioned_columns => %w{parent_id lft rgt}
|
8
|
+
can_be_published
|
9
|
+
has_roles
|
10
|
+
|
11
|
+
belongs_to :website
|
12
|
+
has_many :website_section_contents, :dependent => :destroy
|
13
|
+
has_many :contents, :through => :website_section_contents
|
14
|
+
|
15
|
+
validates :title, :presence => {:message => 'Title cannot be blank'}
|
16
|
+
validates_uniqueness_of :permalink, :scope => [:website_id, :parent_id]
|
17
|
+
validates_uniqueness_of :internal_identifier, :scope => :website_id
|
18
|
+
|
19
|
+
after_create :update_paths
|
20
|
+
before_save :update_path, :check_internal_indentifier
|
21
|
+
|
22
|
+
KNIT_KIT_ROOT = Knitkit::Engine.root.to_s
|
23
|
+
WEBSITE_SECTIONS_TEMP_LAYOUT_PATH = "#{Knitkit::Engine.root.to_s}/app/views/knitkit/website_sections"
|
24
|
+
|
25
|
+
@@types = ['Page']
|
26
|
+
cattr_reader :types
|
27
|
+
|
28
|
+
def articles
|
29
|
+
Article.find_by_section_id(self.id)
|
30
|
+
end
|
31
|
+
|
32
|
+
def website
|
33
|
+
website_id.nil? ? self.parent.website : Website.find(website_id)
|
34
|
+
end
|
35
|
+
|
36
|
+
class << self
|
37
|
+
def register_type(type)
|
38
|
+
@@types << type
|
39
|
+
@@types.uniq!
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def positioned_children
|
44
|
+
children.sort_by{|child| [child.position]}
|
45
|
+
end
|
46
|
+
|
47
|
+
def paths
|
48
|
+
all_paths = [self.path]
|
49
|
+
all_paths | self.descendants.collect(&:path)
|
50
|
+
end
|
51
|
+
|
52
|
+
def child_by_path(path)
|
53
|
+
self.descendants.detect{|child| child.path == path}
|
54
|
+
end
|
55
|
+
|
56
|
+
def type
|
57
|
+
read_attribute(:type) || 'Page'
|
58
|
+
end
|
59
|
+
|
60
|
+
def create_layout
|
61
|
+
self.layout = IO.read(File.join(WEBSITE_SECTIONS_TEMP_LAYOUT_PATH,"index.html.erb"))
|
62
|
+
self.save
|
63
|
+
end
|
64
|
+
|
65
|
+
def get_published_layout(active_publication)
|
66
|
+
layout_content = nil
|
67
|
+
published_website_id = active_publication.id
|
68
|
+
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
|
69
|
+
unless published_element.nil?
|
70
|
+
layout_content = WebsiteSection::Version.where('version = ? and website_section_id = ?', published_element.version, published_element.published_element_record_id).first.layout
|
71
|
+
else
|
72
|
+
layout_content = IO.read(File.join(WEBSITE_SECTIONS_TEMP_LAYOUT_PATH,"index.html.erb"))
|
73
|
+
end
|
74
|
+
layout_content
|
75
|
+
end
|
76
|
+
|
77
|
+
def get_tags
|
78
|
+
get_topics
|
79
|
+
end
|
80
|
+
|
81
|
+
def get_topics
|
82
|
+
# leaving this here for reference until we're sure the built in method tag_counts_on does what we need
|
83
|
+
# sql = "SELECT tags.*, taggings.tags_count AS count FROM \"tags\"
|
84
|
+
# JOIN (SELECT taggings.tag_id, COUNT(taggings.tag_id) AS tags_count FROM \"taggings\"
|
85
|
+
# INNER JOIN contents ON contents.id = taggings.taggable_id AND contents.type = 'Article'
|
86
|
+
# INNER JOIN website_section_contents ON contents.id=website_section_contents.content_id
|
87
|
+
# WHERE (taggings.taggable_type = 'Content' AND taggings.context = 'tags')
|
88
|
+
# AND website_section_contents.website_section_id=#{self.id}
|
89
|
+
# GROUP BY taggings.tag_id HAVING COUNT(*) > 0 AND COUNT(taggings.tag_id) > 0)
|
90
|
+
# AS taggings ON taggings.tag_id = tags.id
|
91
|
+
# ORDER BY tags.name ASC"
|
92
|
+
# ActsAsTaggableOn::Tag.find_by_sql(sql)
|
93
|
+
|
94
|
+
self.contents.tag_counts_on(:tags).sort_by{|t| t.name }
|
95
|
+
end
|
96
|
+
|
97
|
+
# Before destroying a section look at content belonging to this section
|
98
|
+
# and destroy content that does NOT belong to any OTHER section
|
99
|
+
def destroy_content
|
100
|
+
self.contents.each do |c|
|
101
|
+
unless c.website_sections.count > 1
|
102
|
+
puts "destroying"
|
103
|
+
c.destroy
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
def update_path!
|
109
|
+
new_path = build_path
|
110
|
+
self.path = new_path unless self.path == new_path
|
111
|
+
self.save
|
112
|
+
end
|
113
|
+
|
114
|
+
protected
|
115
|
+
|
116
|
+
def update_path
|
117
|
+
if permalink_changed?
|
118
|
+
new_path = build_path
|
119
|
+
self.path = new_path unless self.path == new_path
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
def build_path
|
124
|
+
"/#{self_and_ancestors.map(&:permalink).join('/')}"
|
125
|
+
end
|
126
|
+
|
127
|
+
def update_paths
|
128
|
+
if parent_id
|
129
|
+
move_to_child_of(WebsiteSection.find(parent_id))
|
130
|
+
website.sections.update_paths!
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
def check_internal_indentifier
|
135
|
+
self.internal_identifier = self.permalink if self.internal_identifier.blank?
|
136
|
+
end
|
137
|
+
|
138
|
+
private
|
139
|
+
|
140
|
+
def self.get_published_version(active_publication, content)
|
141
|
+
content_version = nil
|
142
|
+
published_website_id = active_publication.id
|
143
|
+
published_element = PublishedElement.includes([:published_website]).where('published_websites.id = ? and published_element_record_id = ? and published_element_record_type = ?', published_website_id, content.id, 'Content').first
|
144
|
+
unless published_element.nil?
|
145
|
+
content_version = Content::Version.where('version = ? and content_id = ?', published_element.version, published_element.published_element_record_id).first
|
146
|
+
end
|
147
|
+
content_version
|
148
|
+
end
|
149
|
+
|
150
|
+
end
|
151
|
+
|
152
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<br/>
|
2
|
+
<h1>Add Comment</h1>
|
3
|
+
<div>
|
4
|
+
<div id="notice"></div>
|
5
|
+
<br/>
|
6
|
+
|
7
|
+
<%= form_tag "/comments/add/#{@website_section.id}/#{@published_content.content.id}", :remote => true, :id => 'add_comment_form' do %>
|
8
|
+
<div class="form_settings">
|
9
|
+
<div>
|
10
|
+
<p>
|
11
|
+
<span>Comment</span>
|
12
|
+
<%= text_area_tag :comment, @comment, :rows => 8, :cols => 50 %>
|
13
|
+
</p>
|
14
|
+
<p style="padding-top: 15px">
|
15
|
+
<span> </span>
|
16
|
+
<%= submit_tag "Add Comment", :disable_with => "Please wait...", :class => "submit" %>
|
17
|
+
</p>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
21
|
+
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<script type="text/javascript">
|
25
|
+
$('#add_comment_form').bind('ajaxComplete', function(e, xhr, settings){
|
26
|
+
$('#notice').html(xhr.responseText);
|
27
|
+
});
|
28
|
+
</script>
|
@@ -0,0 +1,51 @@
|
|
1
|
+
<h2><%=h @website_section.title %></h2>
|
2
|
+
|
3
|
+
<div class="blog_articles left">
|
4
|
+
<% @contents.each do |content| %>
|
5
|
+
<div class="blog_post" id="blog_<%=h content.id %>">
|
6
|
+
<h4><%=h content.title %></h4>
|
7
|
+
<p>
|
8
|
+
Posted: <%= content.created_at.to_s(:long) %> <%=published_content_created_by %><br />
|
9
|
+
Topics: <%=content.content.tag_list %>
|
10
|
+
</p>
|
11
|
+
<div class="blog_body">
|
12
|
+
<%= raw content.excerpt_html %>
|
13
|
+
</div>
|
14
|
+
<div><%= link_to 'Read More...', main_app.blog_article_path(@website_section.id, content.permalink) %></div>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<%= blog_pagination 'blog_pagination', params %>
|
19
|
+
|
20
|
+
</div>
|
21
|
+
|
22
|
+
<div class="sidebar blog_tags">
|
23
|
+
<h4>Topics</h4>
|
24
|
+
<%=blog_topics 'tag_link' %>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<div class="sidebar rss">
|
28
|
+
<h4>Links</h4>
|
29
|
+
<%=blog_rss_links 'RSS Feed' %>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<div class="sidebar blog_search">
|
33
|
+
<% #Optional Parameters:
|
34
|
+
# content_type: Leave blank to search all section types, set to Blog to only search Blog articles
|
35
|
+
# section_permalink: This is the permalink value for the section
|
36
|
+
# Useful if you only want to search articles within a single Blog section
|
37
|
+
# results_permalink: How do you want your results to display? via ajax? or on a new page?
|
38
|
+
# Leave blank if you want results to display via ajax on the same page as the search form
|
39
|
+
# Enter the permalink of results page if you want the search results to display on a new page
|
40
|
+
# per_page: Number of results per page
|
41
|
+
# class: CSS class for the form %>
|
42
|
+
<%= render_widget :search,
|
43
|
+
:action => get_widget_action,
|
44
|
+
:params => set_widget_params({
|
45
|
+
:content_type => 'Blog',
|
46
|
+
:section_permalink => '',
|
47
|
+
:results_permalink => 'search',
|
48
|
+
:per_page => 20,
|
49
|
+
:class => ''
|
50
|
+
}) %>
|
51
|
+
</div>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
xml.instruct! :xml, :version => "1.0"
|
2
|
+
xml.rss :version => "2.0" do
|
3
|
+
xml.channel do
|
4
|
+
xml.title @blog.title
|
5
|
+
xml.description @blog.title
|
6
|
+
|
7
|
+
if params[:action] == 'tag'
|
8
|
+
xml.link main_app.blog_tag_url(params[:section_id], params[:tag_id], :rss)
|
9
|
+
else
|
10
|
+
xml.link main_app.blogs_url(params[:section_id], :rss)
|
11
|
+
end
|
12
|
+
|
13
|
+
for article in @contents
|
14
|
+
xml.item do
|
15
|
+
xml.title article.title
|
16
|
+
xml.description article.excerpt_html
|
17
|
+
xml.pubDate article.created_at.to_s(:rfc822)
|
18
|
+
xml.link main_app.blog_article_url(params[:section_id], article.permalink)
|
19
|
+
xml.guid main_app.blog_article_url(params[:section_id], article.permalink)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<div class="blog_post">
|
2
|
+
|
3
|
+
<h2><%=h @blog.title %></h2>
|
4
|
+
<br/>
|
5
|
+
<h3><%=h @published_content.title %></h3>
|
6
|
+
<p>
|
7
|
+
Posted: <%= @published_content.created_at.to_s(:long) %> <%=published_content_created_by %><br />
|
8
|
+
Topics: <%= @published_content.content.tag_list %>
|
9
|
+
</p>
|
10
|
+
<p><%= raw @published_content.excerpt_html %></p>
|
11
|
+
<%= raw @published_content.body_html %>
|
12
|
+
|
13
|
+
<h3>Comments</h3>
|
14
|
+
<br/>
|
15
|
+
<%= blog_recent_approved_comments %>
|
16
|
+
<br/>
|
17
|
+
<br/>
|
18
|
+
|
19
|
+
<hr/>
|
20
|
+
<%=blog_add_comment_form %>
|
21
|
+
|
22
|
+
</div>
|
@@ -0,0 +1,59 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml2/DTD/xhtml1-strict.dtd">
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
5
|
+
<meta name="generator" content="Knitkit - Compass AE Open source content management platform" />
|
6
|
+
|
7
|
+
<meta name="description" content="" />
|
8
|
+
<meta name="keywords" content="" />
|
9
|
+
<meta name="copyright" content="©" />
|
10
|
+
<meta name="robots" content="ALL" />
|
11
|
+
<meta name="language" content="English" />
|
12
|
+
|
13
|
+
<title><%= @website.title %></title>
|
14
|
+
<%= javascript_include_tag :application %>
|
15
|
+
<%= include_extjs %>
|
16
|
+
<%= static_javascript_include_tag('erp_app/jquery_support.js') %>
|
17
|
+
<%= static_javascript_include_tag('datepicker.js') %>
|
18
|
+
<%= static_stylesheet_link_tag('datepicker.css') %>
|
19
|
+
<%= static_javascript_include_tag('erp_app/utility.js') %>
|
20
|
+
<%= static_stylesheet_link_tag('extjs/resources/css/knitkit_extjs_4.css') %>
|
21
|
+
<%= static_stylesheet_link_tag('knitkit/style.css') %>
|
22
|
+
<%= static_javascript_include_tag('erp_app/widgets.js') %>
|
23
|
+
<%= static_javascript_include_tag('erp_app/shared/ajax_pagination.js') %>
|
24
|
+
<%= static_javascript_include_tag('erp_app/shared/dynamic_forms/dynamic_forms_validation.js') %>
|
25
|
+
<%= yield :head %>
|
26
|
+
</head>
|
27
|
+
<body>
|
28
|
+
<div id="main">
|
29
|
+
<div id="header">
|
30
|
+
<div id="logo">
|
31
|
+
<%=render_version_viewing%>
|
32
|
+
<%= render_widget :login,
|
33
|
+
:action => :login_header,
|
34
|
+
:params => {:login_url => '/login',
|
35
|
+
:signup_url => '/sign-up'}%>
|
36
|
+
<div id="logo_text">
|
37
|
+
<!-- class="logo_color", allows you to change the color of the text -->
|
38
|
+
<h1><a href="/"><%= @website.title %></a></h1>
|
39
|
+
<h2><%= @website.subtitle %></h2>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
<%= content_for?(:menu) ? yield(:menu) : render_menu(@contents) %>
|
43
|
+
<%#=render_menu(@contents, :menu => 'main')%>
|
44
|
+
</div>
|
45
|
+
<div id="site_content">
|
46
|
+
<%=build_crumbs %>
|
47
|
+
<br/>
|
48
|
+
<%= content_for?(:sub_menu) ? yield(:sub_menu) : render_sub_menu(@contents) %>
|
49
|
+
<%#=render_sub_menu(@contents, :menu => 'main')%>
|
50
|
+
<div id="content">
|
51
|
+
<%= yield %>
|
52
|
+
</div>
|
53
|
+
</div>
|
54
|
+
<div id="content_footer"></div>
|
55
|
+
<%= content_for?(:footer) ? yield(:footer) : (render :partial => 'shared/knitkit/footer') %>
|
56
|
+
<%= yield :foot %>
|
57
|
+
</div>
|
58
|
+
</body>
|
59
|
+
</html>
|