Add content to Account page

FossilOrigin-Name: ddb93098b95a7e750d80156451580be8a59a8471985b93ad00cf43e05a6e49dd
This commit is contained in:
nekobit 2022-08-06 17:41:35 +00:00
parent 19b19b900b
commit ae453835b4
3 changed files with 19 additions and 15 deletions

View file

@ -7,6 +7,7 @@ use Exporter 'import';
our @EXPORT = qw( account content_statuses );
use template_helpers 'to_template';
use l10n 'lang';
sub generate_account
{
@ -15,6 +16,7 @@ sub generate_account
my %vars = (
prefix => '',
ssn => $ssn,
lang => \&lang,
relationship => $relationship,
content => $content,
acct => $acct,

View file

@ -935,7 +935,7 @@ HV* perlify_relationship(const struct mstdnt_relationship* rel)
hvstores_int(rel_hv, "notifying", MSTDNT_T_FLAG_ISSET(rel, MSTDNT_RELATIONSHIP_NOTIFYING));
hvstores_int(rel_hv, "blocking", MSTDNT_T_FLAG_ISSET(rel, MSTDNT_RELATIONSHIP_BLOCKING));
hvstores_int(rel_hv, "domain_blocking", MSTDNT_T_FLAG_ISSET(rel, MSTDNT_RELATIONSHIP_DOMAIN_BLOCKING));
hvstores_str(rel_hv, "blocked_by", rel->id);
hvstores_str(rel_hv, "blocked_by", MSTDNT_T_FLAG_ISSET(rel, MSTDNT_RELATIONSHIP_BLOCKED_BY));
return rel_hv;
}

View file

@ -3,11 +3,11 @@
[% END %]
[% IF acct.id == ssn.account.id %]
<div class="menubar">
<a href="{{%s:prefix}}/blocked">{{ %s : blocked_str }}</a>
<a href="$prefix/blocked">{{ %s : blocked_str }}</a>
<span class="bullet-separate">&bull;</span>
<a href="{{%s:prefix}}/muted">{{ %s : muted_str }}</a>
<a href="$prefix/muted">{{ %s : muted_str }}</a>
<span class="bullet-separate">&bull;</span>
<a href="{{%s:prefix}}/favourites">{{ %s : favourited_str }}</a>
<a href="$prefix/favourites">{{ %s : favourited_str }}</a>
</div>
[% END %]
<div class="account">
@ -24,26 +24,26 @@
Menu
<div class="menu menu-options">
<ul>
<li><a class="nolink" href="{{%s:prefix}}/user/{{%s:userid}}/action/{{%s:unsubscribe}}subscribe"><input class="btn-menu" type="button" value="{{%s:subscribe_text}}"></a></li>
<li><a class="nolink" href="{{%s:prefix}}/user/{{%s:userid}}/action/{{%s:unblock}}block"><input class="btn-menu" type="button" value="{{%s:block_text}}"></a></li>
<li><a class="nolink" href="{{%s:prefix}}/user/{{%s:userid}}/action/{{%s:unmute}}mute"><input class="btn-menu" type="button" value="{{%s:mute_text}}"></a></li>
<li><a class="nolink" href="$prefix/user/{{%s:userid}}/action/{{%s:unsubscribe}}subscribe"><input class="btn-menu" type="button" value="{{%s:subscribe_text}}"></a></li>
<li><a class="nolink" href="$prefix/user/{{%s:userid}}/action/{{%s:unblock}}block"><input class="btn-menu" type="button" value="{{%s:block_text}}"></a></li>
<li><a class="nolink" href="$prefix/user/{{%s:userid}}/action/{{%s:unmute}}mute"><input class="btn-menu" type="button" value="{{%s:mute_text}}"></a></li>
</ul>
</div>
</span>
</div>
<div class="acct-header">
<a href="{{%s:prefix}}/@{{%s:acct}}" class="header-btn btn">
<a href="$prefix/@[% acct.acct %]" class="header-btn btn">
<span class="btn-header">[% lang('TAB_STATUSES') %]</span>
<span class="btn-content">[% acct.statuses_count %]</span>
</a>
<a href="{{%s:prefix}}/@{{%s:acct}}/following" class="header-btn btn">
<a href="$prefix/@[% acct.acct %]/following" class="header-btn btn">
<span class="btn-header">[% lang('TAB_FOLLOWING') %]</span>
<span class="btn-content">[% acct.following_count %]</span>
</a>
<a href="{{%s:prefix}}/@{{%s:acct}}/followers" class="header-btn btn">
<a href="$prefix/@[% acct.acct %]/followers" class="header-btn btn">
<span class="btn-header">[% lang('TAB_FOLLOWERS') %]</span>
<span class="btn-content">[% acct.followers_count %]</span>
</a>
@ -64,21 +64,23 @@
<table class="tabs ui-table">
<tr>
<td>
<a href="{{%s:prefix}}/@{{%s:acct}}/statuses"><input class="tab-btn btn {{%s:tab_statuses_focused}}" type="button" value="{{%s:tab_statuses_text}}"></a>
<a href="$prefix/@[% acct.acct %]/statuses"><input class="tab-btn btn {{%s:tab_statuses_focused}}" type="button" value="[% lang('TAB_STATUSES') %]"></a>
</td>
<td>
<a href="{{%s:prefix}}/@{{%s:acct}}/scrobbles"><input class="tab-btn btn {{%s:tab_scrobbles_focused}}" type="button" value="{{%s:tab_scrobbles_text}}"></a>
<a href="$prefix/@[% acct.acct %]/scrobbles"><input class="tab-btn btn {{%s:tab_scrobbles_focused}}" type="button" value="[% lang('TAB_SCROBBLES') %]"></a>
</td>
<td>
<a href="{{%s:prefix}}/@{{%s:acct}}/media"><input class="tab-btn btn {{%s:tab_media_focused}}" type="button" value="{{%s:tab_media_text}}"></a>
<a href="$prefix/@[% acct.acct %]/media"><input class="tab-btn btn {{%s:tab_media_focused}}" type="button" value="[% lang('TAB_MEDIA') %]"></a>
</td>
<td>
<a href="{{%s:prefix}}/@{{%s:acct}}/pinned"><input class="tab-btn btn {{%s:tab_pinned_focused}}" type="button" value="{{%s:tab_pinned_text}}"></a>
<a href="$prefix/@[% acct.acct %]/pinned"><input class="tab-btn btn {{%s:tab_pinned_focused}}" type="button" value="[% lang('TAB_PINNED') %]"></a>
</td>
</tr>
</table>
<div class="account-content">
[% content %]
[% FOREACH i IN statuses %]
[% create_status(ssn, data, i) %]
[% END %]
</div>