Browse Source

- Add a new design for the lists

- Refresh the old vcard-temp if no Contact is detected in the database
- Fix the Post publishing (when the ACK is received)
- Add a counter for the invitations
- Fix some minor colors for the new testing theme
- Move the chat button on the contact page
- Fix some paddings (in the header and on some pages)
pull/16/head
Jaussoin Timothée 11 years ago
parent
commit
92e930d0b6
  1. 4
      app/models/contact/ContactDAO.php
  2. 4
      app/widgets/Chat/_chat_messages.tpl
  3. 2
      app/widgets/Chats/chats.tpl
  4. 24
      app/widgets/Contact/Contact.php
  5. 6
      app/widgets/Contact/_contact_edit.tpl
  6. 10
      app/widgets/Help/help.tpl
  7. 12
      app/widgets/Menu/Menu.php
  8. 2
      app/widgets/Menu/_menu_list.tpl
  9. 5
      app/widgets/Notifs/_notifs_from.tpl
  10. 1
      app/widgets/Notifs/notifs.css
  11. 2
      app/widgets/Post/Post.php
  12. 2
      app/widgets/Rooms/_rooms.tpl
  13. 2
      app/widgets/Roster/roster.tpl
  14. 2
      app/widgets/Subscribe/subscribe.tpl
  15. 2
      themes/material/css/article.css
  16. 7
      themes/material/css/color.css
  17. 9
      themes/material/css/form.css
  18. 17
      themes/material/css/style.css

4
app/models/contact/ContactDAO.php

@ -7,7 +7,7 @@ class ContactDAO extends SQL {
parent::__construct();
}
function get($jid = null) {
function get($jid = null, $empty = false) {
$this->_sql = '
select *, privacy.value as privacy from contact
left outer join privacy
@ -26,7 +26,7 @@ class ContactDAO extends SQL {
$contact = $this->run('Contact', 'item');
// If we cannot find the contact
if($contact == null) {
if($contact == null && $empty == false) {
$contact = new Contact;
$contact->jid = $jid;
return $contact;

4
app/widgets/Chat/_chat_messages.tpl

@ -5,9 +5,9 @@
<span class="icon bubble {if="$contact->updated == null && !array_key_exists($value->resource, $contacts)"}color {$value->resource|stringToColor}{/if}">
{if="$value->jidfrom == $jid"}
{if="$contact->updated != null"}
<img src="{$contact->getPhoto('s')}">
<img src="{$contact->getPhoto('s', $jid)}">
{elseif="array_key_exists($value->resource, $contacts)"}
<img src="{$contacts[$value->resource]->getPhoto('s')}">
<img src="{$contacts[$value->resource]->getPhoto('s', $jid)}">
{else}
{$value->resource|firstLetterCapitalize}
{/if}

2
app/widgets/Chats/chats.tpl

@ -1,3 +1,3 @@
<ul id="chats_widget_list" class="thick active divided">
<ul id="chats_widget_list" class="thick active divided spaced">
{$list}
</ul>

24
app/widgets/Contact/Contact.php

@ -1,12 +1,20 @@
<?php
use Moxl\Xec\Action\Roster\UpdateItem;
use Moxl\Xec\Action\Vcard\Get;
class Contact extends WidgetCommon
{
function load()
{
$this->registerEvent('roster_updateitem_handle', 'onContactEdited');
$this->registerEvent('vcard_get_handle', 'onVcardReceived');
}
public function onVcardReceived($packet)
{
$contact = $packet->content;
$this->ajaxGetContact($contact->jid);
}
public function onContactEdited($packet)
@ -40,6 +48,12 @@ class Contact extends WidgetCommon
->request();
}
function ajaxRefreshVcard($jid)
{
$r = new Get;
$r->setTo(echapJid($jid))->request();
}
function ajaxEditContact($jid)
{
$rd = new \Modl\RosterLinkDAO();
@ -131,7 +145,15 @@ class Contact extends WidgetCommon
function prepareContact($jid)
{
$cd = new \Modl\ContactDAO;
$c = $cd->get($jid);
$c = $cd->get($jid, true);
if($c == null) {
$c = new \Modl\Contact;
$c->jid = $jid;
$this->ajaxRefreshVcard($jid);
}
$cr = $cd->getRosterItem($jid);
$view = $this->tpl();

6
app/widgets/Contact/_contact_edit.tpl

@ -7,7 +7,11 @@
id="alias"
class="tiny"
placeholder="{$c->__('edit.alias')}"
value="{$contact->rostername}"/>
{if="$contact->rostername"}
value="{$contact->rostername}"
{else}
value="{$contact->jid}"
{/if}"/>
<label for="alias">{$c->__('edit.alias')}</label>
</div>
<div>

10
app/widgets/Help/help.tpl

@ -52,23 +52,23 @@
<ul class="thin">
<li>
<span class="color icon bubble brown small"></span>
{$c->__('banner.white')}
<span>{$c->__('banner.white')}</span>
</li>
<li>
<span class="color icon bubble green small"></span>
{$c->__('banner.green')}
<span>{$c->__('banner.green')}</span>
</li>
<li>
<span class="color icon bubble orange small"></span>
{$c->__('banner.orange')}
<span>{$c->__('banner.orange')}</span>
</li>
<li>
<span class="color icon bubble red small"></span>
{$c->__('banner.red')}
<span>{$c->__('banner.red')}</span>
</li>
<li>
<span class="color icon bubble black small"></span>
{$c->__('banner.black')}
<span>{$c->__('banner.black')}</span>
</li>
</ul>
</section>

12
app/widgets/Menu/Menu.php

@ -9,7 +9,6 @@ class Menu extends WidgetCommon
function load()
{
$this->registerEvent('post', 'onPost');
$this->registerEvent('pubsub_postpublish_handle', 'onPublish');
$this->addjs('menu.js');
}
@ -23,12 +22,7 @@ class Menu extends WidgetCommon
RPC::call('movim_fill', 'menu_refresh', $view->draw('_menu_refresh', true));
}
function onPublish($packet)
{
$this->onPost($packet, false);
}
function onPost($packet, $notify = true)
function onPost($packet)
{
$pd = new \Modl\PostnDAO;
$count = $pd->getCountSince(Cache::c('since'));
@ -45,9 +39,9 @@ class Menu extends WidgetCommon
$title = $post->title;
}
if($notify) Notification::append('news', $contact->getTrueName(), $title, $contact->getPhoto('s'), 2);
if(!$post->isMine()) Notification::append('news', $contact->getTrueName(), $title, $contact->getPhoto('s'), 2);
} else {
if($notify) Notification::append('news', $post->title, $post->node, null, 2);
Notification::append('news', $post->title, $post->node, null, 2);
}
$this->onStream($count);

2
app/widgets/Menu/_menu_list.tpl

@ -1,7 +1,7 @@
{if="$items"}
{if="$page == 0"}
<div id="menu_refresh"></div>
<ul class="thick active divided" id="menu_wrapper">
<ul class="thick active divided spaced" id="menu_wrapper">
{/if}
{loop="$items"}

5
app/widgets/Notifs/_notifs_from.tpl

@ -1,6 +1,9 @@
<ul class="active all">
{if="$invitations"}
<li class="subheader">{$c->__('notifs.title')}</li>
<li class="subheader">
{$c->__('notifs.title')}
<span class="info">{$invitations|count}</span>
</li>
{/if}
{loop="$invitations"}
{if="isset($value)"}

1
app/widgets/Notifs/notifs.css

@ -1,5 +1,4 @@
#notifs_widget li:not(:first-child) {
margin-bottom: 0.5em;
display: list-item;
}

2
app/widgets/Post/Post.php

@ -31,7 +31,7 @@ class Post extends WidgetCommon
$this->registerEvent('pubsub_postpublish_handle', 'onPublish');
}
function onPublish($packet)
function onPublish()
{
Notification::append(false, $this->__('post.published'));
$this->ajaxClear();

2
app/widgets/Rooms/_rooms.tpl

@ -1,4 +1,4 @@
<ul class="thick divided active">
<ul class="thick divided spaced active">
<li class="subheader">
{$c->__('chatrooms.title')}
</li>

2
app/widgets/Roster/roster.tpl

@ -48,7 +48,7 @@
</li>
</div>
</ul>
<br />
<a onclick="Roster_ajaxDisplaySearch()" class="button action color">
<i class="md md-person-add"></i>
</a>

2
app/widgets/Subscribe/subscribe.tpl

@ -6,7 +6,7 @@
</li>
</ul>
<ul class="thick active">
<ul class="thick active divided spaced">
{loop="$servers"}
<li
class="block condensed"

2
themes/material/css/article.css

@ -37,7 +37,7 @@ article section p {
article section content ul li,
article section content ol li {
font-size: 1.75rem;
font-size: 2rem;
line-height: 3rem;
padding-left: 2rem;
list-style-position: inside;

7
themes/material/css/color.css

@ -1,6 +1,7 @@
/* Color */
*.divided > *:not(:last-child) {
*.divided > *:not(:last-child),
*.divided.spaced > *:not(:last-child):after {
border-color: rgba(0, 0, 0, 0.12);
}
@ -17,6 +18,7 @@
border-color: rgba(255, 255, 255, 0.05);
}
main > header a,
.color input {
color: white;
}
@ -108,7 +110,7 @@ input[type=button],
a:not(.classic) { color: #FF5722; border-color: #FF5722; }
form > div .checkbox:before { background-color: #FFE0B2; }
form > div .checkbox > input[type="checkbox"]:checked + label { background-color: #FF9800; }
form > div .checkbox > input[type="checkbox"]:checked + label { background-color: #FF5722; }
.button.color,
ul li span.counter,
@ -127,6 +129,7 @@ form textarea:focus:not(:invalid) {
border-bottom-color: #FF5722;
}
/*
form input:focus:valid {
border-bottom: 2px solid #4CAF50;

9
themes/material/css/form.css

@ -312,8 +312,17 @@ li.action div.action .button {
display: block;
}
header.big ~ .button.action {
bottom: auto;
top: 16rem;
}
@media screen and (min-width: 1024px) {
main > section > div:first-child:nth-last-child(2) .button.action {
right: calc(70% + 3rem);
}
header.big ~ .button.action {
top: 23rem;
}
}

17
themes/material/css/style.css

@ -62,7 +62,7 @@ body > script {
display: none;
}
a, a.link, a.visited {
a, a:link, a:visited {
text-decoration: none;
}
@ -231,6 +231,7 @@ main > header > div {
display: inline-block;
overflow: hidden;
box-sizing: border-box;
padding-right: 1rem;
}
main > header > div > * {
@ -241,6 +242,7 @@ main > header > div > * {
main > header > div > ul.active {
float: right;
margin-right: -1rem;
}
main > header > div > ul.active li {
@ -760,11 +762,22 @@ dl dd {
/* Divided */
*.divided > *:not(:last-child) {
*.divided:not(.spaced) > *:not(:last-child),
*.divided.spaced > *:not(:last-child).subheader,
*.divided.spaced > *:not(:last-child):not(.subheader):after {
border-bottom-width: 1px;
border-bottom-style: solid;
}
*.divided.spaced > *:not(:last-child):after {
position: absolute;
right: 0;
bottom: 0rem;
content: "";
display: block;
width: calc(100% - 9rem);
}
/* Display/hide */
.on_mobile {

Loading…
Cancel
Save