Skip to content

Commit

Permalink
Show related info in element closed state.
Browse files Browse the repository at this point in the history
So if an element is related story and/or media, show the titles of the
relateds below the hint (if there is a hint).

To keep things consistent and to adhere closer to the new design spec, change
the layout of the short summary for a related box to use a hint paragraph
instead of a definition list.
  • Loading branch information
theory committed Apr 19, 2011
1 parent 34c3803 commit 3727f76
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
9 changes: 2 additions & 7 deletions comp/widgets/container_prof/_related.html
Expand Up @@ -102,12 +102,7 @@
$doc
</%args>
<div id="container_<% $cid %>_rel_<% $type %>_shortsum" style="display:none;">
<dl class="viewmeta shortsum" title="<% $lang->maketext('ID') %>: <% $doc->get_id %>
<% $lang->maketext('UUID') %>: <% $doc->get_uuid %>">
<dt><% $lang->maketext('Title') %>:</dt>
<dd><% $doc->get_title %></dd>
<dt><% $lang->maketext('Media Type') %>:</dt>
<dd><% $doc->get_element_name %></dd>
</dl>
<p class="hint"><strong><% $lang->maketext('Title') %>:</strong> <% $doc->get_title %><br />
<strong><% $lang->maketext('Media Type') %>:</strong> <% $doc->get_element_name %></p>
</div>
</%def>
19 changes: 17 additions & 2 deletions comp/widgets/container_prof/container.mc
Expand Up @@ -36,10 +36,25 @@
&>
</div>
% }
% if ($hint_val) {
<p class="hint" id="element_<% $id %>_hint"<% $displayed ? ' style="display: none"' : '' %>><strong><% $hint_name %>:</strong> <% escape_html($hint_val) %></p>
<div id="element_<% $id %>_hint"<% $displayed ? ' style="display: none"' : '' %>
% if ($hint_val || $element->get_related_story || $element->get_related_media) {
<p class="hint">
<%perl>;
my @hints;
push @hints, "<strong>$hint_name:</strong> " . escape_html($hint_val) if $hint_val;
if (my $rel = $element->get_related_story) {
push @hints, '<strong>' . $lang->maketext('Related Story') . ':</strong> ' . escape_html($rel->get_title);
}
if (my $rel = $element->get_related_media) {
push @hints, '<strong>' . $lang->maketext('Related Media') . ':</strong> ' . escape_html($rel->get_title);
}
$m->print(join '<br />' => @hints);
</%perl>
</p>
% }
</div>
<hr id="element_<% $id %>_hr"<% $displayed ? '' : ' style="display: none"' %> />

<ul id="element_<% $id %>" class="elements"<% $top_level || $displayed ? '' : ' style="display: none"' %>>
% foreach my $dt ($element->get_elements()) {
% if ($dt->is_container) {
Expand Down

0 comments on commit 3727f76

Please sign in to comment.