<%perl> my $rightText = $m->scomp( '/widgets/profile/imageSubmit.mc', formName => "theForm", callback => $widget . "|trail_cb", image => "view_trail_teal" ) . ' '; $rightText .= $m->scomp( '/widgets/profile/imageSubmit.mc', formName => "theForm", callback => $widget . "|notes_cb", image => %{ $story->get_notes } ? 'note_fill' : "note", value => 'edit' ); $m->comp("/widgets/wrappers/sharky/table_top.mc", caption => "Information", number => $num++, rightText => $rightText ); % if (@ocs == 1) { % } else { % }
ID:   <% $id %>
Story Type:   <% $story->get_element_name %>
Current Version:   <% $story->get_current_version %>
Published Version:   <% $story->get_published_version %>
URI:  <% $story->get_primary_uri %>
 <% $story->get_primary_uri %>
Preview in:   <% $oc_select %> Preview
<% $ieSpacer %> <& '/widgets/select_object/select_object.mc', object => 'source', name => "$widget|source__id", field => 'source_name', selected => $story->get_source__id, indent => 0, useTable => 1, disp => "Source" &> <% $ieSpacer %> <& '/widgets/profile/displayFormElement.mc', objref => $story, key => 'priority', &> <% $ieSpacer %> <& '/widgets/profile/displayFormElement.mc', objref => $story, key => 'title', &> <% $ieSpacer %> <& '/widgets/profile/displayFormElement.mc', objref => $story, key => 'description', &> <% $ieSpacer %> <& '/widgets/profile/displayFormElement.mc', objref => $story, key => 'slug', &> <% $ieSpacer %> <& '/widgets/profile/displayFormElement.mc', objref => $story, key => 'cover_date', &> <% $ieSpacer %> <& '/widgets/profile/displayFormElement.mc', objref => $story, key => 'expire_date', &> <%perl> $m->comp("/widgets/wrappers/sharky/table_bottom.mc"); $num = $m->comp('/widgets/container_prof/container_prof.mc', tile => $tile, tile_type => 'story', action => 'edit', title => 'Content', num => $num, start_count => 4 ); <%doc> We might want to actually put the categories in using listManager instead. The only issue is having the addition argument put up a button instead of a link. Here is a starter: <%perl>;$repeatable_opts my $cats = $story->get_categories; $m->comp('/widgets/listManager/listManager.mc', object => 'category', userSort => 0, objs => $cats, title => '%n', # addition => $no_edit ? undef : ['Add', "/admin/profile/action?dest_id=$id"], # constrain => { server_type_id => $id }, fields => [qw(name)], profile => undef, select => ['Delete', "$widget|delete_cat"], number => $num );
% $m->comp("/widgets/wrappers/sharky/table_top.mc", % caption => "Categories", % number => $num++); % my @cat = $story->get_categories; % my $primary = $story->get_primary_category(); % my $p_id = $primary ? $primary->get_id : ''; % my $rowspan = scalar (@cat) + 2; % # BEGIN FOREACH CAT % my $curr_cats = {}; % foreach (@cat) { % my $cat_id = $_->get_id; % $curr_cats->{$cat_id} = 1; % } % # END FOREACH CAT % if (!@cat) { % } else { % }
Name URI Primary class="medHeader"> Delete
<% $_->get_name %> <% $_->get_uri %> > % if ($cat_id != $p_id) { <& '/widgets/profile/checkbox.mc', name => "$widget|delete_cat", value => $_->get_id &> % }  
This story has not been assigned to a category.
 
% # Create the subroutine to exclude categories. % my $excl_sub = sub { $curr_cats->{$_[0]->get_id} || ! chk_authz($_[0], READ, 1) };
><& '/widgets/profile/imageSubmit.mc', formName => "theForm", callback => "$widget|add_category_cb", image => "add_category_lgreen", vspace => 3, hspace => 2 &> valign="middle"> <& '/widgets/select_object/select_object.mc', object => 'category', name => "$widget|new_category_id", exclude => $excl_sub, field => 'uri', sort_field => 'uri', useTable => 0 &>
% $m->comp("/widgets/wrappers/sharky/table_bottom.mc"); % $m->comp("/widgets/wrappers/sharky/table_top.mc", % caption => "Associations", % number => $num++);
Type  Values  Action
Keywords:  <%perl> my @keywords; foreach my $kw ($story->get_keywords) { push @keywords, $kw->get_name; } $m->out(scalar(@keywords) ? join(", ", @keywords) : "No keywords defined."); <& '/widgets/profile/imageSubmit.mc', formName => "theForm", callback => "$widget|keywords_cb", image => "edit_lgreen", vspace => 4 &>
Contributors:  <%perl> my @contribs; foreach my $cntr ($story->get_contributors) { push @contribs, $cntr->get_name; } $m->out(scalar(@contribs) ? join(", ", @contribs) : "No contributors defined."); <& '/widgets/profile/imageSubmit.mc', formName => "theForm", callback => $widget . "|contributors_cb", image => "edit_lgreen", vspace => 3 &>
<%perl> $m->comp("/widgets/wrappers/sharky/table_bottom.mc"); $m->comp("/widgets/profile/buttonBar.mc", widget => $widget, desks => $desks, cd => $cd, obj => $story, ); <%args> $widget <%init> my $story = get_state_data($widget, 'story'); my $tile = $story->get_tile(); my $id = $story->get_id; my $wf_id = get_state_data($widget, 'work_id'); $wf_id = $story->get_workflow_id() unless $wf_id; my $wf = Bric::Biz::Workflow->lookup( { id => $wf_id }); my $desks = $wf->allowed_desks(); my $cd = $story->get_current_desk(); $cd = $wf->get_start_desk() unless $cd; my $agent = $m->comp("/widgets/util/detectAgent.mc"); my $infoIndent = ($agent->{browser} eq "Netscape") ? FIELD_INDENT - 5 : FIELD_INDENT + 8; my $ieSpacer = ($agent->{browser} eq "Internet Explorer") ? qq{
} : ''; my $num = 1; # get output channel info my $at = $story->get_element__id(); my $asset_type = Bric::Biz::AssetType->lookup({id => $at}); my @ocs = $asset_type->get_output_channels(); my $oc_select = '';