Changeset 20 in bookmarks for trunk/BookmarkApp.pm


Ignore:
Timestamp:
05/21/13 17:55:34 (11 years ago)
Author:
peter
Message:
  • Bookmarks::get_resources() and Bookmarks::get_cotags() both accept arrayrefs as their tag parameters
  • can now use multiple ?tag query parameters in the request and it will search for the intersection of those tags
  • bkmk list takes 0 or more --tag command line options
  • display a checkbox-based form listing the search tags and available cotags at the below the list of bookmarks
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BookmarkApp.pm

    r19 r20  
    6969    my $format = $q->param('format') || 'html'; 
    7070    my $tag = $q->param('tag'); 
     71    my @tags = $q->param('tag'); 
     72    # special case: handle the empty tag 
     73    if (@tags == 1 && $tags[0] eq '') { 
     74        @tags = (); 
     75    } 
    7176    my $limit = $q->param('limit'); 
    7277    my $offset = $q->param('offset'); 
    7378    my @resources = $bookmarks->get_resources({ 
    74         tag    => $tag, 
     79        tag    => \@tags, 
    7580        limit  => $limit, 
    7681        offset => $offset, 
    7782    }); 
    7883    my @all_tags = $bookmarks->get_tags({ selected => $tag }); 
    79     my @cotags = $bookmarks->get_cotags({ tag => $tag }); 
     84    my @cotags = $bookmarks->get_cotags({ tag => \@tags }); 
    8085 
    8186    if ($format eq 'json') { 
     
    136141                base_url     => $base_url, 
    137142                selected_tag => $tag, 
    138                 tags         => \@all_tags, 
     143                search_tags  => \@tags, 
     144                all_tags     => \@all_tags, 
    139145                cotags       => \@cotags, 
    140146                resources    => \@resources, 
Note: See TracChangeset for help on using the changeset viewer.