[Radiant] About Comments Extension

2009-05-09 Thread Mohit Sindhwani
Hi, I have just started to use the Comments Extension.  One of the 
things that I have noticed is that the comments extension has always 
mentioned in the readme that:


Relative urls will not work on comment pages if they fail validation, 
since the page gets re-rendered at a (probably) different level of the 
hierarchy. Always use absolute urls and you won't have any issues.


I don't know what to make of this.  I find that even if the comment post 
is successful, relative URLs may not work.  I was wondering how to 
resolve it.  For this, I changed the following line in the 
comments_controller.rb  create:


  redirect_to #...@page.url}comments#comment-#{comment.id}

to:
  redirect_to #...@page.url}

This way, it should just redirect to the page on which the comment was 
posted.  It seems to work... but can someone confirm if that is indeed 
the correct way to deal with it?


Cheers,
Mohit.
5/9/2009 | 11:25 PM.
___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


Re: [Radiant] About Comments Extension

2009-05-09 Thread Mohit Sindhwani

Mohit Sindhwani wrote:
Hi, I have just started to use the Comments Extension.  One of the 
things that I have noticed is that the comments extension has always 
mentioned in the readme that:


Relative urls will not work on comment pages if they fail validation, 
since the page gets re-rendered at a (probably) different level of the 
hierarchy. Always use absolute urls and you won't have any issues.


I don't know what to make of this.  I find that even if the comment 
post is successful, relative URLs may not work.  I was wondering how 
to resolve it.  For this, I changed the following line in the 
comments_controller.rb  create:


  redirect_to #...@page.url}comments#comment-#{comment.id}

to:
  redirect_to #...@page.url}

This way, it should just redirect to the page on which the comment was 
posted.  It seems to work... but can someone confirm if that is indeed 
the correct way to deal with it?
I have been further playing and have spent quite a while copying back 
code from Radiant's controllers into the Comments Controller to see what 
works.  This is what the create function looks like now and it seems 
like it works.  Could someone help me see if my assumption is  correct?  
Is this how we should modify the create action on the comments 
controller to fix it in case validation fails?  It appears that relative 
URLs are also rendering correctly now.


 def create
   comment = @page.comments.build(params[:comment])
   comment.request = request
   comment.save!
  
   ResponseCache.instance.clear

   if Radiant::Config['comments.notification'] == true
 if comment.approved? || 
Radiant::Config['comments.notify_unapproved'] == true

   CommentMailer.deliver_comment_notification(comment)
 end
   end
  
   flash[:selected_comment] = comment.id
   #Changed the line below to deal with wrong rendering of relative 
links even when validation passes

   #redirect_to #...@page.url}comments#comment-#{comment.id}
   redirect_to #...@page.url}
 rescue ActiveRecord::RecordInvalid
 @pg = Page.find_by_url(@page.url)
 @pg.last_comment = comment
 unless @pg.nil?
   #process_page(@page) -- replaced this with the part below since 
process_page is private in SiteController

   @pg.process(request, response)
   @cache.cache_response(url, response) if request.get? and live? 
and @pg.cache?

   @performed_render = true
 else
   render :template = 'site/not_found', :status = 404
 end
 end

Any help would be greatly appreciated!

Cheers,
Mohit.
5/10/2009 | 1:10 AM.

___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


Re: [Radiant] Jquery on radiant cms, how to

2009-05-09 Thread Joel Oliveira
Use a link / tag in your layout and point the src attribute to the  
latest jquery release hosted by google.


You'll alleviate a little bit of work off your server(s) and your  
users will most likely have it cached already! Triple-whammy


- Joel

On May 9, 2009, at 9:07 PM, Bruno Carvalho bment...@gmail.com wrote:


I looked in google on this topic but couldnt find a good answer. I've
uploaded jquery.js to public/javascripts and added a script
src=/javascript/jquery.js on the normal template, which has the  
header,

and it makes my site come blank.

I've looked and the url is ok (and the request is ok too in  
firebug), but

the page doesn't show.

I have no script on my page yet, just loaded jquery.

I have the 0.7.1 radiant version with Markdown, Archives and Textile
extensions (the default that comes with radiant). My main page has no
filters attached to it, and still adding jquery to the header messes  
up my

site.

The body tag comes empty and closed: body/
And nothing else comes on the layout file (no stylesheets, nothing),  
just

the script.

Do you know how to use Jquery without breaking Radiant ?

Best regards,
Bruno
___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


Re: [Radiant] couple of hiccups on a fresh install and freeze

2009-05-09 Thread Sean Cribbs

Joel,

A fix will be pushed soon.  A few people ran into that this afternoon in 
the IRC channel while I was hacking on a few things.


Sean

Joel Oliveira wrote:

Hi everyone -
I understand freezing to Radian't edge will vary one's experience since it's
under active development, obviously.  Just thought I'd throw this out in
case anyone has run into this yet.

I froze it per the instructions at the radiant site, and upon subsequent
rake tasks, I got an error

rake aborted!
wrong number of arguments (0 for 1)
...
/vendor/radiant/lib/tasks/rspec.rake:197:in `t'

the culprit being :

namespace :generators do
  [:extension_controller, :extension_mailer, :extension_migration,
:extension_model, :extension].each do |generator|
*task t = :spec_prereq*
  end
end

---

I commented it out for the time being to continue some tests (the commenting
successfully staved that off), and the first time I fired up script/server

joel$ script/server
= Booting Mongrel
= Rails 2.3.2 application starting on http://0.0.0.0:3000
/Users/joel/Documents/Projects/Rails/
radiant_jo.com/vendor/radiant/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack.rb:17:
warning: already initialized constant VERSION
/Users/joel/Documents/Projects/Rails/
radiant_jo.com/vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:105:in`const_missing':
uninitialized constant Rails::Initializer::ResponseCache
(NameError)
from /Users/joel/Documents/Projects/Rails/
radiant_jo.com/config/environments/development.rb:15:in `load_environment'
from /Users/joel/Documents/Projects/Rails/
radiant_jo.com/vendor/radiant/vendor/rails/railties/lib/initializer.rb:365:in`load_environment'
from /Users/joel/Documents/Projects/Rails/
radiant_jo.com/vendor/radiant/vendor/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:11:in`silence_warnings'
from /Users/joel/Documents/Projects/Rails/
radiant_jo.com/vendor/radiant/vendor/rails/railties/lib/initializer.rb:358:in`load_environment'
from /Users/joel/Documents/Projects/Rails/
radiant_jo.com/vendor/radiant/vendor/rails/railties/lib/initializer.rb:137:in`process'
from /Users/joel/Documents/Projects/Rails/
radiant_jo.com/vendor/radiant/vendor/rails/railties/lib/initializer.rb:113:in`send'
from /Users/joel/Documents/Projects/Rails/
radiant_jo.com/vendor/radiant/vendor/rails/railties/lib/initializer.rb:113:in`run'
from /Users/joel/Documents/Projects/Rails/
radiant_jo.com/vendor/radiant/lib/radiant/initializer.rb:111:in `run'
 ... 6 levels...
from /Users/joel/Documents/Projects/Rails/
radiant_jo.com/vendor/radiant/vendor/rails/railties/lib/commands/server.rb:84
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
`require'
from script/server:3

Again - commenting that out in environments/development.rb held off that
issue.

Would this have something to do with the recent efforts to move Radiant to
Rails 2.3?

Lastly - love Radiant.  Finally something flexible enough to bend to our
will, while not dealing with heaps and mounds of extraneous and unnecessary
features

- Joel
___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

  


___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant