Browse Source

Unify and fix the color coherence for the contact and MUC users

pull/1176/merge
Timothée Jaussoin 3 years ago
parent
commit
6729c40835
  1. 2
      app/Presence.php
  2. 40
      app/widgets/Chat/_chat_header.tpl
  3. 2
      app/widgets/Chats/_chats_item.tpl
  4. 4
      app/widgets/ContactActions/_contactactions_drawer.tpl
  5. 2
      app/widgets/ContactData/_contactdata_card.tpl
  6. 12
      app/widgets/ContactHeader/_contactheader.tpl

2
app/Presence.php

@ -70,7 +70,7 @@ class Presence extends Model
public function getConferencePictureAttribute(): string
{
return Image::getOrCreate($this->mucjid, 120) ?? Route::urlize('avatar', $this->mucjid);
return Image::getOrCreate($this->mucjid, 120) ?? Route::urlize('avatar', $this->resource . 'groupchat');
}
public function getConferenceColorAttribute()

40
app/widgets/Chat/_chat_header.tpl

@ -1,9 +1,4 @@
{if="$muc"}
{$curl = false}
{if="$conference"}
{$curl = $conference->getPhoto()}
{/if}
<ul class="list middle">
<li>
<span class="primary icon active on_mobile_after" id="chatheadercounter" onclick="Chat.get()"
@ -11,18 +6,11 @@
<i class="material-icons">arrow_back</i>
</span>
{if="$curl"}
{if="$conference"}
<span class="primary icon bubble active
{if="!$conference->connected"}disabled{/if}"
style="background-image: url({$curl});"
onclick="RoomsUtils_ajaxShowSubject('{$jid|echapJS}')">
{elseif="$conference"}
<span class="primary icon bubble color active {$conference->name|stringToColor}
{if="!$conference->connected"}disabled{/if}"
style="background-image: url({$conference->getPhoto()});"
onclick="RoomsUtils_ajaxShowSubject('{$jid|echapJS}')">
{autoescape="off"}
{$conference->name|firstLetterCapitalize|addEmojis}
{/autoescape}
{else}
<span class="primary icon bubble color active {$jid|stringToColor}"
onclick="RoomsUtils_ajaxShowSubject('{$jid|echapJS}')">
@ -45,24 +33,12 @@
{if="$conference && $conference->info && $conference->info->related"}
{$related = $conference->info->related}
{$url = $related->getPhoto('m')}
{if="$url"}
<span
title="{$c->__('page.communities')} · {$related->name}"
onclick="MovimUtils.reload('{$c->route('community', [$related->server, $related->node])}')"
class="control icon bubble active small">
<img src="{$url}"/>
</span>
{else}
<span
title="{$c->__('page.communities')} · {if="$related->name"}{$related->name}{else}{$related->node}{/if}"
onclick="MovimUtils.reload('{$c->route('community', [$related->server, $related->node])}')"
class="control icon bubble active small color {$related->node|stringToColor}">
{$related->node|firstLetterCapitalize}
</span>
{/if}
<span
title="{$c->__('page.communities')} · {$related->name}"
onclick="MovimUtils.reload('{$c->route('community', [$related->server, $related->node])}')"
class="control icon bubble active small">
<img src="{$related->getPhoto('m')}"/>
</span>
{/if}
<span class="control icon show_context_menu active {if="$conference && !$conference->connected"}disabled{/if}">

2
app/widgets/Chats/_chats_item.tpl

@ -17,7 +17,7 @@
"
{if="$count > 0"}data-counter="{$count}"{/if}
>
<img src="{$contact->getPhoto()}">
<img src="{if="$roster"}{$roster->getPhoto('m')}{else}{$contact->getPhoto('m')}{/if}">
</span>
<div>

4
app/widgets/ContactActions/_contactactions_drawer.tpl

@ -1,8 +1,6 @@
<section>
<header class="big color {$contact->jid|stringToColor}"
{if="$contact->getPhoto()"}
style="background-image: linear-gradient(to bottom, rgba(23,23,23,0.8) 0%, rgba(23,23,23,0.5) 100%), url('{$contact->getBanner('xxl')}');"
{/if}
style="background-image: linear-gradient(to bottom, rgba(23,23,23,0.8) 0%, rgba(23,23,23,0.5) 100%), url('{if="$roster"}{$roster->getBanner('xxl')}{else}{$contact->getBanner('xxl')}{/if}');"
>
<ul class="list thick">
<li>

2
app/widgets/ContactData/_contactdata_card.tpl

@ -2,7 +2,7 @@
<li class="block large">
<div>
<p class="center all">
<img src="{$contact->getPhoto('l')}" class="avatar">
<img src="{if="$roster"}{$roster->getPhoto('l')}{else}{$contact->getPhoto('l')}{/if}" class="avatar">
</p>
</div>
</li>

12
app/widgets/ContactHeader/_contactheader.tpl

@ -4,17 +4,11 @@
</a>
{/if}
{$banner = $contact->getBanner()}
<header class="big top color {$contact->jid|stringToColor}"
style="
background-image:
linear-gradient(to top, rgba(23,23,23,0.9) 0, rgba(23,23,23,0.6) 5rem, rgba(23,23,23,0) 12rem)
{if="$banner"}
, url('{$banner}')
{/if}
;
">
linear-gradient(to top, rgba(23,23,23,0.9) 0, rgba(23,23,23,0.6) 5rem, rgba(23,23,23,0) 12rem), url('{if="$roster"}{$roster->getBanner('xxl')}{else}{$contact->getBanner('xxl')}{/if}');
">
<ul class="list thick">
<li class="block large">
@ -50,7 +44,7 @@
<i class="material-icons">arrow_back</i>
</span>
<span class="primary icon bubble active" onclick="ContactActions_ajaxGetDrawer('{$contact->id|echapJS}')">
<img src="{$contact->getPhoto('m')}">
<img src="{if="$roster"}{$roster->getPhoto('m')}{else}{$contact->getPhoto('m')}{/if}">
</span>
<div>
<p class="line active" onclick="ContactActions_ajaxGetDrawer('{$contact->id|echapJS}')">

Loading…
Cancel
Save