From af21a6048bc2559df8ad1dcbddb8d17728da8071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaussoin=20Timoth=C3=A9e?= Date: Tue, 2 Dec 2014 18:52:34 +0100 Subject: [PATCH] - Update the translations - New News page with two column design - Add nice looking icons for some placeholders - Fix missing JS/CSS in Avatar --- app/assets/js/movim_utils.js | 4 +- app/models/contact/ContactDAO.php | 4 +- app/models/postn/Postn.php | 31 + app/models/postn/PostnDAO.php | 20 + app/views/news.tpl | 25 +- app/widgets/About/about.tpl | 10 +- app/widgets/Avatar/Avatar.php | 78 +- app/widgets/Avatar/avatar.tpl | 3 +- app/widgets/Bookmark/Bookmark.php | 2 +- app/widgets/Bookmark/_bookmark_muc_add.tpl | 12 +- .../ContactPubsubSubscription.php | 4 +- app/widgets/Feed/_feed_empty.tpl | 2 +- app/widgets/Help/Help.php | 19 +- app/widgets/Help/help.js | 12 + app/widgets/Help/help.tpl | 95 +- app/widgets/Help/locales.ini | 20 +- app/widgets/Login/login.css | 1 + app/widgets/Media/_media_empty.tpl | 2 +- app/widgets/Menu/Menu.php | 87 ++ app/widgets/Menu/_menu_list.tpl | 24 + app/widgets/Menu/_menu_refresh.tpl | 3 + app/widgets/Menu/locales.ini | 2 + app/widgets/Menu/menu.css | 55 + app/widgets/Menu/menu.js | 26 + app/widgets/Menu/menu.tpl | 3 + app/widgets/Node/Node.php | 1 + app/widgets/Node/node.tpl | 1 + app/widgets/Notifs/Notifs.php | 9 +- app/widgets/Notifs/_notifs_from.tpl | 23 +- app/widgets/Notifs/notifs.css | 21 - app/widgets/Post/Post.php | 59 + app/widgets/Post/_post.tpl | 49 + app/widgets/Post/_post_empty.tpl | 7 + app/widgets/Post/locales.ini | 2 + app/widgets/Post/post.css | 27 + app/widgets/Post/post.tpl | 8 + app/widgets/Roster/roster.css | 2 +- app/widgets/Roster/roster.tpl | 2 +- app/widgets/Vcard4/Vcard4.php | 15 +- app/widgets/WidgetCommon/_submit_form.tpl | 10 +- linker.php | 85 +- locales/ar.po | 1145 ++++++++------- locales/be.po | 1086 ++++++++------- locales/bn.po | 1082 ++++++++------- locales/br.po | 1133 ++++++++------- locales/da.po | 1098 ++++++++------- locales/de.po | 1217 +++++++++------- locales/el.po | 1111 ++++++++------- locales/eo.po | 1104 ++++++++------- locales/es.po | 1199 +++++++++------- locales/fa.po | 1081 ++++++++------- locales/fi.po | 1139 ++++++++------- locales/fr.po | 1227 ++++++++++------- locales/gl.po | 1086 ++++++++------- locales/he.po | 1208 +++++++++------- locales/hr.po | 1081 ++++++++------- locales/id.po | 1110 ++++++++------- locales/io.po | 1081 ++++++++------- locales/it.po | 1186 +++++++++------- locales/ja.po | 1164 +++++++++------- locales/kk.po | 1081 ++++++++------- locales/lv.po | 1144 ++++++++------- locales/messages.pot | 1081 ++++++++------- locales/nl.po | 1126 ++++++++------- locales/no.po | 1087 ++++++++------- locales/oc.po | 1163 +++++++++------- locales/pt.po | 1139 ++++++++------- locales/ro.po | 1092 ++++++++------- locales/ru.po | 1181 +++++++++------- locales/uk.po | 1089 ++++++++------- locales/zh.po | 1186 +++++++++------- src/Movim/Daemon/Session.php | 2 +- system/Picture.php | 6 +- themes/movim/css/style.css | 59 +- themes/movim/css/template.css | 14 + themes/movim/img/icons/placeholder/chat.png | Bin 0 -> 4700 bytes .../movim/img/icons/placeholder/explore.png | Bin 0 -> 28318 bytes themes/movim/img/icons/placeholder/file.png | Bin 0 -> 3693 bytes themes/movim/img/icons/placeholder/media.png | Bin 0 -> 10624 bytes .../movim/img/icons/placeholder/newspaper.png | Bin 0 -> 4614 bytes themes/movim/img/icons/placeholder/plane.png | Bin 0 -> 23492 bytes 81 files changed, 19211 insertions(+), 15642 deletions(-) create mode 100644 app/widgets/Help/help.js create mode 100644 app/widgets/Menu/Menu.php create mode 100644 app/widgets/Menu/_menu_list.tpl create mode 100644 app/widgets/Menu/_menu_refresh.tpl create mode 100644 app/widgets/Menu/locales.ini create mode 100644 app/widgets/Menu/menu.css create mode 100644 app/widgets/Menu/menu.js create mode 100644 app/widgets/Menu/menu.tpl create mode 100644 app/widgets/Post/Post.php create mode 100644 app/widgets/Post/_post.tpl create mode 100644 app/widgets/Post/_post_empty.tpl create mode 100644 app/widgets/Post/locales.ini create mode 100644 app/widgets/Post/post.css create mode 100644 app/widgets/Post/post.tpl create mode 100644 themes/movim/img/icons/placeholder/chat.png create mode 100644 themes/movim/img/icons/placeholder/explore.png create mode 100644 themes/movim/img/icons/placeholder/file.png create mode 100644 themes/movim/img/icons/placeholder/media.png create mode 100644 themes/movim/img/icons/placeholder/newspaper.png create mode 100644 themes/movim/img/icons/placeholder/plane.png diff --git a/app/assets/js/movim_utils.js b/app/assets/js/movim_utils.js index b62ed6121..58c1ea453 100755 --- a/app/assets/js/movim_utils.js +++ b/app/assets/js/movim_utils.js @@ -79,8 +79,8 @@ function movim_parse_form(formname) { data.set(form.elements[i].name, form.elements[i].value); } - } - return data; + } + return data; } /** diff --git a/app/models/contact/ContactDAO.php b/app/models/contact/ContactDAO.php index 12e0aaa88..ea782c8db 100755 --- a/app/models/contact/ContactDAO.php +++ b/app/models/contact/ContactDAO.php @@ -7,12 +7,14 @@ class ContactDAO extends SQL { parent::__construct(); } - function get($jid) { + function get($jid = null) { $this->_sql = ' select *, privacy.value as privacy from contact left outer join privacy on contact.jid = privacy.pkey where jid = :jid'; + + if($jid == null) $jid = $this->_user; $this->prepare( 'Contact', diff --git a/app/models/postn/Postn.php b/app/models/postn/Postn.php index b1281b57f..954244258 100755 --- a/app/models/postn/Postn.php +++ b/app/models/postn/Postn.php @@ -220,6 +220,37 @@ class Postn extends Model { return $contentimg; } + public function getAttachements() + { + $attachements = null; + + if(isset($this->links)) { + $attachements = array('pictures' => array(), 'files' => array(), 'links' => array()); + + $links = unserialize($this->links); + foreach($links as $l) { + switch($l['rel']) { + case 'enclosure' : + if(in_array($l['type'], array('image/jpeg', 'image/png', 'image/jpg'))) { + array_push($attachements['pictures'], $l); + } else { + array_push($attachements['files'], $l); + } + break; + case 'alternate' : + array_push($attachements['links'], array('href' => $l['href'], 'url' => parse_url($l['href']))); + break; + } + } + } + + if(empty($attachements['pictures'])) unset($attachements['pictures']); + if(empty($attachements['files'])) unset($attachements['files']); + if(empty($attachements['links'])) unset($attachements['links']); + + return $attachements; + } + public function getPlace() { if(isset($this->lat, $this->lon) && $this->lat != '' && $this->lon != '') { return true; diff --git a/app/models/postn/PostnDAO.php b/app/models/postn/PostnDAO.php index 03d159840..0b7e89f28 100755 --- a/app/models/postn/PostnDAO.php +++ b/app/models/postn/PostnDAO.php @@ -220,6 +220,26 @@ class PostnDAO extends SQL { return $this->run('ContactPostn'); } + + function getItem($id) { + $this->_sql = ' + select *, postn.aid, privacy.value as privacy from postn + left outer join contact on postn.aid = contact.jid + left outer join privacy on postn.nodeid = privacy.pkey + where postn.session = :session + and postn.nodeid = :nodeid + order by postn.published desc'; + + $this->prepare( + 'Postn', + array( + 'session' => $this->_user, + 'nodeid' => $id + ) + ); + + return $this->run('ContactPostn', 'item'); + } function getAllPosts($jid, $limitf = false, $limitr = false) { $this->_sql = ' diff --git a/app/views/news.tpl b/app/views/news.tpl index 2f50c3e30..e878b27c5 100755 --- a/app/views/news.tpl +++ b/app/views/news.tpl @@ -3,20 +3,31 @@ widget('Presence');?> widget('Chat');?> widget('VisioExt');?> - -
+ +
widget('Profile');?> widget('Notifs');?> - widget('Bookmark');?> + widget('Bookmark'); ?>
+ widget('Menu');?> + widget('Post');?> +
+ + -
- widget('News');?> -
+ -
+ widget('News');?> + + + + diff --git a/app/widgets/About/about.tpl b/app/widgets/About/about.tpl index 93982f4ea..08a490f30 100755 --- a/app/widgets/About/about.tpl +++ b/app/widgets/About/about.tpl @@ -4,7 +4,7 @@

{$c->__('info')} GNU Affero General Public License v3.

-

{$c->__('title.thanks')}

+

{$c->__('title.thanks')}

{$c->__('title.developers')}
Jaussoin Timothée aka edhelas
Ho Christine aka nodpounod
@@ -77,8 +77,8 @@

{$c->__('title.software')}

-
Database Library
Modl - Movim DB Layer launchpad.net/modl under AGPLv3
-
XMPP Library
Moxl - Movim XMPP Library launchpad.net/moxl under AGPLv3
+
Database Library
Modl - Movim DB Layer - GitHub Modl under AGPLv3
+
XMPP Library
Moxl - Movim XMPP Library - GitHub Moxl under AGPLv3

@@ -87,9 +87,9 @@

{$c->__('title.resources')}

-
Icons
Famfamfam www.famfamfam.com under CC BY 3.0
-
Icomoon by Keyamoon under CC BY 3.0
+
Icons
Icomoon by Keyamoon under CC BY 3.0
FontAwesome by Dave Gandy under CC BY 3.0
+
Boyan Kostov boyankostov.com Free for commercial use

{$c->__('title.api')}

diff --git a/app/widgets/Avatar/Avatar.php b/app/widgets/Avatar/Avatar.php index a7b29f942..08e2ae7b0 100755 --- a/app/widgets/Avatar/Avatar.php +++ b/app/widgets/Avatar/Avatar.php @@ -22,37 +22,37 @@ class Avatar extends WidgetBase { function load() { - $this->registerEvent('myavatarvalid', 'onAvatarPublished'); - $this->registerEvent('myavatarinvalid', 'onAvatarNotPublished'); - $this->registerEvent('myvcard', 'onMyAvatar'); - $this->addcss('avatar.css'); - $this->addjs('avatar.js'); + $this->addjs('avatar.js'); - $cd = new \modl\ContactDAO(); - $me = $cd->get($this->user->getLogin()); - - $p = new Picture; - if(!$p->get($this->user->getLogin())) { - $this->view->assign( - 'getavatar', - $this->call('ajaxGetAvatar') - ); - $this->view->assign('form', $this->prepareForm(new \modl\Contact())); - } else { - $this->view->assign('getavatar', ''); - $this->view->assign('form', $this->prepareForm($me)); - } + $this->registerEvent('avatar_get_handle', 'onMyAvatar'); + $this->registerEvent('avatar_set_handle', 'onMyAvatar'); + $this->registerEvent('avatar_set_errorfeaturenotimplemented', 'onMyAvatarError'); + $this->registerEvent('avatar_set_errorbadrequest', 'onMyAvatarError'); + $this->registerEvent('avatar_set_errornotallowed', 'onMyAvatarError'); } - function onMyAvatar($c) { - $html = $this->prepareForm($c); + function onMyAvatar($me) + { + $me = $packet->content; + $html = $this->prepareForm($me); + + RPC::call('movim_fill', 'avatar_form', $html); + Notification::appendNotification($this->__('avatar.updated'), 'success'); + } + + function onMyAvatarError() + { + $cd = new \modl\ContactDAO(); + $me = $cd->get(); + $html = $this->prepareForm($me); RPC::call('movim_fill', 'avatar_form', $html); - RPC::commit(); + Notification::appendNotification($this->__('avatar.not_updated'), 'error'); } - function prepareForm($me) { + function prepareForm($me) + { $avatarform = $this->tpl(); $p = new Picture; @@ -69,20 +69,8 @@ class Avatar extends WidgetBase return $avatarform->draw('_avatar_form', true); } - function onAvatarPublished() + function ajaxGetAvatar() { - RPC::call('movim_button_reset', '#avatarvalidate'); - Notification::appendNotification($this->__('avatar.updated'), 'success'); - RPC::commit(); - } - - function onAvatarNotPublished() - { - Notification::appendNotification($this->__('avatar.not_updated'), 'error'); - RPC::commit(); - } - - function ajaxGetAvatar() { $r = new Get; $r->setTo($this->user->getLogin()) ->setMe() @@ -98,4 +86,22 @@ class Avatar extends WidgetBase $r = new Set; $r->setData($avatar->photobin->value)->request(); } + + function display() + { + $cd = new \modl\ContactDAO(); + $me = $cd->get(); + + $p = new Picture; + if(!$p->get($this->user->getLogin())) { + $this->view->assign( + 'getavatar', + $this->call('ajaxGetAvatar') + ); + $this->view->assign('form', $this->prepareForm(new \modl\Contact())); + } else { + $this->view->assign('getavatar', ''); + $this->view->assign('form', $this->prepareForm($me)); + } + } } diff --git a/app/widgets/Avatar/avatar.tpl b/app/widgets/Avatar/avatar.tpl index b0e4d404a..55b37442a 100755 --- a/app/widgets/Avatar/avatar.tpl +++ b/app/widgets/Avatar/avatar.tpl @@ -3,7 +3,8 @@ + }); +
{$form}
diff --git a/app/widgets/Bookmark/Bookmark.php b/app/widgets/Bookmark/Bookmark.php index 4daa78de4..60b6edba0 100755 --- a/app/widgets/Bookmark/Bookmark.php +++ b/app/widgets/Bookmark/Bookmark.php @@ -203,7 +203,7 @@ class Bookmark extends WidgetBase 'autojoin' => $form['autojoin'], 'nick' => $form['nick'], 'jid' => $form['jid']); - + movim_log(serialize($item)); $this->ajaxSetBookmark($item); } } diff --git a/app/widgets/Bookmark/_bookmark_muc_add.tpl b/app/widgets/Bookmark/_bookmark_muc_add.tpl index 33f409223..ae0ae4053 100755 --- a/app/widgets/Bookmark/_bookmark_muc_add.tpl +++ b/app/widgets/Bookmark/_bookmark_muc_add.tpl @@ -5,7 +5,7 @@
- +
@@ -13,6 +13,7 @@
+ diff --git a/app/widgets/ContactPubsubSubscription/ContactPubsubSubscription.php b/app/widgets/ContactPubsubSubscription/ContactPubsubSubscription.php index df0e1c21f..ee388ac1e 100755 --- a/app/widgets/ContactPubsubSubscription/ContactPubsubSubscription.php +++ b/app/widgets/ContactPubsubSubscription/ContactPubsubSubscription.php @@ -40,7 +40,9 @@ class ContactPubsubSubscription extends WidgetBase $html = ''; diff --git a/app/widgets/Feed/_feed_empty.tpl b/app/widgets/Feed/_feed_empty.tpl index 4d3ebf581..ddc2e6680 100755 --- a/app/widgets/Feed/_feed_empty.tpl +++ b/app/widgets/Feed/_feed_empty.tpl @@ -1,4 +1,4 @@ -
+

{$c->__('feed.empty_title')}

{$c->__('feed.empty')}

diff --git a/app/widgets/Help/Help.php b/app/widgets/Help/Help.php index ac1bac465..479abff52 100755 --- a/app/widgets/Help/Help.php +++ b/app/widgets/Help/Help.php @@ -22,28 +22,11 @@ class Help extends WidgetBase { function load() { + $this->addjs('help.js'); } function display() { - $this->view->assign('missing_info1', - $this->__( - 'missing.info1', - '', - '')); - $this->view->assign('missing_info2', - $this->__( - 'missing.info2', - '', - '')); - $this->view->assign('faq_info1', - $this->__( - 'faq.info1', - '', - '', - 'movim@conference.movim.eu', - '', - '')); } } diff --git a/app/widgets/Help/help.js b/app/widgets/Help/help.js new file mode 100644 index 000000000..8653a27d9 --- /dev/null +++ b/app/widgets/Help/help.js @@ -0,0 +1,12 @@ +var Help = { + joinChatroom : function() { + var hash = new H(); + hash.set('jid', 'movim@conference.movim.eu'); + hash.set('name', 'Movim Chatroom'); + hash.set('nick', false); + hash.set('autojoin', 0); + + Bookmark_ajaxBookmarkMucAdd(hash); + Bookmark_ajaxBookmarkMucJoin('movim@conference.movim.eu', ''); + } +} diff --git a/app/widgets/Help/help.tpl b/app/widgets/Help/help.tpl index 1d6ed35ff..9fa6e4062 100755 --- a/app/widgets/Help/help.tpl +++ b/app/widgets/Help/help.tpl @@ -1,39 +1,60 @@ -
-

{$c->__('page.help')}

+
+

{$c->__('page.help')}

+ +
+
+

{$c->__('wiki.question')}

+ + + {$c->__('wiki.button')} + +
+
+ +
+
+

{$c->__('chatroom.question')}

+ + + {$c->__('chatroom.button')} + +
+
+ +
+
+

{$c->__('ml.question')}

+ + + {$c->__('ml.button')} + +
+
+ +
+ +

{$c->__('help.faq')}

-

{$c->__('what.title')}

- -

{$c->__('what.info1', '', '')}

- -

{$c->__('banner.title')}

-
-
-
-
-
-
-
- -

{$c->__('banner.info1')}

- -

-

    -
  • {$c->__('banner.white')}
  • -
  • {$c->__('banner.green')}
  • -
  • {$c->__('banner.orange')}
  • -
  • {$c->__('banner.red')}
  • -
  • {$c->__('banner.black')}
  • -
-

- -

{$c->__('missing.title')}

- -

{$missing_info1}

- -

{$missing_info2}

- -

{$c->__('faq.title')}

- -

{$faq_info1}

- +
+

{$c->__('banner.title')}

+
+
+
+
+
+
+
+ +

{$c->__('banner.info1')}

+ +

+

    +
  • {$c->__('banner.white')}
  • +
  • {$c->__('banner.green')}
  • +
  • {$c->__('banner.orange')}
  • +
  • {$c->__('banner.red')}
  • +
  • {$c->__('banner.black')}
  • +
+

+
diff --git a/app/widgets/Help/locales.ini b/app/widgets/Help/locales.ini index 845eba528..cd01eb6e8 100755 --- a/app/widgets/Help/locales.ini +++ b/app/widgets/Help/locales.ini @@ -1,5 +1,4 @@ -what.title = 'What is Movim?' -what.info1 = "Visit the page %s What is Movim ? %s to know more about the project, its aims and understand how it works." +help.faq = 'Frequently Asked Questions' [banners] banner.title = 'What do the little banners refer to ?' @@ -10,11 +9,14 @@ banner.orange = 'Orange, all your contact list can see your information' banner.red = 'Red, everybody in the XMPP network can see your information' banner.black = 'Black, the whole Internet can see your information' -[missings] -missing.title = "Some features are missing/I can't do everything I used to do on other social networks" -missing.info1 = "Although Movim is evolving fast, many (many) features are missing. Be patient ;). You can have a look %sat next versions's roadmaps%s to know if the one you want is on its way." -missing.info2 = "Don't forget that Movim is an open source project, a helping hand is always welcome (see %sCan I participate%s)" +[wiki] +wiki.question = 'Looking for some documentation ?' +wiki.button = 'Read the Wiki' -[faq] -faq.title = "I can't find the answer to my question here" -faq.info1 = "Go to the %sto the Frequently Asked Questions%s or come ask your question on the official chatroom %s or via our mailing-list (%ssee the dedicated page%s)." +[ml] +ml.question = 'Talk with us by email ?' +ml.button = 'Join the Mailing List' + +[chatroom] +chatroom.question = 'Chat with the team ?' +chatroom.button = 'Join the Chatroom' diff --git a/app/widgets/Login/login.css b/app/widgets/Login/login.css index db7ef4116..aa72cb5e0 100755 --- a/app/widgets/Login/login.css +++ b/app/widgets/Login/login.css @@ -151,6 +151,7 @@ body { #loginpage #sessions ul li img { height: 3em; float: left; + border-radius: 0.2em; } #loginpage #sessions ul li span { diff --git a/app/widgets/Media/_media_empty.tpl b/app/widgets/Media/_media_empty.tpl index 62efec42a..530f1bd19 100644 --- a/app/widgets/Media/_media_empty.tpl +++ b/app/widgets/Media/_media_empty.tpl @@ -1,4 +1,4 @@ -
+

{$c->__('error.whoops')}

{$c->__('error.media_not_found')} diff --git a/app/widgets/Menu/Menu.php b/app/widgets/Menu/Menu.php new file mode 100644 index 000000000..5654aa4e0 --- /dev/null +++ b/app/widgets/Menu/Menu.php @@ -0,0 +1,87 @@ + + * + * @version 1.0 + * @date 1 december 2014 + * + * Copyright (C)2014 MOVIM project + * + * See COPYING for licensing information. + */ + +class Menu extends WidgetCommon +{ + private $_paging = 15; + + function load() + { + $this->registerEvent('post', 'onStream'); + $this->registerEvent('stream', 'onStream'); + + $this->addcss('menu.css'); + $this->addjs('menu.js'); + } + + function onStream() + { + $pd = new \Modl\PostnDAO; + $count = $pd->getCountSince(Cache::c('since')); + + if($count > 0) { + $view = $this->tpl(); + $view->assign('count', $count); + $view->assign('refresh', $this->call('ajaxGetMenuList', "''", "''", 0)); + + RPC::call('movim_posts_unread', $count); + RPC::call('movim_fill', 'menu_refresh', $view->draw('_menu_refresh', true)); + } + } + + function ajaxGetMenuList($server = null, $node = null, $page = 0) + { + $html = $this->prepareMenuList($server, $node, $page); + + if($page > 0) { + RPC::call('movim_append', 'menu_widget', $html); + } else { + RPC::call('movim_fill', 'menu_widget', $html); + } + RPC::call('Menu.refresh'); + } + + function prepareMenuList($server = null, $node = null, $page = 0) + { + $view = $this->tpl(); + $pd = new \Modl\PostnDAO; + + Cache::c('since', date(DATE_ISO8601, strtotime($pd->getLastDate()))); + + $next = $page + 1; + + if($server == null || $node == null) { + $view->assign('history', $this->call('ajaxGetMenuList', "''", "''", $next)); + $items = $pd->getNews($page*$this->_paging, $this->_paging); + } else { + $view->assign('history', $this->call('ajaxGetMenuList', '"'.$server.'"', '"'.$node.'"', $next)); + $items = $pd->getNode($server, $node, $page*$this->_paging, $this->_paging); + } + + $view->assign('items', $items); + $view->assign('page', $page); + + return $view->draw('_menu_list', true); + } + + function display() + { + } +} diff --git a/app/widgets/Menu/_menu_list.tpl b/app/widgets/Menu/_menu_list.tpl new file mode 100644 index 000000000..55fc0312b --- /dev/null +++ b/app/widgets/Menu/_menu_list.tpl @@ -0,0 +1,24 @@ +

+{if="$items"} +
    + {loop="$items"} +
  • + {$value->node} + {if="current(explode('.', $value->jid)) == 'nsfw'"} + NSFW + {/if} +

    {$value->title}

    + {$value->published|strtotime|prepareDate} +
  • + {/loop} + +
  • + {$c->__('post.older')} +
  • +
+{elseif="$page == 0"} +
+

{$c->__('menu.empty_title')}

+

{$c->__('menu.empty')}

+
+{/if} diff --git a/app/widgets/Menu/_menu_refresh.tpl b/app/widgets/Menu/_menu_refresh.tpl new file mode 100644 index 000000000..d26129566 --- /dev/null +++ b/app/widgets/Menu/_menu_refresh.tpl @@ -0,0 +1,3 @@ + + {$c->__('post.new_items', $count)} - {$c->__('button.refresh')} + diff --git a/app/widgets/Menu/locales.ini b/app/widgets/Menu/locales.ini new file mode 100644 index 000000000..97a1245b6 --- /dev/null +++ b/app/widgets/Menu/locales.ini @@ -0,0 +1,2 @@ +menu.empty_title = 'Hello' +menu.empty = 'Welcome on your news feed, here you will see all the posts published in the groups you have subscribed.' diff --git a/app/widgets/Menu/menu.css b/app/widgets/Menu/menu.css new file mode 100644 index 000000000..c8c8c8c98 --- /dev/null +++ b/app/widgets/Menu/menu.css @@ -0,0 +1,55 @@ +#menu_widget { + border-right: 1px solid #DDD; +} + +#menu_widget #menu_refresh { + text-align: center; + font-size: 1.2em; +} + +#menu_widget #menu_refresh a { + margin: 1em; +} + +#menu_widget ul { + list-style-type: none; +} + +#menu_widget ul li { + min-height: 3em; + border-bottom: 1px solid #DDD; +} + +#menu_widget ul li.active, +#menu_widget ul li:not(.older):hover { + background-color: rgba(0, 0, 0, 0.05); + cursor: pointer; +} + +#menu_widget ul li h1 { + font-size: 1.2em; +} + +#menu_widget ul li span.tag { + float: right; + background-color: gray; + color: white; + border-radius: 0.2em; + font-weight: bold; + padding: 0.2em 0.5em; + font-size: 0.8em; + clear: right; + margin-bottom: 0.3em; +} + +#menu_widget ul li.older { + border-radius: 0; + margin-bottom: 0; +} + +#main { + background-color: black; + height: 100%; + position: absolute; + width: 100%; +} diff --git a/app/widgets/Menu/menu.js b/app/widgets/Menu/menu.js new file mode 100644 index 000000000..3bd9db7e7 --- /dev/null +++ b/app/widgets/Menu/menu.js @@ -0,0 +1,26 @@ +var Menu = { + refresh: function() { + var items = document.querySelectorAll('#menu_widget ul li'); + + var i = 0; + while(i < items.length -1) + { + items[i].onclick = function(e) { + Post_ajaxGetPost(this.dataset.id); + Menu.reset(items); + movim_add_class(this, 'active'); + } + i++; + } + }, + + reset: function(list) { + for(i = 0; i < list.length; i++) { + movim_remove_class(list[i], 'active'); + } + } +} + +MovimWebsocket.attach(function() { + Menu.refresh(); +}); diff --git a/app/widgets/Menu/menu.tpl b/app/widgets/Menu/menu.tpl new file mode 100644 index 000000000..8aa4cdecb --- /dev/null +++ b/app/widgets/Menu/menu.tpl @@ -0,0 +1,3 @@ + diff --git a/app/widgets/Node/Node.php b/app/widgets/Node/Node.php index 5bcadc1c5..8af824087 100755 --- a/app/widgets/Node/Node.php +++ b/app/widgets/Node/Node.php @@ -47,6 +47,7 @@ class Node extends WidgetCommon if(isset($_GET['s']) && isset($_GET['n'])) { $this->view->assign('server', $_GET['s']); $this->view->assign('node', $_GET['n']); + $this->view->assign('refresh', $this->call('ajaxGetItems', "'".$_GET['s']."'", "'".$_GET['n']."'")); $this->view->assign('getaffiliations', $this->call('ajaxGetAffiliations', "'".$_GET['s']."'", "'".$_GET['n']."'")); $this->view->assign('getmetadata', $this->call('ajaxGetMetadata', "'".$_GET['s']."'", "'".$_GET['n']."'")); $this->view->assign('hash', md5($_GET['s'].$_GET['n'])); diff --git a/app/widgets/Node/node.tpl b/app/widgets/Node/node.tpl index 91f534ea4..01ef2440b 100755 --- a/app/widgets/Node/node.tpl +++ b/app/widgets/Node/node.tpl @@ -27,6 +27,7 @@ +
diff --git a/app/widgets/Roster/roster.css b/app/widgets/Roster/roster.css index af848fbf3..6c67e5dad 100755 --- a/app/widgets/Roster/roster.css +++ b/app/widgets/Roster/roster.css @@ -40,7 +40,7 @@ background-color: #454545; height: 2em; width: calc(100% - 1em); - margin: 0.5em; + margin: 0 0.5em; border-radius: 0.2em; } diff --git a/app/widgets/Roster/roster.tpl b/app/widgets/Roster/roster.tpl index 8c30946bd..48ea72e03 100644 --- a/app/widgets/Roster/roster.tpl +++ b/app/widgets/Roster/roster.tpl @@ -5,7 +5,7 @@ {$c->__('roster.no_contacts')}

- {$c->__('page.explore')} + {$c->__('page.explore')}
diff --git a/app/widgets/Vcard4/Vcard4.php b/app/widgets/Vcard4/Vcard4.php index 5e806fdb8..b0ca49d37 100755 --- a/app/widgets/Vcard4/Vcard4.php +++ b/app/widgets/Vcard4/Vcard4.php @@ -22,20 +22,16 @@ class Vcard4 extends WidgetBase { function load() { - $this->registerEvent('myvcard4valid', 'onMyVcard4Received'); - $this->registerEvent('myvcard4invalid', 'onMyVcard4NotReceived'); - $this->registerEvent('myvcard', 'onMyVcard4'); + $this->registerEvent('vcard4_get_handle', 'onMyVcard4'); + $this->registerEvent('vcard4_set_handle', 'onMyVcard4'); } function display() { $cd = new \Modl\ContactDAO(); - $me = $cd->get($this->user->getLogin()); + $me = $cd->get(); - $this->view->assign( - 'getvcard', - $this->call('ajaxGetVcard') - ); + $this->view->assign('getvcard', $this->call('ajaxGetVcard')); if($me == null) { $this->view->assign('form', $this->prepareForm(new \modl\Contact())); @@ -92,7 +88,8 @@ class Vcard4 extends WidgetBase return $vcardform->draw('_vcard4_form', true); } - function onMyVcard4($c) { + function onMyVcard4($packet) { + $c = $packet->content; $html = $this->prepareForm($c); Notification::appendNotification($this->__('vcard.updated'), 'success'); diff --git a/app/widgets/WidgetCommon/_submit_form.tpl b/app/widgets/WidgetCommon/_submit_form.tpl index 8804a637f..f02eafe3d 100755 --- a/app/widgets/WidgetCommon/_submit_form.tpl +++ b/app/widgets/WidgetCommon/_submit_form.tpl @@ -36,13 +36,15 @@ {/loop} {if="$gallery == null"} -
+

{$c->__('error.whoops')}

-

+

{$c->__('error.media_not_found')}
- {$c->__('error.media_ask_upload')}

- {$c->__('page.media')} + {$c->__('error.media_ask_upload')} +

+ {$c->__('page.media')} +


{/if}