On 5/10/07, Frédéric <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I'm starting a new photo web album manager, called Wapyti. The main feature
> will be the way the photos will be displayed. Instead of viewing all photos
> in the same way, one by one, it will be possible to create a real album,
> like a paper one, with several photos on the same page, texts, nice
> background...
>
> I plan to have a very simple interface, to focus on the album itself. It
> will be possible to choose a template for the album itself (mainly the
> colors and background), and a template for each page (mainly to define the
> position of photos and texts in the page).
>
> I think kid templates are fine, as they can be made by web designers, which
> don't know anything with python, but I need your help to start in the good
> direction.
>
> 1) I would like to use the same pages templates in both display and edition
> mode. My first idea was to have a page template build like this:
>
> <div id="page">
>     <span py:replace="photos[1]">Photo 1 goes here</span>
>     <span py:replace="text[1]">Text 1 goes here</span>
>     <span py:replace="photos[2]">Photo 2 goes here</span>
> </div>
>
> (a real template will be more complicated, with additional div, to be able
> to build a nice page).
>
> Then, in my controller, I load the photos and text dict with XHTML code. For
> display mode:
>
>     photos[1] = "<img src=\"/photos/<link_to_photo_1>\"/>
>
> and in editing mode:
>
>     photos[1] = "<a href=\"<link_to_code_to_pick_up_a_photo\">
>                      <img src=\"/photos/<dummy_image>\"/>
>                  </a>"
>
> The link in the editing mode will allow the user to select a photo in a
> pre-loaded set of photos; then the controller will associate the photo and
> the page in the model.
>
> But I don't like that very much, because I have some XHTML code on the
> controller side. How can I do that in a better way?

Perhaps you can create a photo widget for it?
>
> 2) As navigators have really bad interpolators when resizing pictures, I
> want to do this on the sever side. But how can I define the size of the
> photos in the template? Even if I find a way to let the designer put the
> size of the photos, I will have to parse the template, which is not really
> nice. Any idea to do that? Is there a way to give back informations from a
> template to the controller at runtime? Maybe using javascript?

perhaps writing a custom controller for serving the images and send
the sizes along with the url like
"/images/000001.png?height=100&amp;width200" and do the resizing on
the fly (with caching of course).

>
> 3 I plan to includ the css in the templates (fot both albums and pages) to
> avoid multiple files to install; is it a good idea?

if it solves a problem (like it makes it easier to install (not sure
how you will do that) then I can't see a problem with it. normally
it's better to have it externally to make it easier to cache for the
browser.

>
> Thanks for your help !
>
> PS: the project is here:
>
>     http://wapyti.tuxfamily.org
>
> (sorry, in french :o/ ). At this moment, the svn repository contains some
> tests, but is not complete. I think I will release a very small alpha
> version soon, just to show what I plan to do, without editing mode.
>
> --
>    Frédéric
>
>    http://www.gbiloba.org
>
> >
>


-- 
cheers
    elvelind grandin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to