improve attend-buttons for events

This commit is contained in:
Jakobus Schürz 2023-03-23 23:23:23 +01:00
parent 5277c483fe
commit 33a7cd107e
5 changed files with 86 additions and 63 deletions

View file

@ -256,6 +256,7 @@ class Page implements ArrayAccess
'$likeError' => $l10n->t('Like not successfull'), '$likeError' => $l10n->t('Like not successfull'),
'$dislikeError' => $l10n->t('Dislike not successfull'), '$dislikeError' => $l10n->t('Dislike not successfull'),
'$announceError' => $l10n->t('Sharing not successfull'), '$announceError' => $l10n->t('Sharing not successfull'),
'$attendError' => $l10n->t('Attendation not successfull'),
'$srvError' => $l10n->t('Backend error'), '$srvError' => $l10n->t('Backend error'),
'$netError' => $l10n->t('Network error'), '$netError' => $l10n->t('Network error'),
// Dropzone // Dropzone

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 2023.03-rc\n" "Project-Id-Version: 2023.03-rc\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-03-21 21:43+0000\n" "POT-Creation-Date: 2023-03-23 23:12+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -44,7 +44,7 @@ msgstr ""
msgid "Item not found." msgid "Item not found."
msgstr "" msgstr ""
#: mod/item.php:435 mod/message.php:68 mod/message.php:113 mod/notes.php:45 #: mod/item.php:435 mod/message.php:68 mod/message.php:114 mod/notes.php:45
#: mod/photos.php:152 mod/photos.php:669 src/Model/Event.php:522 #: mod/photos.php:152 mod/photos.php:669 src/Model/Event.php:522
#: src/Module/Attach.php:55 src/Module/BaseApi.php:99 #: src/Module/Attach.php:55 src/Module/BaseApi.php:99
#: src/Module/BaseNotifications.php:98 src/Module/BaseSettings.php:52 #: src/Module/BaseNotifications.php:98 src/Module/BaseSettings.php:52
@ -219,86 +219,86 @@ msgstr ""
msgid "Your password has been changed at %s" msgid "Your password has been changed at %s"
msgstr "" msgstr ""
#: mod/message.php:46 mod/message.php:128 src/Content/Nav.php:319 #: mod/message.php:46 mod/message.php:129 src/Content/Nav.php:319
msgid "New Message" msgid "New Message"
msgstr "" msgstr ""
#: mod/message.php:82 src/Module/Profile/UnkMail.php:100 #: mod/message.php:83 src/Module/Profile/UnkMail.php:100
msgid "No recipient selected." msgid "No recipient selected."
msgstr "" msgstr ""
#: mod/message.php:87 #: mod/message.php:88
msgid "Unable to locate contact information." msgid "Unable to locate contact information."
msgstr "" msgstr ""
#: mod/message.php:91 src/Module/Profile/UnkMail.php:106 #: mod/message.php:92 src/Module/Profile/UnkMail.php:106
msgid "Message could not be sent." msgid "Message could not be sent."
msgstr "" msgstr ""
#: mod/message.php:95 src/Module/Profile/UnkMail.php:109 #: mod/message.php:96 src/Module/Profile/UnkMail.php:109
msgid "Message collection failure." msgid "Message collection failure."
msgstr "" msgstr ""
#: mod/message.php:122 src/Module/Notifications/Introductions.php:135 #: mod/message.php:123 src/Module/Notifications/Introductions.php:135
#: src/Module/Notifications/Introductions.php:170 #: src/Module/Notifications/Introductions.php:170
#: src/Module/Notifications/Notification.php:85 #: src/Module/Notifications/Notification.php:85
msgid "Discard" msgid "Discard"
msgstr "" msgstr ""
#: mod/message.php:135 src/Content/Nav.php:316 view/theme/frio/theme.php:241 #: mod/message.php:136 src/Content/Nav.php:316 view/theme/frio/theme.php:241
msgid "Messages" msgid "Messages"
msgstr "" msgstr ""
#: mod/message.php:148 #: mod/message.php:149
msgid "Conversation not found." msgid "Conversation not found."
msgstr "" msgstr ""
#: mod/message.php:153 #: mod/message.php:154
msgid "Message was not deleted." msgid "Message was not deleted."
msgstr "" msgstr ""
#: mod/message.php:168 #: mod/message.php:169
msgid "Conversation was not removed." msgid "Conversation was not removed."
msgstr "" msgstr ""
#: mod/message.php:181 mod/message.php:286 src/Module/Profile/UnkMail.php:145 #: mod/message.php:182 mod/message.php:287 src/Module/Profile/UnkMail.php:145
msgid "Please enter a link URL:" msgid "Please enter a link URL:"
msgstr "" msgstr ""
#: mod/message.php:190 src/Module/Profile/UnkMail.php:151 #: mod/message.php:191 src/Module/Profile/UnkMail.php:151
msgid "Send Private Message" msgid "Send Private Message"
msgstr "" msgstr ""
#: mod/message.php:191 mod/message.php:346 #: mod/message.php:192 mod/message.php:347
msgid "To:" msgid "To:"
msgstr "" msgstr ""
#: mod/message.php:192 mod/message.php:347 #: mod/message.php:193 mod/message.php:348
msgid "Subject:" msgid "Subject:"
msgstr "" msgstr ""
#: mod/message.php:196 mod/message.php:350 src/Module/Invite.php:171 #: mod/message.php:197 mod/message.php:351 src/Module/Invite.php:171
msgid "Your message:" msgid "Your message:"
msgstr "" msgstr ""
#: mod/message.php:199 mod/message.php:354 src/Content/Conversation.php:352 #: mod/message.php:200 mod/message.php:355 src/Content/Conversation.php:352
#: src/Module/Post/Edit.php:131 #: src/Module/Post/Edit.php:131
msgid "Upload photo" msgid "Upload photo"
msgstr "" msgstr ""
#: mod/message.php:200 mod/message.php:355 src/Module/Post/Edit.php:135 #: mod/message.php:201 mod/message.php:356 src/Module/Post/Edit.php:135
#: src/Module/Profile/UnkMail.php:153 #: src/Module/Profile/UnkMail.php:153
msgid "Insert web link" msgid "Insert web link"
msgstr "" msgstr ""
#: mod/message.php:201 mod/message.php:357 mod/photos.php:1291 #: mod/message.php:202 mod/message.php:358 mod/photos.php:1291
#: src/Content/Conversation.php:381 src/Content/Conversation.php:725 #: src/Content/Conversation.php:381 src/Content/Conversation.php:725
#: src/Module/Item/Compose.php:204 src/Module/Post/Edit.php:145 #: src/Module/Item/Compose.php:204 src/Module/Post/Edit.php:145
#: src/Module/Profile/UnkMail.php:154 src/Object/Post.php:545 #: src/Module/Profile/UnkMail.php:154 src/Object/Post.php:545
msgid "Please wait" msgid "Please wait"
msgstr "" msgstr ""
#: mod/message.php:202 mod/message.php:356 mod/photos.php:702 #: mod/message.php:203 mod/message.php:357 mod/photos.php:702
#: mod/photos.php:819 mod/photos.php:1097 mod/photos.php:1138 #: mod/photos.php:819 mod/photos.php:1097 mod/photos.php:1138
#: mod/photos.php:1194 mod/photos.php:1268 #: mod/photos.php:1194 mod/photos.php:1268
#: src/Module/Calendar/Event/Form.php:250 src/Module/Contact/Advanced.php:132 #: src/Module/Calendar/Event/Form.php:250 src/Module/Contact/Advanced.php:132
@ -317,52 +317,52 @@ msgstr ""
msgid "Submit" msgid "Submit"
msgstr "" msgstr ""
#: mod/message.php:223 #: mod/message.php:224
msgid "No messages." msgid "No messages."
msgstr "" msgstr ""
#: mod/message.php:279 #: mod/message.php:280
msgid "Message not available." msgid "Message not available."
msgstr "" msgstr ""
#: mod/message.php:323 #: mod/message.php:324
msgid "Delete message" msgid "Delete message"
msgstr "" msgstr ""
#: mod/message.php:325 mod/message.php:456 #: mod/message.php:326 mod/message.php:457
msgid "D, d M Y - g:i A" msgid "D, d M Y - g:i A"
msgstr "" msgstr ""
#: mod/message.php:340 mod/message.php:453 #: mod/message.php:341 mod/message.php:454
msgid "Delete conversation" msgid "Delete conversation"
msgstr "" msgstr ""
#: mod/message.php:342 #: mod/message.php:343
msgid "" msgid ""
"No secure communications available. You <strong>may</strong> be able to " "No secure communications available. You <strong>may</strong> be able to "
"respond from the sender's profile page." "respond from the sender's profile page."
msgstr "" msgstr ""
#: mod/message.php:345 #: mod/message.php:346
msgid "Send Reply" msgid "Send Reply"
msgstr "" msgstr ""
#: mod/message.php:427 #: mod/message.php:428
#, php-format #, php-format
msgid "Unknown sender - %s" msgid "Unknown sender - %s"
msgstr "" msgstr ""
#: mod/message.php:429 #: mod/message.php:430
#, php-format #, php-format
msgid "You and %s" msgid "You and %s"
msgstr "" msgstr ""
#: mod/message.php:431 #: mod/message.php:432
#, php-format #, php-format
msgid "%s and You" msgid "%s and You"
msgstr "" msgstr ""
#: mod/message.php:459 #: mod/message.php:460
#, php-format #, php-format
msgid "%d message" msgid "%d message"
msgid_plural "%d messages" msgid_plural "%d messages"
@ -686,14 +686,18 @@ msgid "Sharing not successfull"
msgstr "" msgstr ""
#: src/App/Page.php:259 #: src/App/Page.php:259
msgid "Backend error" msgid "Attendation not successfull"
msgstr "" msgstr ""
#: src/App/Page.php:260 #: src/App/Page.php:260
msgid "Backend error"
msgstr ""
#: src/App/Page.php:261
msgid "Network error" msgid "Network error"
msgstr "" msgstr ""
#: src/App/Page.php:328 #: src/App/Page.php:329
msgid "toggle mobile" msgid "toggle mobile"
msgstr "" msgstr ""
@ -721,8 +725,8 @@ msgid "All contacts"
msgstr "" msgstr ""
#: src/BaseModule.php:432 src/Content/Widget.php:235 src/Core/ACL.php:194 #: src/BaseModule.php:432 src/Content/Widget.php:235 src/Core/ACL.php:194
#: src/Module/Contact.php:407 src/Module/PermissionTooltip.php:122 #: src/Module/Contact.php:407 src/Module/PermissionTooltip.php:127
#: src/Module/PermissionTooltip.php:144 #: src/Module/PermissionTooltip.php:149
msgid "Followers" msgid "Followers"
msgstr "" msgstr ""
@ -1524,20 +1528,20 @@ msgid ""
"Contact birthday events are private to you." "Contact birthday events are private to you."
msgstr "" msgstr ""
#: src/Content/ForumManager.php:157 src/Content/Nav.php:276 #: src/Content/ForumManager.php:151 src/Content/Nav.php:276
#: src/Content/Text/HTML.php:878 src/Content/Widget.php:524 #: src/Content/Text/HTML.php:878 src/Content/Widget.php:524
msgid "Forums" msgid "Forums"
msgstr "" msgstr ""
#: src/Content/ForumManager.php:159 #: src/Content/ForumManager.php:153
msgid "External link to forum" msgid "External link to forum"
msgstr "" msgstr ""
#: src/Content/ForumManager.php:162 src/Content/Widget.php:503 #: src/Content/ForumManager.php:156 src/Content/Widget.php:503
msgid "show less" msgid "show less"
msgstr "" msgstr ""
#: src/Content/ForumManager.php:163 src/Content/Widget.php:405 #: src/Content/ForumManager.php:157 src/Content/Widget.php:405
#: src/Content/Widget.php:504 #: src/Content/Widget.php:504
msgid "show more" msgid "show more"
msgstr "" msgstr ""
@ -2208,8 +2212,8 @@ msgstr ""
msgid "Yourself" msgid "Yourself"
msgstr "" msgstr ""
#: src/Core/ACL.php:201 src/Module/PermissionTooltip.php:128 #: src/Core/ACL.php:201 src/Module/PermissionTooltip.php:133
#: src/Module/PermissionTooltip.php:150 #: src/Module/PermissionTooltip.php:155
msgid "Mutuals" msgid "Mutuals"
msgstr "" msgstr ""
@ -2217,8 +2221,8 @@ msgstr ""
msgid "Post to Email" msgid "Post to Email"
msgstr "" msgstr ""
#: src/Core/ACL.php:320 src/Module/PermissionTooltip.php:85 #: src/Core/ACL.php:320 src/Module/PermissionTooltip.php:90
#: src/Module/PermissionTooltip.php:197 #: src/Module/PermissionTooltip.php:201
msgid "Public" msgid "Public"
msgstr "" msgstr ""
@ -2228,7 +2232,7 @@ msgid ""
"community pages and by anyone with its link." "community pages and by anyone with its link."
msgstr "" msgstr ""
#: src/Core/ACL.php:322 src/Module/PermissionTooltip.php:93 #: src/Core/ACL.php:322 src/Module/PermissionTooltip.php:98
msgid "Limited/Private" msgid "Limited/Private"
msgstr "" msgstr ""
@ -3204,7 +3208,7 @@ msgstr ""
msgid "View on separate page" msgid "View on separate page"
msgstr "" msgstr ""
#: src/Model/Mail.php:136 src/Model/Mail.php:264 #: src/Model/Mail.php:137 src/Model/Mail.php:266
msgid "[no subject]" msgid "[no subject]"
msgstr "" msgstr ""
@ -8138,48 +8142,48 @@ msgstr ""
msgid "Wrong type \"%s\", expected one of: %s" msgid "Wrong type \"%s\", expected one of: %s"
msgstr "" msgstr ""
#: src/Module/PermissionTooltip.php:66 #: src/Module/PermissionTooltip.php:79
msgid "Model not found" msgid "Model not found"
msgstr "" msgstr ""
#: src/Module/PermissionTooltip.php:89 #: src/Module/PermissionTooltip.php:94
msgid "Unlisted" msgid "Unlisted"
msgstr "" msgstr ""
#: src/Module/PermissionTooltip.php:107 #: src/Module/PermissionTooltip.php:112
msgid "Remote privacy information not available." msgid "Remote privacy information not available."
msgstr "" msgstr ""
#: src/Module/PermissionTooltip.php:116 #: src/Module/PermissionTooltip.php:121
msgid "Visible to:" msgid "Visible to:"
msgstr "" msgstr ""
#: src/Module/PermissionTooltip.php:200
#, php-format
msgid "Collection (%s)"
msgstr ""
#: src/Module/PermissionTooltip.php:204 #: src/Module/PermissionTooltip.php:204
#, php-format #, php-format
msgid "Followers (%s)" msgid "Collection (%s)"
msgstr "" msgstr ""
#: src/Module/PermissionTooltip.php:223 #: src/Module/PermissionTooltip.php:208
#, php-format #, php-format
msgid "%d more" msgid "Followers (%s)"
msgstr "" msgstr ""
#: src/Module/PermissionTooltip.php:227 #: src/Module/PermissionTooltip.php:227
#, php-format #, php-format
msgid "%d more"
msgstr ""
#: src/Module/PermissionTooltip.php:231
#, php-format
msgid "<b>To:</b> %s<br>" msgid "<b>To:</b> %s<br>"
msgstr "" msgstr ""
#: src/Module/PermissionTooltip.php:230 #: src/Module/PermissionTooltip.php:234
#, php-format #, php-format
msgid "<b>CC:</b> %s<br>" msgid "<b>CC:</b> %s<br>"
msgstr "" msgstr ""
#: src/Module/PermissionTooltip.php:233 #: src/Module/PermissionTooltip.php:237
#, php-format #, php-format
msgid "<b>BCC:</b> %s<br>" msgid "<b>BCC:</b> %s<br>"
msgstr "" msgstr ""

View file

@ -775,6 +775,15 @@ function doActivityItemAction(ident, verb, un) {
break; break;
case 'announce': case 'announce':
thumbsClass = 'fa-retweet'; thumbsClass = 'fa-retweet';
break;
case 'attendyes':
thumbsClass = 'fa-check';
break;
case 'attendno':
thumbsClass = 'fa-times';
break;
case 'attendmaybe':
thumbsClass = 'fa-question';
} }
if (verb.indexOf('announce') === 0 ) { if (verb.indexOf('announce') === 0 ) {
// Share-Button(s) // Share-Button(s)
@ -802,6 +811,12 @@ function doActivityItemAction(ident, verb, un) {
.success(function(data){ .success(function(data){
$('img[id^=waitfor-' + verb + '-' + ident.toString() + ']').remove(); $('img[id^=waitfor-' + verb + '-' + ident.toString() + ']').remove();
if (data.status == 'ok') { if (data.status == 'ok') {
if (verb.indexOf('attend') === 0) {
$('button[id^=attend][id$=' + ident.toString() + ']').removeClass('active')
$('button#attendyes-' + ident.toString()).attr('onclick', 'javascript:doActivityItemAction(' + ident +', "attendyes" )');
$('button#attendno-' + ident.toString()).attr('onclick', 'javascript:doActivityItemAction(' + ident +', "attendno" )');
$('button#attendmaybe-' + ident.toString()).attr('onclick', 'javascript:doActivityItemAction(' + ident +', "attendmaybe" )');
}
if (data.verb == 'un' + verb) { if (data.verb == 'un' + verb) {
// like/dislike buttons // like/dislike buttons
$('button[id^=' + verb + '-' + ident.toString() + ']' ) $('button[id^=' + verb + '-' + ident.toString() + ']' )
@ -810,7 +825,7 @@ function doActivityItemAction(ident, verb, un) {
// link in share-menu // link in share-menu
$('a[id^=' + verb + '-' + ident.toString() + ']' ) $('a[id^=' + verb + '-' + ident.toString() + ']' )
.removeClass('active') .removeClass('active')
.attr('href', 'javascript:doActivityItemAction(' + ident +', "' + verb + '",false )'); .attr('href', 'javascript:doActivityItemAction(' + ident +', "' + verb + '")');
$('a[id^=' + verb + '-' + ident.toString() + '] i:first-child' ).addClass('fa-retweet').removeClass('fa-ban'); $('a[id^=' + verb + '-' + ident.toString() + '] i:first-child' ).addClass('fa-retweet').removeClass('fa-ban');
} else { } else {
// like/dislike buttons // like/dislike buttons
@ -823,7 +838,7 @@ function doActivityItemAction(ident, verb, un) {
.attr('href', 'javascript:doActivityItemAction(' + ident + ', "' + verb + '", true )'); .attr('href', 'javascript:doActivityItemAction(' + ident + ', "' + verb + '", true )');
$('a[id^=' + verb + '-' + ident.toString() + '] i:first-child' ).removeClass('fa-retweet').addClass('fa-ban'); $('a[id^=' + verb + '-' + ident.toString() + '] i:first-child' ).removeClass('fa-retweet').addClass('fa-ban');
} }
$('button[id^=' + verb + '-' + ident.toString() + '] i:first-child').addClass(thumbsClass).show(); $('button[id^=' + verb + '-' + ident.toString() + '] i:first-child').addClass(thumbsClass);
if (verb.indexOf('announce') === 0 ) { if (verb.indexOf('announce') === 0 ) {
// ShareMenuButton // ShareMenuButton
$('button[id^=shareMenuOptions-' + ident.toString() + '] i:first-child').addClass('fa-share'); $('button[id^=shareMenuOptions-' + ident.toString() + '] i:first-child').addClass('fa-share');

View file

@ -14,6 +14,9 @@ They are loaded into the html <head> so that js functions can use them *}}
'like' : "{{$likeError}}", 'like' : "{{$likeError}}",
'dislike' : "{{$dislikeError}}", 'dislike' : "{{$dislikeError}}",
'announce' : "{{$announceError}}", 'announce' : "{{$announceError}}",
'attendyes' : "{{$attendError}}",
'attendno' : "{{$attendError}}",
'attendmaybe' : "{{$attendError}}",
}; };
var aErrType = { var aErrType = {
'srvErr' : "{{$srvError}}", 'srvErr' : "{{$srvError}}",

View file

@ -316,7 +316,7 @@ as the value of $top_child_total (this is done at the end of this file)
{{/if}} {{/if}}
{{/if}} {{/if}}
{{if $item.vote.announce}} {{if $item.vote.announce}}
<button type="button" class="btn-link button-announces{{if $item.responses.announce.self and $item.reshared }} active" aria-pressed="true{{/if}}" id="announce-{{$item.id}}" title="{{$item.vote.announce.0}}" onclick="doActivityItemAction({{$item.id}}, 'announce'{{if $item.responses.announce.self}}, true{{/if}});" ><i class="fa fa-retweet" aria-hidden="true"></i>&nbsp;{{$item.vote.announce.1}}</button> <button type="button" class="btn-link button-announces{{if $item.responses.announce.self}} active" aria-pressed="true{{/if}}" id="announce-{{$item.id}}" title="{{$item.vote.announce.0}}" onclick="doActivityItemAction({{$item.id}}, 'announce'{{if $item.responses.announce.self}}, true{{/if}});" ><i class="fa fa-retweet" aria-hidden="true"></i>&nbsp;{{$item.vote.announce.1}}</button>
<span role="presentation" class="separator"></span> <span role="presentation" class="separator"></span>
{{/if}} {{/if}}
{{if $item.vote.share}} {{if $item.vote.share}}