Yes. Iâll add a fix in a bit, but requesting you to go over this one. Events Plugin đ
Yes, it should be possible by tweaking the css. Although, our pluginâs logic needs the event start date to be there.
Beforehand, thank you for the awesome plugin!
FWIW, we would use this feature quite a bit. Perhaps others would have interest in it too?
Sorry, me again! This time, I think our people caught a few things that seem to be all bugs related with the RSVP. Maybe someone can help confirm these?
Issue 1
If an event has a limit of participants and it is âBooked outâ, it seems the already âgoingâ users canât remove themselves from the list. This is what a âgoerâ sees:
Issue 2
When editing the event, itâs possible to explicitly set a negative number of guests:
An attribute of min="1"
on that input will help, but mind that currently the form can still be saved with a negative limit of guests.
Issue 3
Lastly, if setting a maximum number of guests but manually adding an higher number of guests will render negative number of available slots:
This is an event with a limit of 1 guest, 2 going. Perhaps itâs best to say âBooked outâ? On this special case (negative available spots), Iâm able to remove myself from the list (see Issue 1).
Sorry for the avalanche of things â unfortunately my tech chops arenât enough to submit a PR, but I can submit a github issue if it is of any help.
Thanks for reporting those issues. If you can report them here, it would be very easy for us to track it.
https://thepavilion.io/w/bug-report/
Secondly, the discourse team also has an implementation of the events use case. Worth having a look
I tried logging with my Github account and it doesnât seem work â I keep getting back to the login screen. No need to fix it for me, just letting you know something seems amiss with the Github authentication bit over there.
I appreciate the heads up about this. I had missed that news and itâs very relevant as we are still evaluating how to proceed regarding events on our community.
Not sure where to report this, but this seemed to be the most appropriate place for this.
I noticed an odd bug that affects the Discourse polls and, from my tests, only occurs when the Events plugin is also installed.
When creating a poll and selecting to âAutomatically close pollâ, regardless of the date picked, the date on the bbcode added to the post is always 24h from then (even if selecting, say, 7 days from now).
Disabling the Events plugin makes the automatic poll close date selection to work as expected.
Will try to repro this.
How can I execute javascript after the calendar page has loaded?
edit: I explain my case.
I was asked to have multi-colored events, like:
I donât want to create a fork of the plugin, so I achieved something with the following code.
The colors are related to event tags and replace the default category color.
I added the tag list in the event HTML this way: data-tags="{{event.topic.tags}}"
<script type="text/x-handlebars" data-template-name="javascripts/components/events-calendar-event">
<div class="{{event.classes}}" data-tags="{{event.topic.tags}}" {{action 'selectEvent' event.topic.url}} style="{{event.listStyle}}">
{{#unless event.allDay}}
<span style='{{event.dotStyle}}'>{{d-icon 'circle'}}</span>
{{/unless}}
{{#if event.time}}
<span class="time">{{event.time}}</span>
{{/if}}
{{#if event.title}}
<span class="title" style="{{event.titleStyle}}">{{replace-emoji event.title}}</span>
{{/if}}
</div>
{{#if showEventCard}}
{{events-calendar-card topic=event.topic selectEvent="selectEvent"}}
{{/if}}
</script>
I generate stripped patterns:
<script type="text/discourse-plugin" version="0.8.23">
api.onPageChange((url, title) => {
// tags colors
let colors = {muni: "#91D0B5", road: "#8ABBE2", freestyle: "#CFB3D3"};
let events = document.getElementsByClassName("event");
for (var i = 0; i < events.length; i++) {
let event = events[i];
let gradient = "";
let tags = event.getAttribute("data-tags").split(",");
for (j = 1; j <= tags.length; j++) {
gradient +=
", " +
colors[tags[j - 1]] +
" " +
j * 8 +
"px, " +
colors[tags[j - 1]] +
" " +
(j * 8 + 8) +
"px";
}
event.style.background = "repeating-linear-gradient(-45deg" + gradient + ")";
}
});
</script>
And I added a bit of CSS.
The result:
2 tags event:
3 tags event:
The issue I encounter is that my javascript is executed at the page change and wonât apply stripped colors on previous/next monthsâ events since the calendar dynamically loads its content.
If Iâm in October and and I click ânextâ twice, going for December, this is how it appears:
This is why Iâd like my js to be executed when the calendar content has loaded.
I tried another method and achieved the striped effect by editing the function eventsForDay
in /assets/javascripts/discourse/lib/date-utilities.js.es6
:
I replaced this line:
let tStyle = `width:calc((100%*${daysInRow}) - ${buffer}px);background-color:#${topic.category.color};`;
By:
let tStyle = `width:calc((100%*${daysInRow}) - ${buffer}px);`;
And I added this:
if (topic.tags.length > 0) {
let colors = {muni: "#91D0B5", road: "#8ABBE2", freestyle: "#CFB3D3"};
let gradient = "";
for (let i = 1; i <= topic.tags.length; i++) {
gradient +=
", " +
colors[topic.tags[i - 1]] +
" " +
i * 8 +
"px, " +
colors[topic.tags[i - 1]] +
" " +
(i * 8 + 8) +
"px";
}
attrs['listStyle'] += `background:repeating-linear-gradient(-45deg ${gradient});`;
}
It works very well and itâs a cleaner way to do what I want to achieve. However, I donât know how to override this function or file without having to create a fork of the pluginâŚ
plugin seems to be incompatible with the latest Discourse version.
from the rebuild log file:
1: from /var/www/discourse/lib/plugin/instance.rb:417:in block in notify_after_initialize' /var/www/discourse/plugins/discourse-events/plugin.rb:190:in
block in activate!â: uninitialized constant #Class:0x0000562a2a10fa90::SCOPES
Did you mean? Sprockets (NameError)
** INCOMPATIBLE PLUGIN **
You are unable to build Discourse due to errors in the plugin at
/var/www/discourse/plugins/discourse-events
Please try removing this plugin and rebuilding again!
seems that it had been a problem in Discourse and not in the plugin.
In the latest beta version of Discourse at least the plugins is working again.
I can confirm that it is currently not possible to rebuild the latest stable version of Discourse with the current events plugin.
Unfortunately we canât switch to tests-passed â we choose the stable branch precisely to avoid this sort of issues. Is anyone looking into this?
I have tried rebuilding with v2.5.2 (which used to work) and that fails with the same error, so Iâm not sure where the issue is. Is there a particular commit (of the plugin or of stable Discourse) that I can point the container to?
Our support policy is to ensure compatibility with the latest tests-passed
version of discourse(due to the fact that its the default setting in discourse_docker). Although, we would like to understand how many of the users of Pavilion family Plugins are on stable
branch of discourse.
Also, weâre planning to depricate the events plugin in favour of the discourse teamâs events plugin in the near future.
I understand that developers have to look forward to keep compatibility with the future of Discourse â that makes sense. But if thereâs no stable branch of sorts for the plugin, then it leaves people looking for a stable setup on a scenario where their setup breaks because due to a beta version they are not using.
Any tips on what commit broke the compatibility? I could try to work with that, but Iâm lost on what change made this.
Edit to add: for anyone who has trouble with this and needs a temporary workaround, this commit seems to be the culprit.
There was an issue with webcal api keys which has been resolved.
Thanks for the report @md-misko
again the plugin seems to be incompatible with the latest discourse release 2.6.0.beta5 ( 2bb7676ba4 ).
This time it creates just a blank page when accessing the site. But other than last time there had not been an error when using admin/upgrade
.
After disabling the plugin and rebuilding the container Discourse is working fine again.
Hi, does this Events plugin produce the âAdd To Calendarâ links at the top of posts, like on this page:
Also, here in 2021 what are peopleâs opinions on using this Pavilion Events plugin vs the official Calendar plugin?
Iâm mainly interested in finding ways to make it easy to aggregate views of topics on a calendar, and would also love the ability for our users to be able to add individual events onto their own Google / .ics calendars.
Cheers.