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,11 @@
|
|
1
|
+
Compass.ErpApp.Widgets.ManageProfile = {
|
2
|
+
addManageProfile:function(){
|
3
|
+
Ext.getCmp('knitkitCenterRegion').addContentToActiveCodeMirror('<%= render_widget :manage_profile %>');
|
4
|
+
}
|
5
|
+
}
|
6
|
+
|
7
|
+
Compass.ErpApp.Widgets.AvailableWidgets.push({
|
8
|
+
name:'Manage Profile',
|
9
|
+
iconUrl:'/images/icons/document_edit/document_edit_48x48.png',
|
10
|
+
onClick:Compass.ErpApp.Widgets.ManageProfile.addManageProfile
|
11
|
+
});
|
@@ -0,0 +1,180 @@
|
|
1
|
+
<%= form_tag build_widget_url(:update_contact_information), :remote => true, :html => {:id => 'contact_information_form'} do %>
|
2
|
+
<div class="form_settings" style="margin-left: 20px;">
|
3
|
+
|
4
|
+
<!-- *****Email Addresses***** -->
|
5
|
+
|
6
|
+
<h4 style='float: left; border-width: 0px 0px 1px; border-style: solid;'>Email Addresses</h4>
|
7
|
+
<h4 style='float: right; border-width: 0px 0px 1px; border-style: solid;'>Contact Type</h4>
|
8
|
+
<div style='clear:both;'></div>
|
9
|
+
</br>
|
10
|
+
<% @email_addresses.each_with_index do |e, i|%>
|
11
|
+
<p>
|
12
|
+
<span>Email Address <%= i + 1 %></span>
|
13
|
+
<%= text_field_tag "email_addresses[#{i}]", e.email_address %>
|
14
|
+
<%= select_tag("email_address_contact_purposes[#{i}]", options_for_select(@purpose_hash, :selected => e.contact.contact_purposes.first.internal_identifier, :disabled => "type"), {:style => 'width: auto; float: right; margin: 5px 0px;'})%>
|
15
|
+
</p>
|
16
|
+
<div style='clear:both;'></div>
|
17
|
+
<% end %>
|
18
|
+
<p><span> </span><a href="#" id="new_email_button"
|
19
|
+
onclick="var state = document.getElementById('new_email_hide_show').style.display;
|
20
|
+
if (state == 'block') {
|
21
|
+
document.getElementById('new_email_hide_show').style.display = 'none';
|
22
|
+
document.getElementById('new_email_button').innerHTML = 'Add New Email Address (+)';
|
23
|
+
} else {
|
24
|
+
document.getElementById('new_email_hide_show').style.display = 'block';
|
25
|
+
document.getElementById('new_email_button').innerHTML = 'Add New Email Address (-)';
|
26
|
+
}
|
27
|
+
return false;
|
28
|
+
">Add (+)</a></p>
|
29
|
+
<div id='new_email_hide_show' style='display: none;'>
|
30
|
+
<p>
|
31
|
+
<span>New Email Address</span>
|
32
|
+
<%= text_field_tag "new_email_address" %>
|
33
|
+
<%= select_tag("new_email_address_contact_purpose", options_for_select(@purpose_hash,
|
34
|
+
:selected => "type", :disabled => "type"),
|
35
|
+
{:style => 'width: auto; float: right; margin: 5px 0px;'}) %>
|
36
|
+
</p>
|
37
|
+
<div style='clear:both;'></div>
|
38
|
+
</div>
|
39
|
+
</br>
|
40
|
+
|
41
|
+
<!-- *****Phone Numbers***** -->
|
42
|
+
|
43
|
+
<h4 style='float: left; border-width: 0px 0px 1px; border-style: solid;'>Phone Numbers</h4>
|
44
|
+
<div style='clear:both;'></div>
|
45
|
+
</br>
|
46
|
+
<% @phone_numbers.each_with_index do |p, i|%>
|
47
|
+
<p>
|
48
|
+
<span>Phone Number <%= i + 1 %></span>
|
49
|
+
<%= text_field_tag "phone_numbers[#{i}]", p.phone_number %>
|
50
|
+
<%= select_tag("phone_number_contact_purposes[#{i}]", options_for_select(@purpose_hash,
|
51
|
+
:selected => p.contact.contact_purposes.first.internal_identifier, :disabled => "type"),
|
52
|
+
{:style => 'width: auto; float: right; margin: 5px 0px;'}) %>
|
53
|
+
</p>
|
54
|
+
<div style='clear:both;'></div>
|
55
|
+
<% end %>
|
56
|
+
<p><span> </span><a href="#" id="new_number_button"
|
57
|
+
onclick="var state = document.getElementById('new_number_hide_show').style.display;
|
58
|
+
if (state == 'block') {
|
59
|
+
document.getElementById('new_number_hide_show').style.display = 'none';
|
60
|
+
document.getElementById('new_number_button').innerHTML = 'Add New Phone Number (+)';
|
61
|
+
} else {
|
62
|
+
document.getElementById('new_number_hide_show').style.display = 'block';
|
63
|
+
document.getElementById('new_number_button').innerHTML = 'Add New Phone Number (-)';
|
64
|
+
}
|
65
|
+
return false;
|
66
|
+
">Add (+)</a></p>
|
67
|
+
<div id='new_number_hide_show' style='display: none;'>
|
68
|
+
<p>
|
69
|
+
<span>New Phone Number</span>
|
70
|
+
<%= text_field_tag("new_phone_number") %>
|
71
|
+
<%= select_tag("new_phone_number_contact_purpose", options_for_select(@purpose_hash,
|
72
|
+
:selected => "type", :disabled => "type"),
|
73
|
+
{:style => 'width: auto; float: right; margin: 5px 0px;'}) %>
|
74
|
+
</p>
|
75
|
+
<div style='clear:both;'></div>
|
76
|
+
</div>
|
77
|
+
</br>
|
78
|
+
|
79
|
+
<!-- *****Postal Addresses***** -->
|
80
|
+
|
81
|
+
<h4 style='float: left; border-width: 0px 0px 1px; border-style: solid;'>Addresses</h4>
|
82
|
+
<div style='clear:both;'></div>
|
83
|
+
</br>
|
84
|
+
<% @postal_addresses.each_with_index do |a, i|%>
|
85
|
+
<p>
|
86
|
+
<!-- left column -->
|
87
|
+
<div style="float: left; width: 21%;">
|
88
|
+
<span>Address <%= i + 1 %></span>
|
89
|
+
</div>
|
90
|
+
|
91
|
+
<!-- middle column -->
|
92
|
+
<div style="float: left; width: 54%;">
|
93
|
+
<%= text_field_tag "postal_addresses[#{i}][address_line_1]", a.address_line_1, {:style => 'margin-bottom: 4px;'} %>
|
94
|
+
<%= text_field_tag "postal_addresses[#{i}][address_line_2]", a.address_line_2, {:style => 'margin-bottom: 4px;'} %>
|
95
|
+
|
96
|
+
<!-- left sub-column -->
|
97
|
+
<div style="float: left; width: 50%;">
|
98
|
+
<%= text_field_tag "postal_addresses[#{i}][city]", a.city, {:style => 'width: auto; margin-bottom: 4px;'} %>
|
99
|
+
<%= text_field_tag "postal_addresses[#{i}][zip]", a.zip, {:style => 'width: auto; margin-bottom: 4px;'} %>
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<!-- right sub-column -->
|
103
|
+
<div style="float: right; width: 50%; text-align: right;">
|
104
|
+
<%= select_tag("postal_addresses[#{i}][state_id]", options_for_select(@states_id,
|
105
|
+
:selected => a.geo_zone_id, :disabled => "default"),
|
106
|
+
{:style => 'width: 125px; margin: 5px 0px;'}) %>
|
107
|
+
</br>
|
108
|
+
<%= select_tag("postal_addresses[#{i}][country_id]", options_for_select(@countries_id,
|
109
|
+
:selected => a.geo_country_id, :disabled => "default"),
|
110
|
+
{:style => 'width: 125px; margin: 5px 0px;'}) %>
|
111
|
+
</div>
|
112
|
+
</div>
|
113
|
+
|
114
|
+
<!-- right column -->
|
115
|
+
<div style ="float: left; width: 25%;">
|
116
|
+
<%= select_tag("postal_address_contact_purposes[#{i}]", options_for_select(@purpose_hash,
|
117
|
+
:selected => a.contact.contact_purposes.first.internal_identifier, :disabled => "type"),
|
118
|
+
{:style => 'width: auto; float: right; margin: 5px 0px;'}) %>
|
119
|
+
</div>
|
120
|
+
<div style="clear: both;"></div>
|
121
|
+
</p>
|
122
|
+
<% end %>
|
123
|
+
|
124
|
+
|
125
|
+
<p><span> </span><a href="#" id="new_address_button"
|
126
|
+
onclick="var state = document.getElementById('new_address_hide_show').style.display;
|
127
|
+
if (state == 'block') {
|
128
|
+
document.getElementById('new_address_hide_show').style.display = 'none';
|
129
|
+
document.getElementById('new_address_button').innerHTML = 'Add New Address (+)';
|
130
|
+
} else {
|
131
|
+
document.getElementById('new_address_hide_show').style.display = 'block';
|
132
|
+
document.getElementById('new_address_button').innerHTML = 'Add New Address (-)';
|
133
|
+
}
|
134
|
+
return false;
|
135
|
+
">Add (+)</a></p>
|
136
|
+
<div id='new_address_hide_show' style='display: none;'>
|
137
|
+
<p>
|
138
|
+
<!-- left column -->
|
139
|
+
<div style="float: left; width: 21%;">
|
140
|
+
<span>New Address</span>
|
141
|
+
</div>
|
142
|
+
|
143
|
+
<!-- middle column -->
|
144
|
+
<div style="float: left; width: 54%;">
|
145
|
+
<%= text_field_tag "new_postal_address[address_line_1]", "Address Line 1", {:style => 'margin-bottom: 4px;'} %>
|
146
|
+
<%= text_field_tag "new_postal_address[address_line_2]", "Address Line 2", {:style => 'margin-bottom: 4px;'} %>
|
147
|
+
|
148
|
+
<!-- left sub-column -->
|
149
|
+
<div style="float: left; width: 50%;">
|
150
|
+
<%= text_field_tag "new_postal_address[city]", "City", {:style => 'width: auto; margin-bottom: 4px;'} %>
|
151
|
+
<%= text_field_tag "new_postal_address[zip]", "Zipcode", {:style => 'width: auto; margin-bottom: 4px;'} %>
|
152
|
+
</div>
|
153
|
+
|
154
|
+
<!-- right sub-column -->
|
155
|
+
<div style="float: right; width: 50%; text-align: right;">
|
156
|
+
<%= select_tag("new_postal_address[state_id]", options_for_select(@states_id, :selected => "default", :disabled => "default"),{:style => 'width: 125px; margin: 5px 0px;'}) %>
|
157
|
+
</br>
|
158
|
+
<%= select_tag("new_postal_address[country_id]", options_for_select(@countries_id, :selected => "default",:disabled => "default"),{:style => 'width: 125px; margin: 5px 0px;'}) %>
|
159
|
+
</div>
|
160
|
+
</div>
|
161
|
+
|
162
|
+
<!-- right column -->
|
163
|
+
<div style ="float: left; width: 25%;">
|
164
|
+
<%= select_tag("new_postal_address_contact_purpose", options_for_select(@purpose_hash, :selected => "type", :disabled => "type"),
|
165
|
+
{:style => 'width: auto; float: right; margin: 5px 0px;'}) %>
|
166
|
+
</div>
|
167
|
+
<div style="clear: both;"></div>
|
168
|
+
</p>
|
169
|
+
<div style='clear:both;'></div>
|
170
|
+
</div>
|
171
|
+
|
172
|
+
<!-- Buttons -->
|
173
|
+
|
174
|
+
<p style="padding-top: 15px">
|
175
|
+
<input type="reset" class="submit" value="Reset" style="margin: 0 0 0 120px;" />
|
176
|
+
<%= submit_tag "Submit", :disable_with => "Please wait...", :class => "submit", :style => "margin-left: 0;" %>
|
177
|
+
</p>
|
178
|
+
|
179
|
+
</div>
|
180
|
+
<% end %>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<%= form_tag build_widget_url(:update_password), :remote => true, :html => {:id => 'password_form'} do %>
|
2
|
+
<div class="form_settings" style="margin-left: 20px;">
|
3
|
+
<p>
|
4
|
+
<span>Old Password</span>
|
5
|
+
<%= password_field_tag :old_password %>
|
6
|
+
</p>
|
7
|
+
<p>
|
8
|
+
<span>New Password</span>
|
9
|
+
<%= password_field_tag :new_password %>
|
10
|
+
</p>
|
11
|
+
<p>
|
12
|
+
<span>Confirm Password</span>
|
13
|
+
<%= password_field_tag :password_confirmation %>
|
14
|
+
</p>
|
15
|
+
<p style="padding-top: 15px">
|
16
|
+
<input type="reset" class="submit" value="Reset" style="margin: 0 0 0 120px;" />
|
17
|
+
<%= submit_tag "Submit", :disable_with => "Please wait...", :class => "submit", :style => "margin-left: 0;" %>
|
18
|
+
</p>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<%= form_tag build_widget_url(:update_user_information), :remote => true, :html => {:id => 'user_information_form'} do %>
|
2
|
+
<div class="form_settings" style="margin-left: 20px;">
|
3
|
+
<p>
|
4
|
+
<span>First Name</span>
|
5
|
+
<%= text_field_tag :first_name, @individual.current_first_name %>
|
6
|
+
</p>
|
7
|
+
<p>
|
8
|
+
<span>Last Name</span>
|
9
|
+
<%= text_field_tag :last_name, @individual.current_last_name %>
|
10
|
+
</p>
|
11
|
+
<p>
|
12
|
+
<span>Middle Name</span>
|
13
|
+
<%= text_field_tag :middle_name, @individual.current_middle_name %>
|
14
|
+
</p>
|
15
|
+
<p>
|
16
|
+
<span>Date of Birth</span>
|
17
|
+
<!--find a better solution for styling this. this method cant be overridden easily by a template -->
|
18
|
+
<%= select_date(@individual.birth_date, {:start_year => Time.now.year - 100, :end_year => Time.now.year},
|
19
|
+
{:style => 'width: auto;'}) %>
|
20
|
+
</p>
|
21
|
+
<p>
|
22
|
+
<span>Gender</span>
|
23
|
+
<%= select_tag(:gender, options_for_select([['M', 'm'], ['F', 'f']], @individual.gender), {:style => 'width: auto;'})%>
|
24
|
+
</p>
|
25
|
+
<p style="padding-top: 15px">
|
26
|
+
<input type="reset" class="submit" value="Reset" style="margin: 0 0 0 120px;" />
|
27
|
+
<%= submit_tag "Submit", :disable_with => "Please wait...", :class => "submit", :style => "margin-left: 0;" %>
|
28
|
+
</p>
|
29
|
+
</div>
|
30
|
+
<% end %>
|
@@ -0,0 +1,46 @@
|
|
1
|
+
|
2
|
+
<div id="<%=widget_result_id%>"></div>
|
3
|
+
<div>
|
4
|
+
|
5
|
+
<!-- *************************************** Update User Information ************************************* -->
|
6
|
+
|
7
|
+
<a href="#" onclick="var state = document.getElementById('user_info_hide_show').style.display;
|
8
|
+
if (state == 'block') {
|
9
|
+
document.getElementById('user_info_hide_show').style.display = 'none';
|
10
|
+
} else {
|
11
|
+
document.getElementById('user_info_hide_show').style.display = 'block';
|
12
|
+
}
|
13
|
+
return false;
|
14
|
+
"><h2 style="border-width: 0px 0px 1px; border-style: solid;">User Information</h2></a>
|
15
|
+
<div id="user_info_hide_show">
|
16
|
+
<%= render :partial => '/user_information_form' %>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<!-- *************************************** Update Password ************************************* -->
|
20
|
+
|
21
|
+
<a href="#" onclick="var state = document.getElementById('password_hide_show').style.display;
|
22
|
+
if (state == 'block') {
|
23
|
+
document.getElementById('password_hide_show').style.display = 'none';
|
24
|
+
} else {
|
25
|
+
document.getElementById('password_hide_show').style.display = 'block';
|
26
|
+
}
|
27
|
+
return false;
|
28
|
+
"><h2 style="border-width: 0px 0px 1px; border-style: solid;">Password</h2></a>
|
29
|
+
<div id="password_hide_show" style="display: none;">
|
30
|
+
<%= render :partial => '/password_form' %>
|
31
|
+
</div>
|
32
|
+
|
33
|
+
<!-- *************************************** Update Contact Information ************************************* -->
|
34
|
+
|
35
|
+
<a href="#" onclick="var state = document.getElementById('contact_info_hide_show').style.display;
|
36
|
+
if (state == 'block') {
|
37
|
+
document.getElementById('contact_info_hide_show').style.display = 'none';
|
38
|
+
} else {
|
39
|
+
document.getElementById('contact_info_hide_show').style.display = 'block';
|
40
|
+
}
|
41
|
+
return false;
|
42
|
+
"><h2 style="border-width: 0px 0px 1px; border-style: solid;">Contact Information</h2></a>
|
43
|
+
<div id="contact_info_hide_show" style="display: none;">
|
44
|
+
<%= render :partial => '/contact_information_form' %>
|
45
|
+
</div>
|
46
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render_widget :manage_profile %>
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Widgets
|
2
|
+
module ResetPassword
|
3
|
+
class Base < ErpApp::Widgets::Base
|
4
|
+
|
5
|
+
def index
|
6
|
+
@login_url = params[:login_url]
|
7
|
+
|
8
|
+
render
|
9
|
+
end
|
10
|
+
|
11
|
+
#should not be modified
|
12
|
+
#modify at your own risk
|
13
|
+
def locate
|
14
|
+
File.dirname(__FILE__)
|
15
|
+
end
|
16
|
+
|
17
|
+
class << self
|
18
|
+
def title
|
19
|
+
"Reset Password"
|
20
|
+
end
|
21
|
+
|
22
|
+
def views_location
|
23
|
+
File.join(File.dirname(__FILE__),"/views")
|
24
|
+
end
|
25
|
+
|
26
|
+
def widget_name
|
27
|
+
File.basename(File.dirname(__FILE__))
|
28
|
+
end
|
29
|
+
|
30
|
+
def base_layout
|
31
|
+
begin
|
32
|
+
file = File.join(File.dirname(__FILE__),"/views/layouts/base.html.erb")
|
33
|
+
IO.read(file)
|
34
|
+
rescue
|
35
|
+
return nil
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Compass.ErpApp.Widgets.ResetPassword = {
|
2
|
+
addResetPassword:function(){
|
3
|
+
Ext.getCmp('knitkitCenterRegion').addContentToActiveCodeMirror('<%= render_widget :reset_password, :params => {:login_url => "/login"}%>');
|
4
|
+
}
|
5
|
+
}
|
6
|
+
|
7
|
+
Compass.ErpApp.Widgets.AvailableWidgets.push({
|
8
|
+
name:'Reset Password',
|
9
|
+
iconUrl:'/images/icons/edit/edit_48x48.png',
|
10
|
+
onClick:Compass.ErpApp.Widgets.ResetPassword.addResetPassword
|
11
|
+
});
|
12
|
+
|
13
|
+
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<div id="<%=widget_result_id%>"></div>
|
2
|
+
<div>
|
3
|
+
<%= form_tag '/users/reset_password', :remote => true, :id => 'reset_password_form' do %>
|
4
|
+
<div class="form_settings">
|
5
|
+
<p>
|
6
|
+
<span style="width:175px">Username or Email Address</span>
|
7
|
+
<%= text_field_tag "login"%>
|
8
|
+
</p>
|
9
|
+
<input type="hidden" name="login_url" value="<%=@login_url%>" />
|
10
|
+
<p style="padding-top: 15px">
|
11
|
+
<span style="width:175px"> </span>
|
12
|
+
<%= submit_tag "Reset", :disable_with => "Please wait...", :class => "submit", :style => 'margin: 0 0 0 0px;'%>
|
13
|
+
</p>
|
14
|
+
</div>
|
15
|
+
<% end %>
|
16
|
+
</div>
|
17
|
+
<script type="text/javascript">
|
18
|
+
$('#reset_password_form').bind('ajaxComplete', function(e, xhr, settings){
|
19
|
+
var response = jQuery.parseJSON(xhr.responseText);
|
20
|
+
if(response.success){
|
21
|
+
$('#<%=widget_result_id%>').html('<div class="sexynotice">'+response.message+'</div>');
|
22
|
+
}
|
23
|
+
else{
|
24
|
+
$('#<%=widget_result_id%>').html('<div class="sexyerror">'+response.message+'</div>');
|
25
|
+
}
|
26
|
+
});
|
27
|
+
</script>
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render_widget :reset_password, :params => {:login_url => "/login"}%>
|
@@ -0,0 +1,80 @@
|
|
1
|
+
module Widgets
|
2
|
+
module Search
|
3
|
+
class Base < ErpApp::Widgets::Base
|
4
|
+
include ActionDispatch::Routing::UrlFor
|
5
|
+
include Rails.application.routes.url_helpers
|
6
|
+
include WillPaginate::ActionView
|
7
|
+
|
8
|
+
def set_variables
|
9
|
+
@results_permalink = params[:results_permalink]
|
10
|
+
@section_permalink = params[:section_permalink]
|
11
|
+
@content_type = params[:content_type]
|
12
|
+
@per_page = params[:per_page]
|
13
|
+
@css_class = params[:class]
|
14
|
+
|
15
|
+
if @results_permalink.nil? or @results_permalink.blank?
|
16
|
+
@ajax_results = true
|
17
|
+
else
|
18
|
+
@ajax_results = false
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def index
|
23
|
+
set_variables
|
24
|
+
render
|
25
|
+
end
|
26
|
+
|
27
|
+
def new
|
28
|
+
set_variables
|
29
|
+
@website = Website.find_by_host(request.host_with_port)
|
30
|
+
|
31
|
+
options = {
|
32
|
+
:website_id => @website.id,
|
33
|
+
:query => params[:query],
|
34
|
+
:content_type => params[:content_type],
|
35
|
+
:section_permalink => params[:section_permalink],
|
36
|
+
:page => (params[:page] || 1),
|
37
|
+
:per_page => (params[:per_page] || 20)
|
38
|
+
}
|
39
|
+
@results = Content.do_search(options)
|
40
|
+
|
41
|
+
if @ajax_results
|
42
|
+
render :update => {:id => "#{@uuid}_result", :view => :show}
|
43
|
+
else
|
44
|
+
render :view => :show
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
#should not be modified
|
49
|
+
#modify at your own risk
|
50
|
+
def locate
|
51
|
+
File.dirname(__FILE__)
|
52
|
+
end
|
53
|
+
|
54
|
+
class << self
|
55
|
+
def title
|
56
|
+
"Search"
|
57
|
+
end
|
58
|
+
|
59
|
+
def views_location
|
60
|
+
File.join(File.dirname(__FILE__),"/views")
|
61
|
+
end
|
62
|
+
|
63
|
+
def widget_name
|
64
|
+
File.basename(File.dirname(__FILE__))
|
65
|
+
end
|
66
|
+
|
67
|
+
def base_layout
|
68
|
+
begin
|
69
|
+
file = File.join(File.dirname(__FILE__),"/views/layouts/base.html.erb")
|
70
|
+
IO.read(file)
|
71
|
+
rescue
|
72
|
+
return nil
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|