wheels 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- data/README +2 -0
- data/Rakefile +22 -22
- data/lib/{generators/core_extensions.rb → core_extensions.rb} +2 -2
- data/lib/generators/{recipes → wheels/recipes}/cancan.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/cucumber.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/default.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/design.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/devise.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/factory_girl.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/haml.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/jquery.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/mongoid.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/postgresql.rb +0 -0
- data/lib/generators/wheels/recipes/public.rb +9 -0
- data/lib/generators/{recipes → wheels/recipes}/recipes.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/remarkable.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/rspec.rb +0 -0
- data/lib/generators/{recipes → wheels/recipes}/wheels.rb +0 -0
- data/lib/generators/{snippets → wheels/snippets}/cucumber/database_config +0 -0
- data/lib/generators/{templates → wheels/templates}/cancan/ability.rb +0 -0
- data/lib/generators/{templates → wheels/templates}/database/postgresql.yml +0 -0
- data/lib/generators/{templates → wheels/templates}/git/gitignore +0 -0
- data/lib/generators/{templates → wheels/templates}/haml/app/views/layouts/application.html.haml +0 -0
- data/lib/generators/{templates → wheels/templates}/mongoid/features/step_definitions/mongoid_steps.rb +0 -0
- data/lib/generators/{templates → wheels/templates}/mongoid/features/support/hooks.rb +0 -0
- data/lib/generators/wheels/wheels_generator.rb +0 -2
- data/lib/generators/wheels_update/core_extensions.3.rb +64 -0
- data/lib/generators/{recipes/wheels_update.rb → wheels_update/recipes/wheels.rb} +0 -0
- data/lib/generators/wheels_update/wheels_update_generator.rb +1 -1
- data/lib/wheels/base.rb +7 -0
- data/lib/wheels/routes.rb +2 -13
- data/test/functional/access_control_entries_controller_test.rb +49 -0
- data/test/functional/app_configs_controller_test.rb +49 -0
- data/test/functional/discussions_controller_test.rb +49 -0
- data/test/functional/external_links_controller_test.rb +49 -0
- data/test/functional/feedback_mailer_test.rb +8 -0
- data/test/functional/feedbacks_controller_test.rb +49 -0
- data/test/functional/forums_controller_test.rb +49 -0
- data/test/functional/layouts_controller_test.rb +49 -0
- data/test/functional/member_pages_controller_test.rb +49 -0
- data/test/functional/members_controller_test.rb +8 -0
- data/test/functional/menus_controller_test.rb +49 -0
- data/test/functional/pages_controller_test.rb +49 -0
- data/test/functional/product_revisions_controller_test.rb +49 -0
- data/test/performance/browsing_test.rb +9 -0
- data/test/test_helper.rb +13 -0
- data/test/unit/access_control_entry_test.rb +8 -0
- data/test/unit/app_config_test.rb +8 -0
- data/test/unit/attachment_test.rb +8 -0
- data/test/unit/discussion_test.rb +8 -0
- data/test/unit/external_link_test.rb +8 -0
- data/test/unit/feedback_test.rb +8 -0
- data/test/unit/forum_message_test.rb +8 -0
- data/test/unit/forum_test.rb +8 -0
- data/test/unit/helpers/access_control_entries_helper_test.rb +4 -0
- data/test/unit/helpers/app_configs_helper_test.rb +4 -0
- data/test/unit/helpers/discussions_helper_test.rb +4 -0
- data/test/unit/helpers/external_links_helper_test.rb +4 -0
- data/test/unit/helpers/feedbacks_helper_test.rb +4 -0
- data/test/unit/helpers/forums_helper_test.rb +4 -0
- data/test/unit/helpers/layouts_helper_test.rb +4 -0
- data/test/unit/helpers/member_pages_helper_test.rb +4 -0
- data/test/unit/helpers/members_helper_test.rb +4 -0
- data/test/unit/helpers/menus_helper_test.rb +4 -0
- data/test/unit/helpers/pages_helper_test.rb +4 -0
- data/test/unit/helpers/product_revisions_helper_test.rb +4 -0
- data/test/unit/layout_test.rb +8 -0
- data/test/unit/member_page_test.rb +8 -0
- data/test/unit/menu_test.rb +8 -0
- data/test/unit/page_revision_test.rb +8 -0
- data/test/unit/page_test.rb +8 -0
- data/test/unit/product_revision_test.rb +8 -0
- data/test/unit/settings_test.rb +8 -0
- data/test/unit/sitemap_test.rb +8 -0
- data/test/unit/user_test.rb +8 -0
- data/wheels.gemspec +122 -252
- metadata +124 -266
- data/LICENSE +0 -20
- data/README.rdoc +0 -17
- data/VERSION +0 -1
- data/app/controllers/access_control_entries_controller.rb +0 -20
- data/app/controllers/app_configs_controller.rb +0 -17
- data/app/controllers/application_controller.rb +0 -39
- data/app/controllers/attachments_controller.rb +0 -16
- data/app/controllers/blogs_controller.rb +0 -39
- data/app/controllers/discussions_controller.rb +0 -10
- data/app/controllers/external_links_controller.rb +0 -5
- data/app/controllers/feedbacks_controller.rb +0 -10
- data/app/controllers/forum_messages_controller.rb +0 -13
- data/app/controllers/forums_controller.rb +0 -2
- data/app/controllers/galleries_controller.rb +0 -60
- data/app/controllers/images_controller.rb +0 -30
- data/app/controllers/menus_controller.rb +0 -2
- data/app/controllers/pages_controller.rb +0 -71
- data/app/controllers/profiles_controller.rb +0 -16
- data/app/controllers/sitemaps_controller.rb +0 -135
- data/app/controllers/users_controller.rb +0 -28
- data/app/helpers/access_control_entries_helper.rb +0 -2
- data/app/helpers/app_configs_helper.rb +0 -2
- data/app/helpers/application_helper.rb +0 -36
- data/app/helpers/blogs_helper.rb +0 -10
- data/app/helpers/discussions_helper.rb +0 -2
- data/app/helpers/external_links_helper.rb +0 -2
- data/app/helpers/feedbacks_helper.rb +0 -2
- data/app/helpers/forums_helper.rb +0 -2
- data/app/helpers/menus_helper.rb +0 -2
- data/app/helpers/pages_helper.rb +0 -192
- data/app/helpers/sitemaps_helper.rb +0 -12
- data/app/mailers/feedback_mailer.rb +0 -10
- data/app/models/ability.rb +0 -43
- data/app/models/access_control_entry.rb +0 -100
- data/app/models/app_config.rb +0 -26
- data/app/models/attachment.rb +0 -10
- data/app/models/blog.rb +0 -10
- data/app/models/discussion.rb +0 -19
- data/app/models/external_link.rb +0 -4
- data/app/models/feedback.rb +0 -11
- data/app/models/forum.rb +0 -4
- data/app/models/forum_message.rb +0 -5
- data/app/models/gallery.rb +0 -5
- data/app/models/image.rb +0 -10
- data/app/models/menu.rb +0 -4
- data/app/models/page.rb +0 -7
- data/app/models/page_revision.rb +0 -2
- data/app/models/profile.rb +0 -12
- data/app/models/role.rb +0 -29
- data/app/models/s3_provider.rb +0 -84
- data/app/models/sitemap.rb +0 -171
- data/app/models/tagging.rb +0 -4
- data/app/models/user.rb +0 -69
- data/app/validators/email_validator.rb +0 -22
- data/app/views/access_control_entries/_form.html.haml +0 -33
- data/app/views/access_control_entries/_index.html.haml +0 -46
- data/app/views/access_control_entries/_show.html.haml +0 -12
- data/app/views/access_control_entries/create.js.haml +0 -3
- data/app/views/access_control_entries/destroy.js.haml +0 -3
- data/app/views/access_control_entries/edit.html.haml +0 -7
- data/app/views/access_control_entries/edit.js.haml +0 -3
- data/app/views/access_control_entries/index.html.haml +0 -2
- data/app/views/access_control_entries/index.js.haml +0 -3
- data/app/views/access_control_entries/new.html.haml +0 -5
- data/app/views/access_control_entries/new.js.haml +0 -3
- data/app/views/access_control_entries/show.html.haml +0 -2
- data/app/views/access_control_entries/show.js.haml +0 -4
- data/app/views/access_control_entries/update.js.haml +0 -3
- data/app/views/app_configs/_form.html.haml +0 -11
- data/app/views/app_configs/_index.html.haml +0 -6
- data/app/views/app_configs/_show.html.haml +0 -4
- data/app/views/app_configs/create.js.haml +0 -3
- data/app/views/app_configs/css.css.haml +0 -2
- data/app/views/app_configs/destroy.js.haml +0 -3
- data/app/views/app_configs/edit.html.haml +0 -2
- data/app/views/app_configs/edit.js.haml +0 -3
- data/app/views/app_configs/index.html.haml +0 -2
- data/app/views/app_configs/index.js.haml +0 -3
- data/app/views/app_configs/new.html.haml +0 -2
- data/app/views/app_configs/new.js.haml +0 -3
- data/app/views/app_configs/show.html.haml +0 -2
- data/app/views/app_configs/show.js.haml +0 -3
- data/app/views/app_configs/update.js.haml +0 -3
- data/app/views/attachments/_form.html.haml +0 -26
- data/app/views/attachments/_index.html.haml +0 -9
- data/app/views/attachments/_show.html.haml +0 -6
- data/app/views/attachments/_uploadify.html.erb +0 -12
- data/app/views/attachments/create.js.haml +0 -3
- data/app/views/attachments/destroy.js.haml +0 -3
- data/app/views/attachments/edit.js.haml +0 -3
- data/app/views/attachments/index.html.haml +0 -2
- data/app/views/attachments/index.js.haml +0 -3
- data/app/views/attachments/new.html.haml +0 -3
- data/app/views/attachments/new.js.haml +0 -3
- data/app/views/attachments/show.html.haml +0 -2
- data/app/views/attachments/show.js.haml +0 -3
- data/app/views/attachments/update.js.haml +0 -3
- data/app/views/blogs/_form.html.haml +0 -22
- data/app/views/blogs/edit.html.haml +0 -8
- data/app/views/blogs/index.html.haml +0 -21
- data/app/views/blogs/index.xml.builder +0 -27
- data/app/views/blogs/new.html.haml +0 -6
- data/app/views/blogs/show.html.haml +0 -25
- data/app/views/discussions/_form.html.haml +0 -16
- data/app/views/discussions/edit.html.haml +0 -7
- data/app/views/discussions/index.html.haml +0 -10
- data/app/views/discussions/new.html.haml +0 -25
- data/app/views/discussions/show.html.haml +0 -16
- data/app/views/external_links/_fields_for.html.haml +0 -2
- data/app/views/external_links/_form.html.haml +0 -18
- data/app/views/external_links/_show.html.haml +0 -7
- data/app/views/external_links/create.js.haml +0 -3
- data/app/views/external_links/destroy.js.haml +0 -3
- data/app/views/external_links/edit.html.haml +0 -7
- data/app/views/external_links/edit.js.haml +0 -3
- data/app/views/external_links/index.html.haml +0 -23
- data/app/views/external_links/index.js.haml +0 -3
- data/app/views/external_links/new.html.haml +0 -5
- data/app/views/external_links/new.js.haml +0 -3
- data/app/views/external_links/show.html.haml +0 -2
- data/app/views/external_links/show.js.haml +0 -3
- data/app/views/external_links/update.js.haml +0 -3
- data/app/views/feedback_mailer/submit_feedback.html.haml +0 -22
- data/app/views/feedbacks/_form.html.haml +0 -37
- data/app/views/feedbacks/index.html.haml +0 -27
- data/app/views/feedbacks/new.html.haml +0 -6
- data/app/views/feedbacks/show.html.haml +0 -19
- data/app/views/forum_messages/_form.html.haml +0 -6
- data/app/views/forum_messages/index.html.haml +0 -11
- data/app/views/forum_messages/new.html.haml +0 -5
- data/app/views/forums/_form.html.haml +0 -13
- data/app/views/forums/edit.html.haml +0 -7
- data/app/views/forums/index.html.haml +0 -23
- data/app/views/forums/new.html.haml +0 -5
- data/app/views/forums/show.html.haml +0 -20
- data/app/views/galleries/_form.html.haml +0 -30
- data/app/views/galleries/_show.html.haml +0 -21
- data/app/views/galleries/edit.html.haml +0 -7
- data/app/views/galleries/index.html.haml +0 -15
- data/app/views/galleries/new.html.haml +0 -5
- data/app/views/galleries/show.html.haml +0 -4
- data/app/views/images/_form.html.haml +0 -10
- data/app/views/images/create.js.haml +0 -3
- data/app/views/images/destroy.js.haml +0 -3
- data/app/views/images/edit.html.haml +0 -7
- data/app/views/images/edit.js.haml +0 -3
- data/app/views/images/index.html.haml +0 -17
- data/app/views/images/index.js.haml +0 -3
- data/app/views/images/new.html.haml +0 -5
- data/app/views/images/new.js.haml +0 -3
- data/app/views/images/show.html.haml +0 -5
- data/app/views/images/show.js.haml +0 -3
- data/app/views/images/update.js.haml +0 -3
- data/app/views/layouts/application.html.haml +0 -59
- data/app/views/layouts/bare.html.haml +0 -2
- data/app/views/layouts/image_dialog.html.haml +0 -18
- data/app/views/loadbehind/_destroy.js.haml +0 -3
- data/app/views/loadbehind/_edit.js.haml +0 -4
- data/app/views/loadbehind/_errors.html.haml +0 -5
- data/app/views/loadbehind/_growl_template.html.haml +0 -65
- data/app/views/loadbehind/_show_box.html.haml +0 -9
- data/app/views/loadbehind/_view.js.haml +0 -4
- data/app/views/loadbehind/growl.js.haml +0 -4
- data/app/views/loadbehind/index.js.haml +0 -4
- data/app/views/menus/_form.html.haml +0 -13
- data/app/views/menus/edit.html.haml +0 -7
- data/app/views/menus/index.html.haml +0 -19
- data/app/views/menus/new.html.haml +0 -5
- data/app/views/menus/show.html.haml +0 -7
- data/app/views/pages/_child_pages_links.html.haml +0 -5
- data/app/views/pages/_control_panel.html.haml +0 -15
- data/app/views/pages/_form.html.haml +0 -27
- data/app/views/pages/_form_fields.html.haml +0 -23
- data/app/views/pages/_show.html.haml +0 -4
- data/app/views/pages/_show_attachment.html.haml +0 -6
- data/app/views/pages/_show_small.html.haml +0 -2
- data/app/views/pages/create.js.haml +0 -3
- data/app/views/pages/destroy.js.haml +0 -3
- data/app/views/pages/edit.html.haml +0 -16
- data/app/views/pages/edit.js.haml +0 -4
- data/app/views/pages/index.html.haml +0 -19
- data/app/views/pages/index.js.haml +0 -3
- data/app/views/pages/new.html.haml +0 -5
- data/app/views/pages/new.js.haml +0 -3
- data/app/views/pages/show.html.haml +0 -20
- data/app/views/pages/show.js.haml +0 -3
- data/app/views/pages/update.js.haml +0 -3
- data/app/views/profiles/_form.html.haml +0 -26
- data/app/views/profiles/edit.html.haml +0 -7
- data/app/views/profiles/index.html.haml +0 -25
- data/app/views/profiles/new.html.haml +0 -5
- data/app/views/profiles/show.html.haml +0 -21
- data/app/views/sitemaps/edit.html.haml +0 -12
- data/app/views/sitemaps/edit.js.erb +0 -0
- data/app/views/sitemaps/index.html.haml +0 -83
- data/app/views/sitemaps/index.json.erb +0 -23
- data/app/views/sitemaps/new.html.haml +0 -8
- data/app/views/sitemaps/new.js.erb +0 -0
- data/app/views/users/edit.html.haml +0 -45
- data/app/views/users/index.html.haml +0 -19
- data/config/amazon_s3.yml +0 -15
- data/db/migrate/0000_devise_create_users.rb +0 -26
- data/db/migrate/0010_add_fields_to_users.rb +0 -28
- data/db/migrate/0020_create_blogs.rb +0 -16
- data/db/migrate/0030_create_galleries.rb +0 -15
- data/db/migrate/0040_create_images.rb +0 -17
- data/db/migrate/0050_create_profiles.rb +0 -24
- data/db/migrate/0060_insert_admin_user_and_roles.rb +0 -24
- data/db/migrate/0070_create_pages.rb +0 -16
- data/db/migrate/0080_create_forums.rb +0 -13
- data/db/migrate/0090_create_discussions.rb +0 -14
- data/db/migrate/0100_create_forum_messages.rb +0 -15
- data/db/migrate/0110_create_access_control_entries.rb +0 -23
- data/db/migrate/0120_create_attachments.rb +0 -17
- data/db/migrate/0130_create_roles.rb +0 -13
- data/db/migrate/0140_create_feedbacks.rb +0 -20
- data/db/migrate/0150_create_external_links.rb +0 -14
- data/db/migrate/0160_create_sitemaps.rb +0 -17
- data/db/migrate/0170_create_menus.rb +0 -14
- data/db/migrate/0180_acts_as_taggable_on_migration.rb +0 -28
- data/init.rb +0 -2
@@ -1,15 +0,0 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
= content_for :sidebar do
|
4
|
-
%ul
|
5
|
-
%li.sidebar_title Control Panel
|
6
|
-
%li
|
7
|
-
Upload a file to this page.
|
8
|
-
= render :partial=>'attachments/form'
|
9
|
-
%li
|
10
|
-
Set permissions >>
|
11
|
-
= link_to 'Edit Access', access_control_entries_path(:resource_type=>"Page", :resource_id=>@page.id), |
|
12
|
-
:confirm => "Are you sure? Any unsaved changes on this page should be saved before leaving."
|
13
|
-
%li= link_to 'New Page as child', new_page_path(:page_id=>@page.id), |
|
14
|
-
:confirm => "Are you sure? Any unsaved changes on this page should be saved before leaving."
|
15
|
-
|
@@ -1,27 +0,0 @@
|
|
1
|
-
- include_ckeditor
|
2
|
-
= render :partial => "child_pages_links"
|
3
|
-
|
4
|
-
- if params[:action]=="new"
|
5
|
-
= form_for resource, :remote=>true do |f|
|
6
|
-
= render :partial => "form_fields", :locals=>{:f=>f}
|
7
|
-
- else
|
8
|
-
= form_for form_object, {:url=>form_url, :remote=>true} do |f|
|
9
|
-
= render :partial => "form_fields", :locals=>{:f=>f}
|
10
|
-
|
11
|
-
= content_for :head do
|
12
|
-
= javascript_include_tag 'jquery-validate/jquery.validate.pack'
|
13
|
-
|
14
|
-
:javascript
|
15
|
-
$(function(){
|
16
|
-
jQuery.validator.addMethod("verify_user", function(value, element, params) {
|
17
|
-
//alert($(element).attr('data-verify-user-path'));
|
18
|
-
xhr = $.ajax({
|
19
|
-
async: false,
|
20
|
-
url: $(element).attr('data-verify-user-path')+ '?password='+value
|
21
|
-
});
|
22
|
-
return xhr.responseText=="true";
|
23
|
-
}, "Password is incorrect.");
|
24
|
-
|
25
|
-
$('form').validate();
|
26
|
-
});
|
27
|
-
|
@@ -1,23 +0,0 @@
|
|
1
|
-
-if @page.errors.any?
|
2
|
-
#errorExplanation
|
3
|
-
%h2= "#{pluralize(@page.errors.count, "error")} prohibited this page from being saved:"
|
4
|
-
%ul
|
5
|
-
- @page.errors.full_messages.each do |msg|
|
6
|
-
%li= msg
|
7
|
-
.field
|
8
|
-
= f.label :title
|
9
|
-
= f.text_field :title
|
10
|
-
.field
|
11
|
-
.fieldName "Display Title for this page?"
|
12
|
-
= f.check_box :show_title
|
13
|
-
|
14
|
-
.textarea
|
15
|
-
= f.label :body
|
16
|
-
= f.text_area :body, :class=>'ckeditor_textarea', :cols=>100, :rows=>25
|
17
|
-
= f.label :stylesheet
|
18
|
-
= f.text_area :stylesheet
|
19
|
-
= hidden_field_tag :container, 'content_pane'
|
20
|
-
= hidden_field_tag :ajax_function, 'html'
|
21
|
-
.actions
|
22
|
-
= f.submit 'Save', :disable_with=>"Saving..."
|
23
|
-
|
@@ -1,16 +0,0 @@
|
|
1
|
-
%h1 Editing page
|
2
|
-
|
3
|
-
= render 'form'
|
4
|
-
|
5
|
-
= link_to 'Show', @page
|
6
|
-
\|
|
7
|
-
= link_to 'Back', pages_path
|
8
|
-
|
9
|
-
= content_for :sidebar do
|
10
|
-
%ul#attachments_list
|
11
|
-
%li.sidebar_title Files
|
12
|
-
- @page.attachments.each do |attachment|
|
13
|
-
= render :partial => "attachments/show", :locals=>{:a=>(@attachment=attachment)}
|
14
|
-
|
15
|
-
= render :partial => "control_panel"
|
16
|
-
|
@@ -1,19 +0,0 @@
|
|
1
|
-
= link_to 'New page', new_page_path if can? :create, Page
|
2
|
-
|
3
|
-
= content_for :links do
|
4
|
-
- @pages.each do |page|
|
5
|
-
%li{:id=>page.element_id}
|
6
|
-
= link_to page.title, page
|
7
|
-
- if can? :edit, @page
|
8
|
-
= link_to '| Edit', edit_page_path(page)
|
9
|
-
- if can? :manage, @page
|
10
|
-
= link_to '| Delete', page_path(page), :remote=>true, "data-confirm" => "Are you sure?", :method=>"delete"
|
11
|
-
- if can? :manage, @page
|
12
|
-
= link_to '| Access Ctrl', access_control_entries_path(:resource_type=>"Page", :resource_id=>page.id)
|
13
|
-
|
14
|
-
- @pages.each do |page|
|
15
|
-
%h1= link_to page.title, page
|
16
|
-
= link_to "Edit", edit_page_path(page) if can? :edit, page
|
17
|
-
.page_content!= page.body
|
18
|
-
%hr/
|
19
|
-
|
data/app/views/pages/new.js.haml
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
= render :partial => "show"
|
2
|
-
= render :partial => "child_pages_links"
|
3
|
-
|
4
|
-
- if @sitemap && (@sitemap.parent != Sitemap.main_menu)
|
5
|
-
= nav_content do
|
6
|
-
%ul.parent_page
|
7
|
-
%li= link_to @sitemap.parent.menu_text, @sitemap
|
8
|
-
- if @sitemap && !@sitemap.children.empty?
|
9
|
-
= nav_content do
|
10
|
-
%ul.child_pages
|
11
|
-
- @sitemap.children.each do |child|
|
12
|
-
%li= link_to child.menu_text, child
|
13
|
-
|
14
|
-
- unless @page.attachments.empty?
|
15
|
-
= sidebar_content do
|
16
|
-
%ul#attachments_list
|
17
|
-
%li.sidebar_title Files
|
18
|
-
- @page.attachments.each do |attachment|
|
19
|
-
= render :partial => "attachments/show", :locals=>{:a=>(@attachment=attachment)}
|
20
|
-
|
@@ -1,26 +0,0 @@
|
|
1
|
-
= form_for @profile, :url=>{:action=>"update"}, :html=>{:multipart=>true} do |f|
|
2
|
-
-if @profile.errors.any?
|
3
|
-
#errorExplanation
|
4
|
-
%h2= "#{pluralize(@profile.errors.count, "error")} prohibited this profile from being saved:"
|
5
|
-
%ul
|
6
|
-
- @profile.errors.full_messages.each do |msg|
|
7
|
-
%li= msg
|
8
|
-
|
9
|
-
.field
|
10
|
-
= f.label :first_name
|
11
|
-
= f.text_field :first_name
|
12
|
-
.field
|
13
|
-
= f.label :last_name
|
14
|
-
= f.text_field :last_name
|
15
|
-
.field
|
16
|
-
= f.label :alias
|
17
|
-
= f.text_field :alias
|
18
|
-
.field
|
19
|
-
= f.label :about_me
|
20
|
-
= f.text_area :about_me
|
21
|
-
.field
|
22
|
-
= f.label :image
|
23
|
-
= f.file_field :image
|
24
|
-
.actions
|
25
|
-
= f.submit 'Save'
|
26
|
-
|
@@ -1,25 +0,0 @@
|
|
1
|
-
%h1 Listing profiles
|
2
|
-
|
3
|
-
%table
|
4
|
-
%tr
|
5
|
-
%th First name
|
6
|
-
%th Last name
|
7
|
-
%th Alias
|
8
|
-
%th About me
|
9
|
-
%th
|
10
|
-
%th
|
11
|
-
%th
|
12
|
-
|
13
|
-
- @profiles.each do |profile|
|
14
|
-
%tr
|
15
|
-
%td= profile.first_name
|
16
|
-
%td= profile.last_name
|
17
|
-
%td= profile.alias
|
18
|
-
%td= profile.about_me
|
19
|
-
%td= link_to 'Show', profile
|
20
|
-
%td= link_to 'Edit', edit_profile_path(profile)
|
21
|
-
%td= link_to 'Destroy', profile, :confirm => 'Are you sure?', :method => :delete
|
22
|
-
|
23
|
-
%br
|
24
|
-
|
25
|
-
= link_to 'New profile', new_profile_path
|
@@ -1,21 +0,0 @@
|
|
1
|
-
- if @profile.image_file_name
|
2
|
-
= image_tag @profile.image.url(:thumb)
|
3
|
-
- else
|
4
|
-
- if can? :edit, @profile
|
5
|
-
- link_to 'Upload a photo', user_profile_path(@user)
|
6
|
-
%p
|
7
|
-
%b First name:
|
8
|
-
= @profile.first_name
|
9
|
-
%p
|
10
|
-
%b Last name:
|
11
|
-
= @profile.last_name
|
12
|
-
%p
|
13
|
-
%b Alias:
|
14
|
-
= @profile.alias
|
15
|
-
%p
|
16
|
-
%b About me:
|
17
|
-
= @profile.about_me
|
18
|
-
|
19
|
-
- if current_user.try(:id) == @user.id
|
20
|
-
= link_to 'Edit', edit_user_profile_path(@user)
|
21
|
-
|
@@ -1,12 +0,0 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
#sitemap
|
5
|
-
|
6
|
-
|
7
|
-
= content_for :head do
|
8
|
-
= javascript_include_tag %(http://static.jstree.com/v.1.0rc2/jquery.cookie.js)
|
9
|
-
= javascript_include_tag %(http://static.jstree.com/v.1.0rc2/jquery.hotkeys.js)
|
10
|
-
= javascript_include_tag %(http://static.jstree.com/v.1.0rc2/jquery.jstree.js)
|
11
|
-
= javascript_include_tag %(sitemap_jstree)
|
12
|
-
|
File without changes
|
@@ -1,83 +0,0 @@
|
|
1
|
-
- include_ckeditor
|
2
|
-
= content_for :head do
|
3
|
-
= javascript_include_tag %w(jquery.hotkeys jquery.cookie jquery.jstree)
|
4
|
-
= javascript_include_tag %(sitemap_jstree)
|
5
|
-
= stylesheet_link_tag %(admin)
|
6
|
-
#container
|
7
|
-
#control_panel
|
8
|
-
#control_panel_handle
|
9
|
-
%h3 Control Panel
|
10
|
-
#sitemap_container
|
11
|
-
#sitemap.sitemap
|
12
|
-
#content_pane
|
13
|
-
|
14
|
-
#dialog_form
|
15
|
-
|
16
|
-
|
17
|
-
:javascript
|
18
|
-
$(function () {
|
19
|
-
// $('#control_panel').draggable({handle: '#control_panel_handle', containment: '#content'}).resizable();
|
20
|
-
|
21
|
-
// Settings up the tree - using $(selector).jstree(options);
|
22
|
-
// All those configuration options are documented in the _docs folder
|
23
|
-
$.jstree._themes = '/jstree/themes/'
|
24
|
-
$("#sitemap")
|
25
|
-
.jstree(sitemapJsTreeConfig())
|
26
|
-
.bind("create.jstree", jstreeEventDeclarations()["create.jstree"])
|
27
|
-
.bind("remove.jstree", jstreeEventDeclarations()["remove.jstree"])
|
28
|
-
// { "obj" : obj, "new_name" : new_name, "old_name" : old_name });
|
29
|
-
.bind("rename.jstree", jstreeEventDeclarations()["rename.jstree"])
|
30
|
-
.bind("select_node.jstree", jstreeEventDeclarations()["select_node.jstree"])
|
31
|
-
.bind("move_node.jstree", jstreeEventDeclarations()["move_node.jstree"]);
|
32
|
-
});
|
33
|
-
|
34
|
-
function createSiteMap(data, callback) {
|
35
|
-
$.post(
|
36
|
-
"#{sitemaps_path(:format=>:json)}",
|
37
|
-
{
|
38
|
-
"utf8" : "#{"✓".html_safe}",
|
39
|
-
#{authenticity_token_json}
|
40
|
-
"sitemap[menu_text]" : data['menu_text'],
|
41
|
-
"sitemap[position]" : data['position'],
|
42
|
-
"sitemap[resource_type]" : data['resource_type'],
|
43
|
-
"sitemap[resource_id]" : data['resource_id'],
|
44
|
-
"sitemap[parent_id]" : data['parent_id']
|
45
|
-
},
|
46
|
-
callback
|
47
|
-
);
|
48
|
-
}
|
49
|
-
|
50
|
-
function updateSiteMap(data, callback) {
|
51
|
-
post_data = {
|
52
|
-
"utf8" : "#{"✓".html_safe}",
|
53
|
-
"format" : "json",
|
54
|
-
#{authenticity_token_json}
|
55
|
-
}
|
56
|
-
if (data['parent_id'] != null) {post_data['parent_id'] = data['parent_id']}
|
57
|
-
if (data['menu_text'] != null) {post_data['sitemap[menu_text]'] = data['menu_text']}
|
58
|
-
if (data['position'] != null) {post_data['sitemap[position]'] = data['position']}
|
59
|
-
if (data['resource_id'] != null) {post_data['sitemap[resource_id]'] = data['resource_id']}
|
60
|
-
if (data['resource_type'] != null) {post_data['sitemap[resource_type]'] = data['resource_type']}
|
61
|
-
|
62
|
-
$.ajax({
|
63
|
-
async : false,
|
64
|
-
type: 'PUT',
|
65
|
-
url: "/sitemaps/" + data['id'].toString(),
|
66
|
-
data : post_data,
|
67
|
-
success: callback
|
68
|
-
});
|
69
|
-
}
|
70
|
-
|
71
|
-
function deleteSiteMap(node_id, callback) {
|
72
|
-
$.ajax({
|
73
|
-
async : false,
|
74
|
-
type: 'DELETE',
|
75
|
-
url: "/sitemaps/" + node_id.toString() + ".json",
|
76
|
-
data : {
|
77
|
-
"utf8" : "#{"✓".html_safe}",
|
78
|
-
#{authenticity_token_json}
|
79
|
-
},
|
80
|
-
success : callback
|
81
|
-
});
|
82
|
-
}
|
83
|
-
|
@@ -1,23 +0,0 @@
|
|
1
|
-
{
|
2
|
-
data: {
|
3
|
-
title=>
|
4
|
-
}
|
5
|
-
:data=>{
|
6
|
-
:title=>self.menu_text,
|
7
|
-
:icon=>icon_name,
|
8
|
-
},
|
9
|
-
:attr=>{
|
10
|
-
:id=>"node_#{id}",
|
11
|
-
:data_resource_type => self.resource_type,
|
12
|
-
:data_resource_id => self.resource_id,
|
13
|
-
:data_edit_path =>
|
14
|
-
},
|
15
|
-
:state=>treeview_state,
|
16
|
-
:children=>children.map{|t| t.to_jstree(false)}
|
17
|
-
}
|
18
|
-
|
19
|
-
def to_jstree(root=true)
|
20
|
-
r =
|
21
|
-
root ? r.to_json : r
|
22
|
-
end
|
23
|
-
|
@@ -1,8 +0,0 @@
|
|
1
|
-
= form_for resource, :html=>{:id=>"sitemap_form"} do |f|
|
2
|
-
= f.hidden_field :resource_type
|
3
|
-
= f.hidden_field :resource_id
|
4
|
-
= f.label :menu_text
|
5
|
-
= f.text_field :menu_text
|
6
|
-
= f.fields_for :resource do |rf|
|
7
|
-
= render :partial = "#{resource.resource_type.tableize}/fields_for", :locals=>{:f=>rf}
|
8
|
-
|
File without changes
|
@@ -1,45 +0,0 @@
|
|
1
|
-
%h1 Change Your Password
|
2
|
-
|
3
|
-
.form
|
4
|
-
= form_for resource do |f|
|
5
|
-
-if resource.errors.any?
|
6
|
-
#errorExplanation
|
7
|
-
%h2= "#{pluralize(resource.errors.count, "error")} prohibited this change:"
|
8
|
-
%ul
|
9
|
-
- resource.errors.full_messages.each do |msg|
|
10
|
-
%li= msg
|
11
|
-
.field
|
12
|
-
.fieldName Old Password:
|
13
|
-
= f.password_field :old_password, :id=>"old_password"
|
14
|
-
.field
|
15
|
-
.fieldName New Password:
|
16
|
-
= f.password_field :password, :id=>"password"
|
17
|
-
.field
|
18
|
-
.fieldName Confirm Password:
|
19
|
-
= f.password_field :password_confirmation
|
20
|
-
.submit= f.submit "Change Password"
|
21
|
-
|
22
|
-
:css
|
23
|
-
.extra_form_data {
|
24
|
-
display: none;
|
25
|
-
}
|
26
|
-
|
27
|
-
= content_for :head do
|
28
|
-
= javascript_include_tag 'jquery.validate'
|
29
|
-
|
30
|
-
|
31
|
-
:javascript
|
32
|
-
var checkingPassword = true;
|
33
|
-
$(function(){
|
34
|
-
jQuery.validator.addMethod("verify_user", function(value, element, params) {
|
35
|
-
//alert($(element).attr('data-verify-user-path'));
|
36
|
-
return $.ajax({
|
37
|
-
async: false,
|
38
|
-
url: $(element).attr('data-verify-user-path')+ '?password='+value
|
39
|
-
}).responseText == "true";
|
40
|
-
}, "Password is incorrect.");
|
41
|
-
|
42
|
-
$('form').validate({onkeyup: function(element) {}});
|
43
|
-
$('#old_password').rules("add", {verify_user : true, alphanumeric: true})
|
44
|
-
});
|
45
|
-
|
@@ -1,19 +0,0 @@
|
|
1
|
-
%h1 Users
|
2
|
-
%ul
|
3
|
-
- for user in @users
|
4
|
-
%li
|
5
|
-
%table.no_border
|
6
|
-
%tr
|
7
|
-
%td= link_to user.login, user_profile_path(user)
|
8
|
-
%td= "#{user.first_name} #{user.last_name}"
|
9
|
-
%td!= image_tag user.image.url(:thumb)
|
10
|
-
- if can? :manage, User
|
11
|
-
%td!= link_to 'Edit', edit_user_path(user)
|
12
|
-
%td!= link_to 'Destroy', user, "data-confirm"=>"Really delete #{user.alias}?", :method=>"delete"
|
13
|
-
%td{:id=>user.element_id(:confirm)}
|
14
|
-
- if user.confirmed_at
|
15
|
-
Confirmed
|
16
|
-
- else
|
17
|
-
= form_for user, :remote=>true do |f|
|
18
|
-
= f.hidden_field
|
19
|
-
|
data/config/amazon_s3.yml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
development:
|
2
|
-
bucket: <%= bucket %>
|
3
|
-
access_key_id: <%= access_key_id %>
|
4
|
-
secret_access_key: <%= secret_access_key %>
|
5
|
-
|
6
|
-
test:
|
7
|
-
bucket: <%= bucket %>
|
8
|
-
access_key_id: <%= access_key_id %>
|
9
|
-
secret_access_key: <%= secret_access_key %>
|
10
|
-
|
11
|
-
production:
|
12
|
-
bucket: <%= bucket %>
|
13
|
-
access_key_id: <%= access_key_id %>
|
14
|
-
secret_access_key: <%= secret_access_key %>
|
15
|
-
|
@@ -1,26 +0,0 @@
|
|
1
|
-
class DeviseCreateUsers < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
create_table(:users) do |t|
|
4
|
-
t.database_authenticatable :null => false
|
5
|
-
t.recoverable
|
6
|
-
t.rememberable
|
7
|
-
t.trackable
|
8
|
-
|
9
|
-
# t.confirmable
|
10
|
-
# t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
|
11
|
-
# t.token_authenticatable
|
12
|
-
|
13
|
-
t.timestamps
|
14
|
-
end
|
15
|
-
|
16
|
-
add_index :users, :email, :unique => true
|
17
|
-
add_index :users, :reset_password_token, :unique => true
|
18
|
-
# add_index :users, :confirmation_token, :unique => true
|
19
|
-
# add_index :users, :unlock_token, :unique => true
|
20
|
-
end
|
21
|
-
|
22
|
-
def self.down
|
23
|
-
drop_table :users
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
@@ -1,28 +0,0 @@
|
|
1
|
-
class AddFieldsToUsers < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
add_column :users, :confirmation_token, :string
|
4
|
-
add_column :users, :confirmed_at, :datetime
|
5
|
-
add_column :users, :confirmation_sent_at, :datetime
|
6
|
-
add_column :users, :failed_attempts, :integer, :default => 0
|
7
|
-
add_column :users, :unlock_token, :string
|
8
|
-
add_column :users, :locked_at, :datetime
|
9
|
-
add_column :users, :authentication_token, :string
|
10
|
-
add_column :users, :login, :string
|
11
|
-
add_column :users, :name, :string
|
12
|
-
add_column :users, :role_id, :integer
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.down
|
16
|
-
remove_column :users, :confirmation_token
|
17
|
-
remove_column :users, :confirmed_at
|
18
|
-
remove_column :users, :confirmation_sent_at
|
19
|
-
remove_column :users, :failed_attempts
|
20
|
-
remove_column :users, :unlock_token
|
21
|
-
remove_column :users, :locked_at
|
22
|
-
remove_column :users, :authentication_token
|
23
|
-
remove_column :users, :login
|
24
|
-
remove_column :users, :name
|
25
|
-
remove_column :users, :role_id
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
@@ -1,17 +0,0 @@
|
|
1
|
-
class CreateImages < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
create_table :images do |t|
|
4
|
-
t.string :image_file_name
|
5
|
-
t.string :image_content_type
|
6
|
-
t.integer :image_file_size
|
7
|
-
t.datetime :image_updated_at
|
8
|
-
t.integer :gallery_id
|
9
|
-
t.timestamps
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.down
|
14
|
-
drop_table :images
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
@@ -1,24 +0,0 @@
|
|
1
|
-
class CreateProfiles < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
create_table :profiles do |t|
|
4
|
-
t.string :first_name
|
5
|
-
t.string :last_name
|
6
|
-
t.string :alias
|
7
|
-
t.string :blog_title
|
8
|
-
t.text :about_me
|
9
|
-
t.integer :user_id
|
10
|
-
t.string :image_file_name
|
11
|
-
t.string :image_content_type
|
12
|
-
t.integer :image_file_size
|
13
|
-
t.datetime :image_updated_at
|
14
|
-
t.timestamps
|
15
|
-
end
|
16
|
-
add_index :profiles, :alias, :unique=>true
|
17
|
-
add_index :profiles, :user_id, :unique=>true
|
18
|
-
end
|
19
|
-
|
20
|
-
def self.down
|
21
|
-
drop_table :profiles
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
@@ -1,24 +0,0 @@
|
|
1
|
-
class InsertAdminUserAndRoles < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
Role.create(:name=>"Super")
|
4
|
-
Role.create(:name=>"Admin")
|
5
|
-
Role.create(:name=>"User")
|
6
|
-
user = User.create(:email=>"<%= user_email %>",
|
7
|
-
:password=>"<%= user_password %>",
|
8
|
-
:confirmed_at=>DateTime::now,
|
9
|
-
:role=>:super)
|
10
|
-
Profile.create(
|
11
|
-
:first_name => "<%= user_first_name %>",
|
12
|
-
:last_name => "<%= user_last_name %>",
|
13
|
-
:blog_title => "<%= user_blog_title %>",
|
14
|
-
:alias => "<%= user_alias %>",
|
15
|
-
:user => user
|
16
|
-
)
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.down
|
20
|
-
User.find_by_email("<%= user_email %>").destroy
|
21
|
-
Role.all.each {|t| t.destroy}
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|