<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[13753] sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events: Translate: Sync "Translation Events" from GitHub</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/13753">13753</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/13753","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>amieiro</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2024-05-28 11:52:23 +0000 (Tue, 28 May 2024)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Translate: Sync "Translation Events" from GitHub</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsassetscsstranslationeventscss">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/assets/css/translation-events.css</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsautoloadphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/autoload.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludesattendeeattendeerepositoryphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/attendee/attendee-repository.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludeseventeventcapabilitiesphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event-capabilities.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludeseventeventformhandlerphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event-form-handler.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludeseventeventrepositoryinterfacephp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event-repository-interface.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludeseventeventrepositoryphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event-repository.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludeseventeventphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludesroutesattendeeremovephp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/attendee/remove.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludesrouteseventcreatephp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/event/create.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludesrouteseventlisttrashedphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/event/list-trashed.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludesroutesuserattendeventphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/user/attend-event.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludesroutesuserhosteventphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/user/host-event.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludesroutesusermyeventsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/user/my-events.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludesstatsstatslistenerphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/stats/stats-listener.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludesurlsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/urls.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventstemplateseventphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/event.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventstemplateseventsformphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/events-form.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventstemplateseventsmyeventsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/events-my-events.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventstemplateshelperfunctionsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/helper-functions.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventstemplatespartialseventlistphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/partials/event-list.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventstemplatespartialsheaderphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/partials/header.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventswporggptranslationeventsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/wporg-gp-translation-events.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsassetscssnewdotorgdesigncss">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/assets/css/new-dotorg-design.css</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/assets/fonts/</li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/assets/fonts/eb-garamond/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsassetsfontsebgaramondEBGaramondRegularttf">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/assets/fonts/eb-garamond/EBGaramond-Regular.ttf</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsassetsfontsebgaramondlicensetxt">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/assets/fonts/eb-garamond/license.txt</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludesrouteseventimagephp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/event/image.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsassetscssnewdotorgdesigncss"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/assets/css/new-dotorg-design.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/assets/css/new-dotorg-design.css                             (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/assets/css/new-dotorg-design.css       2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,53 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/* This style is copied from
+https://github.com/WordPress/wporg-mu-plugins/blob/4ab57d37d930c8b8526458fc510568d0fb0050f8/mu-plugins/blocks/global-header-footer/postcss/_common.pcss
+ */
+body {
+       --wp--preset--color--charcoal-2: #23282d;
+       --wp-global-header--background-color: var(--wp--preset--color--charcoal-2);
+       --wp--preset--color--charcoal-4: #656a71;
+       --wp--preset--color--white-opacity-15: #ffffff26;
+}
+
+header#masthead.site-header {
+       height: 60px;
+       gap: 80px;
+       border-top: 1px solid var(--wp--preset--color--white-opacity-15);
+       background-color: var(--wp-global-header--background-color);
+       div.site-branding {
+               p.site-title {
+                       font-family: Inter;
+                       font-size: 14px;
+                       font-weight: 400;
+                       line-height: 24px;
+                       text-align: left;
+               }
+
+               ul#menu-headline-nav.menu li {
+                       font-family: Inter;
+                       font-size: 14px;
+                       font-weight: 400;
+                       line-height: 24px;
+                       text-align: left;
+                       a {
+                               text-decoration: none;
+                       }
+               }
+       }
+}
+
+ul.breadcrumb {
+       font-family: Inter;
+       height: 24px;
+       li, li a {
+               font-size: 14px;
+               font-weight: 400;
+               line-height: 24px;
+               text-align: left;
+               color: var(--wp--preset--color--charcoal-4);
+               text-decoration: none;
+       }
+       li:after {
+               color: rgba(217, 217, 217, 1);
+               margin: 0 8px;
+       }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/assets/css/new-dotorg-design.css
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsassetscsstranslationeventscss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/assets/css/translation-events.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/assets/css/translation-events.css    2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/assets/css/translation-events.css      2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -123,6 +123,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">        display: inline-block;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/* Event list */
+li.event-list-item {
+       list-style-type: none;
+       margin-bottom: .5em;
+}
</ins><span class="cx" style="display: block; padding: 0 10px"> span.event-list-date {
</span><span class="cx" style="display: block; padding: 0 10px">        display: block;
</span><span class="cx" style="display: block; padding: 0 10px">        color: #939393;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -130,29 +135,49 @@
</span><span class="cx" style="display: block; padding: 0 10px">        font-weight: normal;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-span.event-list-date.events-i-am-attending {
-       font-size: .8em;
-       font-weight: normal;
-}
-
-/* Event title. */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/* Event list: Event title. */
</ins><span class="cx" style="display: block; padding: 0 10px"> .event-list-item a:first-child {
</span><span class="cx" style="display: block; padding: 0 10px">        font-weight: bold;
</span><span class="cx" style="display: block; padding: 0 10px">        font-size: 1.2em;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-li.event-list-item {
-       list-style-type: none;
-       margin-bottom: .5em;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/* Event list: Event labels. */
+.event-list-item-labels {
+       margin-right: .3em;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.event-list-item-labels > span {
+       font-weight: 500;
+       color: var(--gp-color-white);
+       font-size: .7em;
+       margin-right: 0.3em;
+       width: 6em;
+       text-align: center;
+       padding: 0.2em 0.5em;
+       border-radius: 1em;
+       text-transform: capitalize;
+}
+.event-list-item-label-draft {
+       background-color: var(--gp-color-attention-fg);
+       color: var(--gp-color-secondary) !important;
+}
+.event-list-item-label-hosting {
+       background-color: var(--gp-color-accent-fg);
+}
+.event-list-item-label-attending {
+       background-color: var(--gp-color-accent-fg);
+}
+.event-list-item-label-hosted {
+       background-color: var(--gp-color-success-fg);
+}
+.event-list-item-label-attended {
+       background-color: var(--gp-color-success-fg);
+}
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/* Event list: Event buttons. */
</ins><span class="cx" style="display: block; padding: 0 10px"> .event-list-item-button {
</span><span class="cx" style="display: block; padding: 0 10px">        text-decoration: none;
</span><span class="cx" style="display: block; padding: 0 10px">        vertical-align: bottom;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.event-list-item-button:nth-child(2) { /* The first button. */
-       margin-left: .3em;
-}
</del><span class="cx" style="display: block; padding: 0 10px"> .event-list-item-button.is-destructive {
</span><span class="cx" style="display: block; padding: 0 10px">        color: var(--gp-color-btn-danger-text);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -193,15 +218,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">        content: " | ";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.events-links-to-anchors {
-       width: 80%;
-       margin: 0 auto;
-}
-
-.events-links-to-anchors li {
-       list-style-type: square;
-}
-
</del><span class="cx" style="display: block; padding: 0 10px"> .event-left-col {
</span><span class="cx" style="display: block; padding: 0 10px">        width: 75%;
</span><span class="cx" style="display: block; padding: 0 10px">        float: left;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -232,8 +248,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">        color: #80807f;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-span.event-label-draft,
-span.event-details-join-expired,
</del><span class="cx" style="display: block; padding: 0 10px"> span.active-events-before-translation-table {
</span><span class="cx" style="display: block; padding: 0 10px">        font-weight: 500;
</span><span class="cx" style="display: block; padding: 0 10px">        color: var(--gp-color-bubble-inactive-project-text);
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsassetsfontsebgaramondEBGaramondRegularttf"></a>
<div class="binary"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/assets/fonts/eb-garamond/EBGaramond-Regular.ttf</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx" style="display: block; padding: 0 10px">Index: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/assets/fonts/eb-garamond/EBGaramond-Regular.ttf
</span><span class="cx" style="display: block; padding: 0 10px">===================================================================
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/assets/fonts/eb-garamond/EBGaramond-Regular.ttf 2024-05-28 09:02:15 UTC (rev 13752)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/assets/fonts/eb-garamond/EBGaramond-Regular.ttf  2024-05-28 11:52:23 UTC (rev 13753)
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/assets/fonts/eb-garamond/EBGaramond-Regular.ttf
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:mime-type</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+application/octet-stream
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsassetsfontsebgaramondlicensetxt"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/assets/fonts/eb-garamond/license.txt</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/assets/fonts/eb-garamond/license.txt                         (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/assets/fonts/eb-garamond/license.txt   2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,93 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+Copyright 2017 The EB Garamond Project Authors (https://github.com/octaviopardo/EBGaramond12)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://openfontlicense.org
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded, 
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsautoloadphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/autoload.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/autoload.php 2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/autoload.php   2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -12,6 +12,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> require_once __DIR__ . '/includes/routes/event/trash.php';
</span><span class="cx" style="display: block; padding: 0 10px"> require_once __DIR__ . '/includes/routes/event/delete.php';
</span><span class="cx" style="display: block; padding: 0 10px"> require_once __DIR__ . '/includes/routes/event/list.php';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+require_once __DIR__ . '/includes/routes/event/image.php';
</ins><span class="cx" style="display: block; padding: 0 10px"> require_once __DIR__ . '/includes/routes/event/list-trashed.php';
</span><span class="cx" style="display: block; padding: 0 10px"> require_once __DIR__ . '/includes/routes/event/translations.php';
</span><span class="cx" style="display: block; padding: 0 10px"> require_once __DIR__ . '/includes/routes/user/attend-event.php';
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludesattendeeattendeerepositoryphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/attendee/attendee-repository.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/attendee/attendee-repository.php    2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/attendee/attendee-repository.php      2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,6 +25,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        ),
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px">                // phpcs:enable
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+               wp_cache_delete( 'events_for_user_' . $attendee->user_id() );
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -81,52 +83,84 @@
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // phpcs:enable
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                wp_cache_delete( 'events_for_user_' . $user_id );
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><span class="cx" style="display: block; padding: 0 10px">         * @throws Exception
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        public function get_attendee( int $event_id, int $user_id ): ?Attendee {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_attendee_for_event_for_user( int $event_id, int $user_id ): ?Attendee {
+               $attendees = $this->get_attendees_for_events_for_user( array( $event_id ), $user_id );
+               if ( 1 !== count( $attendees ) ) {
+                       return null;
+               }
+               return $attendees[ $event_id ];
+       }
+
+       /**
+        * @var int[] $event_ids
+        * @return Attendee[] Associative array with event id as key.
+        * @throws Exception
+        */
+       public function get_attendees_for_events_for_user( array $event_ids, int $user_id ): array {
+               if ( empty( $event_ids ) ) {
+                       return array();
+               }
+
+               // Prevent SQL injection.
+               foreach ( $event_ids as $event_id ) {
+                       if ( is_numeric( $event_id ) ) {
+                               $event_id = intval( $event_id );
+                       }
+                       if ( ! is_int( $event_id ) || $event_id <= 0 ) {
+                               return array();
+                       }
+               }
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 global $wpdb, $gp_table_prefix;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                $event_id_params = implode( ',', array_fill( 0, count( $event_ids ), '%d' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared
</span><span class="cx" style="display: block; padding: 0 10px">                // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery
</span><span class="cx" style="display: block; padding: 0 10px">                // phpcs:disable WordPress.DB.DirectDatabaseQuery.NoCaching
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $row = $wpdb->get_row(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $rows = $wpdb->get_results(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $wpdb->prepare(
</span><span class="cx" style="display: block; padding: 0 10px">                                "
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                select
-                                       user_id,
-                                       is_host,
-                                       is_new_contributor,
-                                       (
-                                               select group_concat( distinct locale )
-                                               from {$gp_table_prefix}event_actions
-                                               where event_id = attendees.event_id
-                                                 and user_id = attendees.user_id
-                                       ) as locales
-                               from {$gp_table_prefix}event_attendees attendees
-                               where event_id = %d
-                                 and user_id = %d
-                       ",
-                               array(
-                                       $event_id,
-                                       $user_id,
-                               ),
-                       )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 select
+                                               event_id,
+                                               user_id,
+                                               is_host,
+                                               is_new_contributor,
+                                               (
+                                                       select group_concat( distinct locale )
+                                                       from {$gp_table_prefix}event_actions
+                                                       where event_id = attendees.event_id
+                                                         and user_id = attendees.user_id
+                                               ) as locales
+                                       from {$gp_table_prefix}event_attendees attendees
+                                       where event_id in ($event_id_params)
+                                         and user_id = %d
+                               ",
+                               array_merge(
+                                       $event_ids,
+                                       array( $user_id ),
+                               )
+                       ),
+                       OBJECT_K
</ins><span class="cx" style="display: block; padding: 0 10px">                 );
</span><span class="cx" style="display: block; padding: 0 10px">                // phpcs:enable
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( ! $row ) {
-                       return null;
-               }
-
-               return new Attendee(
-                       $event_id,
-                       $row->user_id,
-                       '1' === $row->is_host,
-                       '1' === $row->is_new_contributor,
-                       null === $row->locales ? array() : explode( ',', $row->locales ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         return array_map(
+                       function ( $row ) {
+                               return new Attendee(
+                                       $row->event_id,
+                                       $row->user_id,
+                                       '1' === $row->is_host,
+                                       '1' === $row->is_new_contributor,
+                                       null === $row->locales ? array() : explode( ',', $row->locales ),
+                               );
+                       },
+                       $rows,
</ins><span class="cx" style="display: block; padding: 0 10px">                 );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -213,41 +247,4 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
-       /**
-        * @deprecated
-        * TODO: This method should be moved out of this class because it's not about attendance,
-        *       it returns events that match a condition (have a user as attendee), so it belongs in an event repository.
-        *       However, since we don't have an event repository yet, the method is placed here for now.
-        *       When the method is moved to an event repository, it should return Event instances instead of event ids.
-        *
-        * @return int[] Event ids.
-        */
-       public function get_events_for_user( int $user_id ): array {
-               global $wpdb, $gp_table_prefix;
-
-               // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared
-               // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery
-               // phpcs:disable WordPress.DB.DirectDatabaseQuery.NoCaching
-               $rows = $wpdb->get_results(
-                       $wpdb->prepare(
-                               "
-                               select event_id
-                               from {$gp_table_prefix}event_attendees
-                               where user_id = %d
-                       ",
-                               array(
-                                       $user_id,
-                               )
-                       )
-               );
-               // phpcs:enable
-
-               return array_map(
-                       function ( object $row ) {
-                               return intval( $row->event_id );
-                       },
-                       $rows
-               );
-       }
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludeseventeventcapabilitiesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event-capabilities.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event-capabilities.php        2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event-capabilities.php  2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,18 +5,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> use Exception;
</span><span class="cx" style="display: block; padding: 0 10px"> use GP;
</span><span class="cx" style="display: block; padding: 0 10px"> use WP_User;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+use DateTimeImmutable;
+use DateTimeZone;
</ins><span class="cx" style="display: block; padding: 0 10px"> use Wporg\TranslationEvents\Attendee\Attendee;
</span><span class="cx" style="display: block; padding: 0 10px"> use Wporg\TranslationEvents\Attendee\Attendee_Repository;
</span><span class="cx" style="display: block; padding: 0 10px"> use Wporg\TranslationEvents\Stats\Stats_Calculator;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> class Event_Capabilities {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        private const MANAGE         = 'manage_translation_events';
-       private const CREATE         = 'create_translation_event';
-       private const VIEW           = 'view_translation_event';
-       private const EDIT           = 'edit_translation_event';
-       private const TRASH          = 'trash_translation_event';
-       private const DELETE         = 'delete_translation_event';
-       private const EDIT_ATTENDEES = 'edit_translation_event_attendees';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ private const MANAGE           = 'manage_translation_events';
+       private const CREATE           = 'create_translation_event';
+       private const VIEW             = 'view_translation_event';
+       private const EDIT             = 'edit_translation_event';
+       private const TRASH            = 'trash_translation_event';
+       private const DELETE           = 'delete_translation_event';
+       private const EDIT_ATTENDEES   = 'edit_translation_event_attendees';
+       private const EDIT_TITLE       = 'edit_translation_event_title';
+       private const EDIT_DESCRIPTION = 'edit_translation_event_description';
+       private const EDIT_START       = 'edit_translation_event_start';
+       private const EDIT_END         = 'edit_translation_event_end';
+       private const EDIT_TIMEZONE    = 'edit_translation_event_timezone';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><span class="cx" style="display: block; padding: 0 10px">         * All the capabilities that concern Events.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -29,6 +36,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">                self::TRASH,
</span><span class="cx" style="display: block; padding: 0 10px">                self::DELETE,
</span><span class="cx" style="display: block; padding: 0 10px">                self::EDIT_ATTENDEES,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                self::EDIT_TITLE,
+               self::EDIT_DESCRIPTION,
+               self::EDIT_START,
+               self::EDIT_END,
+               self::EDIT_TIMEZONE,
</ins><span class="cx" style="display: block; padding: 0 10px">         );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        private Event_Repository_Interface $event_repository;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,6 +76,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        case self::TRASH:
</span><span class="cx" style="display: block; padding: 0 10px">                        case self::DELETE:
</span><span class="cx" style="display: block; padding: 0 10px">                        case self::EDIT_ATTENDEES:
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        case self::EDIT_TITLE:
+                       case self::EDIT_DESCRIPTION:
+                       case self::EDIT_START:
+                       case self::EDIT_END:
+                       case self::EDIT_TIMEZONE:
</ins><span class="cx" style="display: block; padding: 0 10px">                                 if ( ! isset( $args[2] ) || ! is_numeric( $args[2] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                        return false;
</span><span class="cx" style="display: block; padding: 0 10px">                                }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -87,6 +104,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                if ( self::EDIT_ATTENDEES === $cap ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                        return $this->has_edit_attendees( $user, $event );
</span><span class="cx" style="display: block; padding: 0 10px">                                }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                if ( self::EDIT_TITLE === $cap || self::EDIT_DESCRIPTION === $cap || self::EDIT_START === $cap || self::EDIT_END === $cap || self::EDIT_TIMEZONE === $cap ) {
+                                       return $this->has_edit_field( $user, $event, $cap );
+                               }
</ins><span class="cx" style="display: block; padding: 0 10px">                                 break;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -136,14 +156,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @return bool
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        private function has_edit( WP_User $user, Event $event ): bool {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( $event->end()->is_in_the_past() ) {
-                       return false;
-               }
-
-               if ( $this->stats_calculator->event_has_stats( $event->id() ) ) {
-                       return false;
-               }
-
</del><span class="cx" style="display: block; padding: 0 10px">                 if ( $event->author_id() === $user->ID ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        return true;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -152,7 +164,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        return true;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attendee = $this->attendee_repository->get_attendee( $event->id(), $user->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attendee = $this->attendee_repository->get_attendee_for_event_for_user( $event->id(), $user->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">                 if ( ( $attendee instanceof Attendee ) && $attendee->is_host() ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        return true;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -186,7 +198,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        return true;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attendee = $this->attendee_repository->get_attendee( $event->id(), $user->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attendee = $this->attendee_repository->get_attendee_for_event_for_user( $event->id(), $user->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">                 if ( ( $attendee instanceof Attendee ) && $attendee->is_host() ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        return true;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -232,7 +244,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        return true;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attendee = $this->attendee_repository->get_attendee( $event->id(), $user->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attendee = $this->attendee_repository->get_attendee_for_event_for_user( $event->id(), $user->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">                 if ( ( $attendee instanceof Attendee ) && $attendee->is_host() ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        return true;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -240,6 +252,43 @@
</span><span class="cx" style="display: block; padding: 0 10px">                return false;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        /**
+        * Evaluate whether a user can edit event title for a specific event.
+        *
+        * @param WP_User $user  User for which we're evaluating the capability.
+        * @param Event   $event Event for which we're evaluating the capability.
+        * @return bool
+        */
+       private function has_edit_field( WP_User $user, Event $event, $cap ): bool {
+               $now                 = new DateTimeImmutable( 'now', new DateTimeZone( 'UTC' ) );
+               $event_end_plus_1_hr = $event->end()->modify( '+1 hour' );
+
+               if ( self::EDIT_DESCRIPTION === $cap ) {
+                       return true;
+               }
+
+               if ( $event->start() > $now ) {
+                       return true;
+               }
+
+               if ( $event->is_active() && ! $this->stats_calculator->event_has_stats( $event->id() ) ) {
+                       return true;
+               }
+
+               if ( $event->is_active() && $this->stats_calculator->event_has_stats( $event->id() ) ) {
+                       return ( self::EDIT_TITLE === $cap || self::EDIT_END === $cap );
+               }
+
+               if ( $event->end()->is_in_the_past() && $now < $event_end_plus_1_hr ) {
+                       return ( self::EDIT_TITLE === $cap || self::EDIT_END === $cap );
+               }
+               if ( $event->end()->is_in_the_past() && $now > $event_end_plus_1_hr ) {
+                       return ( self::EDIT_DESCRIPTION === $cap );
+               }
+
+               return false;
+       }
+
</ins><span class="cx" style="display: block; padding: 0 10px">         public function register_hooks(): void {
</span><span class="cx" style="display: block; padding: 0 10px">                add_action(
</span><span class="cx" style="display: block; padding: 0 10px">                        'user_has_cap',
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludeseventeventformhandlerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event-form-handler.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event-form-handler.php        2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event-form-handler.php  2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -29,7 +29,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        wp_send_json_error( esc_html__( 'Invalid form name.', 'gp-translation-events' ), 403 );
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $event_id = isset( $form_data['event_id'] ) ? sanitize_text_field( wp_unslash( $form_data['event_id'] ) ) : 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $event_id = isset( $form_data['event_id'] ) ? intval( sanitize_text_field( wp_unslash( $form_data['event_id'] ) ) ) : 0;
+               $event    = null;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                if ( 'create_event' === $action && ( ! current_user_can( 'create_translation_event' ) ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        wp_send_json_error( esc_html__( 'You do not have permissions to create events.', 'gp-translation-events' ), 403 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,10 +55,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $response_message = '';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                if ( $event_id ) {
+                       $event = $this->event_repository->get_event( $event_id );
+               }
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 if ( 'trash_event' === $action ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        // Trash event.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $event_id = intval( sanitize_text_field( wp_unslash( $form_data['event_id'] ) ) );
-                       $event    = $this->event_repository->get_event( $event_id );
</del><span class="cx" style="display: block; padding: 0 10px">                         if ( ! $event ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                wp_send_json_error( esc_html__( 'Event does not exist.', 'gp-translation-events' ), 404 );
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -84,6 +87,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        // Create or update event.
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        try {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                if ( 'edit_event' === $action && $event ) {
+                                       $form_data['event_timezone'] = $event->timezone()->getName();
+                               }
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $new_event = $this->parse_form_data( $form_data );
</span><span class="cx" style="display: block; padding: 0 10px">                        } catch ( InvalidTimeZone $e ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                wp_send_json_error( esc_html__( 'Invalid time zone.', 'gp-translation-events' ), 422 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,11 +110,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                return;
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if ( $new_event->end() < new DateTime( 'now', new DateTimeZone( 'UTC' ) ) ) {
-                               wp_send_json_error( esc_html__( 'Past events cannot be created or edited.', 'gp-translation-events' ), 422 );
-                               return;
-                       }
-
</del><span class="cx" style="display: block; padding: 0 10px">                         // This is a list of slugs that are not allowed, as they conflict with the event URLs.
</span><span class="cx" style="display: block; padding: 0 10px">                        $invalid_slugs = array( 'new', 'edit', 'attend', 'my-events' );
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( in_array( sanitize_title( $new_event->title() ), $invalid_slugs, true ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -132,10 +133,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                try {
</span><span class="cx" style="display: block; padding: 0 10px">                                        $event->set_status( $new_event->status() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        $event->set_title( $new_event->title() );
-                                       $event->set_description( $new_event->description() );
-                                       $event->set_timezone( $new_event->timezone() );
-                                       $event->set_times( $new_event->start(), $new_event->end() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 if ( current_user_can( 'edit_translation_event_title', $event->id() ) ) {
+                                               $event->set_title( $new_event->title() );
+                                       }
+                                       if ( current_user_can( 'edit_translation_event_description', $event->id() ) ) {
+                                               $event->set_description( $new_event->description() );
+                                       }
+                                       if ( current_user_can( 'edit_translation_event_timezone', $event->id() ) ) {
+                                               $event->set_timezone( $new_event->timezone() );
+                                       }
+
+                                       $event->validate_times( $new_event->start(), $new_event->end() );
+
+                                       if ( current_user_can( 'edit_translation_event_start', $event->id() ) ) {
+                                               $event->set_start( $new_event->start() );
+                                       }
+                                       if ( current_user_can( 'edit_translation_event_end', $event->id() ) ) {
+                                               $event->set_end( $new_event->end() );
+                                       }
</ins><span class="cx" style="display: block; padding: 0 10px">                                 } catch ( Exception $e ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                        wp_send_json_error( esc_html__( 'Failed to update event.', 'gp-translation-events' ), 422 );
</span><span class="cx" style="display: block; padding: 0 10px">                                        return;
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludeseventeventrepositoryinterfacephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event-repository-interface.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event-repository-interface.php        2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event-repository-interface.php  2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -100,6 +100,18 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function get_trashed_events( int $page = -1, int $page_size = -1 ): Events_Query_Result;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * Get events for a given user. Includes events created by the user.
+        *
+        * @param int $user_id   Id of the user.
+        * @param int $page      Index of the page to return.
+        * @param int $page_size Page size.
+        *
+        * @return Events_Query_Result
+        * @throws Exception
+        */
+       public function get_events_for_user( int $user_id, int $page = -1, int $page_size = -1 ): Events_Query_Result;
+
+       /**
</ins><span class="cx" style="display: block; padding: 0 10px">          * Get events that are currently active for a given user.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @param int $user_id   Id of the user.
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludeseventeventrepositoryphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event-repository.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event-repository.php  2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event-repository.php    2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -223,6 +223,24 @@
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        public function get_events_for_user( int $user_id, int $page = -1, int $page_size = -1 ): Events_Query_Result {
+               // phpcs:disable WordPress.DB.SlowDBQuery.slow_db_query_meta_key
+               return $this->execute_events_query(
+                       $page,
+                       $page_size,
+                       array(
+                               'post_status' => array( 'publish', 'draft' ),
+                               'meta_key'    => '_event_start',
+                               'orderby'     => 'meta_value',
+                               'order'       => 'DESC',
+                       ),
+                       array(),
+                       $user_id,
+                       true,
+               );
+               // phpcs:enable
+       }
+
</ins><span class="cx" style="display: block; padding: 0 10px">         public function get_current_events_for_user( int $user_id, int $page = -1, int $page_size = -1 ): Events_Query_Result {
</span><span class="cx" style="display: block; padding: 0 10px">                $now = new DateTimeImmutable( 'now', new DateTimeZone( 'UTC' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -250,7 +268,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'orderby'    => 'meta_value',
</span><span class="cx" style="display: block; padding: 0 10px">                                'order'      => 'ASC',
</span><span class="cx" style="display: block; padding: 0 10px">                        ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $this->attendee_repository->get_events_for_user( $user_id ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 array(),
+                       $user_id,
</ins><span class="cx" style="display: block; padding: 0 10px">                 );
</span><span class="cx" style="display: block; padding: 0 10px">                // phpcs:enable
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -276,7 +295,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'orderby'    => 'meta_value',
</span><span class="cx" style="display: block; padding: 0 10px">                                'order'      => 'ASC',
</span><span class="cx" style="display: block; padding: 0 10px">                        ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $this->attendee_repository->get_events_for_user( $user_id ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 array(),
+                       $user_id,
</ins><span class="cx" style="display: block; padding: 0 10px">                 );
</span><span class="cx" style="display: block; padding: 0 10px">                // phpcs:enable
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -284,11 +304,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function get_past_events_for_user( int $user_id, int $page = -1, int $page_size = -1 ): Events_Query_Result {
</span><span class="cx" style="display: block; padding: 0 10px">                $now = new DateTimeImmutable( 'now', new DateTimeZone( 'UTC' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_events = $this->attendee_repository->get_events_for_user( $user_id );
-               if ( empty( $user_events ) ) {
-                       return new Events_Query_Result( array(), 1, 1 );
-               }
-
</del><span class="cx" style="display: block; padding: 0 10px">                 // phpcs:disable WordPress.DB.SlowDBQuery.slow_db_query_meta_query
</span><span class="cx" style="display: block; padding: 0 10px">                // phpcs:disable WordPress.DB.SlowDBQuery.slow_db_query_meta_key
</span><span class="cx" style="display: block; padding: 0 10px">                return $this->execute_events_query(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -308,7 +323,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'orderby'    => 'meta_value',
</span><span class="cx" style="display: block; padding: 0 10px">                                'order'      => 'DESC',
</span><span class="cx" style="display: block; padding: 0 10px">                        ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $user_events
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 array(),
+                       $user_id,
</ins><span class="cx" style="display: block; padding: 0 10px">                 );
</span><span class="cx" style="display: block; padding: 0 10px">                // phpcs:enable
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -434,7 +450,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @throws InvalidStatus
</span><span class="cx" style="display: block; padding: 0 10px">         * @throws Exception
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        private function execute_events_query( int $page, int $page_size, array $args, array $filter_by_ids = array() ): Events_Query_Result {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ private function execute_events_query(
+               int $page,
+               int $page_size,
+               array $args,
+               array $filter_by_ids = array(),
+               int $user_id = null,
+               bool $include_created_by_user = false
+       ): Events_Query_Result {
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->assert_pagination_arguments( $page, $page_size );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $args = array_replace_recursive(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -454,10 +477,26 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $args['post__in'] = $filter_by_ids;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $query  = new WP_Query( $args );
-               $posts  = $query->get_posts();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( null !== $user_id ) {
+                       $user_id_filter_callback = 'Wporg\TranslationEvents\Event\add_user_id_where_clause_to_events_query';
+                       $user_id_filter_priority = 10;
+                       // Only return events for which this user is an attendee, or (optionally) the event author.
+                       // We use a filter to modify the where clause of the query.
+                       // The filter removes itself, so it will only apply to the next query.
+                       add_filter( 'posts_where', $user_id_filter_callback, $user_id_filter_priority, 2 );
+                       $args['translation_events_user_id']                 = $user_id;
+                       $args['translation_events_include_created_by_user'] = $include_created_by_user;
+               }
+
+               $query = new WP_Query( $args );
+               $posts = $query->get_posts();
+
+               if ( isset( $user_id_filter_callback ) ) {
+                       // Remove the filter, so it only applies to this query.
+                       remove_filter( 'posts_where', $user_id_filter_callback, $user_id_filter_priority );
+               }
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 $events = array();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px">                 foreach ( $posts as $post ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        $meta = $this->get_event_meta( $post->ID );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -533,3 +572,41 @@
</span><span class="cx" style="display: block; padding: 0 10px">                update_post_meta( $event->id(), '_hosts', $hosts_ids );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+// phpcs:ignore Universal.Files.SeparateFunctionsFromOO.Mixed
+function add_user_id_where_clause_to_events_query( string $where, WP_Query $query ): string {
+       $user_id = $query->get( 'translation_events_user_id' );
+       if ( ! $user_id || ! is_int( $user_id ) ) {
+               return $where;
+       }
+
+       $include_created_by_user = $query->get( 'translation_events_include_created_by_user' ) ?? false;
+
+       global $wpdb, $gp_table_prefix;
+       $posts_table     = "{$wpdb->prefix}posts";
+       $attendees_table = "{$gp_table_prefix}event_attendees";
+
+       $posts_where = array();
+       if ( $include_created_by_user ) {
+               $posts_where[] = "$posts_table.post_author = $user_id";
+       }
+
+       $event_ids = wp_cache_get( 'events_for_user_' . $user_id );
+       if ( false === $event_ids ) {
+               // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery
+               // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared
+               $event_ids = $wpdb->get_col( $wpdb->prepare( "SELECT event_id FROM $attendees_table WHERE user_id = %d", $user_id ) );
+               // phpcs:enable
+               wp_cache_set( 'events_for_user_' . $user_id, $event_ids );
+       }
+
+       if ( ! empty( $event_ids ) ) {
+               $posts_where[] = "$posts_table.ID IN ( " . implode( ', ', array_map( 'intval', $event_ids ) ) . ' )';
+       }
+       if ( empty( $posts_where ) ) {
+               // If there are no events for this user, we want to return an empty result set.
+               return $where . ' AND 0 = 1';
+       }
+
+       return $where . ' AND ( ' . implode( ' OR ', $posts_where ) . ' )';
+}
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludeseventeventphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event.php     2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event.php       2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -57,7 +57,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                string $description
</span><span class="cx" style="display: block; padding: 0 10px">        ) {
</span><span class="cx" style="display: block; padding: 0 10px">                $this->author_id = $author_id;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->set_times( $start, $end );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->validate_times( $start, $end );
+               $this->set_start( $start );
+               $this->set_end( $end );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->set_timezone( $timezone );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->set_status( $status );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->set_title( $title );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -129,15 +131,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->slug = $slug;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        /**
-        * @throws InvalidStart|InvalidEnd
-        */
-       public function set_times( Event_Start_Date $start, Event_End_Date $end ): void {
-               $this->validate_times( $start, $end );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_start( Event_Start_Date $start ): void {
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->start = $start;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->end   = $end;
</del><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        public function set_end( Event_End_Date $end ): void {
+               $this->end = $end;
+       }
+
</ins><span class="cx" style="display: block; padding: 0 10px">         public function set_timezone( DateTimeZone $timezone ): void {
</span><span class="cx" style="display: block; padding: 0 10px">                $this->timezone = $timezone;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -164,7 +165,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @throws InvalidStart
</span><span class="cx" style="display: block; padding: 0 10px">         * @throws InvalidEnd
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        private function validate_times( Event_Start_Date $start, Event_End_Date $end ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function validate_times( Event_Start_Date $start, Event_End_Date $end ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                 if ( $end <= $start ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        throw new InvalidEnd();
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludesroutesattendeeremovephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/attendee/remove.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/attendee/remove.php  2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/attendee/remove.php    2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,10 +47,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->die_with_error( esc_html__( 'You do not have permission to edit this event.', 'gp-translation-events' ), 403 );
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attendee = $this->attendee_repository->get_attendee( $event->id(), $user_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attendee = $this->attendee_repository->get_attendee_for_event_for_user( $event->id(), $user_id );
</ins><span class="cx" style="display: block; padding: 0 10px">                 if ( $attendee instanceof Attendee ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( ! current_user_can( 'edit_translation_event_attendees', $event->id() ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $this->die_with_error( esc_html__( 'You do not have permission to remove this attendee.', 'gp-translation-events' ), 400 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $this->die_with_error( esc_html__( 'You do not have permission to remove this attendee.', 'gp-translation-events' ), 403 );
</ins><span class="cx" style="display: block; padding: 0 10px">                         }
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->attendee_repository->remove_attendee( $event->id(), $user_id );
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludesrouteseventcreatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/event/create.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/event/create.php     2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/event/create.php       2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,7 +21,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                if ( ! current_user_can( 'create_translation_event' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $this->die_with_error( 'You do not have permission to create events.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $this->die_with_error( 'You do not have permission to create events.', 403 );
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $now = new DateTimeImmutable( 'now', new DateTimeZone( 'UTC' ) );
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludesrouteseventimagephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/event/image.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/event/image.php                              (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/event/image.php        2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,107 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+namespace Wporg\TranslationEvents\Routes\Event;
+
+use Wporg\TranslationEvents\Routes\Route;
+use Wporg\TranslationEvents\Event\Event_Repository_Interface;
+use Wporg\TranslationEvents\Translation_Events;
+
+/**
+ * Displays the image for the event.
+ */
+class Image_Route extends Route {
+
+       /**
+        * @var Event_Repository_Interface
+        */
+       private Event_Repository_Interface $event_repository;
+
+       /**
+        * Image_Route constructor.
+        */
+       public function __construct() {
+               parent::__construct();
+               $this->event_repository = Translation_Events::get_event_repository();
+       }
+
+       /**
+        * Handles the request.
+        *
+        * Generates an image with the event title.
+        *
+        * @param int $event_id The event ID.
+        */
+       public function handle( int $event_id ): void {
+               if ( ! extension_loaded( 'gd' ) ) {
+                       $this->die_with_error( esc_html__( 'The image cannot be generated because GD extension is not installed.', 'gp-translation-events' ) );
+               }
+
+               $event = $this->event_repository->get_event( $event_id );
+               $text  = ! $event ? esc_html__( 'Translation events', 'gp-translation-events' ) : $event->title();
+               $text  = '' === $text ? esc_html__( 'Translation events', 'gp-translation-events' ) : $text;
+               $text  = substr( $text, 0, 44 ); // Limit the text to 44 characters.
+
+               $lines = $this->split_text( $text, 22 ); // Limit each line to 22 characters.
+               $text1 = $lines[0];
+               $text2 = $lines[1] ?? '';
+
+               $image    = imagecreatetruecolor( 1200, 675 );
+               $bg_color = imagecolorallocate( $image, 35, 40, 45 );
+               imagefill( $image, 0, 0, $bg_color );
+               $text_color = imagecolorallocate( $image, 255, 255, 255 );
+               $font       = trailingslashit( dirname( __DIR__, 3 ) ) . 'assets/fonts/eb-garamond/EBGaramond-Regular.ttf';
+               $text_size  = 70;
+               $text_angle = 0;
+
+               $text_box1   = imagettfbbox( $text_size, $text_angle, $font, $text1 );
+               $text_width1 = $text_box1[4] - $text_box1[0];
+               $text_x1     = ( 1200 - $text_width1 ) / 2;
+               $text_y1     = 350;
+               if ( '' !== $text2 ) {
+                       $text_y1 -= 50;
+               }
+
+               if ( '' !== $text2 ) {
+                       $text_box2   = imagettfbbox( $text_size, $text_angle, $font, $text2 );
+                       $text_width2 = $text_box2[4] - $text_box2[0];
+                       $text_x2     = ( 1200 - $text_width2 ) / 2;
+                       $text_y2     = $text_y1 + 110;
+                       imagettftext( $image, $text_size, $text_angle, $text_x2, $text_y2, $text_color, $font, $text2 );
+               }
+
+               imagettftext( $image, $text_size, $text_angle, $text_x1, $text_y1, $text_color, $font, $text1 );
+
+               header( 'Content-type: image/png' );
+               imagepng( $image );
+               imagedestroy( $image );
+       }
+
+       /**
+        * Splits a string into two lines based on the maximum line length.
+        *
+        * @param string $text       The text to split.
+        * @param int    $max_length The maximum length of each line.
+        *
+        * @return string[]
+        */
+       private function split_text( string $text, int $max_length ): array {
+               if ( strlen( $text ) <= $max_length ) {
+                       return array( $text );
+               }
+
+               $words = explode( ' ', $text );
+
+               $line1 = '';
+               $line2 = '';
+
+               foreach ( $words as $word ) {
+                       if ( strlen( $line1 . ' ' . $word ) <= $max_length ) {
+                               $line1 .= ( '' === $line1 ? '' : ' ' ) . $word;
+                       } else {
+                               $line2 .= ( '' === $line2 ? '' : ' ' ) . $word;
+                       }
+               }
+
+               return array( $line1, $line2 );
+       }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/event/image.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludesrouteseventlisttrashedphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/event/list-trashed.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/event/list-trashed.php       2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/event/list-trashed.php 2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,7 +25,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                if ( ! current_user_can( 'manage_translation_events' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $this->die_with_error( 'You do not have permission to manage events.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $this->die_with_error( 'You do not have permission to manage events.', 403 );
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $current_page = 1;
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludesroutesuserattendeventphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/user/attend-event.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/user/attend-event.php        2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/user/attend-event.php  2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,7 +46,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->die_with_error( esc_html__( 'Cannot attend or un-attend a past event', 'gp-translation-events' ), 403 );
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attendee = $this->attendee_repository->get_attendee( $event->id(), $user_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attendee = $this->attendee_repository->get_attendee_for_event_for_user( $event->id(), $user_id );
</ins><span class="cx" style="display: block; padding: 0 10px">                 if ( $attendee instanceof Attendee ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( $attendee->is_contributor() ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $this->die_with_error( esc_html__( 'Contributors cannot un-attend the event', 'gp-translation-events' ), 403 );
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludesroutesuserhosteventphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/user/host-event.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/user/host-event.php  2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/user/host-event.php    2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,7 +49,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->die_with_404();
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $affected_attendee = $this->attendee_repository->get_attendee( $event_id, $user_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $affected_attendee = $this->attendee_repository->get_attendee_for_event_for_user( $event_id, $user_id );
</ins><span class="cx" style="display: block; padding: 0 10px">                 // The user is attending to the event, so if I don't find the attendee, I won't create it.
</span><span class="cx" style="display: block; padding: 0 10px">                if ( $affected_attendee instanceof Attendee ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( $affected_attendee->is_host() ) {
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludesroutesusermyeventsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/user/my-events.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/user/my-events.php   2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/user/my-events.php     2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2,6 +2,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> namespace Wporg\TranslationEvents\Routes\User;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+use Wporg\TranslationEvents\Attendee\Attendee_Repository;
</ins><span class="cx" style="display: block; padding: 0 10px"> use Wporg\TranslationEvents\Event\Event_Repository_Interface;
</span><span class="cx" style="display: block; padding: 0 10px"> use Wporg\TranslationEvents\Routes\Route;
</span><span class="cx" style="display: block; padding: 0 10px"> use Wporg\TranslationEvents\Translation_Events;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11,10 +12,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> class My_Events_Route extends Route {
</span><span class="cx" style="display: block; padding: 0 10px">        private Event_Repository_Interface $event_repository;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        private Attendee_Repository $attendee_repository;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function __construct() {
</span><span class="cx" style="display: block; padding: 0 10px">                parent::__construct();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->event_repository = Translation_Events::get_event_repository();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->event_repository    = Translation_Events::get_event_repository();
+               $this->attendee_repository = Translation_Events::get_attendee_repository();
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function handle(): void {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,52 +26,35 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        wp_safe_redirect( wp_login_url( home_url( $wp->request ) ) );
</span><span class="cx" style="display: block; padding: 0 10px">                        exit;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                include ABSPATH . 'wp-admin/includes/post.php';
</del><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $_events_i_am_or_will_attend_paged = 1;
-               $_events_i_created_paged           = 1;
-               $_events_i_hosted_paged            = 1;
-               $_events_i_attended_paged          = 1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = get_current_user_id();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                $page = 1;
</ins><span class="cx" style="display: block; padding: 0 10px">                 // phpcs:disable WordPress.Security.NonceVerification.Recommended
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( isset( $_GET['events_i_am_or_will_attend_paged'] ) ) {
-                       $value = sanitize_text_field( wp_unslash( $_GET['events_i_am_or_will_attend_paged'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( isset( $_GET['page'] ) ) {
+                       $value = sanitize_text_field( wp_unslash( $_GET['page'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                         if ( is_numeric( $value ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $_events_i_am_or_will_attend_paged = (int) $value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $page = (int) $value;
</ins><span class="cx" style="display: block; padding: 0 10px">                         }
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( isset( $_GET['events_i_created_paged'] ) ) {
-                       $value = sanitize_text_field( wp_unslash( $_GET['events_i_created_paged'] ) );
-                       if ( is_numeric( $value ) ) {
-                               $_events_i_created_paged = (int) $value;
-                       }
-               }
-               if ( isset( $_GET['events_i_hosted_paged'] ) ) {
-                       $value = sanitize_text_field( wp_unslash( $_GET['events_i_hosted_paged'] ) );
-                       if ( is_numeric( $value ) ) {
-                               $_events_i_hosted_paged = (int) $value;
-                       }
-               }
-               if ( isset( $_GET['events_i_attended_paged'] ) ) {
-                       $value = sanitize_text_field( wp_unslash( $_GET['events_i_attended_paged'] ) );
-                       if ( is_numeric( $value ) ) {
-                               $_events_i_attended_paged = (int) $value;
-                       }
-               }
</del><span class="cx" style="display: block; padding: 0 10px">                 // phpcs:enable
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $events_i_am_or_will_attend_query = $this->event_repository->get_current_and_upcoming_events_for_user( get_current_user_id(), $_events_i_am_or_will_attend_paged, 10 );
-               $events_i_created_query           = $this->event_repository->get_events_created_by_user( get_current_user_id(), $_events_i_created_paged, 10 );
-               $events_i_host_query              = $this->event_repository->get_events_hosted_by_user( get_current_user_id(), $_events_i_hosted_paged, 10 );
-               $events_i_attended_query          = $this->event_repository->get_past_events_for_user( get_current_user_id(), $_events_i_attended_paged, 10 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $events = $this->event_repository->get_events_for_user( get_current_user_id(), $page, 10 );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                $event_ids = array_map(
+                       function ( $event ) {
+                               return $event->id();
+                       },
+                       $events->events,
+               );
+
+               $current_user_attendee_per_event = $this->attendee_repository->get_attendees_for_events_for_user( $event_ids, $user_id );
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->tmpl(
</span><span class="cx" style="display: block; padding: 0 10px">                        'events-my-events',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        array(
-                               'events_i_am_or_will_attend_query' => $events_i_am_or_will_attend_query,
-                               'events_i_created_query'           => $events_i_created_query,
-                               'events_i_host_query'              => $events_i_host_query,
-                               'events_i_attended_query'          => $events_i_attended_query,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 compact(
+                               'events',
+                               'current_user_attendee_per_event'
</ins><span class="cx" style="display: block; padding: 0 10px">                         ),
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludesstatsstatslistenerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/stats/stats-listener.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/stats/stats-listener.php    2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/stats/stats-listener.php      2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,8 +7,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> use Exception;
</span><span class="cx" style="display: block; padding: 0 10px"> use GP_Translation;
</span><span class="cx" style="display: block; padding: 0 10px"> use GP_Translation_Set;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-use Wporg\TranslationEvents\Attendee\Attendee_Repository;
-use Wporg\TranslationEvents\Event\Event;
</del><span class="cx" style="display: block; padding: 0 10px"> use Wporg\TranslationEvents\Event\Event_Repository_Interface;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> class Stats_Listener {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,15 +15,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">        const ACTION_REJECT          = 'reject';
</span><span class="cx" style="display: block; padding: 0 10px">        const ACTION_REQUEST_CHANGES = 'request_changes';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        private Attendee_Repository $attendee_repository;
</del><span class="cx" style="display: block; padding: 0 10px">         private Event_Repository_Interface $event_repository;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        public function __construct(
-               Event_Repository_Interface $event_repository,
-               Attendee_Repository $attendee_repository
-       ) {
-               $this->event_repository    = $event_repository;
-               $this->attendee_repository = $attendee_repository;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct( Event_Repository_Interface $event_repository ) {
+               $this->event_repository = $event_repository;
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function start(): void {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -76,9 +69,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        private function handle_action( GP_Translation $translation, int $user_id, string $action, DateTimeImmutable $happened_at ): void {
</span><span class="cx" style="display: block; padding: 0 10px">                try {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        // Get events that are active when the action happened, for which the user is registered for.
-                       $active_events = $this->event_repository->get_current_events();
-                       $events        = $this->select_events_user_is_registered_for( $active_events->events, $user_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 // Get events that are active now, for which the user is registered for.
+                       $events = $this->event_repository->get_current_events_for_user( $user_id )->events;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        // phpcs:ignore Generic.Commenting.DocComment.MissingShort
</span><span class="cx" style="display: block; padding: 0 10px">                        /** @var GP_Translation_Set $translation_set Translation set */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -113,24 +105,4 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        error_log( $exception );
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
-       /**
-        * Filter an array of events so that it only includes events the given user is attending.
-        *
-        * @param Event[] $events Events.
-        *
-        * @return Event[]
-        */
-       // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
-       // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.Found
-       private function select_events_user_is_registered_for( array $events, int $user_id ): array {
-               $attending_event_ids = $this->attendee_repository->get_events_for_user( $user_id );
-               return array_filter(
-                       $events,
-                       function ( Event $event ) use ( $attending_event_ids ) {
-                               return in_array( $event->id(), $attending_event_ids, true );
-                       }
-               );
-       }
-       // phpcs:enable
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventsincludesurlsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/urls.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/urls.php    2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/urls.php      2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,6 +49,26 @@
</span><span class="cx" style="display: block; padding: 0 10px">                return gp_url( '/events/new/' );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        /**
+        * Returns the absolute URL to the image for the event.
+        *
+        * @param int $event_id The event ID.
+        *
+        * @return string
+        */
+       public static function event_image( int $event_id ): string {
+               return home_url( gp_url( "events/image/$event_id" ) );
+       }
+
+       /**
+        * Returns the absolute URL to the default event image.
+        *
+        * @return string
+        */
+       public static function event_default_image(): string {
+               return self::event_image( 0 );
+       }
+
</ins><span class="cx" style="display: block; padding: 0 10px">         public static function event_toggle_attendee( int $event_id ): string {
</span><span class="cx" style="display: block; padding: 0 10px">                return gp_url( "/events/attend/$event_id" );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventstemplateseventphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/event.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/event.php  2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/event.php    2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,8 +27,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> Templates::header(
</span><span class="cx" style="display: block; padding: 0 10px">        array(
</span><span class="cx" style="display: block; padding: 0 10px">                /* translators: %s: Event title. */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                'html_title'  => sprintf( __( 'Translation Events - %s' ), esc_html( $event->title() ) ),
-               'page_title'  => function () use ( $event ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         'html_title'       => sprintf( __( 'Translation Events - %s' ), esc_html( $event->title() ) ),
+               'page_title'       => function () use ( $event ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         echo esc_html( $event->title() );
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( 'draft' === $event->status() ) : ?>
</span><span class="cx" style="display: block; padding: 0 10px">                                <span class="event-label-draft"><?php echo esc_html( $event->status() ); ?></span>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -35,8 +35,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        <?php endif; ?>
</span><span class="cx" style="display: block; padding: 0 10px">                        <?php
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                'breadcrumbs' => array( esc_html( $event->title() ) ),
-               'sub_head'    => function () use ( $event, $user, $hosts ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         'html_description' => $event->description(),
+               'url'              => Urls::event_details_absolute( $event->id() ),
+               'image_url'        => Urls::event_image( $event->id() ),
+               'breadcrumbs'      => array( esc_html( $event->title() ) ),
+               'sub_head'         => function () use ( $event, $user, $hosts ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         ?>
</span><span class="cx" style="display: block; padding: 0 10px">                        <span class="event-host">
</span><span class="cx" style="display: block; padding: 0 10px">                                <?php
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventstemplateseventsformphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/events-form.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/events-form.php    2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/events-form.php      2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        <input type="hidden" id="event-form-action" name="event_form_action">
</span><span class="cx" style="display: block; padding: 0 10px">        <div>
</span><span class="cx" style="display: block; padding: 0 10px">                <label for="event-title"><?php esc_html_e( 'Event Title', 'gp-translation-events' ); ?></label>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                <input type="text" id="event-title" name="event_title" value="<?php echo esc_html( $event->title() ); ?>" required size="42">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <input type="text" id="event-title" name="event_title" value="<?php echo esc_html( $event->title() ); ?>" <?php echo esc_html( $is_create_form || current_user_can( 'edit_translation_event_title', $event->id() ) ?: 'readonly' ); ?> required size="42">
</ins><span class="cx" style="display: block; padding: 0 10px">         </div>
</span><span class="cx" style="display: block; padding: 0 10px">        <?php $event_url_class = $is_create_form ? 'hide-event-url' : ''; ?>
</span><span class="cx" style="display: block; padding: 0 10px">        <?php $event_url = $is_create_form ? '' : Urls::event_details_absolute( $event->id() ); ?>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,7 +46,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        </div>
</span><span class="cx" style="display: block; padding: 0 10px">        <div>
</span><span class="cx" style="display: block; padding: 0 10px">                <label for="event-description"><?php esc_html_e( 'Event Description', 'gp-translation-events' ); ?></label>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                <textarea id="event-description" name="event_description" rows="4" cols="40" required><?php echo esc_html( $event->description() ); ?></textarea>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <textarea id="event-description" name="event_description" rows="4" cols="40" required <?php echo esc_html( $is_create_form || current_user_can( 'edit_translation_event_description', $event->id() ) ?: 'readonly' ); ?>><?php echo esc_html( $event->description() ); ?></textarea>
</ins><span class="cx" style="display: block; padding: 0 10px">                 <?php
</span><span class="cx" style="display: block; padding: 0 10px">                echo wp_kses(
</span><span class="cx" style="display: block; padding: 0 10px">                        Event_Text_Snippet::get_snippet_links(),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,15 +63,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">                ?>
</span><span class="cx" style="display: block; padding: 0 10px">                        <div>
</span><span class="cx" style="display: block; padding: 0 10px">                <label for="event-start"><?php esc_html_e( 'Start Date', 'gp-translation-events' ); ?></label>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                <input type="datetime-local" id="event-start" name="event_start" value="<?php echo esc_attr( $event->start()->format( 'Y-m-d H:i' ) ); ?>" required>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <input type="datetime-local" id="event-start" name="event_start" value="<?php echo esc_attr( $event->start()->format( 'Y-m-d H:i' ) ); ?>" required <?php echo esc_html( $is_create_form || current_user_can( 'edit_translation_event_start', $event->id() ) ?: 'readonly' ); ?> >
</ins><span class="cx" style="display: block; padding: 0 10px">         </div>
</span><span class="cx" style="display: block; padding: 0 10px">        <div>
</span><span class="cx" style="display: block; padding: 0 10px">                <label for="event-end"><?php esc_html_e( 'End Date', 'gp-translation-events' ); ?></label>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                <input type="datetime-local" id="event-end" name="event_end" value="<?php echo esc_attr( $event->end()->format( 'Y-m-d H:i' ) ); ?>" required>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <input type="datetime-local" id="event-end" name="event_end" value="<?php echo esc_attr( $event->end()->format( 'Y-m-d H:i' ) ); ?>" required <?php echo esc_html( $is_create_form || current_user_can( 'edit_translation_event_end', $event->id() ) ?: 'readonly' ); ?>>
</ins><span class="cx" style="display: block; padding: 0 10px">         </div>
</span><span class="cx" style="display: block; padding: 0 10px">        <div>
</span><span class="cx" style="display: block; padding: 0 10px">                <label for="event-timezone"><?php esc_html_e( 'Event Timezone', 'gp-translation-events' ); ?></label>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                <select id="event-timezone" name="event_timezone" required>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <select id="event-timezone" name="event_timezone" required <?php echo esc_html( $is_create_form || current_user_can( 'edit_translation_event_timezone', $event->id() ) ?: 'disabled' ); ?> >
</ins><span class="cx" style="display: block; padding: 0 10px">                         <?php
</span><span class="cx" style="display: block; padding: 0 10px">                        echo wp_kses(
</span><span class="cx" style="display: block; padding: 0 10px">                                wp_timezone_choice( $is_create_form ? null : $event->timezone()->getName(), get_user_locale() ),
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventstemplateseventsmyeventsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/events-my-events.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/events-my-events.php       2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/events-my-events.php 2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,12 +4,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> namespace Wporg\TranslationEvents\Templates;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+use Wporg\TranslationEvents\Attendee\Attendee;
</ins><span class="cx" style="display: block; padding: 0 10px"> use Wporg\TranslationEvents\Event\Events_Query_Result;
</span><span class="cx" style="display: block; padding: 0 10px"> use Wporg\TranslationEvents\Templates;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/** @var Events_Query_Result $events_i_created_query */
-/** @var Events_Query_Result $events_i_host_query */
-/** @var Events_Query_Result $events_i_attended_query */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @var Events_Query_Result $events */
+/** @var ?Attendee[] $current_user_attendee_per_event Associative array with event id as key, and boolean as value. */
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> Templates::header(
</span><span class="cx" style="display: block; padding: 0 10px">        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -18,93 +18,29 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'breadcrumbs' => array( esc_html__( 'My Events', 'gp-translation-events' ) ),
</span><span class="cx" style="display: block; padding: 0 10px">        ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<div class="events-links-to-anchors">
-       <ul>
-               <?php if ( ! empty( $events_i_am_or_will_attend_query->events ) ) : ?>
-                       <li><a href="#events-i-am-or-will-attend"><?php esc_html_e( 'Events I am or will be attending', 'gp-translation-events' ); ?></a></li>
-               <?php endif; ?>
-               <?php if ( ! empty( $events_i_host_query->events ) ) : ?>
-                       <li><a href="#events-i-host"><?php esc_html_e( 'Events I host', 'gp-translation-events' ); ?></a></li>
-               <?php endif; ?>
-               <?php if ( ! empty( $events_i_created_query->events ) ) : ?>
-                       <li><a href="#events-i-created"><?php esc_html_e( 'Events I have created', 'gp-translation-events' ); ?></a></li>
-               <?php endif; ?>
-               <?php if ( ! empty( $events_i_attended_query->events ) ) : ?>
-                       <li><a href="#events-i-attended"><?php esc_html_e( 'Events I attended', 'gp-translation-events' ); ?></a></li>
-               <?php endif; ?>
-               </ul>
-</div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> <div class="event-page-wrapper">
</span><span class="cx" style="display: block; padding: 0 10px">        <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( empty( $events_i_am_or_will_attend_query->events ) && empty( $events_i_created_query->events ) && empty( $events_i_host_query->events ) && empty( $events_i_attended_query->post_count ) ) :
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( empty( $events->events ) ) :
</ins><span class="cx" style="display: block; padding: 0 10px">                 esc_html_e( 'No events found.', 'gp-translation-events' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        endif;
-       ?>
-
-       <?php if ( ! empty( $events_i_am_or_will_attend_query->events ) ) : ?>
-               <h2 id="events-i-am-or-will-attend"><?php esc_html_e( 'Events I am or will be attending', 'gp-translation-events' ); ?> </h2>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ else :
+               ?>
</ins><span class="cx" style="display: block; padding: 0 10px">                 <?php
</span><span class="cx" style="display: block; padding: 0 10px">                Templates::partial(
</span><span class="cx" style="display: block; padding: 0 10px">                        'event-list',
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                'query'                  => $events_i_am_or_will_attend_query,
-                               'pagination_query_param' => 'events_i_am_or_will_attend_paged',
-                               'show_start'             => true,
-                               'show_end'               => true,
-                               'relative_time'          => false,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         'query'                           => $events,
+                               'pagination_query_param'          => 'page',
+                               'show_start'                      => true,
+                               'show_end'                        => true,
+                               'relative_time'                   => false,
+                               'current_user_attendee_per_event' => $current_user_attendee_per_event,
</ins><span class="cx" style="display: block; padding: 0 10px">                         ),
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px">        endif;
</span><span class="cx" style="display: block; padding: 0 10px">        ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
-       <?php if ( ! empty( $events_i_host_query->events ) ) : ?>
-               <h2 id="events-i-host"><?php esc_html_e( 'Events I host', 'gp-translation-events' ); ?> </h2>
-               <?php
-               Templates::partial(
-                       'event-list',
-                       array(
-                               'query'                  => $events_i_host_query,
-                               'pagination_query_param' => 'events_i_hosted_paged',
-                               'show_start'             => true,
-                               'show_end'               => true,
-                               'relative_time'          => false,
-                       ),
-               );
-       endif;
-       ?>
-
-       <?php if ( ! empty( $events_i_created_query->events ) ) : ?>
-               <h2 id="events-i-created"><?php esc_html_e( 'Events I have created', 'gp-translation-events' ); ?> </h2>
-               <?php
-               Templates::partial(
-                       'event-list',
-                       array(
-                               'query'                  => $events_i_created_query,
-                               'pagination_query_param' => 'events_i_created_paged',
-                               'show_start'             => true,
-                               'show_end'               => true,
-                               'relative_time'          => false,
-                       ),
-               );
-       endif;
-       ?>
-
-       <?php if ( ! empty( $events_i_attended_query->events ) ) : ?>
-               <h2 id="events-i-attended"><?php esc_html_e( 'Events I attended', 'gp-translation-events' ); ?> </h2>
-               <?php
-               Templates::partial(
-                       'event-list',
-                       array(
-                               'query'                  => $events_i_attended_query,
-                               'pagination_query_param' => 'events_i_attended_paged',
-                               'show_start'             => true,
-                               'show_end'               => true,
-                               'relative_time'          => false,
-                       ),
-               );
-       endif;
-       ?>
</del><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> <?php Templates::footer(); ?>
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventstemplateshelperfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/helper-functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/helper-functions.php       2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/helper-functions.php 2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11,9 +11,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * @return string   HTML of the breadcrumb.
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> function gp_breadcrumb_translation_events( $extra_items = array() ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        $home_link  = gp_link_get( home_url(), __( 'Home', 'gp-translation-events' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">         $breadcrumb = array(
</span><span class="cx" style="display: block; padding: 0 10px">                empty( $extra_items ) ? __( 'Events', 'gp-translation-events' ) : gp_link_get( Urls::events_home(), __( 'Events', 'gp-translation-events' ) ),
</span><span class="cx" style="display: block; padding: 0 10px">        );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        $breadcrumb = array_merge( array( $home_link ), $breadcrumb );
</ins><span class="cx" style="display: block; padding: 0 10px">         if ( ! empty( $extra_items ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                $breadcrumb = array_merge( $breadcrumb, $extra_items );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventstemplatespartialseventlistphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/partials/event-list.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/partials/event-list.php    2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/partials/event-list.php      2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,6 +1,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> namespace Wporg\TranslationEvents\Templates\Partials;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+use Wporg\TranslationEvents\Attendee\Attendee;
</ins><span class="cx" style="display: block; padding: 0 10px"> use Wporg\TranslationEvents\Event\Event_End_Date;
</span><span class="cx" style="display: block; padding: 0 10px"> use Wporg\TranslationEvents\Event\Event_Start_Date;
</span><span class="cx" style="display: block; padding: 0 10px"> use Wporg\TranslationEvents\Event\Events_Query_Result;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,13 +15,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** @var ?string $date_format */
</span><span class="cx" style="display: block; padding: 0 10px"> /** @var ?bool $relative_time */
</span><span class="cx" style="display: block; padding: 0 10px"> /** @var ?string[] $extra_classes */
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @var ?Attendee[] $current_user_attendee_per_event Associative array with event id as key, and Attendee as value. */
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-$show_start    = $show_start ?? false;
-$show_end      = $show_end ?? false;
-$show_excerpt  = $show_excerpt ?? true;
-$date_format   = $date_format ?? '';
-$relative_time = $relative_time ?? true;
-$extra_classes = isset( $extra_classes ) ? implode( $extra_classes, ' ' ) : '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+$show_start                      = $show_start ?? false;
+$show_end                        = $show_end ?? false;
+$show_excerpt                    = $show_excerpt ?? true;
+$date_format                     = $date_format ?? '';
+$relative_time                   = $relative_time ?? true;
+$extra_classes                   = isset( $extra_classes ) ? implode( $extra_classes, ' ' ) : '';
+$current_user_attendee_per_event = $current_user_attendee_per_event ?? array();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px">  * @param Event_Start_Date|Event_End_Date $time
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,6 +39,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> <ul class="event-list <?php echo esc_attr( $extra_classes ); ?>">
</span><span class="cx" style="display: block; padding: 0 10px">        <?php foreach ( $query->events as $event ) : ?>
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                <?php
+               $current_user_attendee = $current_user_attendee_per_event[ $event->id() ] ?? null;
+               ?>
</ins><span class="cx" style="display: block; padding: 0 10px">                 <li class="event-list-item">
</span><span class="cx" style="display: block; padding: 0 10px">                        <?php // Title. ?>
</span><span class="cx" style="display: block; padding: 0 10px">                        <?php // phpcs:ignore Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace ?>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,10 +49,27 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                href="<?php echo esc_url( Urls::event_details( $event->id() ) ); ?>">
</span><span class="cx" style="display: block; padding: 0 10px">                                <?php echo esc_html( $event->title() ); ?>
</span><span class="cx" style="display: block; padding: 0 10px">                        </a>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        <?php if ( $event->is_draft() ) : ?>
-                               <span class="event-label-draft">Draft</span>
-                       <?php endif; ?>
</del><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        <?php // Labels. ?>
+                       <span class="event-list-item-labels">
+                               <?php if ( $event->is_draft() ) : ?>
+                                       <span class="event-list-item-label-draft"><?php echo esc_html__( 'Draft', 'gp-translation-events' ); ?></span>
+                               <?php endif; ?>
+                               <?php if ( $event->is_past() ) : ?>
+                                       <?php if ( $current_user_attendee && $current_user_attendee->is_host() ) : ?>
+                                               <span class="event-list-item-label-hosted"><?php echo esc_html__( 'Hosted', 'gp-translation-events' ); ?></span>
+                                       <?php elseif ( $current_user_attendee ) : ?>
+                                               <span class="event-list-item-label-attended"><?php echo esc_html__( 'Attended', 'gp-translation-events' ); ?></span>
+                                       <?php endif; ?>
+                               <?php else : ?>
+                                       <?php if ( $current_user_attendee && $current_user_attendee->is_host() ) : ?>
+                                               <span class="event-list-item-label-hosting"><?php echo esc_html__( 'Hosting', 'gp-translation-events' ); ?></span>
+                                       <?php elseif ( $current_user_attendee ) : ?>
+                                               <span class="event-list-item-label-attending"><?php echo esc_html__( 'Attending', 'gp-translation-events' ); ?></span>
+                                       <?php endif; ?>
+                               <?php endif; ?>
+                       </span>
+
</ins><span class="cx" style="display: block; padding: 0 10px">                         <?php // Buttons. ?>
</span><span class="cx" style="display: block; padding: 0 10px">                        <?php if ( current_user_can( 'edit_translation_event', $event->id() ) ) : ?>
</span><span class="cx" style="display: block; padding: 0 10px">                                <a href="<?php echo esc_url( Urls::event_edit( $event->id() ) ); ?>"
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventstemplatespartialsheaderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/partials/header.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/partials/header.php        2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/partials/header.php  2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6,9 +6,40 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> /** @var string $html_title */
</span><span class="cx" style="display: block; padding: 0 10px"> /** @var string|callable $page_title */
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @var string $url */
+/** @var string $image_url */
+/** @var string $html_description */
</ins><span class="cx" style="display: block; padding: 0 10px"> /** @var ?callable $sub_head */
</span><span class="cx" style="display: block; padding: 0 10px"> /** @var ?string[] $breadcrumbs */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+$html_title       = $html_title ?? esc_html__( 'Translation Events', 'gp-translation-events' );
+$url              = $url ?? Urls::events_home();
+$html_description = $html_description ?? esc_html__( 'WordPress Translation Events', 'gp-translation-events' );
+$image_url        = $image_url ?? Urls::event_default_image();
+
+add_action(
+       'gp_head',
+       function () use ( $html_title, $url, $html_description, $image_url ) {
+               echo '<meta name="twitter:card" content="summary" />' . "\n";
+               echo '<meta name="twitter:site" content="@WordPress" />' . "\n";
+               echo '<meta name="twitter:title" content="' . esc_attr( $html_title ) . '" />' . "\n";
+               echo '<meta name="twitter:description" content="' . esc_attr( $html_description ) . '" />' . "\n";
+               echo '<meta name="twitter:creator" content="@WordPress" />' . "\n";
+               echo '<meta name="twitter:image" content="' . esc_url( $image_url ) . '" />' . "\n";
+               echo '<meta name="twitter:image:alt" content="' . esc_attr( $html_title ) . '" />' . "\n";
+
+               echo '<meta property="og:url" content="' . esc_url( $url ) . '" />' . "\n";
+               echo '<meta property="og:title" content="' . esc_attr( $html_title ) . '" />' . "\n";
+               echo '<meta property="og:description" content="' . esc_attr( $html_description ) . '" />' . "\n";
+               echo '<meta property="og:site_name" content="' . esc_attr( get_bloginfo() ) . '" />' . "\n";
+               echo '<meta property="og:image:url" content="' . esc_url( $image_url ) . '" />' . "\n";
+               echo '<meta property="og:image:secure_url" content="' . esc_url( $image_url ) . '" />' . "\n";
+               echo '<meta property="og:image:type" content="image/png" />' . "\n";
+               echo '<meta property="og:image:width" content="1200" />' . "\n";
+               echo '<meta property="og:image:height" content="675" />' . "\n";
+               echo '<meta property="og:image:alt" content="' . esc_attr( $html_title ) . '" />' . "\n";
+       }
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> gp_title( $html_title );
</span><span class="cx" style="display: block; padding: 0 10px"> gp_breadcrumb_translation_events( $breadcrumbs ?? array() );
</span><span class="cx" style="display: block; padding: 0 10px"> gp_tmpl_header();
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationeventswporggptranslationeventsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/wporg-gp-translation-events.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/wporg-gp-translation-events.php      2024-05-28 09:02:15 UTC (rev 13752)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/wporg-gp-translation-events.php        2024-05-28 11:52:23 UTC (rev 13753)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -111,6 +111,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                GP::$router->add( "/events/edit/$id", array( 'Wporg\TranslationEvents\Routes\Event\Edit_Route', 'handle' ) );
</span><span class="cx" style="display: block; padding: 0 10px">                GP::$router->add( "/events/trash/$id", array( 'Wporg\TranslationEvents\Routes\Event\Trash_Route', 'handle' ) );
</span><span class="cx" style="display: block; padding: 0 10px">                GP::$router->add( "/events/delete/$id", array( 'Wporg\TranslationEvents\Routes\Event\Delete_Route', 'handle' ) );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                GP::$router->add( "/events/image/$id", array( 'Wporg\TranslationEvents\Routes\Event\Image_Route', 'handle' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 GP::$router->add( "/events/attend/$id", array( 'Wporg\TranslationEvents\Routes\User\Attend_Event_Route', 'handle' ), 'post' );
</span><span class="cx" style="display: block; padding: 0 10px">                GP::$router->add( "/events/host/$id/$id", array( 'Wporg\TranslationEvents\Routes\User\Host_Event_Route', 'handle' ), 'post' );
</span><span class="cx" style="display: block; padding: 0 10px">                GP::$router->add( '/events/my-events', array( 'Wporg\TranslationEvents\Routes\User\My_Events_Route', 'handle' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -120,10 +121,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                GP::$router->add( "/events/$slug/attendees", array( 'Wporg\TranslationEvents\Routes\Attendee\List_Route', 'handle' ) );
</span><span class="cx" style="display: block; padding: 0 10px">                GP::$router->add( "/events/$id/attendees/remove/$id", array( 'Wporg\TranslationEvents\Routes\Attendee\Remove_Attendee_Route', 'handle' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $stats_listener = new Stats_Listener(
-                       self::get_event_repository(),
-                       self::get_attendee_repository(),
-               );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $stats_listener = new Stats_Listener( self::get_event_repository() );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $stats_listener->start();
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -258,7 +256,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function register_translation_event_js() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_register_style( 'translation-events-css', plugins_url( 'assets/css/translation-events.css', __FILE__ ), array( 'dashicons' ), filemtime( __DIR__ . '/assets/css/translation-events.css' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                gp_enqueue_style( 'translation-events-css' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         gp_enqueue_styles( 'translation-events-css' );
+               if ( $this->should_load_new_design() ) {
+                       wp_register_style( 'new-dotorg-design-css', plugins_url( 'assets/css/new-dotorg-design.css', __FILE__ ), array( 'dashicons' ), filemtime( __DIR__ . '/assets/css/new-dotorg-design.css' ) );
+                       gp_enqueue_styles( 'new-dotorg-design-css' );
+               }
</ins><span class="cx" style="display: block; padding: 0 10px">                 wp_register_script( 'translation-events-js', plugins_url( 'assets/js/translation-events.js', __FILE__ ), array( 'jquery', 'gp-common' ), filemtime( __DIR__ . '/assets/js/translation-events.js' ), false );
</span><span class="cx" style="display: block; padding: 0 10px">                gp_enqueue_script( 'translation-events-js' );
</span><span class="cx" style="display: block; padding: 0 10px">                wp_localize_script(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -294,7 +296,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $user_id             = $post->post_author;
</span><span class="cx" style="display: block; padding: 0 10px">                        $attendee_repository = self::get_attendee_repository();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $attendee            = $attendee_repository->get_attendee( $event->id(), $user_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $attendee            = $attendee_repository->get_attendee_for_event_for_user( $event->id(), $user_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( null === $attendee ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $attendee = new Attendee( $event->id(), $user_id, true );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -431,5 +433,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px">                return $override_slug;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+       /**
+        * Check if the current site is a translate.wordpress.org or a development TLD.
+        *
+        * @return bool
+        */
+       private function should_load_new_design(): bool {
+               return defined( 'TRANSLATION_EVENTS_NEW_DESIGN' ) && TRANSLATION_EVENTS_NEW_DESIGN;
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> Translation_Events::get_instance();
</span></span></pre>
</div>
</div>

</body>
</html>