Re: [Radiant] children:each tag behaviour

2008-09-27 Thread Andrew Neil



Supose I've got 6 children pages, if I write:

  ...

it behaves like a pure

  ...

showing all 6 pages.

But if I write:

  ...

it works correctly, showing only the last three.

Is it correct?


I recently ran into this confusing problem too.

Here are the relevant specs:


http://github.com/radiant/radiant/tree/master/spec/models/standard_tags_spec.rb#L90-96

which test children:each given a limit, or an offset with a limit. But  
there is no spec for an offset without a limit. When I saw this, I  
tried adding a limit to my children:each tag (which had only an  
offset), and reached the same conclusion as Gabriel.



Page.find(:all, :offset => 3) returns all pages.
This is essentially what the children:each does (scoped to a  
particular page)

If this is incorrect behavior, it's with ActiveRecord::Base


As Jim points out, the behaviour is defined at the level of  
ActiveRecord.


I wonder if an interim solution might be for the children:each tag to  
set a default limit of a very high number (such as 10,000). This way,  
you could call:



  ...


which would run something like:


Page.find(:all, :offset => 3, :limit => 1)


and produce the expected effect of returning all pages after the first  
3. (As long as you have less than 1 pages!)


Any thoughts?

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


Re: [Radiant] children:each tag behaviour

2008-09-27 Thread Sean Cribbs

Jim Gay wrote:

Page.find(:all, :offset => 3) returns all pages.
This is essentially what the children:each does (scoped to a 
particular page)

If this is incorrect behavior, it's with ActiveRecord::Base

Right, which is a database issue more than one with Radiant.  Offset is 
generally used in concert with limit for pagination.


Sean
___
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 using database_form on every page

2008-09-27 Thread Andrew Neil


On 22 Sep 2008, at 21:16, [EMAIL PROTECTED] wrote:


On Thu, 2008-09-18 at 15:37 -0400, Tim Gossett wrote:
On Thu, Sep 18, 2008 at 2:10 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED] 
>wrote:


Is it a bad thing? I was going to include a contact form on every  
page
of a website I am building, but that means that every page must  
have the

page type "Database Form". Will that mess up any of the other
functionality that might be inherent in the page type ""?



I was planning on doing the same thing with the mailer  
extension put all
the necessary parts on the homepage, and have every other page  
inherit it.
However, it would require that every page be of type Mailer, and  
apparently

inheriting some of the mailer parts isn't allowed.

Maybe just put the mailer form in an iframe in the sidebar snippet?  
And

create the mailer page with a blank layout... sound useful?



I hate to bring up an old thread, but would putting an iframe in the
template be considered bad practice by html zealots?


I'll start by admitting that I haven't actually used the database_form  
extension (which looks excellent, by the way). But I've looked at the  
code, and recognise certain similarities with my subscriber_lists  
extension[1], which was based on Andrea's newsletter extension[2].


As I understand it, the DatabaseFormPage differs from regular Radiant  
pages in that it is able to process an incoming post request. On top  
of that, it adds a bunch of tags which make it convenient for you to  
build a form on that page. These tags are only available on pages of  
type DatabaseFormPage, but that doesn't mean that you *have* to build  
the form on a page of that type. You could code up a form using  
regular HTML, and set it to submit to the URL of your  
DatabaseFormPage. The handcoded HTML form could go in a regular  
snippet, and be included on every page.


I'll give an example to make it clear:

Say you have a DatabaseFormPage whose url is /contact and contains the  
following:



  Name:
  
  Email:
  
  Primary Interest:
  


  
  
  


This would render into something like this:


  Name:
  
  Email:
  
  Primary Interest:
  
work
fun!
  
  
  


[this is no doubt simplified from the actual form, but it serves as an  
example]


Now copy that HTML code, and put it in a snippet called "contact-form":


...[copy the HTML form above]...


You can call that snippet on every page, because it doesn't use the  
radius tags defined by (and available exclusively to)  
DatabaseFormPage. The  tag ensures that if you are on the  
contact page itself, the HTML handcoded version is not rendered, but  
the radius coded version would be.


There is a possible snag to this approach: I am not sure how this will  
play with the validation. If you were to copy the real rendered HTML  
form, it should include ids and classes on all form elements, so the  
prototype validation might still work. Perhaps Nick Plante could chime  
in on this?


I used this approach on this site:

http://westportbookfestival.org/

to make the Mailing List subscription form available on every page.  
Note that the subscriber_list page type uses server side validation,  
so if you submit the form with no email address, or an invalid one,  
the form is re-rendered in the page body with a list of errors. The  
sidebar version of the form is rendered from a snippet, which uses a  
pure HTML form. The version of the form which appears in the page body  
is rendered using the radius tags provided by the SubscriberList page  
type.


I think that this is a better solution than using an iframe. Let me  
know how you get on with it.


Cheers,
Drew

[1]: http://github.com/nelstrom/radiant-subscriber-lists-extension/tree/master
[2]: https://github.com/pilu/radiant-newsletter/tree
___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


[Radiant] script/extension error

2008-09-27 Thread Josh Godsiff
Hi

I have a problem with script/extension not working on my installation of
Radiant

For example, trying to install the Gallery extension via this method yields
the following:

C:\www\rails_apps\radiant>ruby script/extension install gallery
The filename, directory name, or volume label syntax is incorrect.
c:/www/ruby/lib/ruby/1.8/fileutils.rb:1255:in `copy': unknown file type:
C:/User
s/silk/AppData/Local/Temp/gallery (RuntimeError)
from c:/www/ruby/lib/ruby/1.8/fileutils.rb:451:in `copy_entry'
from c:/www/ruby/lib/ruby/1.8/fileutils.rb:1324:in `traverse'
from c:/www/ruby/lib/ruby/1.8/fileutils.rb:448:in `copy_entry'
from c:/www/ruby/lib/ruby/1.8/fileutils.rb:423:in `cp_r'
from c:/www/ruby/lib/ruby/1.8/fileutils.rb:1395:in
`fu_each_src_dest'
from c:/www/ruby/lib/ruby/1.8/fileutils.rb:1411:in
`fu_each_src_dest0'
from c:/www/ruby/lib/ruby/1.8/fileutils.rb:1393:in
`fu_each_src_dest'
from c:/www/ruby/lib/ruby/1.8/fileutils.rb:422:in `cp_r'
from
c:/www/ruby/lib/ruby/gems/1.8/gems/radiant-0.6.9/lib/radiant/extens
ion/script.rb:37:in `copy_to_vendor_extensions'
from
c:/www/ruby/lib/ruby/gems/1.8/gems/radiant-0.6.9/lib/radiant/extens
ion/script.rb:31:in `install'
from
c:/www/ruby/lib/ruby/gems/1.8/gems/radiant-0.6.9/lib/radiant/extens
ion/script.rb:81:in `install'
from
c:/www/ruby/lib/ruby/gems/1.8/gems/radiant-0.6.9/lib/radiant/extens
ion/script.rb:10:in `install'
from
c:/www/ruby/lib/ruby/gems/1.8/gems/radiant-0.6.9/lib/radiant/extens
ion/script.rb:231:in `initialize'
from
c:/www/ruby/lib/ruby/gems/1.8/gems/radiant-0.6.9/lib/radiant/extens
ion/script.rb:193:in `new'
from
c:/www/ruby/lib/ruby/gems/1.8/gems/radiant-0.6.9/lib/radiant/extens
ion/script.rb:193:in `execute'
from script/extension:5


Does someone know what I might be doing wrong, or a way to fix this? I
managed to get the gallery installed using GIT, but I'd rather not do that
for every extension I want if there's an easier way.

My system/server is:
Windows Vista Ultimate (before anyone suggests I change OS, this is not an
option at present. If this computer liked Linux, it'd be running it
tomorrow).
Standard InstantRails server (Apache using Mongrel for Rails, w/MySQL
Database)
Radiant 0.6.9 standard installation.

Any help would be appreciated.

-- 
-Silk
HeavenGames.com Seraph
TheWhisper.net Head Mod
___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


Re: [Radiant] script/extension error

2008-09-27 Thread Sean Cribbs

Josh,

It doesn't like the temporary directory for some reason.  Try setting 
the TEMP shell environment variable to something else, like C:\temp.  In 
order to avoid messing up your Radiant project, script/extension does 
all of its checkout/unpack stuff in the temporary directory, and then 
copies the results to your project.


Sean

Josh Godsiff wrote:

Hi

I have a problem with script/extension not working on my installation of
Radiant

For example, trying to install the Gallery extension via this method yields
the following:

C:\www\rails_apps\radiant>ruby script/extension install gallery
The filename, directory name, or volume label syntax is incorrect.
c:/www/ruby/lib/ruby/1.8/fileutils.rb:1255:in `copy': unknown file type:
C:/User
s/silk/AppData/Local/Temp/gallery (RuntimeError)
from c:/www/ruby/lib/ruby/1.8/fileutils.rb:451:in `copy_entry'
from c:/www/ruby/lib/ruby/1.8/fileutils.rb:1324:in `traverse'
from c:/www/ruby/lib/ruby/1.8/fileutils.rb:448:in `copy_entry'
from c:/www/ruby/lib/ruby/1.8/fileutils.rb:423:in `cp_r'
from c:/www/ruby/lib/ruby/1.8/fileutils.rb:1395:in
`fu_each_src_dest'
from c:/www/ruby/lib/ruby/1.8/fileutils.rb:1411:in
`fu_each_src_dest0'
from c:/www/ruby/lib/ruby/1.8/fileutils.rb:1393:in
`fu_each_src_dest'
from c:/www/ruby/lib/ruby/1.8/fileutils.rb:422:in `cp_r'
from
c:/www/ruby/lib/ruby/gems/1.8/gems/radiant-0.6.9/lib/radiant/extens
ion/script.rb:37:in `copy_to_vendor_extensions'
from
c:/www/ruby/lib/ruby/gems/1.8/gems/radiant-0.6.9/lib/radiant/extens
ion/script.rb:31:in `install'
from
c:/www/ruby/lib/ruby/gems/1.8/gems/radiant-0.6.9/lib/radiant/extens
ion/script.rb:81:in `install'
from
c:/www/ruby/lib/ruby/gems/1.8/gems/radiant-0.6.9/lib/radiant/extens
ion/script.rb:10:in `install'
from
c:/www/ruby/lib/ruby/gems/1.8/gems/radiant-0.6.9/lib/radiant/extens
ion/script.rb:231:in `initialize'
from
c:/www/ruby/lib/ruby/gems/1.8/gems/radiant-0.6.9/lib/radiant/extens
ion/script.rb:193:in `new'
from
c:/www/ruby/lib/ruby/gems/1.8/gems/radiant-0.6.9/lib/radiant/extens
ion/script.rb:193:in `execute'
from script/extension:5


Does someone know what I might be doing wrong, or a way to fix this? I
managed to get the gallery installed using GIT, but I'd rather not do that
for every extension I want if there's an easier way.

My system/server is:
Windows Vista Ultimate (before anyone suggests I change OS, this is not an
option at present. If this computer liked Linux, it'd be running it
tomorrow).
Standard InstantRails server (Apache using Mongrel for Rails, w/MySQL
Database)
Radiant 0.6.9 standard installation.

Any help would be appreciated.

  


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


[Radiant] complain druby in aaf_search:migrate

2008-09-27 Thread KIRIYAMA Kazuhiko
Hi. I'm newbie of radiant but have very interesting of
radiant cms framework. Now I'm trying to install AAF Search
extention,but failed in migration:

[EMAIL PROTECTED]:~/radiant/openedu[64]% rake production 
radiant:extensions:aaf_search:migrate
(in /s/usr-home/admin/radiant/openedu)
rake aborted!
druby://localhost:9010 - #

(See full trace by running task with --trace)
[EMAIL PROTECTED]:~/radiant/openedu[65]%

I've installed aaf_search according to [1] and [2] as
follows:

(1) chechout Search extention

% svn checkout 
http://projects.barnard-engineering.com/svn/tags/radiant-extensions/aaf_search/REL-0.1
 vendor/extensions/aaf_search

(2) install ferret and acts_as_ferret

# gem install ferret
# gem install acts_as_ferret

(3) add require for acts_as_ferret in config/environment.rb

(4) execute aaf_install

% aaf_install

Whats' wrong?  My working enviroments are following

[EMAIL PROTECTED]:~[67]% uname -a
FreeBSD web.openedu.org 7.0-STABLE FreeBSD 7.0-STABLE #0: Sun Mar 30 19:07:40 
JST 2008 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC  i386
[EMAIL PROTECTED]:~[68]% gem list

*** LOCAL GEMS ***

actionmailer (2.0.2)
actionpack (2.0.2)
activerecord (2.0.2)
activeresource (2.0.2)
activesupport (2.0.2)
acts_as_ferret (0.4.3)
ferret (0.11.6)
gettext (1.91.0)
radiant (0.6.7)
radius (0.5.1)
rails (2.0.2)
rake (0.8.2, 0.8.1)
sources (0.0.2)
[EMAIL PROTECTED]:~[69]% ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-freebsd7]
[EMAIL PROTECTED]:~[71]% 


[1] http://projects.barnard-engineering.com/doc/aaf_search/index.html
[2] http://projects.jkraemer.net/acts_as_ferret/
___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


Re: [Radiant] children:each tag behaviour

2008-09-27 Thread Gabriel Lamounier
A possible solution would be the children:each to count the number of
children pages and automatically set it as the value for the limit
param.

I think it would be a very fast and easy solution.


Be Radiant!

Gabriel



2008/9/27 Andrew Neil <[EMAIL PROTECTED]>:
>
>>> Supose I've got 6 children pages, if I write:
>>>
>>>  ...
>>>
>>> it behaves like a pure
>>>
>>>  ...
>>>
>>> showing all 6 pages.
>>>
>>> But if I write:
>>>
>>>  ...
>>>
>>> it works correctly, showing only the last three.
>>>
>>> Is it correct?
>
> I recently ran into this confusing problem too.
>
> Here are the relevant specs:
>
>
>  
> http://github.com/radiant/radiant/tree/master/spec/models/standard_tags_spec.rb#L90-96
>
> which test children:each given a limit, or an offset with a limit. But there
> is no spec for an offset without a limit. When I saw this, I tried adding a
> limit to my children:each tag (which had only an offset), and reached the
> same conclusion as Gabriel.
>
>> Page.find(:all, :offset => 3) returns all pages.
>> This is essentially what the children:each does (scoped to a particular
>> page)
>> If this is incorrect behavior, it's with ActiveRecord::Base
>
> As Jim points out, the behaviour is defined at the level of ActiveRecord.
>
> I wonder if an interim solution might be for the children:each tag to set a
> default limit of a very high number (such as 10,000). This way, you could
> call:
>
>>>  ...
>
> which would run something like:
>
>> Page.find(:all, :offset => 3, :limit => 1)
>
> and produce the expected effect of returning all pages after the first 3.
> (As long as you have less than 1 pages!)
>
> Any thoughts?
>
> Drew
> ___
> 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] script/extension error

2008-09-27 Thread Josh Godsiff
No luck - it throws the same thing, just with a different directory.

2008/9/28 Sean Cribbs <[EMAIL PROTECTED]>

> Josh,
>
> It doesn't like the temporary directory for some reason.  Try setting the
> TEMP shell environment variable to something else, like C:\temp.  In order
> to avoid messing up your Radiant project, script/extension does all of its
> checkout/unpack stuff in the temporary directory, and then copies the
> results to your project.
>
> Sean
>
>
> Josh Godsiff wrote:
>
>> Hi
>>
>> I have a problem with script/extension not working on my installation of
>> Radiant
>>
>> For example, trying to install the Gallery extension via this method
>> yields
>> the following:
>>
>> C:\www\rails_apps\radiant>ruby script/extension install gallery
>> The filename, directory name, or volume label syntax is incorrect.
>> c:/www/ruby/lib/ruby/1.8/fileutils.rb:1255:in `copy': unknown file type:
>> C:/User
>> s/silk/AppData/Local/Temp/gallery (RuntimeError)
>>from c:/www/ruby/lib/ruby/1.8/fileutils.rb:451:in `copy_entry'
>>from c:/www/ruby/lib/ruby/1.8/fileutils.rb:1324:in `traverse'
>>from c:/www/ruby/lib/ruby/1.8/fileutils.rb:448:in `copy_entry'
>>from c:/www/ruby/lib/ruby/1.8/fileutils.rb:423:in `cp_r'
>>from c:/www/ruby/lib/ruby/1.8/fileutils.rb:1395:in
>> `fu_each_src_dest'
>>from c:/www/ruby/lib/ruby/1.8/fileutils.rb:1411:in
>> `fu_each_src_dest0'
>>from c:/www/ruby/lib/ruby/1.8/fileutils.rb:1393:in
>> `fu_each_src_dest'
>>from c:/www/ruby/lib/ruby/1.8/fileutils.rb:422:in `cp_r'
>>from
>> c:/www/ruby/lib/ruby/gems/1.8/gems/radiant-0.6.9/lib/radiant/extens
>> ion/script.rb:37:in `copy_to_vendor_extensions'
>>from
>> c:/www/ruby/lib/ruby/gems/1.8/gems/radiant-0.6.9/lib/radiant/extens
>> ion/script.rb:31:in `install'
>>from
>> c:/www/ruby/lib/ruby/gems/1.8/gems/radiant-0.6.9/lib/radiant/extens
>> ion/script.rb:81:in `install'
>>from
>> c:/www/ruby/lib/ruby/gems/1.8/gems/radiant-0.6.9/lib/radiant/extens
>> ion/script.rb:10:in `install'
>>from
>> c:/www/ruby/lib/ruby/gems/1.8/gems/radiant-0.6.9/lib/radiant/extens
>> ion/script.rb:231:in `initialize'
>>from
>> c:/www/ruby/lib/ruby/gems/1.8/gems/radiant-0.6.9/lib/radiant/extens
>> ion/script.rb:193:in `new'
>>from
>> c:/www/ruby/lib/ruby/gems/1.8/gems/radiant-0.6.9/lib/radiant/extens
>> ion/script.rb:193:in `execute'
>>from script/extension:5
>>
>>
>> Does someone know what I might be doing wrong, or a way to fix this? I
>> managed to get the gallery installed using GIT, but I'd rather not do that
>> for every extension I want if there's an easier way.
>>
>> My system/server is:
>> Windows Vista Ultimate (before anyone suggests I change OS, this is not an
>> option at present. If this computer liked Linux, it'd be running it
>> tomorrow).
>> Standard InstantRails server (Apache using Mongrel for Rails, w/MySQL
>> Database)
>> Radiant 0.6.9 standard installation.
>>
>> Any help would be appreciated.
>>
>>
>>
>
> ___
> Radiant mailing list
> Post:   Radiant@radiantcms.org
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>



-- 
-Silk
HeavenGames.com Seraph
TheWhisper.net Head Mod
___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant