49 changed files with 1099 additions and 229 deletions
-
6app/controllers/GroupController.php
-
15app/controllers/PostController.php
-
4app/models/item/Item.php
-
49app/models/item/ItemDAO.php
-
27app/views/group.tpl
-
7app/views/news.tpl
-
16app/views/post.tpl
-
61app/widgets/Communities/Communities.php
-
63app/widgets/Communities/_communities.tpl
-
3app/widgets/Communities/communities.js
-
1app/widgets/Communities/communities.tpl
-
143app/widgets/CommunitiesServer/CommunitiesServer.php
-
88app/widgets/CommunitiesServer/_communitiesserver.tpl
-
21app/widgets/CommunitiesServer/_communitiesserver_add.tpl
-
6app/widgets/CommunitiesServer/communitiesserver.js
-
1app/widgets/CommunitiesServer/communitiesserver.tpl
-
36app/widgets/CommunityAffiliations/CommunityAffiliations.php
-
22app/widgets/CommunityAffiliations/_communityaffiliations.tpl
-
3app/widgets/CommunityAffiliations/communityaffiliations.tpl
-
44app/widgets/CommunityData/CommunityData.php
-
9app/widgets/CommunityData/_communitydata.tpl
-
3app/widgets/CommunityData/communitydata.tpl
-
47app/widgets/CommunityHeader/CommunityHeader.php
-
36app/widgets/CommunityHeader/_communityheader.tpl
-
3app/widgets/CommunityHeader/communityheader.tpl
-
141app/widgets/Group/Group.php
-
57app/widgets/Group/_group_header.tpl
-
19app/widgets/Group/_group_posts.tpl
-
2app/widgets/Group/group.js
-
5app/widgets/Group/group.tpl
-
19app/widgets/Groups/Groups.php
-
8app/widgets/Menu/Menu.php
-
49app/widgets/Menu/_menu_list.tpl
-
2app/widgets/Menu/_menu_refresh.tpl
-
4app/widgets/Menu/menu.css
-
6app/widgets/Navigation/navigation.tpl
-
22app/widgets/NewsNav/NewsNav.php
-
115app/widgets/NewsNav/newsnav.tpl
-
9app/widgets/Post/Post.php
-
2app/widgets/Post/_post.tpl
-
81app/widgets/Post/_post_card.tpl
-
4linker.php
-
1locales/locales.ini
-
5src/Movim/Bootstrap.php
-
1src/Movim/Route.php
-
23themes/material/css/article.css
-
4themes/material/css/icon.css
-
2themes/material/css/listn.css
-
33themes/material/css/style.css
@ -0,0 +1,15 @@ |
|||
<?php |
|||
use Movim\Controller\Base; |
|||
|
|||
class PostController extends Base |
|||
{ |
|||
function load() |
|||
{ |
|||
$this->session_only = true; |
|||
} |
|||
|
|||
function dispatch() |
|||
{ |
|||
$this->page->setTitle(__('page.post')); |
|||
} |
|||
} |
@ -0,0 +1,16 @@ |
|||
<?php $this->widget('Init');?> |
|||
<?php $this->widget('VisioLink');?> |
|||
<?php $this->widget('Notification');?> |
|||
<?php $this->widget('Upload');?> |
|||
<?php $this->widget('Search');?> |
|||
|
|||
<nav class="color dark"> |
|||
<?php $this->widget('Presence');?> |
|||
<?php $this->widget('Navigation');?> |
|||
</nav> |
|||
|
|||
<main> |
|||
<section> |
|||
<?php $this->widget('Post');?> |
|||
</section> |
|||
</main> |
@ -0,0 +1,61 @@ |
|||
<?php |
|||
|
|||
use Moxl\Xec\Action\Disco\Items; |
|||
use Respect\Validation\Validator; |
|||
|
|||
class Communities extends \Movim\Widget\Base |
|||
{ |
|||
public function load() |
|||
{ |
|||
$this->registerEvent('disco_items_handle', 'onDisco'); |
|||
$this->addjs('communities.js'); |
|||
} |
|||
|
|||
function onDisco($packet) |
|||
{ |
|||
$this->ajaxGet(); |
|||
} |
|||
|
|||
function ajaxDisco($server) |
|||
{ |
|||
if(!$this->validateServer($server)) { |
|||
Notification::append(null, $this->__('groups.disco_error')); |
|||
return; |
|||
} |
|||
|
|||
RPC::call('MovimTpl.fill', '#groups_widget', ''); |
|||
|
|||
$r = new Items; |
|||
$r->setTo($server)->request(); |
|||
} |
|||
|
|||
function ajaxGet() |
|||
{ |
|||
RPC::call('MovimTpl.fill', '#communities', $this->prepareCommunities()); |
|||
} |
|||
|
|||
function prepareCommunities() |
|||
{ |
|||
$id = new \Modl\ItemDAO(); |
|||
|
|||
$view = $this->tpl(); |
|||
$view->assign('servers', $id->getGroupServers()); |
|||
|
|||
return $view->draw('_communities', true); |
|||
} |
|||
|
|||
/** |
|||
* @brief Validate the server |
|||
* |
|||
* @param string $server |
|||
*/ |
|||
private function validateServer($server) |
|||
{ |
|||
$validate_server = Validator::noWhitespace()->alnum('.-_')->length(6, 40); |
|||
return ($validate_server->validate($server)); |
|||
} |
|||
|
|||
public function display() |
|||
{ |
|||
} |
|||
} |
@ -0,0 +1,63 @@ |
|||
<header> |
|||
<ul class="list middle"> |
|||
<li> |
|||
<span class="primary icon gray active on_mobile" onclick="history.back()"> |
|||
<i class="zmdi zmdi-arrow-left"></i> |
|||
</span> |
|||
<p class="center">{$c->__('page.communities')}</p> |
|||
<p class="center line">{$c->__('group.empty_text')}</p> |
|||
</li> |
|||
</ul> |
|||
</header> |
|||
<!-- |
|||
<ul class="list card thick"> |
|||
<li></li> |
|||
<li class="block"> |
|||
<span class="primary icon gray"> |
|||
<i class="zmdi zmdi-help"></i> |
|||
</span> |
|||
<p class="all"> |
|||
{$c->__('group.help_info1')} |
|||
</p> |
|||
<p> |
|||
{$c->___('group.help_info2', '<i class="zmdi zmdi-bookmark"></i>', '<i class="zmdi zmdi-plus"></i> ')}<br /> |
|||
{$c->___('group.help_info3', '<i class="zmdi zmdi-edit"></i>')}<br /> |
|||
</p> |
|||
<p> |
|||
{$c->___('group.help_info4', '<a href="'.$c->route('news').'"><i class="zmdi zmdi-receipt"></i> ','</a>')} |
|||
</p> |
|||
</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 |
|||
{if="empty($value->number)"}faded{/if}" |
|||
onclick="MovimUtils.redirect('{$c->route('group', $value->server)}')"> |
|||
<span class="primary icon bubble color {$value->server|stringToColor}"> |
|||
{$value->server|firstLetterCapitalize} |
|||
</span> |
|||
<p class="line" title="{$value->server} - {$value->name}"> |
|||
{$value->server} |
|||
<span class="second">{$value->name}</span> |
|||
</p> |
|||
<p>{$c->__('group.counter', (empty($value->number)) ? 0 : $value->number)}</p> |
|||
</li> |
|||
{/if} |
|||
{/loop} |
|||
<li class="block large"> |
|||
<span class="primary icon"> |
|||
<i class="zmdi zmdi-search-for"></i> |
|||
</span> |
|||
<form> |
|||
<div> |
|||
<input placeholder="pubsub.server.com" onkeypress=" |
|||
if(event.keyCode == 13) { Communities_ajaxDisco(this.value); return false; }" > |
|||
<label>{$c->__('group.search_server')}</label> |
|||
</div> |
|||
</form> |
|||
</li> |
|||
</ul> |
@ -0,0 +1,3 @@ |
|||
MovimWebsocket.attach(function() { |
|||
Communities_ajaxGet(); |
|||
}); |
@ -0,0 +1 @@ |
|||
<div id="communities"></div> |
@ -0,0 +1,143 @@ |
|||
<?php |
|||
|
|||
use Moxl\Xec\Action\Pubsub\GetItems; |
|||
use Moxl\Xec\Action\Disco\Items; |
|||
use Respect\Validation\Validator; |
|||
use Moxl\Xec\Action\Pubsub\Create; |
|||
use Moxl\Xec\Action\Pubsub\TestCreate; |
|||
|
|||
use Cocur\Slugify\Slugify; |
|||
|
|||
class CommunitiesServer extends \Movim\Widget\Base |
|||
{ |
|||
public function load() |
|||
{ |
|||
$this->registerEvent('disco_items_handle', 'onDisco'); |
|||
$this->registerEvent('disco_items_error', 'onDiscoError'); |
|||
$this->registerEvent('pubsub_create_handle', 'onCreate'); |
|||
$this->registerEvent('pubsub_testcreate_handle', 'onTestCreate'); |
|||
$this->registerEvent('pubsub_testcreate_error', 'onTestCreateError'); |
|||
|
|||
$this->addjs('communitiesserver.js'); |
|||
} |
|||
|
|||
function onCreate($packet) |
|||
{ |
|||
Notification::append(null, $this->__('groups.created')); |
|||
|
|||
list($server, $node) = array_values($packet->content); |
|||
$this->ajaxDisco($server); |
|||
} |
|||
|
|||
function onDisco($packet) |
|||
{ |
|||
$server = $packet->content; |
|||
|
|||
RPC::call('MovimTpl.fill', '#communities_server', $this->prepareCommunitiesServer($server)); |
|||
} |
|||
|
|||
function onDiscoError($packet) |
|||
{ |
|||
$server = $packet->content; |
|||
|
|||
$id = new \Modl\ItemDAO(); |
|||
$id->deleteItems($server); |
|||
|
|||
RPC::call('MovimTpl.fill', '#communities_server', $this->prepareCommunitiesServer($server)); |
|||
|
|||
Notification::append(null, $this->__('groups.disco_error')); |
|||
} |
|||
|
|||
function onTestCreate($packet) |
|||
{ |
|||
$server = $packet->content; |
|||
|
|||
$view = $this->tpl(); |
|||
$view->assign('server', $server); |
|||
|
|||
Dialog::fill($view->draw('_communitiesserver_add', true)); |
|||
} |
|||
|
|||
function onTestCreateError($packet) |
|||
{ |
|||
Notification::append(null, $this->__('groups.no_creation')); |
|||
} |
|||
|
|||
function ajaxDisco($server) |
|||
{ |
|||
if(!$this->validateServer($server)) { |
|||
Notification::append(null, $this->__('groups.disco_error')); |
|||
return; |
|||
} |
|||
|
|||
RPC::call('MovimTpl.fill', '#communities_server', ''); |
|||
|
|||
$r = new Items; |
|||
$r->setTo($server)->request(); |
|||
} |
|||
|
|||
/* |
|||
* Seriously ? We need to put this hack because of buggy XEP-0060... |
|||
*/ |
|||
function ajaxTestAdd($server) |
|||
{ |
|||
if(!$this->validateServer($server)) return; |
|||
|
|||
$t = new TestCreate; |
|||
$t->setTo($server) |
|||
->request(); |
|||
} |
|||
|
|||
function ajaxAddConfirm($server, $form) |
|||
{ |
|||
if(!$this->validateServer($server)) return; |
|||
|
|||
$validate_name = Validator::stringType()->length(4, 80); |
|||
if(!$validate_name->validate($form->name->value)) { |
|||
Notification::append(null, $this->__('groups.name_error')); |
|||
return; |
|||
} |
|||
|
|||
$slugify = new Slugify(); |
|||
$uri = $slugify->slugify($form->name->value); |
|||
|
|||
if($uri == '') { |
|||
Notification::append(null, $this->__('groups.name_error')); |
|||
return; |
|||
} |
|||
|
|||
$c = new Create; |
|||
$c->setTo($server) |
|||
->setNode($uri) |
|||
->setName($form->name->value) |
|||
->request(); |
|||
} |
|||
|
|||
public function prepareCommunitiesServer($server) |
|||
{ |
|||
$id = new \Modl\ItemDAO; |
|||
|
|||
$view = $this->tpl(); |
|||
$view->assign('item', $id->getJid($server)); |
|||
$view->assign('nodes', $id->getItems($server)); |
|||
$view->assign('server', $server); |
|||
|
|||
return $view->draw('_communitiesserver', true); |
|||
} |
|||
|
|||
/** |
|||
* @brief Validate the server |
|||
* |
|||
* @param string $server |
|||
*/ |
|||
private function validateServer($server) |
|||
{ |
|||
$validate_server = Validator::noWhitespace()->alnum('.-_')->length(6, 40); |
|||
return ($validate_server->validate($server)); |
|||
} |
|||
|
|||
public function display() |
|||
{ |
|||
$this->view->assign('server', $this->get('s')); |
|||
} |
|||
} |
@ -0,0 +1,88 @@ |
|||
<header> |
|||
<ul class="list middle"> |
|||
<li> |
|||
<span class="primary icon icon gray active" onclick="history.back()"> |
|||
<i class="zmdi zmdi-arrow-back"></i> |
|||
</span> |
|||
{if="count($nodes) > 0"} |
|||
<span class="control icon gray"> |
|||
{$nodes|count} |
|||
</span> |
|||
{/if} |
|||
<p class="center">{$c->__('page.communities')}</p> |
|||
<p class="center line">{$server}</p> |
|||
</li> |
|||
</ul> |
|||
</header> |
|||
{if="$nodes == null"} |
|||
<ul class="thick"> |
|||
<div class="placeholder icon pages"> |
|||
<h1>{$c->__('error.oops')}</h1> |
|||
<h4>{$c->__('groups.empty_server')}</h4> |
|||
</li> |
|||
</ul> |
|||
{else} |
|||
<ul class="list middle divided spaced active all flex"> |
|||
<!--<li class="subheader" > |
|||
<span class="primary icon"><i class="zmdi zmdi-arrow-back"></i></span> |
|||
<p class="normal">{$server}</p> |
|||
</li>--> |
|||
{loop="$nodes"} |
|||
<li |
|||
class="block |
|||
{if="$value->subscription == 'subscribed'"}action{/if} |
|||
{if="$value->sub > 0 || $value->num > 0"}condensed{/if} |
|||
" |
|||
onclick="MovimUtils.redirect('{$c->route('group', [$value->server, $value->node])}')" |
|||
title="{$value->server} - {$value->node}" |
|||
> |
|||
{if="$value->subscription == 'subscribed'"} |
|||
<span class="control icon gray"> |
|||
<i class="zmdi zmdi-bookmark"></i> |
|||
</span> |
|||
{/if} |
|||
|
|||
{if="$value->logo"} |
|||
<span class="primary icon bubble"> |
|||
<img src="{$value->getLogo(50)}"> |
|||
</span> |
|||
{else} |
|||
<span class="primary icon bubble color {$value->node|stringToColor}"> |
|||
{$value->node|firstLetterCapitalize} |
|||
</span> |
|||
{/if} |
|||
<p class="line"> |
|||
{if="$value->name"} |
|||
{$value->name} |
|||
{else} |
|||
{$value->node} |
|||
{/if} |
|||
<span class="second"> |
|||
{if="$value->description"} |
|||
{$value->description|strip_tags} |
|||
{/if} |
|||
</span> |
|||
</p> |
|||
<p> |
|||
{if="$value->num > 0"} |
|||
{$c->__('groups.num', $value->num)} |
|||
{/if} |
|||
{if="$value->sub > 0 && $value->num > 0"} |
|||
- |
|||
{/if} |
|||
{if="$value->sub > 0"} |
|||
<span title="{$c->__('groups.sub', $value->sub)}"> |
|||
{$value->sub} <i class="zmdi zmdi-accounts"></i> |
|||
</span> |
|||
{/if} |
|||
<span class="info"> |
|||
{$value->published|strtotime|prepareDate:true,true} |
|||
</span> |
|||
</p> |
|||
</li> |
|||
{/loop} |
|||
</ul> |
|||
{/if} |
|||
<a onclick="CommunitiesServer_ajaxTestAdd('{$server}')" class="button action color"> |
|||
<i class="zmdi zmdi-plus"></i> |
|||
</a> |
@ -0,0 +1,21 @@ |
|||
<section> |
|||
<form name="groupadd" onsubmit="return false;"> |
|||
<h3>{$c->__('groups.add', $server)}</h3> |
|||
|
|||
<div> |
|||
<input name="name" placeholder="{$c->__('groups.name_example')}" type="text" required /> |
|||
<label for="name">{$c->__('groups.name')}</label> |
|||
</div> |
|||
</section> |
|||
<div> |
|||
<a class="button flat" onclick="Dialog_ajaxClear()"> |
|||
{$c->__('button.close')} |
|||
</a> |
|||
<a |
|||
class="button flat" |
|||
onclick="CommunitiesServer_ajaxAddConfirm('{$server}', MovimUtils.formToJson('groupadd')); Dialog_ajaxClear();"> |
|||
{$c->__('button.add')} |
|||
</a> |
|||
</div> |
|||
|
|||
</div> |
@ -0,0 +1,6 @@ |
|||
MovimWebsocket.attach(function() { |
|||
var parts = MovimUtils.urlParts(); |
|||
if(parts.params.length > 0) { |
|||
CommunitiesServer_ajaxDisco(parts.params[0]); |
|||
} |
|||
}); |
@ -0,0 +1 @@ |
|||
<div id="communities_server" class="spin"></div> |
@ -0,0 +1,36 @@ |
|||
<?php |
|||
|
|||
use Respect\Validation\Validator; |
|||
|
|||
class CommunityAffiliations extends \Movim\Widget\Base |
|||
{ |
|||
public function load() |
|||
{ |
|||
$this->registerEvent('pubsub_getaffiliations_handle', 'onAffiliations'); |
|||
} |
|||
|
|||
function onAffiliations($packet) |
|||
{ |
|||
list($affiliations, $server, $node) = array_values($packet->content); |
|||
|
|||
$role = null; |
|||
|
|||
foreach($affiliations as $r) { |
|||
if($r[0] == $this->user->getLogin()) |
|||
$role = (string)$r[1]; |
|||
} |
|||
|
|||
$id = new \Modl\ItemDAO; |
|||
$item = $id->getItem($server, $node); |
|||
|
|||
$view = $this->tpl(); |
|||
$view->assign('role', $role); |
|||
$view->assign('item', $item); |
|||
|
|||
RPC::call('MovimTpl.fill', '#community_affiliation', $view->draw('_communityaffiliations', true)); |
|||
} |
|||
|
|||
public function display() |
|||
{ |
|||
} |
|||
} |
@ -0,0 +1,22 @@ |
|||
{if="$role == 'owner'"} |
|||
<ul class="list active"> |
|||
<li onclick="Group_ajaxGetConfig('{$item->server|echapJS}', '{$item->node|echapJS}')"> |
|||
<span class="primary icon gray"> |
|||
<i class="zmdi zmdi-settings"></i> |
|||
</span> |
|||
<p class="normal">{$c->__('group.configuration')}</p> |
|||
</li> |
|||
<li onclick="Group_ajaxGetSubscriptions('{$item->server|echapJS}', '{$item->node|echapJS}', true)"> |
|||
<span class="primary icon gray"> |
|||
<i class="zmdi zmdi-accounts-list"></i> |
|||
</span> |
|||
<p class="normal">{$c->__('group.subscriptions')}</p> |
|||
</li> |
|||
<li onclick="Group_ajaxDelete('{$item->server|echapJS}', '{$item->node|echapJS}')"> |
|||
<span class="primary icon gray"> |
|||
<i class="zmdi zmdi-delete"></i> |
|||
</span> |
|||
<p class="normal">{$c->__('button.delete')}</p> |
|||
</li> |
|||
</ul> |
|||
{/if} |
@ -0,0 +1,3 @@ |
|||
<ul class="list card"> |
|||
<li id="community_affiliation"></li> |
|||
</ul> |
@ -0,0 +1,44 @@ |
|||
<?php |
|||
|
|||
use Respect\Validation\Validator; |
|||
|
|||
class CommunityData extends \Movim\Widget\Base |
|||
{ |
|||
public function load() |
|||
{ |
|||
$this->registerEvent('pubsub_getmetadata_handle', 'onMetadata'); |
|||
} |
|||
|
|||
function onMetadata($packet) |
|||
{ |
|||
list($server, $node) = $packet->content; |
|||
|
|||
RPC::call('MovimTpl.fill', '#community_data', $this->prepareData($server, $node)); |
|||
} |
|||
|
|||
public function prepareData($server, $node) |
|||
{ |
|||
$id = new \Modl\ItemDAO; |
|||
$item = $id->getItem($server, $node); |
|||
|
|||
if($item && !$item->logo) { |
|||
$item->setPicture(); |
|||
$id->set($item); |
|||
} |
|||
|
|||
$pd = new \Modl\SubscriptionDAO; |
|||
$subscription = $pd->get($server, $node); |
|||
|
|||
$view = $this->tpl(); |
|||
$view->assign('item', $item); |
|||
$view->assign('subscription', $subscription); |
|||
|
|||
return $view->draw('_communitydata', true); |
|||
} |
|||
|
|||
public function display() |
|||
{ |
|||
$this->view->assign('server', $this->get('s')); |
|||
$this->view->assign('node', $this->get('n')); |
|||
} |
|||
} |
@ -0,0 +1,9 @@ |
|||
<br /> |
|||
{if="$item->logo"} |
|||
<li class="block large"> |
|||
<p class="center"> |
|||
<img src="{$item->getLogo(400)}" style="max-width: 100%"/> |
|||
</p> |
|||
<p>{$item->created|strtotime|prepareDate:true,true}</p> |
|||
</li> |
|||
{/if} |
@ -0,0 +1,3 @@ |
|||
<ul id="community_data" class="list card thick"> |
|||
{$c->prepareData($server, $node)} |
|||
</ul> |
@ -0,0 +1,47 @@ |
|||
<?php |
|||
|
|||
use Respect\Validation\Validator; |
|||
|
|||
class CommunityHeader extends \Movim\Widget\Base |
|||
{ |
|||
public function load() |
|||
{ |
|||
$this->registerEvent('pubsub_getmetadata_handle', 'onMetadata'); |
|||
} |
|||
|
|||
function onMetadata($packet) |
|||
{ |
|||
list($server, $node) = $packet->content; |
|||
|
|||
RPC::call('MovimTpl.fill', '#community_header', $this->prepareHeader($server, $node)); |
|||
} |
|||
|
|||
public function prepareHeader($server, $node) |
|||
{ |
|||
$id = new \Modl\ItemDAO; |
|||
$item = $id->getItem($server, $node); |
|||
|
|||
if($item && !$item->logo) { |
|||
$item->setPicture(); |
|||
$id->set($item); |
|||
} |
|||
|
|||
$pd = new \Modl\SubscriptionDAO; |
|||
$subscription = $pd->get($server, $node); |
|||
|
|||
$view = $this->tpl(); |
|||
|
|||
$view->assign('item', $item); |
|||
$view->assign('subscription', $subscription); |
|||
$view->assign('node', $node); |
|||
$view->assign('server', $server); |
|||
|
|||
return $view->draw('_communityheader', true); |
|||
} |
|||
|
|||
public function display() |
|||
{ |
|||
$this->view->assign('server', $this->get('s')); |
|||
$this->view->assign('node', $this->get('n')); |
|||
} |
|||
} |
@ -0,0 +1,36 @@ |
|||
<ul class="list thick"> |
|||
<li> |
|||
{if="$subscription == null"} |
|||
<a class="button oppose green color" title="{$c->__('group.subscribe')}" |
|||
onclick="Group_ajaxAskSubscribe('{$item->server|echapJS}', '{$item->node|echapJS}')"> |
|||
Join |
|||
</a> |
|||
{else} |
|||
<a class="button oppose flat" title="{$c->__('group.unsubscribe')}" |
|||
onclick="Group_ajaxAskUnsubscribe('{$item->server|echapJS}', '{$item->node|echapJS}')"> |
|||
Leave |
|||
</a> |
|||
{/if} |
|||
<span id="back" class="primary icon active gray" onclick="history.back()"> |
|||
<i class="zmdi zmdi-arrow-back"></i> |
|||
</span> |
|||
<p class="line"> |
|||
{if="$item != null"} |
|||
{if="$item->name"} |
|||
{$item->name} |
|||
{else} |
|||
{$item->node} |
|||
{/if} |
|||
{else} |
|||
{$node} |
|||
{/if} |
|||
</p> |
|||
{if="$item != null && $item->description"} |
|||
<p class="line" title="{$item->description|strip_tags}"> |
|||
{$item->description|strip_tags} |
|||
</p> |
|||
{else} |
|||
<p class="line">{$server}</p> |
|||
{/if} |
|||
</li> |
|||
</ul> |
@ -0,0 +1,3 @@ |
|||
<header id="community_header" class="relative"> |
|||
{$c->prepareHeader($server, $node)} |
|||
</header> |
@ -1,57 +0,0 @@ |
|||
<ul class="list middle"> |
|||
<li> |
|||
<span id="back" class="primary icon active" onclick="MovimTpl.hidePanel(); Group_ajaxClear();"> |
|||
<i class="zmdi zmdi-arrow-back"></i> |
|||
</span> |
|||
{if="$role == 'owner'"} |
|||
<span class="control show_context_menu icon active"> |
|||
<i class="zmdi zmdi-more-vert"></i> |
|||
</span> |
|||
{/if} |
|||
{if="$subscription == null"} |
|||
<span class="control icon active" title="{$c->__('group.subscribe')}" |
|||
onclick="Group_ajaxAskSubscribe('{$item->server|echapJS}', '{$item->node|echapJS}')"> |
|||
<i class="zmdi zmdi-bookmark-outline"></i> |
|||
</span> |
|||
{else} |
|||
<span class="control icon active" title="{$c->__('group.unsubscribe')}" |
|||
onclick="Group_ajaxAskUnsubscribe('{$item->server|echapJS}', '{$item->node|echapJS}')"> |
|||
<i class="zmdi zmdi-bookmark"></i> |
|||
</span> |
|||
{/if} |
|||
<p class="line"> |
|||
{if="$item != null"} |
|||
{if="$item->name"} |
|||
{$item->name} |
|||
{else} |
|||
{$item->node} |
|||
{/if} |
|||
{/if} |
|||
</p> |
|||
{if="$item->description"} |
|||
<p class="line" title="{$item->description|strip_tags}"> |
|||
{$item->description|strip_tags} |
|||
</p> |
|||
{else} |
|||
<p class="line">{$item->server}</p> |
|||
{/if} |
|||
</li> |
|||
</ul> |
|||
|
|||
{if="$role == 'owner'"} |
|||
<ul class="list context_menu active"> |
|||
<li onclick="Group_ajaxGetConfig('{$item->server|echapJS}', '{$item->node|echapJS}')"> |
|||
<p class="normal">{$c->__('group.configuration')}</p> |
|||
</li> |
|||
<li onclick="Group_ajaxGetSubscriptions('{$item->server|echapJS}', '{$item->node|echapJS}', true)"> |
|||
<p class="normal">{$c->__('group.subscriptions')}</p> |
|||
</li> |
|||
<li onclick="Group_ajaxDelete('{$item->server|echapJS}', '{$item->node|echapJS}')"> |
|||
<p class="normal">{$c->__('button.delete')}</p> |
|||
</li> |
|||
</ul> |
|||
{/if} |
|||
|
|||
<a onclick="Publish_ajaxTestPublish('{$item->server|echapJS}','{$item->node|echapJS}')" class="button action color"> |
|||
<i class="zmdi zmdi-edit"></i> |
|||
</a> |
@ -1,3 +1,4 @@ |
|||
<div id="group_widget" class="spin" style="background-color: #EEE;"> |
|||
{$c->prepareEmpty()} |
|||
<div id="group_widget" class="spin {$class}" style="background-color: #EEE;"> |
|||
<!--{$c->prepareEmpty()}--> |
|||
{$html} |
|||
</div> |
@ -1,7 +1,3 @@ |
|||
#menu_widget { |
|||
background-color: #EEE; |
|||
} |
|||
|
|||
#menu_widget #history { |
|||
padding-top: 2rem; |
|||
} |
@ -0,0 +1,22 @@ |
|||
<?php |
|||
|
|||
class NewsNav extends \Movim\Widget\Base |
|||
{ |
|||
public function load() |
|||
{ |
|||
|
|||
} |
|||
|
|||
public function display() |
|||
{ |
|||
$nd = new \Modl\PostnDAO; |
|||
$cd = new \Modl\ContactDAO; |
|||
|
|||
$this->view->assign('presencestxt', getPresencesTxt()); |
|||
$this->view->assign('top', $cd->getTop(6)); |
|||
$this->view->assign('blogs', $nd->getLastBlogPublic(0, 3)); |
|||
$this->view->assign('posts', $nd->getLastPublished(0, 2)); |
|||
$this->view->assign('me', $cd->get($this->user->getLogin()), true); |
|||
$this->view->assign('jid', $this->user->getLogin()); |
|||
} |
|||
} |
@ -0,0 +1,115 @@ |
|||
<ul class="list thick"> |
|||
<li> |
|||
<p class="line"> |
|||
<h4 class="gray">{$c->__('post.blog_last')}</h4> |
|||
</p> |
|||
</li> |
|||
</ul> |
|||
|
|||
<ul class="list active"> |
|||
{loop="$blogs"} |
|||
{$attachments = $value->getAttachments()} |
|||
<li |
|||
class="block condensed" |
|||
data-id="{$value->nodeid}" |
|||
data-server="{$value->origin}" |
|||
data-node="{$value->node}"> |
|||
|
|||
<p class="line" {if="isset($value->title)"}title="{$value->title}"{/if}> |
|||
{if="isset($value->title)"} |
|||
{$value->title} |
|||
{else} |
|||
{$value->node} |
|||
{/if} |
|||
</p> |
|||
<p dir="auto">{$value->contentcleaned|strip_tags|truncate:140}</p> |
|||
<p> |
|||
<a href="{$c->route('contact', $value->getContact()->jid)}"> |
|||
<i class="zmdi zmdi-account"></i> {$value->getContact()->getTrueName()} |
|||
</a> |
|||
{$count = $value->countComments()} |
|||
{if="$count > 0"} |
|||
{$count} <i class="zmdi zmdi-comment-outline"></i> |
|||
{/if} |
|||
<span class="info"> |
|||
{$value->published|strtotime|prepareDate:true,true} |
|||
</span> |
|||
</p> |
|||
</li> |
|||
{/loop} |
|||
</ul> |
|||
|
|||
{if="$c->supported('pubsub')"} |
|||
<ul class="list active on_desktop middle"> |
|||
<a href="{$c->route('blog', array($jid))}" target="_blank"> |
|||
<li> |
|||
<span class="primary icon"> |
|||
<i class="zmdi zmdi-portable-wifi"></i> |
|||
</span> |
|||
<span class="control icon"> |
|||
<i class="zmdi zmdi-chevron-right"></i> |
|||
</span> |
|||
<p class="normal line">{$c->__('hello.blog_title')}</p> |
|||
</li> |
|||
</a> |
|||
</ul> |
|||
{/if} |
|||
|
|||
<ul class="list thick"> |
|||
<li> |
|||
<p class="line"> |
|||
<h4 class="gray">{$c->__('page.communities')}</h4> |
|||
</p> |
|||
</li> |
|||
</ul> |
|||
<ul class="list active"> |
|||
{loop="$posts"} |
|||
<li |
|||
class="block condensed" |
|||
data-id="{$value->nodeid}" |
|||
data-server="{$value->origin}" |
|||
data-node="{$value->node}"> |
|||
|
|||
<p class="line" {if="isset($value->title)"}title="{$value->title}"{/if}> |
|||
{if="isset($value->title)"} |
|||
{$value->title} |
|||
{else} |
|||
{$value->node} |
|||
{/if} |
|||
</p> |
|||
<p dir="auto">{$value->contentcleaned|strip_tags|truncate:140}</p> |
|||
<p> |
|||
{$value->origin} / |
|||
<a href="{$c->route('group', [$value->origin, $value->node])}"> |
|||
<i class="zmdi zmdi-pages"></i> {$value->node} |
|||
</a> |
|||
<span class="info"> |
|||
{$value->published|strtotime|prepareDate} |
|||
</span> |
|||
</p> |
|||
</li> |
|||
{/loop} |
|||
</ul> |
|||
{if="$c->supported('pubsub')"} |
|||
<ul class="list active middle"> |
|||
<a href="{$c->route('group')}"> |
|||
<li> |
|||
<span class="primary icon"><i class="zmdi zmdi-pages"></i></span> |
|||
<span class="control icon"> |
|||
<i class="zmdi zmdi-chevron-right"></i> |
|||
</span> |
|||
<p class="normal line">{$c->__('post.discover')}</p> |
|||
</li> |
|||
</a> |
|||
</ul> |
|||
|
|||
<ul class="list thick on_desktop card"> |
|||
<li class="block"> |
|||
<p class="line">{$c->__('hello.share_title')}</p> |
|||
<p class="all">{$c->__('hello.share_text')}</p> |
|||
<p class="center"> |
|||
<a class="button" onclick="return false;" href="javascript:(function(){location.href='{$c->route('share', '\'+encodeURIComponent(location.href);')}})();"><i class="zmdi zmdi-share"></i> {$c->__('button.share')}</a></p> |
|||
</li> |
|||
</ul> |
|||
{/if} |
|||
|
@ -0,0 +1,81 @@ |
|||
<article class="block large"> |
|||
<ul class="list thick"> |
|||
<li> |
|||
<span class="primary icon gray"> |
|||
{if="$post->isMicroblog()"} |
|||
<i class="zmdi zmdi-account"></i> |
|||
{else} |
|||
<i class="zmdi zmdi-group-work"></i> |
|||
{/if} |
|||
</span> |
|||
<p class="normal">{$post->title}</p> |
|||
<p> |
|||
{if="$post->isMicroblog()"} |
|||
<a href="{$c->route('contact', $post->getContact()->jid)}"> |
|||
{$post->getContact()->getTrueName()} |
|||
</a> – |
|||
{else} |
|||
<a href="{$c->route('group', $post->origin)}"> |
|||
{$post->origin} |
|||
</a> / |
|||
<a href="{$c->route('group', [$post->origin, $post->node])}"> |
|||
{$post->node} |
|||
</a> – |
|||
{/if} |
|||
{$post->published|strtotime|prepareDate} |
|||
{if="$post->published != $post->updated"} |
|||
– <i class="zmdi zmdi-edit"></i> {$post->updated|strtotime|prepareDate:true,true} |
|||
{/if} |
|||
</p> |
|||
</li> |
|||
</ul> |
|||
<ul class="list"> |
|||
<li class="active"> |
|||
<p> |
|||
</p> |
|||
<p> |
|||
<section {if="!$post->isShort()"}class="limited"{/if}> |
|||
<content> |
|||
{if="$post->isShort() && isset($attachments.pictures)"} |
|||
{loop="$attachments.pictures"} |
|||
{if="$value.type != 'picture'"} |
|||
<a href="{$value.href}" class="alternate" target="_blank"> |
|||
<img class="big_picture" type="{$value.type}" src="{$value.href|urldecode}"/> |
|||
</a> |
|||
{/if} |
|||
{/loop} |
|||
{/if} |
|||
{if="$post->getYoutube()"} |
|||
<div class="video_embed"> |
|||
<iframe src="https://www.youtube.com/embed/{$post->getYoutube()}" frameborder="0" allowfullscreen></iframe> |
|||
</div> |
|||
{/if} |
|||
{$post->contentcleaned} |
|||
</content> |
|||
<section> |
|||
</p> |
|||
</li> |
|||
|
|||
<li> |
|||
<p class="normal"> |
|||
{$tags = $post->getTags()} |
|||
{if="isset($tags)"} |
|||
{loop="$tags"} |
|||
<a target="_blank" href="{$c->route('tag', [$value])}">#{$value}</a> |
|||
{/loop} |
|||
{/if} |
|||
</p> |
|||
<p class="normal"> |
|||
<a class="button flat gray"> |
|||
{$post->countComments()} <i class="zmdi zmdi-comment"></i> |
|||
</a> |
|||
<a class="button flat gray"> |
|||
<i class="zmdi zmdi-share"></i> |
|||
</a> |
|||
<a class="button flat oppose" href="{$c->route('post', [$post->origin, $post->node, $post->nodeid])}"> |
|||
Read more |
|||
</a> |
|||
</p> |
|||
</li> |
|||
</ul> |
|||
</article> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue