Browse Source

Small improvements for the Communities

Center properly the 3 colums
Improve the logo and bubbles rendering
Add link to public URL
Show more infos in CommunityData
pull/325/head
Timothée Jaussoin 9 years ago
parent
commit
19507f2275
  1. 2
      app/models/item/Item.php
  2. 13
      app/models/item/ItemDAO.php
  3. 3
      app/widgets/Communities/_communities.tpl
  4. 2
      app/widgets/Communities/communities.tpl
  5. 12
      app/widgets/CommunityData/_communitydata.tpl
  6. 32
      app/widgets/Post/_post_card.tpl
  7. 1
      locales/locales.ini
  8. 5
      themes/material/css/style.css

2
app/models/item/Item.php

@ -128,7 +128,7 @@ class Item extends Model
}
}
public function getLogo($size = 120)
public function getLogo($size = false)
{
$p = new Picture;
return $p->get($this->server.$this->node, $size);

13
app/models/item/ItemDAO.php

@ -290,8 +290,19 @@ class ItemDAO extends SQL
function getItem($server, $item) {
$this->_sql = '
select * from item
left outer join (
select node, count(node) as num from postn
where origin = :server
group by node) as p
on p.node = item.node
left outer join (
select node, count(node) as sub from subscription
where server = :server
group by node
) as sub
on sub.node = item.node
where
node = :node
item.node = :node
and server = :server';
$this->prepare(

3
app/widgets/Communities/_communities.tpl

@ -29,9 +29,6 @@
</li>
</ul>-->
<ul class="list flex middle active">
<li class="block large">
<p>{$c->__('group.servers')}</p>
</li>
{loop="$servers"}
{if="!filter_var($value->server, FILTER_VALIDATE_EMAIL)"}
<li class="block

2
app/widgets/Communities/communities.tpl

@ -1 +1 @@
<div id="communities"></div>
<div id="communities" class="spin"></div>

12
app/widgets/CommunityData/_communitydata.tpl

@ -2,11 +2,19 @@
{if="$item->logo"}
<li class="block large">
<p class="center">
<img src="{$item->getLogo(400)}" style="max-width: 100%"/>
<img src="{$item->getLogo()}" style="max-width: 100%"/>
</p>
</li>
<li class="block large">
<p>{$item->name}</p>
<p>{$item->created|strtotime|prepareDate:true,true}</p>
<p>
<!--{$item->created|strtotime|prepareDate:true,true}-->
{if="$item->num > 0"}
{$c->__('groups.num', $item->num)}
{/if}
{if="$item->sub > 0"}
<br />{$c->__('groups.sub', $item->sub)}
{/if}
</p>
</li>
{/if}

32
app/widgets/Post/_post_card.tpl

@ -1,13 +1,27 @@
<article class="block large">
<ul class="list thick">
<li>
<span class="primary icon gray">
{if="$post->isMicroblog()"}
<i class="zmdi zmdi-account"></i>
{if="$post->isNSFW()"}
<span class="primary icon bubble color red tiny">
+18
</span>
{elseif="$post->isMicroblog()"}
{$url = $post->getContact()->getPhoto('m')}
{if="$url"}
<span class="primary icon bubble color white">
<img src="{$url}"/>
</span>
{else}
<span class="primary icon thumb color {$post->getContact()->jid|stringToColor}">
<i class="zmdi zmdi-account"></i>
</span>
{/if}
{else}
<i class="zmdi zmdi-group-work"></i>
<span class="primary icon bubble color {$post->node|stringToColor}">
{$post->node|firstLetterCapitalize}
</span>
{/if}
</span>
<p class="normal">{$post->title}</p>
<p>
{if="$post->isMicroblog()"}
@ -93,11 +107,17 @@
</p>
<p class="normal">
<a class="button flat gray">
{$post->countComments()} <i class="zmdi zmdi-comment"></i>
{$post->countComments()} <i class="zmdi zmdi-comment-outline"></i>
</a>
<a class="button flat gray" href="{$c->route('publish', [$post->origin, $post->node, $post->nodeid, 'share'])}">
<i class="zmdi zmdi-share"></i>
</a>
{if="$post->isPublic()"}
<a class="button flat gray" target="_blank" href="{$post->getPublicUrl()}">
<i title="{$c->__('menu.public')}" class="zmdi zmdi-portable-wifi"></i>
</a>
{/if}
<a class="button flat oppose" href="{$c->route('post', [$post->origin, $post->node, $post->nodeid])}">
Read more
</a>

1
locales/locales.ini

@ -19,6 +19,7 @@ configuration = Configuration
public_groups = Public Groups
profile = Profile
publish = Publish
post = Post
blog = Blog
about = About
login = Login

5
themes/material/css/style.css

@ -196,10 +196,9 @@ main > section > div:first-child:nth-last-child(2) ~ div {
@media screen and (min-width: 1025px) {
main > section > aside {
width: 33%;
width: calc(50% - 30rem);
right: 0;
position: absolute;
margin-right: 2%;
}
main > section > aside > * {
@ -211,7 +210,7 @@ main > section > div:first-child:nth-last-child(2) ~ div {
}
main > section > aside + div > * {
margin-right: 35%;
margin-right: calc(50% - 30rem);
margin-left: auto;
}
}

Loading…
Cancel
Save