← Back to team overview

sloecode-dev team mailing list archive

Re: configurable root path of sloecode instance

 

Hi,

On 3 June 2011 14:25, Guy K. Kloss <guy.kloss@xxxxxxxxx> wrote:
> OK, now let me rearrange:
>
>> > * Links to personal pages in line 31:
>> >  sloecode/templates/admin/person-list.html
>> >
>> > * As mentioned before:
>> >  sloecode/templates/login.html (line 18)
>> >  (don't know whether also needed for the hidden field in line 32)
>> >
>> > * Link to login in line 16:
>> >  sloecode/templates/index.html
>> >
>> > * Link to project details:
>> >  sloecode/templates/project-details.html (line 59)
>>
>> These are all jobs for url_for. So here's how this works:
>
> All these tackled (see attached diff). Also the login.html (line 32), where I
> found an action in a controller called "me", so I've modded that one
> accordingly, hoping that things are correct.

The "me" controller is just a shortcut to the person controller with
the currently logged in user displayed. So you can go to "/me" and get
your home page.

>
>> > * Link to help:
>> >  sloecode/templates/admin/person-create.html (line 19)
>> >  sloecode/templates/admin/person-update.html (line 60)
>> >  sloecode/templates/person-details.html (line 40)
>
> I didn't know what to do with these ones, as I didn't know what kind of
> controller "what-is" would fall under. Actually, couldn't find any controller
> referring to any type of help at all.
>

Sorry - this isn't a url_for job - this is a "patch
sloecode.lib.helpers" functions job. The function in
sloecode.lib.helpers prints a link that executes a small javascript
function (the JS is at the top of base.html). The JS currently opens a
new window with the help page displayed; in the future I'd like to
open a YUI dialog or panel or something.

> [snipped helpful description]
>
>> Here are a few more tips to help you out:
>>
>> from the sloecode root directory, if you type 'paster shell' then you
>> get a python shell (or ipython, if you have it installed) with the
>> WSGI app loaded correctly already for you, so you can do something
>>
>> like this:
>> >>> import sloecode.lib.helpers as h
>> >>> h.url_for(controller='project', action='index',
>> >>> project_name='sloecode')
>>
>> '/p/sloecode/index'
>
> Couldn't get that to work, so I couldn't test my url_for() calls.
>

Hmmm - any idea why? Error message? It "just works" for me...


> PS: A simple reply to the list is sufficient, otherwise I'm getting the mail
> multiple times.

Sorry, I blame gmail ;)


References