forked from MarseyWorld/MarseyWorld
small refactor to buttons on userpages
parent
fa43317ee2
commit
ce2d90a212
|
@ -6310,3 +6310,12 @@ div.markdown {
|
|||
.comment-actions *:hover {
|
||||
color: var(--black);
|
||||
}
|
||||
|
||||
.actionbtns > *:not(.d-none) {
|
||||
display: inline !important;
|
||||
margin-bottom: 10px !important;
|
||||
margin-right: 5px !important;
|
||||
}
|
||||
.actionbtns > form > * {
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
|
|
|
@ -163,6 +163,7 @@
|
|||
<div>
|
||||
{% if v and v.id != u.id %}
|
||||
<div id="profile--actionbtns">
|
||||
<div class="actionbtns mb-3">
|
||||
<button type="button" id="button-unsub" class="btn btn-secondary {% if not is_following %}d-none{% endif %}" onclick="postToast(this,'/unfollow/{{u.username}}','button-unsub','button-sub','d-none')">Unfollow</button>
|
||||
|
||||
<button type="button" id="button-sub" class="btn btn-primary {% if is_following or u.is_nofollow or u.is_blocked %}d-none{% endif %}" onclick="postToast(this,'/follow/{{u.username}}','button-unsub','button-sub','d-none')">Follow</button>
|
||||
|
@ -177,8 +178,9 @@
|
|||
{%- endif %}
|
||||
|
||||
<button type="button" class="btn btn-primary" onclick="postToast(this,'/settings/block?username={{u.username}}',true)">Block</button>
|
||||
</div>
|
||||
|
||||
{{userpage_admintools.userAdminToolsUpper('desktop')}}
|
||||
{{userpage_admintools.userAdminTools('desktop')}}
|
||||
</div>
|
||||
<form class="d-none toggleable" id="message" action="/@{{u.username}}/message" onsubmit="submitFormAjax(event)">
|
||||
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
||||
|
@ -203,19 +205,22 @@
|
|||
<div>{{u.username}} will receive <span id="bux-transfer-taxed">0</span> marseybux</div>
|
||||
<button type="button" class="btn btn-primary mt-3" onclick="transferBux()">Gift</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% elif v and v.id == u.id %}
|
||||
<div class="actionbtns">
|
||||
{% if v and v.id == u.id %}
|
||||
<a href="/settings/profile" class="btn btn-secondary">Edit profile</a>
|
||||
<a href="/views" class="btn btn-secondary">Profile views</a>
|
||||
{% endif %}
|
||||
|
||||
{% if FEATURES['USERS_PROFILE_SONG'] and u.song and v and (v.id == u.id or v.mute and not u.unmutable) %}
|
||||
<span>
|
||||
<button type="button" class="btn btn-secondary" onclick="toggle()">Toggle anthem</button>
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{{userpage_admintools.userAdminToolsLower('desktop')}}
|
||||
|
||||
<div class="mt-1" id="profile--info">
|
||||
<div class="mt-2" id="profile--info">
|
||||
<p id="profile--info--id">User ID: {{u.id}}</p>
|
||||
<p id="profile--info--spent">Coins spent: {{u.coins_spent}}</p>
|
||||
<p id="profile--info--truescore">True score: {{u.truecoins}}</p>
|
||||
|
@ -396,19 +401,24 @@
|
|||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="actionbtns">
|
||||
{% if v and v.id == u.id %}
|
||||
<a href="/settings/profile" class="btn btn-secondary ">Edit profile</a>
|
||||
<a href="/views" class="btn btn-secondary">Profile views</a>
|
||||
{% endif %}
|
||||
|
||||
{% if FEATURES['USERS_PROFILE_SONG'] and u.song and v and (v.id == u.id or v.mute and not u.unmutable) %}
|
||||
<span>
|
||||
<button type="button" class="btn btn-secondary" onclick="toggle()">Toggle anthem</button>
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if v and v.id != u.id %}
|
||||
<button type="button" id="button-unsub2" class="btn btn-secondary {% if not is_following %}d-none{% endif %}" onclick="postToast(this,'/unfollow/{{u.username}}','button-unsub2','button-sub2','d-none')">Unfollow</button>
|
||||
|
||||
<button type="button" id="button-sub2" class="btn btn-primary {% if is_following or u.is_nofollow or u.is_blocked %}d-none{% endif %}" onclick="postToast(this,'/follow/{{u.username}}','button-unsub2','button-sub2','d-none')">Follow</button>
|
||||
|
||||
<button type="button" class="btn btn-primary" onclick="toggleElement('message-mobile', 'input-message-mobile')">Message</button>
|
||||
{% if FEATURES['USERS_SUICIDE'] -%}
|
||||
<button type="button" class="btn btn-primary" onclick="postToast(this,'/@{{u.username}}/suicide')">Get Them Help</button>
|
||||
|
@ -419,8 +429,11 @@
|
|||
{%- endif %}
|
||||
|
||||
<button type="button" class="btn btn-primary" onclick="postToast(this,'/settings/block?username={{u.username}}',true)">Block</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{{userpage_admintools.userAdminToolsUpper('mobile')}}
|
||||
{% if v and v.id != u.id %}
|
||||
{{userpage_admintools.userAdminTools('mobile')}}
|
||||
<form class="d-none toggleable" id='message-mobile' action="/@{{u.username}}/message" onsubmit="submitFormAjax(event)">
|
||||
<input class="mt-1" type="hidden" name="formkey" value="{{v.formkey}}">
|
||||
<textarea autocomplete="off" id="input-message-mobile" form="message-mobile" name="message" rows="3" minlength="1" maxlength="10000" class="form-control" data-preview="message-preview-mobile" oninput="markdown(this)" required></textarea>
|
||||
|
@ -445,10 +458,8 @@
|
|||
<button type="button" class="btn btn-primary mt-2 mb-3" onclick="transferBux(true)">Gift</button>
|
||||
</div>
|
||||
|
||||
{{userpage_admintools.userAdminToolsLower('mobile')}}
|
||||
|
||||
{% endif %}
|
||||
<div class="mt-1" id="profile-mobile--info">
|
||||
<div class="mt-2" id="profile-mobile--info">
|
||||
<p id="profile-mobile--info--id">User ID: {{u.id}}</p>
|
||||
<p id="profile-mobile--info--spent">Coins spent: {{u.coins_spent}}</p>
|
||||
<p id="profile-mobile--info--truescore">True score: {{u.truecoins}}</p>
|
||||
|
|
|
@ -20,24 +20,9 @@
|
|||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro userAdminToolsUpper(deviceType) %}
|
||||
{% if v and v.id != u.id and v.admin_level >= PERMS['USER_MODERATION_TOOLS_VISIBLE'] %}
|
||||
{% if v.admin_level >= PERMS['ADMIN_ADD'] %}
|
||||
<button type="button" id="add-admin-{{deviceType}}" class="{% if u.admin_level >= PERMS['ADMIN_ADD_PERM_LEVEL'] %}d-none{% endif %} btn btn-primary" onclick="postToast(this,'/@{{u.username}}/make_admin','add-admin-{{deviceType}}','remove-admin-{{deviceType}}','d-none')">Make admin</button>
|
||||
{% endif %}
|
||||
{% if v.admin_level >= PERMS['ADMIN_REMOVE'] %}
|
||||
<button type="button" id="remove-admin-{{deviceType}}" class="{% if u.admin_level < 1 %}d-none{% endif %} btn btn-danger" onclick="postToast(this,'/@{{u.username}}/remove_admin','add-admin-{{deviceType}}','remove-admin-{{deviceType}}','d-none')">Remove admin</button>
|
||||
{% endif %}
|
||||
{% if v.admin_level >= PERMS['ADMIN_ACTIONS_REVERT'] and u.admin_level %}
|
||||
<button type="button" class="btn btn-danger" data-click="postToast(this,'/@{{u.username}}/revert_actions')" onclick="areyousure(this)">Revert admin actions</button>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro userAdminToolsLower(deviceType) -%}
|
||||
{% macro userAdminTools(deviceType) %}
|
||||
{% if v and v.id != u.id and v.admin_level >= PERMS['USER_MODERATION_TOOLS_VISIBLE'] %}
|
||||
<div class="admintools-user-lower-{{deviceType}}">
|
||||
<br><br>
|
||||
{% if v.admin_level >= PERMS['USER_TITLE_CHANGE'] %}
|
||||
<div class="body d-lg-flex border-bottom mb-2">
|
||||
<div class="w-lg-100">
|
||||
|
@ -103,6 +88,18 @@
|
|||
</form>
|
||||
<button type="button" id="unagendaposter-{{deviceType}}" class="mt-1 {% if not u.agendaposter %}d-none{% endif %} btn btn-success" onclick="postToast(this,'/unagendaposter/{{u.id}}','agendaposter-{{deviceType}}','unagendaposter-{{deviceType}}','d-none')">Disable Chud Theme</button>
|
||||
{% endif %}
|
||||
|
||||
<div class="actionbtns mt-3">
|
||||
{% if v.admin_level >= PERMS['ADMIN_ADD'] %}
|
||||
<button type="button" id="add-admin-{{deviceType}}" class="{% if u.admin_level >= PERMS['ADMIN_ADD_PERM_LEVEL'] %}d-none{% endif %} btn btn-primary" onclick="postToast(this,'/@{{u.username}}/make_admin','add-admin-{{deviceType}}','remove-admin-{{deviceType}}','d-none')">Make admin</button>
|
||||
{% endif %}
|
||||
{% if v.admin_level >= PERMS['ADMIN_REMOVE'] %}
|
||||
<button type="button" id="remove-admin-{{deviceType}}" class="{% if u.admin_level < 1 %}d-none{% endif %} btn btn-danger" onclick="postToast(this,'/@{{u.username}}/remove_admin','add-admin-{{deviceType}}','remove-admin-{{deviceType}}','d-none')">Remove admin</button>
|
||||
{% endif %}
|
||||
{% if v.admin_level >= PERMS['ADMIN_ACTIONS_REVERT'] and u.admin_level %}
|
||||
<button type="button" class="btn btn-danger" data-click="postToast(this,'/@{{u.username}}/revert_actions')" onclick="areyousure(this)">Revert admin actions</button>
|
||||
{% endif %}
|
||||
|
||||
{% if v.admin_level >= PERMS['USER_BAN'] %}
|
||||
<button type="button" id="mute-user-{{deviceType}}" class="{% if u.is_muted %}d-none{% endif %} btn btn-danger" onclick="postToast(this,'/mute_user/{{u.id}}/1','mute-user-{{deviceType}}','unmute-user-{{deviceType}}','d-none')">Mute</button>
|
||||
<button type="button" id="unmute-user-{{deviceType}}" class="mb-1 {% if not u.is_muted %}d-none{% endif %} btn btn-success" onclick="postToast(this,'/mute_user/{{u.id}}/0','mute-user-{{deviceType}}','unmute-user-{{deviceType}}','d-none')">Unmute</button>
|
||||
|
@ -124,5 +121,6 @@
|
|||
<button type="button" id="bar-{{device}}" class="{% if u.club_allowed == False %}d-none{% endif %} btn btn-danger" onclick="postToast(this,'/@{{u.username}}/club_ban','grant-{{device}}','bar-{{device}}','d-none')">Bar from club</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{%- endmacro %}
|
||||
|
|
Loading…
Reference in New Issue