Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of https://github.com/portablemind/compass_agil…

  • Loading branch information...
commit a81f1a8c599f6d846dbbe90ebe87ac34b394864b 2 parents 62a9272 + 3d4d35e
@cwoodward cwoodward authored
View
3  engines/erp_forms/db/data_migrations/20110608185830_create_default_dynamic_models_and_forms.rb
@@ -3,7 +3,6 @@ class CreateDefaultDynamicModelsAndForms
def self.up
#insert data here
DynamicFormModel.create(:model_name => 'DynamicFormDocument')
- DynamicFormModel.create(:model_name => 'WebsiteInquiry')
fields = []
@@ -20,7 +19,7 @@ def self.up
d.model_name = 'WebsiteInquiry'
d.internal_identifier = 'contact_us'
d.default = true
- d.dynamic_form_model_id = DynamicFormModel.find_by_model_name('WebsiteInquiry')
+ d.dynamic_form_model = DynamicFormModel.create(:model_name => 'WebsiteInquiry')
d.save
end
View
8 engines/knitkit/app/controllers/erp_app/desktop/knitkit/website_nav_controller.rb
@@ -48,7 +48,7 @@ def add_menu_item
website_nav_item = WebsiteNavItem.new(:title => params[:title])
url = params[:url]
- if(params[:link_to] != 'url')
+ if(params[:link_to] != 'Url')
#user wants to see Section so this is needed
params[:link_to] = 'WebsiteSection' if params[:link_to] == 'Section'
@@ -56,7 +56,7 @@ def add_menu_item
linked_to_id = params["#{params[:link_to].underscore}_id".to_sym]
link_to_item = params[:link_to].constantize.find(linked_to_id)
#setup link
- website_nav_item.url = link_to_item.permalink
+ website_nav_item.url = '/' + link_to_item.permalink
website_nav_item.linked_to_item = link_to_item
url = "http://#{website_nav.website.hosts.first.host}/" + link_to_item.permalink
else
@@ -81,7 +81,7 @@ def update_menu_item
url = params[:url]
linked_to_id = nil
- if(params[:link_to] != 'url')
+ if(params[:link_to] != 'Url')
#user wants to see Section so this is needed
params[:link_to] = 'WebsiteSection' if params[:link_to] == 'Section'
@@ -89,7 +89,7 @@ def update_menu_item
linked_to_id = params["#{params[:link_to].underscore}_id".to_sym]
link_to_item = params[:link_to].constantize.find(linked_to_id)
#setup link
- website_nav_item.url = link_to_item.permalink
+ website_nav_item.url = '/' + link_to_item.permalink
website_nav_item.linked_to_item = link_to_item
url = "http://#{website_nav_item.website_nav.website.hosts.first.host}/" + link_to_item.permalink
else
View
39 engines/knitkit/app/views/contact/_contact_form.html.erb
@@ -1,39 +0,0 @@
-<%
-display = 'none'
-unless @website_inquiry.errors.empty?
- display = 'block'
-end
-%>
-<div>
- <div id="requiredErrorDiv" style="display:<%=display%>;padding:5px;color:red;border:solid 1px #CCC;background-color:#CCFFCC;">Please correct following errors
- <ul>
- <% @website_inquiry.errors.collect do |e, m| %>
- <li><%="#{e.humanize unless e == "base"} #{m}"%></li>
- <% end %>
- </ul>
- </div>
- <% form_for @website_inquiry, :url => { :controller => "contact", :action => "new" } do |f| %>
- <div class="form_settings">
- <p>
- <span>First Name</span>
- <%= f.text_field :first_name %>
- </p>
- <p>
- <span>Last Name</span>
- <%= f.text_field :last_name %>
- </p>
- <p>
- <span>Email</span>
- <%= f.text_field :email %>
- </p>
- <p>
- <span>Inquiry</span>
- <%= f.text_area :inquiry, :class => 'contact textarea', :rows => 8, :cols => 50 %>
- </p>
- <p style="padding-top: 15px">
- <span>&nbsp;</span>
- <%= submit_tag "Submit", :class => "submit" %>
- </p>
- </div>
- <% end %>
-</div>
View
6 engines/knitkit/app/views/contact/new.html.erb
@@ -1,6 +0,0 @@
-<% if @success %>
- <h1>Thank you.</h1>
- <p>We've received your inquiry and will get back to you with a response shortly.</p>
-<% else %>
- <%= render :partial => 'contact_form', :local => {:user => @user} %>
-<% end %>
View
1  engines/knitkit/app/views/contact/show.html.erb
@@ -1 +0,0 @@
-<%= render :partial => 'contact_form', :local => {:user => @user} %>
View
17 engines/knitkit/db/migrate/20110712173254_update_website_nav_items.rb
@@ -0,0 +1,17 @@
+class UpdateWebsiteNavItems < ActiveRecord::Migration
+ def self.up
+ unless columns(:website_nav_items).collect {|c| c.name}.include?('linked_to_item_id')
+ add_column :website_nav_items, :linked_to_item_id, :integer
+ add_column :website_nav_items, :linked_to_item_type, :string
+
+ add_index :website_nav_items, [:linked_to_item_id, :linked_to_item_type], :name => 'linked_to_idx'
+ end
+ end
+
+ def self.down
+ if columns(:website_nav_items).collect {|c| c.name}.include?('linked_to_item_id')
+ remove_column :website_sections, :linked_to_item_id
+ remove_column :website_sections, :linked_to_item_type
+ end
+ end
+end
View
13 engines/knitkit/public/javascripts/erp_app/desktop/applications/knitkit/west_region.js
@@ -142,6 +142,17 @@ Compass.ErpApp.Desktop.Applications.Knitkit.WestRegion = Ext.extend(Ext.TabPanel
var codeMirror = btn.findParentByType('codemirror');
Ext.MessageBox.prompt('New File', 'Please enter content area name:', function(btn, text){
if(btn == 'ok'){
+ codeMirror.setValue(codeMirror.getValue() + '<%=render_content_area(:'+text+')%>');
+ }
+ });
+ }
+ },
+ {
+ text: 'Insert Content',
+ handler: function(btn){
+ var codeMirror = btn.findParentByType('codemirror');
+ Ext.MessageBox.prompt('New File', 'Please enter permalink:', function(btn, text){
+ if(btn == 'ok'){
codeMirror.setValue(codeMirror.getValue() + '<%=render_content(:'+text+')%>');
}
});
@@ -1651,7 +1662,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.WestRegion = Ext.extend(Ext.TabPanel
url: './knitkit/website_nav/delete_menu_item',
method: 'POST',
params:{
- id:node.websiteNavItemId
+ id:node.attributes.websiteNavItemId
},
success: function(response) {
self.clearWindowStatus();
Please sign in to comment.
Something went wrong with that request. Please try again.