From b1407ba823f72a3b11ec32f80388baed6152bce7 Mon Sep 17 00:00:00 2001 From: KosFurler <35310076+KosFurler@users.noreply.github.com> Date: Tue, 1 Feb 2022 14:20:14 +0300 Subject: [PATCH 1/6] Groups: Update groups layout (#444) * Groups: Update groups layot * We don't use crowdin anymore, why it's still there? * Locales: Delete unnecessary LICENSE We already have COPYING in the root directory :/ * Locales: Localize strings for updated group layout Localized strings: open_new_group, open_group_desc, search_group, search_by_groups, search_group_desc (we already have search_for_groups but idk, I'll leave it for now) * Global: Fix tabs * Groups: Fix tabs and div block I have SO many questions... * Groups: Update layot New counter, info and actions blocks and some stye fixes * Global: Fix tabs * Locales: Localize strings for updated group layout Localized strings: check_community, groups_list * Update Groups.xml * Update Groups.xml Co-authored-by: veselcraft Co-authored-by: Ilya Prokopenko Co-authored-by: celestora --- Web/Presenters/templates/@listView.xml | 50 ++++---- Web/Presenters/templates/User/Groups.xml | 108 +++++++++++++----- Web/Presenters/templates/components/error.xml | 11 +- .../templates/components/paginator.xml | 24 ++-- Web/static/css/style.css | 34 ++++++ locales/en.strings | 11 ++ locales/ru.strings | 11 ++ 7 files changed, 184 insertions(+), 65 deletions(-) diff --git a/Web/Presenters/templates/@listView.xml b/Web/Presenters/templates/@listView.xml index 35c9a2f0..ffdcf620 100644 --- a/Web/Presenters/templates/@listView.xml +++ b/Web/Presenters/templates/@listView.xml @@ -5,10 +5,14 @@
{include tabs}
- + + {ifset size} + {include size, x => $dat} + {/ifset} +
{var data = is_array($iterator) ? $iterator : iterator_to_array($iterator)} - + {if sizeof($data) > 0}
@@ -20,32 +24,32 @@ -
- - - {include name, x => $dat} - - -
- - {include description, x => $dat} + {ifset infotable} + {include infotable, x => $dat} + {else} + + + {include name, x => $dat} + + +
+ {include description, x => $dat} + {/ifset}
- -
- {include "components/paginator.xml", conf => (object) [ - "page" => $page, - "count" => $count, - "amount" => sizeof($data), - "perPage" => $perPage ?? OPENVK_DEFAULT_PER_PAGE, - "atBottom" => true, - ]} -
+ {include "components/paginator.xml", conf => (object) [ + "page" => $page, + "count" => $count, + "amount" => sizeof($data), + "perPage" => $perPage ?? OPENVK_DEFAULT_PER_PAGE, + "atBottom" => true, + ]} {else} {ifset customErrorMessage} {include customErrorMessage} @@ -54,5 +58,9 @@ {/ifset} {/if}
+ + {ifset bottom} + {include bottom} + {/ifset} {/block} diff --git a/Web/Presenters/templates/User/Groups.xml b/Web/Presenters/templates/User/Groups.xml index 18860fd8..a32673b9 100644 --- a/Web/Presenters/templates/User/Groups.xml +++ b/Web/Presenters/templates/User/Groups.xml @@ -2,37 +2,45 @@ {var iterator = $user->getClubs($page, $admin)} {var count = $user->getClubCount($admin)} -{block title}{_"groups"}{/block} +{block title} + {_groups} +{/block} {block header} - {$user->getCanonicalName()} » {_"groups"} - -
- - - - {_"create_group"} - - - -
+ {if !is_null($thisUser) && $user->getId() === $thisUser->getId()} + {_my_groups} + {else} + {$user->getCanonicalName()} » {_groups} + {/if} {/block} {* BEGIN ELEMENTS DESCRIPTION *} {block tabs} - {if !is_null($thisUser) && $user->getId() === $thisUser->getId()} - - - {/if} + {if !is_null($thisUser) && $user->getId() === $thisUser->getId()} + + + {/if} +{/block} + +{block size} +
+
+ {if !is_null($thisUser) && $user->getId() === $thisUser->getId()} + {tr("groups_list", $thisUser->getClubCount())} + {else} + {tr("groups", $user->getClubCount())} + {/if} +
+
{/block} {block link|strip|stripHtml} @@ -43,8 +51,19 @@ Фотография группы {/block} -{block name} - {$x->getName()} +{block infotable} + + + + + + + + + + + +
Название: {$x->getName()}
Размер:{tr("participants", $x->getFollowersCount())}
{/block} {block description} @@ -54,12 +73,47 @@ {block actions} {var clubPinned = $thisUser->isClubPinned($x)} {if $x->canBeModifiedBy($thisUser ?? NULL) && ($clubPinned || $thisUser->getPinnedClubCount() <= 10)} - + + {_check_community} + + + {if $clubPinned} {_remove_from_left_menu} {else} {_add_to_left_menu} {/if} + +
+ + + + +
+ + {/if} +{/block} + +{block bottom} + {if !is_null($thisUser) && $user->getId() === $thisUser->getId()} +
+
+

{_open_new_group}

+ {_open_group_desc} +
+ +
+
+
+

{_search_group}

+ {_search_group_desc} +
+ + + +
+
+
{/if} {/block} diff --git a/Web/Presenters/templates/components/error.xml b/Web/Presenters/templates/components/error.xml index 288129a2..9ce715db 100644 --- a/Web/Presenters/templates/components/error.xml +++ b/Web/Presenters/templates/components/error.xml @@ -1,7 +1,6 @@ -
- Ошибка -

{$title}

-

+

+ + {$title}

{$description} -

-
+ +
\ No newline at end of file diff --git a/Web/Presenters/templates/components/paginator.xml b/Web/Presenters/templates/components/paginator.xml index cf717e23..7c14e7e4 100644 --- a/Web/Presenters/templates/components/paginator.xml +++ b/Web/Presenters/templates/components/paginator.xml @@ -1,16 +1,18 @@ {var $space = 2} {var $pageCount = ceil($conf->count / $conf->perPage)} -
- {if $conf->page > $space} - « - {/if} - {for $j = $conf->page - ($space-1); $j <= $conf->page + ($space-1); $j++} - {if $j > 0 && $j <= $pageCount} - {$j} +
+
+ {if $conf->page > $space} + « {/if} - {/for} - {if $conf->page <= $pageCount-$space} - » - {/if} + {for $j = $conf->page - ($space-1); $j <= $conf->page + ($space-1); $j++} + {if $j > 0 && $j <= $pageCount} + {$j} + {/if} + {/for} + {if $conf->page <= $pageCount-$space} + » + {/if} +
diff --git a/Web/static/css/style.css b/Web/static/css/style.css index 3579c71c..cf40d339 100644 --- a/Web/static/css/style.css +++ b/Web/static/css/style.css @@ -1832,6 +1832,40 @@ body.scrolled .toTop:hover { padding: 5px 0px 0px 0px; } +.groups_options { + padding: 10px 20px 20px; + border-top: #DEDEDE solid 1px; + margin-top: 12px; + margin-left: -12px; + margin-right: -12px; +} + +#gp_container { + display: inline-block; +} + +#gp_container span { + display: block; + margin: 10px 0 15px; +} + +#gp_container h4 { + font-size: 11px; +} + +.container_gray .content:last-child { + margin-bottom: 0; +} + +.group_info { + padding: 0 0 0 5px !important; +} + +.group_info .label { + width: auto !important; + padding-right: 5px; +} + .border-block { box-shadow: inset 0px 0 0px 1px #b6bfca, inset 0px 0 0px 10px #d8dfe7; width: 300px; diff --git a/locales/en.strings b/locales/en.strings index 1fec702f..fe40e638 100644 --- a/locales/en.strings +++ b/locales/en.strings @@ -223,6 +223,7 @@ "subscriptions" = "Subscriptions"; "join_community" = "Join community"; "leave_community" = "Leave community"; +"check_community" = "View community"; "min_6_community" = "Name of the group must have more that 6 characters"; "participants" = "Participants"; "groups" = "Groups"; @@ -272,10 +273,20 @@ "groups_one" = "$1 group"; "groups_other" = "$1 groups"; +"groups_list_zero" = "You are not a participant in any group"; +"groups_list_one" = "You are participating in one group"; +"groups_list_other" = "You are a participant of $1 groups"; + "meetings_zero" = "No meetings"; "meetings_one" = "$1 meeting"; "meetings_other" = "$1 meetings"; +"open_new_group" = "Open a new group"; +"open_group_desc" = "Can't find the right group? Open your own..."; +"search_group" = "Search group"; +"search_by_groups" = "Search by groups"; +"search_group_desc" = "Here you can browse through the existing groups and choose a group to suit your needs..."; + /* Albums */ "create" = "Create"; diff --git a/locales/ru.strings b/locales/ru.strings index dc76df6e..8a073ce0 100644 --- a/locales/ru.strings +++ b/locales/ru.strings @@ -232,6 +232,7 @@ "subscriptions" = "Подписки"; "join_community" = "Вступить в группу"; "leave_community" = "Выйти из группы"; +"check_community" = "Просмотр группы"; "min_6_community" = "Название должно быть не менее 6 символов"; "participants" = "Участники"; "groups" = "Группы"; @@ -286,12 +287,22 @@ "groups_many" = "$1 групп"; "groups_other" = "$1 групп"; +"groups_list_zero" = "Вы не состоите ни в одной группе"; +"groups_list_one" = "Вы состоите в одной группе"; +"groups_list_other" = "Вы состоите в $1 группах"; + "meetings_zero" = "Ни одной встречи"; "meetings_one" = "Одна встреча"; "meetings_few" = "$1 встречи"; "meetings_many" = "$1 встреч"; "meetings_other" = "$1 встреч"; +"open_new_group" = "Открыть новую группу"; +"open_group_desc" = "Не можете найти нужную группу? Откройте свою..."; +"search_group" = "Поиск группы"; +"search_by_groups" = "Поиск по группам"; +"search_group_desc" = "Здесь Вы можете просмотреть существующие группы и выбрать группу себе по вкусу..."; + /* Albums */ "create" = "Создать"; From 16df71506856414882ce466387aa9b5e27ba20d5 Mon Sep 17 00:00:00 2001 From: celestora Date: Tue, 1 Feb 2022 17:11:39 +0200 Subject: [PATCH 2/6] Correct Latte syntax in Group.xml --- Web/Presenters/templates/User/Groups.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Web/Presenters/templates/User/Groups.xml b/Web/Presenters/templates/User/Groups.xml index a32673b9..1f3a370b 100644 --- a/Web/Presenters/templates/User/Groups.xml +++ b/Web/Presenters/templates/User/Groups.xml @@ -18,13 +18,13 @@ {block tabs} {if !is_null($thisUser) && $user->getId() === $thisUser->getId()} -
- + -
- + From b7654c8d16b95fd4daf9a5889072e5406395a62e Mon Sep 17 00:00:00 2001 From: Maxim Leshchenko Date: Tue, 1 Feb 2022 18:58:39 +0200 Subject: [PATCH 3/6] Fixup "Groups: Update groups layout (#444)" --- Web/Presenters/templates/@listView.xml | 6 +++--- Web/Presenters/templates/User/Groups.xml | 23 +++++++++++------------ locales/en.strings | 1 + locales/ru.strings | 1 + 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/Web/Presenters/templates/@listView.xml b/Web/Presenters/templates/@listView.xml index ffdcf620..9b47d992 100644 --- a/Web/Presenters/templates/@listView.xml +++ b/Web/Presenters/templates/@listView.xml @@ -2,7 +2,7 @@ {block wrap}
- -
- + @@ -32,7 +32,7 @@ {/block} {block size} -
+
{if !is_null($thisUser) && $user->getId() === $thisUser->getId()} {tr("groups_list", $thisUser->getClubCount())} @@ -51,15 +51,15 @@ Фотография группы {/block} -{block infotable} +{block infoTable} - + - + @@ -73,11 +73,11 @@ {block actions} {var clubPinned = $thisUser->isClubPinned($x)} {if $x->canBeModifiedBy($thisUser ?? NULL) && ($clubPinned || $thisUser->getPinnedClubCount() <= 10)} - + {_check_community} - + {if $clubPinned} {_remove_from_left_menu} {else} @@ -89,16 +89,15 @@ - + - {/if} {/block} {block bottom} {if !is_null($thisUser) && $user->getId() === $thisUser->getId()}
-
+

{_open_new_group}

{_open_group_desc}
@@ -110,7 +109,7 @@ {_search_group_desc} - +
diff --git a/locales/en.strings b/locales/en.strings index fe40e638..55b6ba28 100644 --- a/locales/en.strings +++ b/locales/en.strings @@ -241,6 +241,7 @@ "only_administrators" = "Only administrators"; "website" = "Website"; "managed" = "Managed"; +"size" = "Size"; "administrators_one" = "$1 administrator"; "administrators_other" = "$1 administrators"; diff --git a/locales/ru.strings b/locales/ru.strings index 8a073ce0..085d9fae 100644 --- a/locales/ru.strings +++ b/locales/ru.strings @@ -250,6 +250,7 @@ "only_administrators" = "Только администраторы"; "website" = "Сайт"; "managed" = "Управляемые"; +"size" = "Размер"; "administrators_one" = "$1 администратор"; "administrators_few" = "$1 администратора"; From 5e15d54d07a25ccd52ba86a642d33ab920c761cb Mon Sep 17 00:00:00 2001 From: Ilya Prokopenko Date: Thu, 3 Feb 2022 08:21:57 +0300 Subject: [PATCH 4/6] README: Add one missing line --- README.md | 1 + README_RU.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 56211045..f9f05c9f 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ ln -s /path/to/chandler/extensions/available/openvk /path/to/chandler/extensions ``` 4. Import `install/init-static-db.sql` to **same database** you installed Chandler to +4.1. Import all sqls from `install/sqls` to **same database** 5. Import `install/init-event-db.sql` to **separate database** 6. Copy `openvk-example.yml` to `openvk.yml` and change options 7. Run `composer install` in OpenVK directory diff --git a/README_RU.md b/README_RU.md index 2ed13a7b..affdce33 100644 --- a/README_RU.md +++ b/README_RU.md @@ -49,6 +49,7 @@ ln -s /path/to/chandler/extensions/available/openvk /path/to/chandler/extensions ``` 4. Импортируйте `install/init-static-db.sql` в **ту же базу данных**, в которую вы установили Chandler +4.1. Импортируйте все SQL файлы из папки `install/sqls` в **ту же базу данных** 5. Импортируйте `install/init-event-db.sql` в **отдельную базу данных** 6. Скопируйте `openvk-example.yml` в `openvk.yml` и измените параметры 7. Запустите `composer install` в директории OpenVK From 63edf582158fc18a04f939cdcfe7b75bfc26f45d Mon Sep 17 00:00:00 2001 From: Ilya Prokopenko Date: Thu, 3 Feb 2022 08:23:45 +0300 Subject: [PATCH 5/6] README: Change the Telegram link for English users --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f9f05c9f..8cbcc610 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ You may reach out to us via: * [Bug-tracker](https://github.com/openvk/openvk/projects/1) * [Ticketing system](https://openvk.su/support?act=new) -* Telegram chat: Go to [our channel](https://t.me/openvkch) and open discussion in our channel menu. +* Telegram chat: Go to [our channel](https://t.me/openvkenglish) and open discussion in our channel menu. * [Reddit](https://www.reddit.com/r/openvk/) * [Discussions](https://github.com/openvk/openvk/discussions) From 79f137c608a20a6c58476e635d094ea512e00669 Mon Sep 17 00:00:00 2001 From: Ilya Prokopenko Date: Thu, 3 Feb 2022 08:26:43 +0300 Subject: [PATCH 6/6] Fix-up "READNE: Add one missing line" --- README.md | 3 +-- README_RU.md | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8cbcc610..41c12559 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,7 @@ ln -s /path/to/chandler/extensions/available/commitcaptcha /path/to/chandler/ext ln -s /path/to/chandler/extensions/available/openvk /path/to/chandler/extensions/enabled/ ``` -4. Import `install/init-static-db.sql` to **same database** you installed Chandler to -4.1. Import all sqls from `install/sqls` to **same database** +4. Import `install/init-static-db.sql` to **same database** you installed Chandler to and import all sqls from `install/sqls` to **same database** 5. Import `install/init-event-db.sql` to **separate database** 6. Copy `openvk-example.yml` to `openvk.yml` and change options 7. Run `composer install` in OpenVK directory diff --git a/README_RU.md b/README_RU.md index affdce33..480552a3 100644 --- a/README_RU.md +++ b/README_RU.md @@ -48,8 +48,7 @@ ln -s /path/to/chandler/extensions/available/commitcaptcha /path/to/chandler/ext ln -s /path/to/chandler/extensions/available/openvk /path/to/chandler/extensions/enabled/ ``` -4. Импортируйте `install/init-static-db.sql` в **ту же базу данных**, в которую вы установили Chandler -4.1. Импортируйте все SQL файлы из папки `install/sqls` в **ту же базу данных** +4. Импортируйте `install/init-static-db.sql` в **ту же базу данных**, в которую вы установили Chandler, и импортируйте все SQL файлы из папки `install/sqls` в **ту же базу данных** 5. Импортируйте `install/init-event-db.sql` в **отдельную базу данных** 6. Скопируйте `openvk-example.yml` в `openvk.yml` и измените параметры 7. Запустите `composer install` в директории OpenVK
Название: {_name}: {$x->getName()}
Размер:{_size}: {tr("participants", $x->getFollowersCount())}