Skip to content

Commit

Permalink
Disable category and contributor pagination in docs.
Browse files Browse the repository at this point in the history
This commit fixes a few issues, discovered and fixed in reaction to Bug [#121 state:resolved]:

* When editing contributors associated with a story or media document, they are no longer paginated. When there were more contributors than would fit on a paginated page, the pagination didn't work and reording didn't work. So by disabling pagination in this case, we get around that issue. Documents with that many contributors are rare, so the trade-off seems worthwhile.

* The same turned out to be true for categories when they were displayed and the `ENABLE_CATEGORY_BROWSER` `bricolage.conf` directive was true. So pagination is now diabled there, too.

* While at it, the ordering of categories displayed as such was borked, so I fixed it so that they display in URI order, which is what had been expected in the first place.

* And finally, when associating contriutors with a media document, the user was prompted to select a role, even if there was only one. We now skip that step, as we had been doing with stories for a while now.
  • Loading branch information
theory committed Feb 25, 2010
1 parent 1448bea commit 173f809
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 3 deletions.
11 changes: 10 additions & 1 deletion comp/widgets/listManager/listManager.mc
Expand Up @@ -261,6 +261,13 @@ The background color for the featured rows. This can be any string that you
would normally pass to the 'bgcolor' attribute of the <tr> element. This will
default to a standard color if not passed.

=item no_pagination

By default, listManager paginates results if the pagination preference
indicates that they should be paginated. If C<no_pagination> is passed a true
value, the results will not be paginated, even if there is a pagination
preference.

=back

=head1 NOTES
Expand Down Expand Up @@ -330,6 +337,7 @@ $objs => undef # These are user objects to be listed.
$def_sort_field => undef
$def_sort_order => undef # Whether to sort in descending order by default
$cx_filter => 1 # Make false to override Filter by Site Context.
$no_pagination => 0
</%args>
<%init>;

Expand All @@ -352,7 +360,8 @@ $fields ||= [sort keys %$meth];
my %featured_lookup = map { ($_,1) } @$featured;

# limit the number of results to display per page
my $limit = Bric::Util::Pref->lookup_val( 'Search Results / Page' ) || 0;
my $limit = $no_pagination ? 0
: Bric::Util::Pref->lookup_val( 'Search Results / Page' ) || 0;

#--------------------------------------#
# Set up pagination data.
Expand Down
1 change: 1 addition & 0 deletions comp/widgets/media_prof/edit_contributors.html
Expand Up @@ -39,6 +39,7 @@
field_values => $order_sub,
select => [ 'Delete', "$widget|delete_id" ],
addition => '',
no_pagination => 1,
);
$m->comp('/widgets/wrappers/sharky/table_bottom.mc');
</%perl>
Expand Down
3 changes: 2 additions & 1 deletion comp/widgets/story_prof/edit_categories.html
Expand Up @@ -5,7 +5,7 @@
<& '/widgets/listManager/listManager.mc',
object => 'category',
userSort => 0,
def_sort_field => 'uri',
sortBy => 'uri',
title => 'Current Categories',
objs => \@categories,
profile => undef,
Expand All @@ -15,6 +15,7 @@
select => $category_select,
addition => '',
state_key => 'story_category_assoc',
no_pagination => 1,
&>

<& '/widgets/wrappers/sharky/table_bottom.mc' &>
Expand Down
1 change: 1 addition & 0 deletions comp/widgets/story_prof/edit_contributors.html
Expand Up @@ -39,6 +39,7 @@
select => [ 'Delete', "$widget|delete_id" ],
addition => '',
state_key => 'story_contrib_assoc',
no_pagination => 1,
);
$m->comp('/widgets/wrappers/sharky/table_bottom.mc');
</%perl>
Expand Down
2 changes: 1 addition & 1 deletion lib/Bric/App/Callback/Profile/Media.pm
Expand Up @@ -564,7 +564,7 @@ sub assoc_contrib : Callback {
my $contrib =
Bric::Util::Grp::Parts::Member::Contrib->lookup({'id' => $contrib_id});
my $roles = $contrib->get_roles;
if (scalar(@$roles)) {
if (@$roles > 1) {
set_state_data($self->class_key, 'contrib', $contrib);
$self->set_redirect("/workflow/profile/media/contributor_role.html");
} else {
Expand Down
23 changes: 23 additions & 0 deletions lib/Bric/Changes.pod
Expand Up @@ -33,6 +33,12 @@ encoded in the user's preferred encoding. So if you have Windows gremlins in
your templates, you can set your Character Set preference to "CP1252" and it
will just work. Thanks to Phillip Smith for the report (Bug #124). [David]

=item *

When displaying categories associated with a story when the
C<ENABLE_CATEGORY_BROWSER> F<bricolage.conf> directive is true, the categories
are now displayed in alphabetical order by URI. [David]

=back

=head2 Bug Fixes
Expand Down Expand Up @@ -71,6 +77,23 @@ to the contributor and category editing screens with a story or media
document. Searches from within documents should cache their own results,
separate from the admin search interfaces. [David]

=item *

Contributors associated with a story or media document and categories
associated with a story document are no longer paginated. When there were more
contributors or categories than would fit on a paginated page, the pagination
didn't work and reording didn't work. So by disabling pagination in this case,
we get around that issue. Documents with that many categories or contributors
are rare, so the trade-off seems worthwhile. Thanks to Bret Dawson for the
report (Bug #121). [David]

=item *

When associating a contributor with a media document, don't prompt for role
selection if the contributor has only one role. This saves a page load for
each contributor association and brings media in line with how story
contributor association already works. [David]

=back

=head1 VERSION 1.10.8 (2009-11-14)
Expand Down

0 comments on commit 173f809

Please sign in to comment.