Skip to content
This repository has been archived by the owner on Mar 25, 2019. It is now read-only.

Commit

Permalink
Issue #1276: Bugfix display of message author avatar, claims, tickets…
Browse files Browse the repository at this point in the history
…, entity metadata and forum topics lists (#1301)
  • Loading branch information
avakorin authored Mar 1, 2019
1 parent eba02e0 commit 9ea81bc
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 61 deletions.
32 changes: 14 additions & 18 deletions profiles/drupalru/themes/druru/css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,6 @@

&.current-user {
.media-body {
&:before {
border-width: @pmgs-bt @pmgs-br @pmgs-bb @pmgs-bl;
border-top-color: @privatemsg-bg;
right: -@pmsg-p-width+4;
top: @pmsg-p-top + 10;
.rotate(@pmgs-rotate*@pmsg-right-rotate-coeff);
}

&:after {
border-width: @pmgs-bt+2 @pmgs-br+2 @pmgs-bb+2 @pmgs-bl+3;
border-top-color: @privatemsg-border;
right: -@pmsg-p-width;
top: @pmsg-p-top + 10;
.rotate(@pmgs-rotate*@pmsg-right-rotate-coeff);
}

&.new {
&:before {
border-bottom-color: @privatemsg-bg-new;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
}
}

&__content,
&__content:not(:first-child),
&__links {
margin-top: @gap-entity;
}
Expand Down
22 changes: 21 additions & 1 deletion profiles/drupalru/themes/druru/less/fixes.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,24 @@
.node-event img {
max-width: 100%;
height: auto;
}
}

.forum-topic-list {
.row {
&:not(:first-child) {
margin-top: @gap-listing-page;
}

> *:not(.title) {
font-size: @font-size-aux;
}

.author {
white-space: nowrap;
}
}
}

li.ticket-assign a:before {
content: unset;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,20 @@ function druru_preprocess_privatemsg_view(&$vars) {
if (!$vars['author_place']) {
$vars['author_place'] = $author_place;
}

$picture = isset($message->author->picture) ? $message->author->picture : null;

if (!empty($picture->uri)) {
$filepath = $picture->uri;
}
elseif (variable_get('user_picture_default', '')) {
$filepath = variable_get('user_picture_default', '');
}

if (isset($filepath)) {
$vars['author_picture'] = theme('image_style', array(
'style_name' => 'thumbnail',
'path' => $filepath,
));
}
}
44 changes: 23 additions & 21 deletions profiles/drupalru/themes/druru/theme/system/node.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,32 +93,34 @@
</h2>
<?php endif; ?>

<div class="node__meta">
<?php if ($show_author): ?>
<span class="node__author-avatar"><?php print $user_picture; ?></span>
<span class="node__author-name"><?php print $name; ?></span>
<?php endif; ?>

<span class="node__date">
<?php print $date; ?>
</span>
<?php if ($show_entity_meta): ?>
<div class="node__meta">
<?php if ($show_author): ?>
<span class="node__author-avatar"><?php print $user_picture; ?></span>
<span class="node__author-name"><?php print $name; ?></span>
<?php endif; ?>

<?php if(!empty($content['ticket-popover'])): ?>
<span class="node__claim">
<?php print drupal_render($content['ticket-popover']); ?>
<span class="node__date">
<?php print $date; ?>
</span>
<?php endif; ?>

<?php if(!empty($tnx)): ?>
<span class="node__voting">
<?php print $tnx; ?>
</span>
<?php endif; ?>
<?php if(!empty($content['ticket-popover'])): ?>
<span class="node__claim">
<?php print drupal_render($content['ticket-popover']); ?>
</span>
<?php endif; ?>

<span class="node__status"></span>
<?php if(!empty($tnx)): ?>
<span class="node__voting">
<?php print $tnx; ?>
</span>
<?php endif; ?>

<span class="menu-toggle"></span>
</div>
<span class="node__status"></span>

<span class="menu-toggle"></span>
</div>
<?php endif; ?>

<div<?php print $content_attributes; ?>>
<?php
Expand Down
9 changes: 6 additions & 3 deletions profiles/drupalru/themes/druru/theme/system/node.vars.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@ function druru_preprocess_node(&$vars) {
$vars['content']['links']['#attributes']['class'] = [];
$vars['content']['links']['#attributes']['class'][] = 'node__menu';

$vars['content']['links']['blog']['#links']['blog_usernames_blog']['title'] = t('Blog');
$vars['content']['links']['blog']['#links']['blog_usernames_blog']['href'] = '/user/' . $vars['uid'] . '/blog';
if ($vars['type'] == 'blog') {
$vars['content']['links']['blog']['#links']['blog_usernames_blog']['title'] = t('Blog');
$vars['content']['links']['blog']['#links']['blog_usernames_blog']['href'] = '/user/' . $vars['uid'] . '/blog';
$vars['show_entity_meta'] = TRUE;
}

if ($vars['type'] !== 'blog') {
if (!in_array($vars['type'], ['blog', 'ticket'])) {
unset($vars['content']['links']);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function dru_claim_node_view($node, $view_mode) {
$node->content['entity'] = [
'#markup' => '<div class="entity claimed-entity claimed-entity-full">
<div class="label claim-entity-label">' . t('Entity') . ':</div>
<div class="value claimed-entity-value">' . $original_title . check_markup($original_text, $original_format) . '</div>
<div class="value claimed-entity-value"><h3>' . $original_title . '</h3><div>' . check_markup($original_text, $original_format) . '</div></div>
</div>',
];
}
Expand Down

0 comments on commit 9ea81bc

Please sign in to comment.