mirror of
https://github.com/friendica/friendica
synced 2024-11-10 21:02:54 +00:00
Merge pull request #2575 from annando/1606-shared-template
New template for shared content instead of hardcoded stuff in source
This commit is contained in:
commit
17f362f4f6
5 changed files with 56 additions and 24 deletions
|
@ -396,8 +396,6 @@ function bb_ShareAttributes($share, $simplehtml) {
|
||||||
|
|
||||||
$itemcache = get_itemcachepath();
|
$itemcache = get_itemcachepath();
|
||||||
|
|
||||||
// relative dates only make sense when they aren't cached
|
|
||||||
if ($itemcache == "") {
|
|
||||||
preg_match("/posted='(.*?)'/ism", $attributes, $matches);
|
preg_match("/posted='(.*?)'/ism", $attributes, $matches);
|
||||||
if ($matches[1] != "")
|
if ($matches[1] != "")
|
||||||
$posted = $matches[1];
|
$posted = $matches[1];
|
||||||
|
@ -406,8 +404,9 @@ function bb_ShareAttributes($share, $simplehtml) {
|
||||||
if ($matches[1] != "")
|
if ($matches[1] != "")
|
||||||
$posted = $matches[1];
|
$posted = $matches[1];
|
||||||
|
|
||||||
|
// relative dates only make sense when they aren't cached
|
||||||
|
if ($itemcache == "")
|
||||||
$reldate = (($posted) ? " " . relative_date($posted) : '');
|
$reldate = (($posted) ? " " . relative_date($posted) : '');
|
||||||
}
|
|
||||||
|
|
||||||
$data = get_contact_details_by_url($profile);
|
$data = get_contact_details_by_url($profile);
|
||||||
|
|
||||||
|
@ -489,16 +488,20 @@ function bb_ShareAttributes($share, $simplehtml) {
|
||||||
$text .= "<br /><br />".$link;
|
$text .= "<br /><br />".$link;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$headline = trim($share[1])."\n";
|
$text = trim($share[1])."\n";
|
||||||
$headline .= '<div class="shared-wrapper">'."\n";
|
|
||||||
$headline .= '<div class="shared_header">'."\n";
|
|
||||||
if ($avatar != "")
|
|
||||||
$headline .= '<img src="'.proxy_url($avatar, false, PROXY_SIZE_MICRO).'" height="32" width="32" >';
|
|
||||||
|
|
||||||
$headline .= sprintf(t('<span><a href="%s" target="_blank">%s</a> wrote the following <a href="%s" target="_blank">post</a>'.$reldate.':</span>'), $profile, $author, $link);
|
$tpl = get_markup_template('shared_content.tpl');
|
||||||
$headline .= "</div>\n";
|
$text .= replace_macros($tpl,
|
||||||
$text = $headline.'<blockquote class="shared_content">'.trim($share[3])."</blockquote>\n";
|
array(
|
||||||
$text .= "<div>\n";
|
'$profile' => $profile,
|
||||||
|
'$avatar' => $avatar,
|
||||||
|
'$author' => $author,
|
||||||
|
'$link' => $link,
|
||||||
|
'$posted' => $posted,
|
||||||
|
'$reldate' => $reldate,
|
||||||
|
'$content' => trim($share[3])
|
||||||
|
)
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return($text);
|
return($text);
|
||||||
|
|
13
view/templates/shared_content.tpl
Normal file
13
view/templates/shared_content.tpl
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<div class="shared-wrapper">
|
||||||
|
<div class="shared_header">
|
||||||
|
{{if $avatar}}
|
||||||
|
<a href="{{$profile}}" target="_blank" class="shared-userinfo">
|
||||||
|
<img src="{{$avatar}}" height="32" width="32">
|
||||||
|
</a>
|
||||||
|
{{/if}}
|
||||||
|
{{*<span><a href="{{$profile}}" target="_blank" class="shared-wall-item-name">{{$author}}</a> wrote the following <a href="{{$link}}" target="_blank">post</a>{{$reldate}}:</span>*}}
|
||||||
|
<div><a href="{{$profile}}" target="_blank" class="shared-wall-item-name"><span class="shared-author">{{$author}}</span></a></div>
|
||||||
|
<div class="shared-wall-item-ago"><small><a href="{{$link}}" target="_blank"><span class="shared-time">{{$posted}}</a></a></small></div>
|
||||||
|
</div>
|
||||||
|
<blockquote class="shared_content">{{$content}}</blockquote>
|
||||||
|
<div>
|
|
@ -1112,7 +1112,8 @@ input#dfrn-url {
|
||||||
left: 65px;
|
left: 65px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wall-item-ago {
|
.wall-item-ago,
|
||||||
|
.shared-time {
|
||||||
color: #888888;
|
color: #888888;
|
||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
}
|
}
|
||||||
|
@ -1201,7 +1202,8 @@ input#dfrn-url {
|
||||||
.wall-item-wrapper-end {
|
.wall-item-wrapper-end {
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
.wall-item-name-link {
|
.wall-item-name-link,
|
||||||
|
.shared-author {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: #3172BD;
|
color: #3172BD;
|
||||||
|
|
|
@ -1258,7 +1258,8 @@ section #jotOpen {
|
||||||
.media-heading {
|
.media-heading {
|
||||||
margin: 0 0 5px;
|
margin: 0 0 5px;
|
||||||
}
|
}
|
||||||
.wall-item-name {
|
.wall-item-name,
|
||||||
|
.shared-author {
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
@ -1592,6 +1593,7 @@ ul.dropdown-menu li:hover {
|
||||||
|
|
||||||
/* Media Classes */
|
/* Media Classes */
|
||||||
.media .time,
|
.media .time,
|
||||||
|
.media .shared-time,
|
||||||
.media .location,
|
.media .location,
|
||||||
.media .location a {
|
.media .location a {
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
|
|
|
@ -1426,6 +1426,15 @@ section.minimal {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.shared-time {
|
||||||
|
color: #999;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shared_header {
|
||||||
|
line-height: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
.wall-item-network {
|
.wall-item-network {
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
@ -1504,7 +1513,8 @@ section.minimal {
|
||||||
color: #36c;
|
color: #36c;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wall-item-container .wall-item-name {
|
.wall-item-container .wall-item-name,
|
||||||
|
.wall-item-container .shared-author {
|
||||||
color: black;
|
color: black;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
-webkit-transition: all 0.2s ease-in-out;
|
-webkit-transition: all 0.2s ease-in-out;
|
||||||
|
@ -1515,7 +1525,9 @@ section.minimal {
|
||||||
}
|
}
|
||||||
|
|
||||||
.toplevel_item:hover .wall-item-name,
|
.toplevel_item:hover .wall-item-name,
|
||||||
.wall-item-container:hover .wall-item-name {
|
.wall-item-container:hover .wall-item-name,
|
||||||
|
.toplevel_item:hover .shared-author,
|
||||||
|
.wall-item-container:hover .shared-author {
|
||||||
color: #36c;
|
color: #36c;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
-webkit-transition: all 0.2s ease-in-out;
|
-webkit-transition: all 0.2s ease-in-out;
|
||||||
|
|
Loading…
Reference in a new issue