wheels 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +20 -0
- data/README.rdoc +17 -0
- data/Rakefile +22 -22
- data/VERSION +1 -0
- data/app/controllers/access_control_entries_controller.rb +38 -0
- data/app/controllers/app_configs_controller.rb +17 -0
- data/app/controllers/application_controller.rb +39 -0
- data/app/controllers/attachments_controller.rb +16 -0
- data/app/controllers/blogs_controller.rb +39 -0
- data/app/controllers/discussions_controller.rb +10 -0
- data/app/controllers/external_links_controller.rb +5 -0
- data/app/controllers/feedbacks_controller.rb +10 -0
- data/app/controllers/forum_messages_controller.rb +13 -0
- data/app/controllers/forums_controller.rb +2 -0
- data/app/controllers/galleries_controller.rb +60 -0
- data/app/controllers/images_controller.rb +30 -0
- data/app/controllers/menus_controller.rb +2 -0
- data/app/controllers/pages_controller.rb +80 -0
- data/app/controllers/profiles_controller.rb +16 -0
- data/app/controllers/sitemaps_controller.rb +135 -0
- data/app/controllers/users_controller.rb +28 -0
- data/app/helpers/access_control_entries_helper.rb +2 -0
- data/app/helpers/app_configs_helper.rb +2 -0
- data/app/helpers/application_helper.rb +43 -0
- data/app/helpers/blogs_helper.rb +10 -0
- data/app/helpers/discussions_helper.rb +2 -0
- data/app/helpers/external_links_helper.rb +2 -0
- data/app/helpers/feedbacks_helper.rb +2 -0
- data/app/helpers/forums_helper.rb +2 -0
- data/app/helpers/menus_helper.rb +2 -0
- data/app/helpers/pages_helper.rb +192 -0
- data/app/helpers/sitemaps_helper.rb +12 -0
- data/app/mailers/feedback_mailer.rb +10 -0
- data/app/models/ability.rb +43 -0
- data/app/models/access_control_entry.rb +109 -0
- data/app/models/app_config.rb +26 -0
- data/app/models/attachment.rb +10 -0
- data/app/models/blog.rb +10 -0
- data/app/models/discussion.rb +19 -0
- data/app/models/external_link.rb +10 -0
- data/app/models/feedback.rb +11 -0
- data/app/models/forum.rb +4 -0
- data/app/models/forum_message.rb +5 -0
- data/app/models/gallery.rb +5 -0
- data/app/models/image.rb +10 -0
- data/app/models/menu.rb +5 -0
- data/app/models/page.rb +8 -0
- data/app/models/page_revision.rb +2 -0
- data/app/models/profile.rb +12 -0
- data/app/models/role.rb +29 -0
- data/app/models/s3_provider.rb +84 -0
- data/app/models/sitemap.rb +175 -0
- data/app/models/tagging.rb +4 -0
- data/app/models/user.rb +69 -0
- data/app/validators/email_validator.rb +22 -0
- data/app/views/access_control_entries/_form.html.haml +33 -0
- data/app/views/access_control_entries/_index.html.haml +53 -0
- data/app/views/access_control_entries/_show.html.haml +12 -0
- data/app/views/access_control_entries/create.js.haml +3 -0
- data/app/views/access_control_entries/destroy.js.haml +3 -0
- data/app/views/access_control_entries/edit.html.haml +7 -0
- data/app/views/access_control_entries/edit.js.haml +3 -0
- data/app/views/access_control_entries/index.html.haml +2 -0
- data/app/views/access_control_entries/index.js.haml +3 -0
- data/app/views/access_control_entries/new.html.haml +5 -0
- data/app/views/access_control_entries/new.js.haml +3 -0
- data/app/views/access_control_entries/show.html.haml +2 -0
- data/app/views/access_control_entries/show.js.haml +4 -0
- data/app/views/access_control_entries/update.js.haml +3 -0
- data/app/views/app_configs/_form.html.haml +11 -0
- data/app/views/app_configs/_index.html.haml +6 -0
- data/app/views/app_configs/_show.html.haml +3 -0
- data/app/views/app_configs/create.js.haml +3 -0
- data/app/views/app_configs/css.css.haml +2 -0
- data/app/views/app_configs/destroy.js.haml +3 -0
- data/app/views/app_configs/edit.html.haml +2 -0
- data/app/views/app_configs/edit.js.haml +3 -0
- data/app/views/app_configs/index.html.haml +2 -0
- data/app/views/app_configs/index.js.haml +3 -0
- data/app/views/app_configs/new.html.haml +2 -0
- data/app/views/app_configs/new.js.haml +3 -0
- data/app/views/app_configs/show.html.haml +2 -0
- data/app/views/app_configs/show.js.haml +3 -0
- data/app/views/app_configs/update.js.haml +3 -0
- data/app/views/attachments/_form.html.haml +26 -0
- data/app/views/attachments/_index.html.haml +9 -0
- data/app/views/attachments/_show.html.haml +6 -0
- data/app/views/attachments/_uploadify.html.erb +12 -0
- data/app/views/attachments/create.js.haml +3 -0
- data/app/views/attachments/destroy.js.haml +3 -0
- data/app/views/attachments/edit.js.haml +3 -0
- data/app/views/attachments/index.html.haml +2 -0
- data/app/views/attachments/index.js.haml +3 -0
- data/app/views/attachments/new.html.haml +3 -0
- data/app/views/attachments/new.js.haml +3 -0
- data/app/views/attachments/show.html.haml +2 -0
- data/app/views/attachments/show.js.haml +3 -0
- data/app/views/attachments/update.js.haml +3 -0
- data/app/views/blogs/_form.html.haml +22 -0
- data/app/views/blogs/edit.html.haml +8 -0
- data/app/views/blogs/index.html.haml +21 -0
- data/app/views/blogs/index.xml.builder +27 -0
- data/app/views/blogs/new.html.haml +6 -0
- data/app/views/blogs/show.html.haml +25 -0
- data/app/views/discussions/_form.html.haml +16 -0
- data/app/views/discussions/edit.html.haml +7 -0
- data/app/views/discussions/index.html.haml +10 -0
- data/app/views/discussions/new.html.haml +25 -0
- data/app/views/discussions/show.html.haml +16 -0
- data/app/views/external_links/_fields_for.html.haml +2 -0
- data/app/views/external_links/_form.html.haml +18 -0
- data/app/views/external_links/_show.html.haml +7 -0
- data/app/views/external_links/create.js.haml +3 -0
- data/app/views/external_links/destroy.js.haml +3 -0
- data/app/views/external_links/edit.html.haml +7 -0
- data/app/views/external_links/edit.js.haml +3 -0
- data/app/views/external_links/index.html.haml +23 -0
- data/app/views/external_links/index.js.haml +3 -0
- data/app/views/external_links/new.html.haml +5 -0
- data/app/views/external_links/new.js.haml +3 -0
- data/app/views/external_links/show.html.haml +2 -0
- data/app/views/external_links/show.js.haml +3 -0
- data/app/views/external_links/update.js.haml +3 -0
- data/app/views/feedback_mailer/submit_feedback.html.haml +22 -0
- data/app/views/feedbacks/_form.html.haml +38 -0
- data/app/views/feedbacks/index.html.haml +27 -0
- data/app/views/feedbacks/new.html.haml +6 -0
- data/app/views/feedbacks/show.html.haml +19 -0
- data/app/views/forum_messages/_form.html.haml +6 -0
- data/app/views/forum_messages/index.html.haml +11 -0
- data/app/views/forum_messages/new.html.haml +5 -0
- data/app/views/forums/_form.html.haml +13 -0
- data/app/views/forums/edit.html.haml +7 -0
- data/app/views/forums/index.html.haml +23 -0
- data/app/views/forums/new.html.haml +5 -0
- data/app/views/forums/show.html.haml +20 -0
- data/app/views/galleries/_form.html.haml +30 -0
- data/app/views/galleries/_show.html.haml +21 -0
- data/app/views/galleries/edit.html.haml +7 -0
- data/app/views/galleries/index.html.haml +15 -0
- data/app/views/galleries/new.html.haml +5 -0
- data/app/views/galleries/show.html.haml +4 -0
- data/app/views/images/_form.html.haml +10 -0
- data/app/views/images/create.js.haml +3 -0
- data/app/views/images/destroy.js.haml +3 -0
- data/app/views/images/edit.html.haml +7 -0
- data/app/views/images/edit.js.haml +3 -0
- data/app/views/images/index.html.haml +17 -0
- data/app/views/images/index.js.haml +3 -0
- data/app/views/images/new.html.haml +5 -0
- data/app/views/images/new.js.haml +3 -0
- data/app/views/images/show.html.haml +5 -0
- data/app/views/images/show.js.haml +3 -0
- data/app/views/images/update.js.haml +3 -0
- data/app/views/layouts/application.html.haml +60 -0
- data/app/views/layouts/bare.html.haml +2 -0
- data/app/views/layouts/image_dialog.html.haml +18 -0
- data/app/views/loadbehind/_destroy.js.haml +3 -0
- data/app/views/loadbehind/_edit.js.haml +4 -0
- data/app/views/loadbehind/_errors.html.haml +5 -0
- data/app/views/loadbehind/_growl_template.html.haml +65 -0
- data/app/views/loadbehind/_show_box.html.haml +9 -0
- data/app/views/loadbehind/_view.js.haml +4 -0
- data/app/views/loadbehind/growl.js.haml +4 -0
- data/app/views/loadbehind/index.js.haml +4 -0
- data/app/views/menus/_form.html.haml +13 -0
- data/app/views/menus/edit.html.haml +7 -0
- data/app/views/menus/index.html.haml +19 -0
- data/app/views/menus/new.html.haml +5 -0
- data/app/views/menus/show.html.haml +7 -0
- data/app/views/pages/_child_pages_links.html.haml +5 -0
- data/app/views/pages/_control_panel.html.haml +15 -0
- data/app/views/pages/_form.html.haml +27 -0
- data/app/views/pages/_form_fields.html.haml +23 -0
- data/app/views/pages/_show.html.haml +4 -0
- data/app/views/pages/_show_attachment.html.haml +6 -0
- data/app/views/pages/_show_small.html.haml +2 -0
- data/app/views/pages/create.js.haml +3 -0
- data/app/views/pages/destroy.js.haml +3 -0
- data/app/views/pages/edit.html.haml +16 -0
- data/app/views/pages/edit.js.haml +4 -0
- data/app/views/pages/index.html.haml +19 -0
- data/app/views/pages/index.js.haml +3 -0
- data/app/views/pages/new.html.haml +5 -0
- data/app/views/pages/new.js.haml +3 -0
- data/app/views/pages/show.html.haml +18 -0
- data/app/views/pages/show.js.haml +3 -0
- data/app/views/pages/update.js.haml +3 -0
- data/app/views/profiles/_form.html.haml +26 -0
- data/app/views/profiles/edit.html.haml +7 -0
- data/app/views/profiles/index.html.haml +25 -0
- data/app/views/profiles/new.html.haml +5 -0
- data/app/views/profiles/show.html.haml +21 -0
- data/app/views/sitemaps/edit.html.haml +12 -0
- data/app/views/sitemaps/index.html.haml +83 -0
- data/app/views/sitemaps/index.json.erb +23 -0
- data/app/views/sitemaps/new.html.haml +8 -0
- data/app/views/sitemaps/new.js.erb +0 -0
- data/app/views/users/edit.html.haml +45 -0
- data/app/views/users/index.html.haml +19 -0
- data/config/amazon_s3.yml +15 -0
- data/db/migrate/0000_devise_create_users.rb +26 -0
- data/db/migrate/0010_add_fields_to_users.rb +28 -0
- data/db/migrate/0020_create_blogs.rb +16 -0
- data/db/migrate/0030_create_galleries.rb +15 -0
- data/db/migrate/0040_create_images.rb +17 -0
- data/db/migrate/0050_create_profiles.rb +24 -0
- data/db/migrate/0060_insert_admin_user_and_roles.rb +24 -0
- data/db/migrate/0070_create_pages.rb +16 -0
- data/db/migrate/0080_create_forums.rb +13 -0
- data/db/migrate/0090_create_discussions.rb +14 -0
- data/db/migrate/0100_create_forum_messages.rb +15 -0
- data/db/migrate/0110_create_access_control_entries.rb +23 -0
- data/db/migrate/0120_create_attachments.rb +17 -0
- data/db/migrate/0130_create_roles.rb +13 -0
- data/db/migrate/0140_create_feedbacks.rb +20 -0
- data/db/migrate/0150_create_external_links.rb +14 -0
- data/db/migrate/0160_create_sitemaps.rb +17 -0
- data/db/migrate/0170_create_menus.rb +14 -0
- data/db/migrate/0180_acts_as_taggable_on_migration.rb +28 -0
- data/db/migrate/20100912194121_add_stylesheet_to_pages.rb +9 -0
- data/db/migrate/20100913073354_add_position_to_access_control_entries.rb +9 -0
- data/init.rb +2 -0
- data/lib/{core_extensions.rb → generators/core_extensions.rb} +2 -2
- data/lib/generators/templates/haml/app/views/layouts/application.html.haml +0 -0
- data/lib/generators/wheels/wheels_generator.rb +2 -0
- data/lib/generators/wheels_update/wheels_update_generator.rb +1 -1
- data/lib/wheels/routes.rb +13 -2
- data/wheels.gemspec +254 -122
- metadata +268 -124
- data/README +0 -2
- data/lib/generators/wheels/recipes/public.rb +0 -9
- data/lib/generators/wheels_update/core_extensions.3.rb +0 -64
- data/lib/wheels/base.rb +0 -7
- data/test/functional/access_control_entries_controller_test.rb +0 -49
- data/test/functional/app_configs_controller_test.rb +0 -49
- data/test/functional/discussions_controller_test.rb +0 -49
- data/test/functional/external_links_controller_test.rb +0 -49
- data/test/functional/feedback_mailer_test.rb +0 -8
- data/test/functional/feedbacks_controller_test.rb +0 -49
- data/test/functional/forums_controller_test.rb +0 -49
- data/test/functional/layouts_controller_test.rb +0 -49
- data/test/functional/member_pages_controller_test.rb +0 -49
- data/test/functional/members_controller_test.rb +0 -8
- data/test/functional/menus_controller_test.rb +0 -49
- data/test/functional/pages_controller_test.rb +0 -49
- data/test/functional/product_revisions_controller_test.rb +0 -49
- data/test/performance/browsing_test.rb +0 -9
- data/test/test_helper.rb +0 -13
- data/test/unit/access_control_entry_test.rb +0 -8
- data/test/unit/app_config_test.rb +0 -8
- data/test/unit/attachment_test.rb +0 -8
- data/test/unit/discussion_test.rb +0 -8
- data/test/unit/external_link_test.rb +0 -8
- data/test/unit/feedback_test.rb +0 -8
- data/test/unit/forum_message_test.rb +0 -8
- data/test/unit/forum_test.rb +0 -8
- data/test/unit/helpers/access_control_entries_helper_test.rb +0 -4
- data/test/unit/helpers/app_configs_helper_test.rb +0 -4
- data/test/unit/helpers/discussions_helper_test.rb +0 -4
- data/test/unit/helpers/external_links_helper_test.rb +0 -4
- data/test/unit/helpers/feedbacks_helper_test.rb +0 -4
- data/test/unit/helpers/forums_helper_test.rb +0 -4
- data/test/unit/helpers/layouts_helper_test.rb +0 -4
- data/test/unit/helpers/member_pages_helper_test.rb +0 -4
- data/test/unit/helpers/members_helper_test.rb +0 -4
- data/test/unit/helpers/menus_helper_test.rb +0 -4
- data/test/unit/helpers/pages_helper_test.rb +0 -4
- data/test/unit/helpers/product_revisions_helper_test.rb +0 -4
- data/test/unit/layout_test.rb +0 -8
- data/test/unit/member_page_test.rb +0 -8
- data/test/unit/menu_test.rb +0 -8
- data/test/unit/page_revision_test.rb +0 -8
- data/test/unit/page_test.rb +0 -8
- data/test/unit/product_revision_test.rb +0 -8
- data/test/unit/settings_test.rb +0 -8
- data/test/unit/sitemap_test.rb +0 -8
- data/test/unit/user_test.rb +0 -8
- /data/{lib/generators/wheels/templates/haml/app/views/layouts/application.html.haml → app/views/sitemaps/edit.js.erb} +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/cancan.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/cucumber.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/default.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/design.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/devise.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/factory_girl.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/haml.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/jquery.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/mongoid.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/postgresql.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/recipes.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/remarkable.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/rspec.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/wheels.rb +0 -0
- /data/lib/generators/{wheels_update/recipes/wheels.rb → recipes/wheels_update.rb} +0 -0
- /data/lib/generators/{wheels/snippets → snippets}/cucumber/database_config +0 -0
- /data/lib/generators/{wheels/templates → templates}/cancan/ability.rb +0 -0
- /data/lib/generators/{wheels/templates → templates}/database/postgresql.yml +0 -0
- /data/lib/generators/{wheels/templates → templates}/git/gitignore +0 -0
- /data/lib/generators/{wheels/templates → templates}/mongoid/features/step_definitions/mongoid_steps.rb +0 -0
- /data/lib/generators/{wheels/templates → templates}/mongoid/features/support/hooks.rb +0 -0
@@ -0,0 +1,22 @@
|
|
1
|
+
- include_ckeditor
|
2
|
+
|
3
|
+
= form_for [@blog.user, @blog], :html=>{:multipart=>true} do |f|
|
4
|
+
-if @blog.errors.any?
|
5
|
+
#errorExplanation
|
6
|
+
%h2= "#{pluralize(@blog.errors.count, "error")} prohibited this blog from being saved:"
|
7
|
+
%ul
|
8
|
+
- @blog.errors.full_messages.each do |msg|
|
9
|
+
%li= msg
|
10
|
+
|
11
|
+
.field
|
12
|
+
.fieldTitle Title
|
13
|
+
= f.text_field :title
|
14
|
+
.field
|
15
|
+
.fieldTitle Body
|
16
|
+
= f.text_area :body, :class=>'ckeditor_textarea'
|
17
|
+
.field
|
18
|
+
.fieldTitle Tags:
|
19
|
+
.tag_list= f.text_field :tag_list
|
20
|
+
.actions
|
21
|
+
= f.submit 'Save'
|
22
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
%h1= @user.profile.blog_title
|
2
|
+
|
3
|
+
- collection.each do |blog|
|
4
|
+
.entry
|
5
|
+
.entry-title= link_to blog.title, resource_url(blog)
|
6
|
+
|
7
|
+
.date Posted on #{blog.created_at}
|
8
|
+
.blog_body!= blog.body
|
9
|
+
.comments
|
10
|
+
%a{:href => "#"} 3 comments
|
11
|
+
|
12
|
+
|
13
|
+
- if current_user.try(:id) == @user.id
|
14
|
+
= link_to 'New Blog Post', new_user_blog_path(@user)
|
15
|
+
|
16
|
+
= will_paginate collection
|
17
|
+
|
18
|
+
- content_for(:tags) do
|
19
|
+
- for tag in tags
|
20
|
+
%li= link_to tag.name, user_blogs_path(@user, :tag=>tag.name)
|
21
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
xml.instruct!
|
2
|
+
|
3
|
+
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
|
4
|
+
|
5
|
+
xml.title "Feed Name"
|
6
|
+
xml.link "rel" => "self", "href" => user_blogs_path(@user, :only_path=>false, :format=>:xml)
|
7
|
+
# xml.link "rel" => "alternate", "href" => url_for(:only_path => false, :controller => 'posts')
|
8
|
+
xml.id user_blogs_path(@user, :only_path => false)
|
9
|
+
xml.updated @blogs.first.updated_at.strftime "%Y-%m-%dT%H:%M:%SZ" if @blogs.any?
|
10
|
+
xml.author { xml.name @blogs.first }
|
11
|
+
|
12
|
+
@blogs.each do |post|
|
13
|
+
xml.entry do
|
14
|
+
xml.title post.title
|
15
|
+
xml.link "rel" => "alternate", "href" => user_blogs_path(@user, post, :only_path => false)
|
16
|
+
xml.id user_blog_path(@user, post, :only_path => false)
|
17
|
+
xml.updated post.updated_at.strftime "%Y-%m-%dT%H:%M:%SZ"
|
18
|
+
xml.author { xml.name post.user.email }
|
19
|
+
xml.summary "Post summary"
|
20
|
+
xml.content "type" => "html" do
|
21
|
+
xml.cdata! post.body
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
|
2
|
+
.entry
|
3
|
+
.entry-title= link_to resource.title, resource_url(resource)
|
4
|
+
|
5
|
+
.date Posted on #{resource.created_at}
|
6
|
+
.blog_body!= resource.body
|
7
|
+
.tags!= tag_list resource
|
8
|
+
|
9
|
+
.comments
|
10
|
+
%a{:href => "#"} 3 comments
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
= will_paginate collection
|
15
|
+
|
16
|
+
- content_for(:tags) do
|
17
|
+
- for tag in tags
|
18
|
+
%li= link_to tag.name, user_blogs_path(parent, :tag=>tag.name)
|
19
|
+
|
20
|
+
|
21
|
+
= link_to 'Back', collection_url
|
22
|
+
= link_to '| Edit', edit_resource_url if can? :edit, resource
|
23
|
+
- if current_user.try(:id) == parent.id
|
24
|
+
= link_to '| New Blog Post', new_user_blog_path(parent)
|
25
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
= form_for @discussion do |f|
|
2
|
+
-if @discussion.errors.any?
|
3
|
+
#errorExplanation
|
4
|
+
%h2= "#{pluralize(@discussion.errors.count, "error")} prohibited this discussion from being saved:"
|
5
|
+
%ul
|
6
|
+
- @discussion.errors.full_messages.each do |msg|
|
7
|
+
%li= msg
|
8
|
+
|
9
|
+
.field
|
10
|
+
= f.label :subject
|
11
|
+
= f.text_field :subject
|
12
|
+
.field
|
13
|
+
= f.label :forum_id
|
14
|
+
= f.text_field :forum_id
|
15
|
+
.actions
|
16
|
+
= f.submit 'Save'
|
@@ -0,0 +1,10 @@
|
|
1
|
+
%h1 Listing discussions in forum #{@forum.name}
|
2
|
+
= link_to 'New discussion', new_resource_url if can? :create, Discussion, :forum_id=>@forum.id
|
3
|
+
|
4
|
+
%ul
|
5
|
+
- for discussion in @discussions.sort{|u,v| u.updated_at <=> v.update_at}
|
6
|
+
%li
|
7
|
+
= link_to discussion.subject, url_for([@forum, discussion])
|
8
|
+
- if can? :manage, discussion
|
9
|
+
= link_to "Manage", edit_forum_discussion_path(@forum, discussion)
|
10
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
%h1 New discussion
|
2
|
+
- include_ckeditor
|
3
|
+
= form_for [@forum, @discussion] do |f|
|
4
|
+
-if @discussion.errors.any?
|
5
|
+
#errorExplanation
|
6
|
+
%h2= "#{pluralize(@discussion.errors.count, "error")} prohibited this discussion from being saved:"
|
7
|
+
%ul
|
8
|
+
- @discussion.errors.full_messages.each do |msg|
|
9
|
+
%li= msg
|
10
|
+
|
11
|
+
%ul.form_fields
|
12
|
+
%li.field
|
13
|
+
= f.label :subject
|
14
|
+
= f.text_field :subject
|
15
|
+
= f.hidden_field :forum_id
|
16
|
+
%li.field
|
17
|
+
= f.fields_for :new_message, @new_message do |ff|
|
18
|
+
= ff.hidden_field :author_id
|
19
|
+
%ul.form_fields
|
20
|
+
%li.field= ff.text_area :message, :class=>'ckeditor_textarea'
|
21
|
+
.actions
|
22
|
+
= f.submit 'Create new discussion'
|
23
|
+
|
24
|
+
= link_to 'Back', collection_url
|
25
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
%h2 #{@forum.name} > #{@discussion.subject}
|
2
|
+
|
3
|
+
%ul
|
4
|
+
- for message in @discussion.forum_messages
|
5
|
+
%li
|
6
|
+
.named_box
|
7
|
+
.box_title
|
8
|
+
Posted By #{message.author.email} on #{message.updated_at}
|
9
|
+
.box_content!= message.message
|
10
|
+
|
11
|
+
= content_for :links do
|
12
|
+
%ul
|
13
|
+
- if can? :create, Discussion, :forum_id=>@forum.id
|
14
|
+
%li= link_to "Reply to this discussion", new_forum_discussion_forum_message_path(@forum, @discussion)
|
15
|
+
%li= link_to 'Back to Forum', @forum
|
16
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
= form_for @external_link, :remote=>true do |f|
|
2
|
+
-if @external_link.errors.any?
|
3
|
+
#errorExplanation
|
4
|
+
%h2= "#{pluralize(@external_link.errors.count, "error")} prohibited this external_link from being saved:"
|
5
|
+
%ul
|
6
|
+
- @external_link.errors.full_messages.each do |msg|
|
7
|
+
%li= msg
|
8
|
+
.field
|
9
|
+
= f.label :url
|
10
|
+
= f.text_field :url
|
11
|
+
.field
|
12
|
+
= f.label :link_text
|
13
|
+
= f.text_area :link_text
|
14
|
+
= hidden_field_tag :container, 'content_pane'
|
15
|
+
= hidden_field_tag :ajax_function, 'html'
|
16
|
+
.actions
|
17
|
+
= f.submit 'Save', :disable_with=>"Saving..."
|
18
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
%h1 Listing external_links
|
2
|
+
|
3
|
+
%table
|
4
|
+
%tr
|
5
|
+
%th Page
|
6
|
+
%th Url
|
7
|
+
%th Link text
|
8
|
+
%th
|
9
|
+
%th
|
10
|
+
%th
|
11
|
+
|
12
|
+
- @external_links.each do |external_link|
|
13
|
+
%tr
|
14
|
+
%td= external_link.page_id
|
15
|
+
%td= external_link.url
|
16
|
+
%td= external_link.link_text
|
17
|
+
%td= link_to 'Show', external_link
|
18
|
+
%td= link_to 'Edit', edit_external_link_path(external_link)
|
19
|
+
%td= link_to 'Destroy', external_link, :confirm => 'Are you sure?', :method => :delete
|
20
|
+
|
21
|
+
%br
|
22
|
+
|
23
|
+
= link_to 'New external_link', new_external_link_path
|
@@ -0,0 +1,22 @@
|
|
1
|
+
!!!
|
2
|
+
%html
|
3
|
+
%head
|
4
|
+
%meta{:content=>"text/html; charset=UTF-8", "http-equiv"=>"Content-Type"}
|
5
|
+
%body
|
6
|
+
%h1 A user submitted feedback to cagym.com.
|
7
|
+
%p
|
8
|
+
%b Name:
|
9
|
+
= @feedback.name
|
10
|
+
%p
|
11
|
+
%b Phone:
|
12
|
+
= @feedback.phone
|
13
|
+
%p
|
14
|
+
%b Email:
|
15
|
+
= @feedback.email
|
16
|
+
%p
|
17
|
+
%b Message:
|
18
|
+
= @feedback.message
|
19
|
+
%p
|
20
|
+
%b Want response:
|
21
|
+
= @feedback.want_response ? "Yes" : "No"
|
22
|
+
|
@@ -0,0 +1,38 @@
|
|
1
|
+
= content_for :head do
|
2
|
+
= javascript_include_tag 'jquery-validate/jquery.validate.pack'
|
3
|
+
|
4
|
+
:javascript
|
5
|
+
$(function(){
|
6
|
+
$('form').validate();
|
7
|
+
});
|
8
|
+
|
9
|
+
= form_for @feedback do |f|
|
10
|
+
-if @feedback.errors.any?
|
11
|
+
#errorExplanation
|
12
|
+
%h2= "#{pluralize(@feedback.errors.count, "error")} prohibited this feedback from being saved:"
|
13
|
+
%ul
|
14
|
+
- @feedback.errors.full_messages.each do |msg|
|
15
|
+
%li= msg
|
16
|
+
|
17
|
+
.field
|
18
|
+
= f.label :name
|
19
|
+
= f.text_field :name
|
20
|
+
.field
|
21
|
+
= f.label :phone
|
22
|
+
= f.text_field :phone
|
23
|
+
.field
|
24
|
+
= f.label :email
|
25
|
+
= f.text_field :email
|
26
|
+
.field
|
27
|
+
= f.label :subject
|
28
|
+
= f.text_field :subject
|
29
|
+
.field
|
30
|
+
= label_tag "Want a response?"
|
31
|
+
= f.check_box(:want_response)
|
32
|
+
.field
|
33
|
+
.text_area
|
34
|
+
= f.label :message
|
35
|
+
= f.text_area :message
|
36
|
+
.actions
|
37
|
+
= f.submit 'Send feedback'
|
38
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
%h1 Listing feedbacks
|
2
|
+
|
3
|
+
%table
|
4
|
+
%tr
|
5
|
+
%th Name
|
6
|
+
%th Phone
|
7
|
+
%th Email
|
8
|
+
%th Message
|
9
|
+
%th Want response
|
10
|
+
%th
|
11
|
+
%th
|
12
|
+
%th
|
13
|
+
|
14
|
+
- @feedbacks.each do |feedback|
|
15
|
+
%tr
|
16
|
+
%td= feedback.name
|
17
|
+
%td= feedback.phone
|
18
|
+
%td= feedback.email
|
19
|
+
%td= feedback.message
|
20
|
+
%td= feedback.want_response
|
21
|
+
%td= link_to 'Show', feedback
|
22
|
+
%td= link_to 'Edit', edit_feedback_path(feedback)
|
23
|
+
%td= link_to 'Destroy', feedback, :confirm => 'Are you sure?', :method => :delete
|
24
|
+
|
25
|
+
%br
|
26
|
+
|
27
|
+
= link_to 'New feedback', new_feedback_path
|
@@ -0,0 +1,19 @@
|
|
1
|
+
%p
|
2
|
+
%b Name:
|
3
|
+
= @feedback.name
|
4
|
+
%p
|
5
|
+
%b Phone:
|
6
|
+
= @feedback.phone
|
7
|
+
%p
|
8
|
+
%b Email:
|
9
|
+
= @feedback.email
|
10
|
+
%p
|
11
|
+
%b Message:
|
12
|
+
= @feedback.message
|
13
|
+
%p
|
14
|
+
%b Want response:
|
15
|
+
= @feedback.want_response
|
16
|
+
|
17
|
+
= link_to 'Edit', edit_feedback_path(@feedback)
|
18
|
+
\|
|
19
|
+
= link_to 'Back', feedbacks_path
|
@@ -0,0 +1,11 @@
|
|
1
|
+
%h1 Messages in #{@discussion.subject}
|
2
|
+
- if can? :create, Discussion, :forum_id=>@discussion.forum.id
|
3
|
+
= link_to "Reply to this topic", new_resource_url
|
4
|
+
|
5
|
+
%ul.listing
|
6
|
+
- for message in @forum_messages
|
7
|
+
%li
|
8
|
+
.content_box
|
9
|
+
.box_title Posted By #{message.author.email} on #{message.created_at}
|
10
|
+
.box_content!= message.message
|
11
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
= form_for @forum do |f|
|
2
|
+
-if @forum.errors.any?
|
3
|
+
#errorExplanation
|
4
|
+
%h2= "#{pluralize(@forum.errors.count, "error")} prohibited this forum from being saved:"
|
5
|
+
%ul
|
6
|
+
- @forum.errors.full_messages.each do |msg|
|
7
|
+
%li= msg
|
8
|
+
|
9
|
+
.field
|
10
|
+
= f.label :name
|
11
|
+
= f.text_field :name
|
12
|
+
.actions
|
13
|
+
= f.submit 'Save'
|
@@ -0,0 +1,23 @@
|
|
1
|
+
%h1 Forums Home
|
2
|
+
|
3
|
+
- if can? :create, Forum
|
4
|
+
%h2 Open a New Forum
|
5
|
+
= form_for Forum.new do |f|
|
6
|
+
%ul.form_fields
|
7
|
+
%li.field
|
8
|
+
Name:
|
9
|
+
= f.text_field :name
|
10
|
+
%li.action
|
11
|
+
= f.submit
|
12
|
+
|
13
|
+
= content_for :links do
|
14
|
+
%h2 Forums:
|
15
|
+
- @forums.each do |forum|
|
16
|
+
%li.important_link
|
17
|
+
= link_to "#{forum.name} ->", forum
|
18
|
+
- if can? :create, Discussion, :forum_id=>forum.id
|
19
|
+
= link_to "ReplyTo", new_forum_discussion_path(forum)
|
20
|
+
- if can? :manage, forum
|
21
|
+
!= "|" + link_to("Manage", edit_forum_path(forum))
|
22
|
+
%li.important_link= link_to 'New forum', new_forum_path if can? :create, Forum
|
23
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
%h1 Forum: #{@forum.name}
|
2
|
+
|
3
|
+
.titled_box
|
4
|
+
.box_title Discussions in this forum
|
5
|
+
.box_contents
|
6
|
+
%ul
|
7
|
+
- for discussion in @forum.discussions.sort{|u,v| u.updated_at <=> v.update_at}
|
8
|
+
%li
|
9
|
+
= link_to discussion.subject, url_for([@forum, discussion])
|
10
|
+
- if can? :create, Discussion, :forum_id => @forum.id
|
11
|
+
= link_to "Reply to this topic", new_forum_discussion_forum_message_path(@forum, discussion)
|
12
|
+
- if can? :manage, discussion
|
13
|
+
= link_to "Manage", edit_forum_discussion_path(@forum, discussion)
|
14
|
+
|
15
|
+
= content_for :links do
|
16
|
+
- if can? :create, Discussion, :forum_id=>@forum.id
|
17
|
+
%li= link_to "New topic in this forum", new_forum_discussion_path(@forum)
|
18
|
+
- if can? :manage, @forum
|
19
|
+
%li= link_to 'Edit', edit_forum_path(@forum)
|
20
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
:css
|
2
|
+
#image_gallery li {
|
3
|
+
display: inline;
|
4
|
+
list-style: none;
|
5
|
+
width: 300px;
|
6
|
+
min-height: 300px;
|
7
|
+
float: left;
|
8
|
+
margin: 0 10px 10px 0;
|
9
|
+
text-align: center;
|
10
|
+
}
|
11
|
+
= form_for @gallery do |f|
|
12
|
+
%h2 Gallery Name:
|
13
|
+
= f.text_field :name
|
14
|
+
= f.submit "Save Gallery"
|
15
|
+
|
16
|
+
%ul#image_gallery
|
17
|
+
- paginated_images_for(@gallery).each do |image|
|
18
|
+
%li
|
19
|
+
= image_tag image.image.url(:medium)
|
20
|
+
|
21
|
+
= will_paginate paginated_images_for(@gallery)
|
22
|
+
|
23
|
+
#upload_form
|
24
|
+
= form_for [@gallery, Image.new(:gallery=>@gallery)], :html=>{:id=>'upload', :multipart=>true} do |f|
|
25
|
+
- params.slice(:CKEditor, :CKEditorFuncNum, :langCode).each do |key, val|
|
26
|
+
= hidden_field_tag key, val
|
27
|
+
.upload_field= f.file_field :image
|
28
|
+
.tag_field= f.text_field :tag_list
|
29
|
+
= f.submit "Upload Image", :disable_with=>"Uploading..."
|
30
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
:css
|
2
|
+
#image_gallery li {
|
3
|
+
display: inline;
|
4
|
+
list-style: none;
|
5
|
+
width: 300px;
|
6
|
+
min-height: 300px;
|
7
|
+
float: left;
|
8
|
+
margin: 0 10px 10px 0;
|
9
|
+
text-align: center;
|
10
|
+
}
|
11
|
+
|
12
|
+
%h1= gallery.name.empty? ? "Name your gallery" : gallery.name
|
13
|
+
- if can? :update, gallery
|
14
|
+
= link_to 'Edit', edit_gallery_path(gallery, ckeditor_params)
|
15
|
+
- if can? :manage, gallery
|
16
|
+
= link_to 'Destroy', gallery_path(gallery, ckeditor_params), "data-confirm"=>"You'll shoot your eye out!", :method=>"delete"
|
17
|
+
%ul#image_gallery
|
18
|
+
- images.each do |image|
|
19
|
+
%li
|
20
|
+
= image_tag image.image.url(:medium)
|
21
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
%h1 #{@user.profile.alias}'s Galleries
|
2
|
+
%ul
|
3
|
+
- @galleries.each do |gallery|
|
4
|
+
%li
|
5
|
+
%h2= link_to (gallery.name || "No name"), gallery_path(gallery, ckeditor_params)
|
6
|
+
- unless gallery.images.empty?
|
7
|
+
= image_tag gallery.images[0].image.url(:medium)
|
8
|
+
- if can? :update, gallery
|
9
|
+
= link_to 'Edit', edit_gallery_path(gallery, ckeditor_params)
|
10
|
+
- if can? :manage, gallery
|
11
|
+
= link_to 'Destroy', gallery_path(gallery, ckeditor_params), "data-confirm"=>"Sure? All the images from this gallery will be gone...", :method=>"delete"
|
12
|
+
|
13
|
+
|
14
|
+
= link_to 'New gallery', new_gallery_path
|
15
|
+
|