Browse Source

Better tickets for the Posts in disco

pull/647/head
Timothée Jaussoin 8 years ago
parent
commit
2b4b3672f2
  1. 4
      app/widgets/Communities/Communities.php
  2. 3
      app/widgets/ContactDiscoPosts/ContactDiscoPosts.php
  3. 4
      app/widgets/Post/Post.php
  4. 11
      app/widgets/Post/_post_ticket.tpl
  5. 2
      app/widgets/PublishBrief/PublishBrief.php
  6. 2
      app/widgets/PublishBrief/_publishbrief.tpl
  7. 13
      themes/material/css/icon.css

4
app/widgets/Communities/Communities.php

@ -28,7 +28,7 @@ class Communities extends \Movim\Widget\Base
->recents()
->orderBy('posts.published', 'desc')
->where('open', true)
->take(40)
->take(50)
->get();
$view->assign('posts', $posts);
@ -38,6 +38,6 @@ class Communities extends \Movim\Widget\Base
public function prepareTicket(\App\Post $post)
{
return (new \Post)->prepareTicket($post);
return (new \Post)->prepareTicket($post, true);
}
}

3
app/widgets/ContactDiscoPosts/ContactDiscoPosts.php

@ -14,7 +14,7 @@ class ContactDiscoPosts extends \Movim\Widget\Base
public function prepareTicket(\App\Post $post)
{
return (new Post)->prepareTicket($post);
return (new Post)->prepareTicket($post, true);
}
public function preparePosts()
@ -27,6 +27,7 @@ class ContactDiscoPosts extends \Movim\Widget\Base
->recents()
->where('open', true)
->orderBy('posts.published', 'desc')
->take(40)
->get();
$view->assign('blogs', $blogs);

4
app/widgets/Post/Post.php

@ -203,11 +203,11 @@ class Post extends \Movim\Widget\Base
}
}
function prepareTicket(\App\Post $post, $large = false)
function prepareTicket(\App\Post $post, $big = false)
{
$view = $this->tpl();
$view->assign('post', $post);
$view->assign('large', $large);
$view->assign('big', $big);
return $view->draw('_post_ticket', true);
}

11
app/widgets/Post/_post_ticket.tpl

@ -1,4 +1,7 @@
<li class="block {if="$large"}large{/if}" onclick="MovimUtils.redirect('{$c->route('post', [$post->server, $post->node, $post->nodeid])}')">
<li class="block" onclick="MovimUtils.redirect('{$c->route('post', [$post->server, $post->node, $post->nodeid])}')">
{if="$big && $post->picture != null"}
<img class="icon thumb" src="{$post->picture->href|protectPicture}">
{elseif="!$big"}
<span class="primary icon thumb color
{if="$post->contact"}
{$post->contact->jid|stringToColor}
@ -20,6 +23,7 @@
{$post->node|firstLetterCapitalize}
{/if}
</span>
{/if}
<p class="line" {if="isset($post->title)"}title="{$post->title}"{/if}>
{if="isset($post->title)"}
{$post->title}
@ -36,7 +40,10 @@
{/if}
{if="!$post->isMicroblog()"}
<a href="{$c->route('community', [$post->server, $post->node])}">{$post->node}</a>
<a title="{$post->server} / {$post->node}"
href="{$c->route('community', [$post->server, $post->node])}">
{$post->node}
</a>
{/if}
{$count = $post->likes()->count()}

2
app/widgets/PublishBrief/PublishBrief.php

@ -329,7 +329,7 @@ class PublishBrief extends \Movim\Widget\Base
$view->assign('to', $this->user->jid);
$view->assign('node', 'urn:xmpp:microblog:0');
$view->assign('reply', $reply);
$view->assign('replyblock', (new \Post)->prepareTicket($reply, true));
$view->assign('replyblock', (new \Post)->prepareTicket($reply));
} else {
$view->assign('to', $server);
$view->assign('node', $node);

2
app/widgets/PublishBrief/_publishbrief.tpl

@ -111,7 +111,7 @@
</span>
{/if}
<div>
<ul class="normal list embed flex">
<ul class="list embed">
{if="$reply"}
{$replyblock}
{else}

13
themes/material/css/icon.css

@ -30,13 +30,22 @@ span.icon.top.preview {
height: 25rem;
}
img.icon.thumb {
margin-top: -1rem;
margin-bottom: 1rem;
display: block;
max-width: 100%;
object-fit: cover;
}
span.icon.primary.thumb {
height: 100%;
left: 0;
width: 7rem;
top: 0;
height: 100%;
width: 7rem;
margin: 0;
line-height: 7.5rem;
max-height: 100%;
}
/*
*[dir="rtl"] span.icon.primary.thumb {

Loading…
Cancel
Save