Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/cykod/Webiva into mailing-s…
Browse files Browse the repository at this point in the history
…teps

Conflicts:
	config/environments/development.rb
  • Loading branch information
Doug Youch committed Feb 24, 2010
2 parents 8f2e6af + 30d4cc2 commit 36ce530
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Expand Up @@ -250,7 +250,7 @@ def set_language #:nodoc:
# Convenience method to log a user in
# sets the session and remember cookie
def process_login(usr,remember = false)
session.clear
# session.clear
session[:user_id] = usr.id
session[:user_model] = usr.class.to_s
reset_myself
Expand Down
23 changes: 23 additions & 0 deletions app/controllers/editor/auth_feature.rb
Expand Up @@ -25,6 +25,16 @@ class Editor::AuthFeature < ParagraphFeature #:nodoc:all
<!-- optional fields except='field1' or fields="field1,field2" options work too -->
<cms:publication>
<cms:field>
<div class='item'>
<cms:error><div class='error'><cms:value/></div></cms:error>
<div class='label'><cms:label/><cms:required>*</cms:required>:</div>
<div class='field'><cms:control/></div>
</div>
</cms:field>
</cms:publication>
<cms:submit/>
</cms:register>
Expand Down Expand Up @@ -64,6 +74,8 @@ def user_register_feature(data)
if data[:options].publication
c.fields_for_tag('register:publication',:model) { |t| data[:model] }
c.publication_field_tags("register:publication",data[:options].publication)
else
c.expansion_tag('register:publication') { |t| nil }
end

c.button_tag('register:submit')
Expand Down Expand Up @@ -96,6 +108,15 @@ def user_register_feature(data)
</cms:any_field>
<!-- optional fields except='field1' or fields="field1,field2" options work too -->
<cms:publication>
<cms:field>
<div class='item'>
<cms:error><div class='error'><cms:value/></div></cms:error>
<div class='label'><cms:label/><cms:required>*</cms:required>:</div>
<div class='field'><cms:control/></div>
</div>
</cms:field>
</cms:publication>
<cms:submit/>
Expand Down Expand Up @@ -137,6 +158,8 @@ def user_edit_account_feature(data)
if data[:options].publication
c.fields_for_tag('edit:publication',:model) { |t| data[:model] }
c.publication_field_tags("edit:publication",data[:options].publication)
else
c.expansion_tag('edit:publication') { |t| nil }
end

c.button_tag('edit:submit')
Expand Down
5 changes: 5 additions & 0 deletions app/controllers/editor/auth_renderer.rb
Expand Up @@ -325,6 +325,11 @@ def login
user = EndUser.login_by_username(params[:cms_login][:username],params[:cms_login][:password])
end

if myself.id && user
process_logout
redirect_paragraph paragraph_page_url
return
end
if user
process_login(user,params[:cms_login][:remember].to_s == '1')
paragraph_action(myself.action('/editor/auth/login'))
Expand Down
3 changes: 3 additions & 0 deletions app/models/content/core_publication/view_publication.rb
Expand Up @@ -5,6 +5,8 @@ class Content::CorePublication::ViewPublication < Content::PublicationType #:no
class ViewOptions < HashModel
default_options :title_field => nil, :description_field => nil, :published_at_field => nil, :url_field => nil
end

feature_name :display

# add the options class
options_class ViewOptions
Expand Down Expand Up @@ -47,6 +49,7 @@ def default_feature
output += "<tr>\n"
output += " <td colspan='2' align='right'><cms:return_link>Return</cms:return_link></td>\n"
output += "</tr>\n"
output += "</table>\n"
output += '</cms:entry>'

output
Expand Down
4 changes: 2 additions & 2 deletions app/models/content_node.rb
Expand Up @@ -170,11 +170,11 @@ def generate_content_values!(type_preload = nil,force=false)

def link(type_preload = nil)
type_preload ||= self.content_type
self.content_url_override || type_preload.content_link(node)
node ? (self.content_url_override || type_preload.content_link(node)) : ''
end

def title
if self.content_type
if self.content_type && node
node.send(content_type.title_field)
else
"Unknown"
Expand Down
14 changes: 8 additions & 6 deletions app/views/file/_file_javascript.rhtml
Expand Up @@ -1380,13 +1380,15 @@ FileEditor = {
};

//if the browser is IE4+
document.onselectstart=new Function ("return false")

document.onselectstart=new Function ("return false");
Event.observe(window,'load',FileEditor.init);
Event.observe(window,'resize',FileEditor.onResize);
Event.observe(window,'mousemove',FileEditor.dragBox);
Event.observe(window,'mouseup',FileEditor.endDrag);
Event.observe(window,'mousedown',FileEditor.startDrag);

// Can't use Event.observe b/c we want the return value to
// prevent highlighting
window.onresize = FileEditor.onResize;
window.onmousemove = FileEditor.dragBox;
window.onmouseup = FileEditor.endDrag;
window.onmousedown = FileEditor.startDrag;
</script>

</script>
Expand Up @@ -19,17 +19,20 @@ def get_feed
:items => []}

conditions = @options.content_type_ids.length > 0 ? { :content_type_id => @options.content_type_ids } : nil
@nodes = ContentNode.find(:all,:conditions => conditions, :limit => @options.limit, :order => @options.order )
@nodes = ContentNode.find(:all,:conditions => conditions, :limit => @options.limit, :order => @options.order, :include => :content_type )
@nodes.each do |node|
item = { :title => node.title,
:description => '',
:guid => Configuration.domain_link(node.link),
:published_at => @options.order_by == 'newest' ? node.created_at.to_s(:rfc822) : node.updated_at.to_s(:rfc822),
:link => Configuration.domain_link(node.link)
}

categories = [node.content_type.type_description, node.content_type.content_name].collect { |c| c unless c.blank? }.compact
item[:categories] = categories unless categories.empty?

# unless node.content_type.content_name.blank? && node.content_type.type_description.blank?
# item[:description] = "#{node.content_type.content_name} #{node.content_type.type_description}"
# end
data[:items] << item
end

Expand Down
2 changes: 1 addition & 1 deletion vendor/modules/feed/app/views/feed/admin/rss.rhtml
Expand Up @@ -17,7 +17,7 @@
<div align='right'>
<a href='javascript:void(0);' onclick='StructureEditor.nodeDelete(<%= @node.id %>,"<%= jh "Are you sure you want to delete this RSS Module?" .t %>");'><%= "Remove RSS Module".t %></a>
</div>
<b> <%= "RSS Options:".t %> <%= @node.node_path %></b><br/><br/>
<b> <%= "RSS Options:".t %> <a href='<%= h @node.node_path %>'><%= @node.node_path %></a></b><br/><br/>

<% remote_cms_form_for :options, @options, :update => 'element_info',:html => {:id => 'feed_form', :class => 'admin_form' }, :url => { :action => 'rss', :path => @node.id } do |f| -%>
<tbody>
Expand Down
Expand Up @@ -9,8 +9,12 @@ def initialize
end

def index
render :text => @server.process(request.body.read),
if request.post?
render :text => @server.process(request.body.read),
:content_type => "text/xml; charset=utf-8", :layout => false
else
render :nothing => true
end
end

protected
Expand Down

0 comments on commit 36ce530

Please sign in to comment.