Browse Source
Allow setting Avatars on Communities by combining XEP-0084 (metadata + url) and XEP-0060
pull/808/head
Allow setting Avatars on Communities by combining XEP-0084 (metadata + url) and XEP-0060
pull/808/head
20 changed files with 252 additions and 31 deletions
-
1CHANGELOG.md
-
9app/Info.php
-
5app/widgets/CommunitiesServer/_communitiesserver.tpl
-
1app/widgets/CommunityAffiliations/CommunityAffiliations.php
-
7app/widgets/CommunityAffiliations/_communityaffiliations.tpl
-
40app/widgets/CommunityConfig/CommunityConfig.php
-
30app/widgets/CommunityConfig/_communityconfig_avatar.tpl
-
16app/widgets/CommunityData/CommunityData.php
-
5app/widgets/CommunityData/_communitydata.tpl
-
6app/widgets/CommunityData/communitydata.css
-
6app/widgets/CommunityData/communitydata.js
-
16app/widgets/CommunitySubscriptions/_communitysubscriptions.tpl
-
21database/migrations/20190124220622_add_avatar_hash_infos_table.php
-
21lib/moxl/src/Moxl/Stanza/Avatar.php
-
3lib/moxl/src/Moxl/Xec/Action/Avatar/Get.php
-
21lib/moxl/src/Moxl/Xec/Action/Avatar/Set.php
-
27lib/moxl/src/Moxl/Xec/Action/Pubsub/GetItem.php
-
18lib/moxl/src/Moxl/Xec/Action/Pubsub/GetItems.php
-
7lib/moxl/src/Moxl/Xec/Action/Pubsub/GetItemsId.php
-
23src/Movim/Picture.php
@ -0,0 +1,30 @@ |
|||
<section class="scroll"> |
|||
<form name="avatarcommunity"> |
|||
<img src="{$info->getPhoto('o')}"> |
|||
<input type="hidden" name="photobin"/> |
|||
</form> |
|||
<ul class="list thick divided"> |
|||
<li> |
|||
<span class="primary icon bubble color green"> |
|||
<i class="material-icons">attach_file</i> |
|||
</span> |
|||
<p>{$c->__('avatar.file')}</p> |
|||
<p><input type="file" onchange="MovimAvatar.file(this.files, 'avatarcommunity');"></p> |
|||
</li> |
|||
</ul> |
|||
</section> |
|||
<div> |
|||
<button onclick="Dialog_ajaxClear()" class="button flat"> |
|||
{$c->__('button.close')} |
|||
</button> |
|||
<button |
|||
type="button" |
|||
onclick=" |
|||
CommunityConfig_ajaxSetAvatar('{$info->server}', '{$info->node}', MovimUtils.formToJson('avatarcommunity')); |
|||
this.value = '{$c->__('button.submitting')}'; |
|||
this.className='button flat inactive';" |
|||
class="button flat" |
|||
> |
|||
{$c->__('button.submit')} |
|||
</button> |
|||
</div> |
|||
@ -0,0 +1,6 @@ |
|||
#community_data li:first-child img { |
|||
height: 25rem; |
|||
border-radius: 0.25rem; |
|||
margin-top: 1rem; |
|||
margin-bottom: -2rem; |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
MovimWebsocket.attach(function() { |
|||
var parts = MovimUtils.urlParts(); |
|||
if (parts.params.length > 0) { |
|||
CommunityData_ajaxGetAvatar(parts.params[0], parts.params[1]); |
|||
} |
|||
}); |
|||
@ -0,0 +1,21 @@ |
|||
<?php |
|||
|
|||
use Movim\Migration; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
|
|||
class AddAvatarHashInfosTable extends Migration |
|||
{ |
|||
public function up() |
|||
{ |
|||
$this->schema->table('infos', function(Blueprint $table) { |
|||
$table->string('avatarhash', 128)->nullable(); |
|||
}); |
|||
} |
|||
|
|||
public function down() |
|||
{ |
|||
$this->schema->table('infos', function(Blueprint $table) { |
|||
$table->dropColumn('avatarhash'); |
|||
}); |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue