plainblack.com
Username Password
search
Bookmark and Share
Gallery: Additional navigation in photo view  (#11412)
Issue

Currently, it is a pain to click through photos of a gallery album unless you like to use the thumbnail view.

It would be nice to have additional controls in the photo view that allowed users to go the first, previous, next and last photo in the album.

Solution Summary
Comments
preaction
0
3/3/2010 7:41 pm
Approved.
kimd
5
3/4/2010 3:20 pm
Here is the patch. It should contain everything except .... testing!!! I know, it has to be.... I will do it the next time I get to it.
I can also update the default template. However, I am not good at making things fancy. Up to you!

*Patch Summary*
- Added methods to WebGUI::Asset::Wobject::GalleryAlbum for finding the id of the next or previous file based on another id
- Added methods to WebGUI::Asset::File::GalleryFile for finding the first, next, previous and last file in the same album.
- New common template variables in WebGUI::Asset::File::GalleryFile
- Internationalized template help

*Common Template Variables Added to WebGUI::Asset::File::GalleryFile*
- (firstFile|nextFile|previousFile|lastFile)_url
- (firstFile|nextFile|previousFile|lastFile)_title
- (firstFile|nextFile|previousFile|lastFile)_thumbnailUrl

*Example of Use*
Add the following to the view template for photos.

<div class="navigation">
    <tmpl_if previousFile_url>
         <a title="first file" href="<tmpl_var firstFile_url>">|&lt;</a>
        <tmpl_else>
        |&lt;
        </tmpl_if>
    <tmpl_if previousFile_url>
         <a title="previous file" href="<tmpl_var previousFile_url>">&lt;</a>
        <tmpl_else>
        &lt;
        </tmpl_if>
    <tmpl_if nextFile_url>
         <a title="next file" href="<tmpl_var nextFile_url>">&gt;</a>
        <tmpl_else>
        &gt;
        </tmpl_if>
    <tmpl_if nextFile_url>
        <a title="last file" href="<tmpl_var lastFile_url>">&gt;|</a>
        <tmpl_else>
        &gt;|
        </tmpl_if>
</div>
kimd
0
3/13/2010 2:31 pm
I have added testing for the new methods in WebGUI::Asset::File::GalleryFile and WebGUI::Asset::Wobject::GalleryAlbum. I believe, the code is ready for review now.
Note that testing for WebGUI::Asset::File::GalleryFile went to WebGUI::Asset::File::GalleryFile::Photo since GalleryFile cannot be added to an album.
I was not able to figure out how to include new files in the diff. That is why I uploaded them separately. They should go to respective folders in the testing hierarchy. The prefix should be stripped, of course.

Testing was implemented for the following methods:

*Photo*
- getFirstFile
- getLastFile
- getNextFile
- getPreviousFile

*Album*
- getNextFileId
- getPreviousFileId
perlDreamer
0
3/13/2010 5:36 pm
If you use git, then here's how you'd put files into the diff:

git add patchedFile1
git add newFile1
git diff --staged

and all the diffs, for new and patched files would show up.
kimd
0
3/14/2010 4:31 pm
Thanks for your help, perlDreamer. However, the problem persists. It seems that I cannot add testing files with suffix ".t". Even "git add -f" does not work. If I use "git add -A" every piece of junk is added but not testing files. I have no clue how to fix this.
kimd
0
3/14/2010 4:37 pm
I have uploaded a new patch named "patch2.txt", which replaces "patch.txt". It contains additional testing concerning template variables of the photo asset.

git status produces

# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#    modified:   lib/WebGUI/Asset/File/GalleryFile.pm
#    modified:   lib/WebGUI/Asset/Wobject/GalleryAlbum.pm
#    modified:   lib/WebGUI/Help/Asset_Photo.pm
#    modified:   lib/WebGUI/i18n/English/Asset_Photo.pm
#    modified:   t/Asset/File/GalleryFile/Photo/view.t
kimd
0
3/14/2010 4:55 pm
I have added packages containing an updated photo view template, gallery stylesheet and four additional buttons. Check the screenshot for a first impression. If you do not like the buttons just replace them in the image folder.
preaction
0
3/25/2010 9:04 pm
I've merged your changes into 7.9.2, but I need a credit to go in the changelog and the credits.txt file. A name and optionally a company name.
kimd
0
3/26/2010 2:54 am
I thought I had done that already. Didn't you get my last e-mail with the new commit id? If not, it is 1fbdaf2be00e56cb3dbaf528953b96632ced2d1c in my fork of the webgui repo on github. It's possible I made I mistake. Git is still confusing me.
If you would like to add me manually, my full name is "Bernd Kalbfuß-Zimmermann" (no company).
kimd
0
5/2/2010 5:53 am
This one can be closed.
Details
Ticket Status Resolved  
Rating5.0 
Submitted By kimd  
Date Submitted2010-02-15 
Assigned To unassigned  
Date Assigned 2012-02-12  
Assigned By  
What to improve? WebGUI Beta  
URLrfe/request-for-enhancement/11412
Karma
Difficulty 1  
Karma So Far0
Karma Rank0.00
Keywords
Related Files
Ticket History
5/2/2010
4:45 PM
Resolved DBell
3/26/2010
2:54 AM
Pending kimd
3/25/2010
9:05 PM
Feedback Requested DBell
2/15/2010
3:47 PM
Ticket created kimd
© 2012 Plain Black Corporation | All Rights Reserved