diff --git a/Web/Presenters/templates/@layout.xml b/Web/Presenters/templates/@layout.xml
index 2a759469..b634a770 100644
--- a/Web/Presenters/templates/@layout.xml
+++ b/Web/Presenters/templates/@layout.xml
@@ -167,7 +167,7 @@
{var canAccessAdminPanel = $thisUser->getChandlerUser()->can("access")->model("admin")->whichBelongsTo(NULL)}
{var canAccessHelpdesk = $thisUser->getChandlerUser()->can("write")->model('openvk\Web\Models\Entities\TicketReply')->whichBelongsTo(0)}
{var menuLinksAvaiable = sizeof(OPENVK_ROOT_CONF['openvk']['preferences']['menu']['links']) > 0}
-
+
{if $canAccessAdminPanel}
Админ-панель
{/if}
@@ -179,23 +179,22 @@
href="{$menuItem['url']}"
target="_blank"
class="link">{$menuItem["name"]}
-
- {$club->getName()}
-
-
-
-
+
{else}
Поддержка
Выйти
diff --git a/Web/Presenters/templates/User/Groups.xml b/Web/Presenters/templates/User/Groups.xml
index f8dc9154..9c2aa853 100644
--- a/Web/Presenters/templates/User/Groups.xml
+++ b/Web/Presenters/templates/User/Groups.xml
@@ -18,12 +18,6 @@
{/block}
-{block actions}
-
-{/block}
-
{* BEGIN ELEMENTS DESCRIPTION *}
{block tabs}
@@ -62,7 +56,7 @@
{_actions}: |
-
+
{if $clubPinned}
{_remove_from_left_menu}
{else}
diff --git a/Web/static/css/style.css b/Web/static/css/style.css
index ed5be910..4c4e6606 100644
--- a/Web/static/css/style.css
+++ b/Web/static/css/style.css
@@ -145,6 +145,12 @@ a {
right: 0;
}
+.navigation .group_link {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
.navigation_footer {
padding: 0;
}
@@ -346,6 +352,12 @@ table {
margin-bottom: 6px;
}
+.menu_divider {
+ height: 1px;
+ background: #CCC;
+ margin: 4px 0 2px;
+}
+
.page_status {
font-weight: normal;
font-size: 11px;
diff --git a/Web/static/js/openvk.cls.js b/Web/static/js/openvk.cls.js
index 90178366..1e1cf6a0 100644
--- a/Web/static/js/openvk.cls.js
+++ b/Web/static/js/openvk.cls.js
@@ -85,6 +85,47 @@ document.addEventListener("DOMContentLoaded", function() { //BEGIN
return e.preventDefault();
});
+ u("#_pinGroup").on("click", async function(e) {
+ e.preventDefault();
+
+ let link = u(this).attr("href");
+ let thisButton = u(this);
+ let groupName = u(this).attr("data-group-name");
+ let groupId = u(this).attr("data-group-id");
+ let list = u('#_groupListPinnedGroups');
+
+ let req = await ky(link);
+ if(req.ok == false) {
+ NewNotification(tr('error'), tr('error_1'), null);
+ }
+
+ // Adding a divider if not already there
+ if(list.nodes[0].children.length == 0) {
+ list.nodes[0].append(u('').first());
+ }
+
+ // Changing the button name
+ if(thisButton.html().trim() == tr('remove_from_left_menu')) {
+ thisButton.html(tr('add_to_left_menu'));
+ for(let i = 0; i < list.nodes[0].children.length; i++) {
+ let element = list.nodes[0].children[i];
+ if(element.pathname == '/club'+groupId) {
+ element.remove();
+ }
+ }
+ }else{
+ thisButton.html(tr('remove_from_left_menu'));
+ list.nodes[0].append(u('' + groupName + '').first());
+ }
+
+ // Adding the group to the left group list
+ if(list.nodes[0].children[0].className != "menu_divider" || list.nodes[0].children.length == 1) {
+ list.nodes[0].children[0].remove();
+ }
+
+ return false;
+ });
+
}); //END ONREADY DECLS
function repostPost(id, hash) {
|