gregsadetsky / nycnoise

https://nyc-noise.com
15 stars 0 forks source link

Add user-facing event submission form #230

Closed pfeyz closed 4 months ago

pfeyz commented 4 months ago

This PR adds a submission form that allows users to submit events. They are required to include at least the following

submission-form

form validation is performed, and if successful, it redirects to the homepage and flashes a thanks message

thanks

all user-submitted events will be stored in the db with is_approved=False and user_submitted=True.

all events with is_approved=False are filtered out from the calendar list of events.

then in the admin interface we can filter to just the is_approved=False entries to see the user-submitted events that still need to be checked and approved,

filtered

for now approving an event just means flipping that boolean field in the admin interface. maybe we could add some kind of moderation flow if it feels necessary next.

pfeyz commented 4 months ago

@nycnoise looking at it now I feel like it might be an intimidating form because it's not obvious that they only really need to fill out 3 of those fields. I can picture somebody looking at that form and getting scared away immediately, vs something like this:

simple

gregsadetsky commented 4 months ago

really great work, thanks so much!

if you still have time / energy, it would be great if the default Event manager (i.e. objects) could be set to return only approved events by default

I use the same approach for static pages i.e. the regular objects returns a filtered view (only public pages) and there's a non-default all_pages that exists for any query which actually needs all of the pages/objects.

that way, it's safer -- you don't have to chase down all the calls to StaticPage.objects... and make sure that they filter out the non-public pages. it would be too easy to forget to do that otherwise.

I'd love if the Event filtering was done in the same way - to reduce any chance of a user-submitted event from appearing anywhere.

small note: once you go down this route, you'll also have to change the queryset of the model admin class, otherwise the admin will also use the (new) objects and not show all (non-approved) objects i.e. the admin wouldn't be that useful anymore :-) thankfully it's a small change -- you can see this done here for staticpage.


after the above is done, I'd also add two tests: 1) that a user submitted event does not show up on the homepage by default, and 2) that once a user submitted event is approved, it does show up on the homepage.

that's it! :-)


I agree with your point re: the form potentially feeling intimidating - I think we could do a further iteration after merging this PR and think about either hiding optional fields, marking them as clearly being optional, etc. all possible & good improvements.

(one alternative could be to show two different forms (at the same url, with a different GET parameter) i.e. the "simple" form with less fields and the more complete one, for those that have more info... maybe!)

thanks again!

gregsadetsky commented 4 months ago

oh, and as noted by @nycnoise in https://github.com/gregsadetsky/nycnoise/issues/228 , we should also add a "closed" boolean field (defaulting to false) on all venues, so that "zzz___" venues right now can all be marked as closed (in the admin, in bulk) and then not show them in the submission form

feel free to tackle it as part of this PR, or we can do a follow up after this is merged

pfeyz commented 4 months ago

thanks for the review and yes those are great ideas, will do!

pfeyz commented 4 months ago

@gregsadetsky I moved the unapproved event filtering into the Event manager and handled the change in the admin, added the tests you suggested and added a Venue.closed field that is hidden from the even submission form

gregsadetsky commented 4 months ago

amazing amazing amazing!!!! thank you so so so much

I added a few admin actions (to mark events as approved/not approved) and venues (mark them as closed/opened) and a few tiny tiny things. the result looks awesome, I'm super grateful for all of this work!

deploying now, should be live soon! cheeeeeeeeers

gregsadetsky commented 4 months ago

we are live!!!!!! https://nyc-noise.com/submit-event @nycnoise

pfeyz commented 4 months ago

awesome! I just submitted one through the form @nycnoise !

nycnoise commented 4 months ago

OMGGGGGG I'M JUST NOW SEEING THESE

gregsadetsky commented 4 months ago

@nycnoise obviously, if/when you feel that https://nyc-noise.com/submit-event is ready, you could link it in https://nyc-noise.com/submit/ -- obviously :-) lmk if anything is missing, etc.!

nycnoise commented 4 months ago

i JUST made an issue w/ my MANY, MANY THOUGHTS –– apologies if i should have put that here?? anyway only need the "quick priority" to change before sharing, VERY EXCITED YAYYY

gregsadetsky commented 4 months ago

ah all good, a new issue is a good place for this! cheers