thewca / worldcubeassociation.org

All of the code that runs on worldcubeassociation.org
https://www.worldcubeassociation.org/
GNU General Public License v3.0
331 stars 176 forks source link

Allow organizers to upload a logo for competitions #112

Open lgarron opened 9 years ago

lgarron commented 9 years ago

https://www.worldcubeassociation.org/ looks a bit drab. It would be awesome to have logos for Worlds and Nationals, at least.

jbmertens commented 8 years ago

Copied from #115:

A natural extension of #110.

Worlds this year had a beautiful logo. It would be great to use it on the front page, and to style the WCA competition page.

ronaldmansveld commented 6 years ago

This can already be done now we support markdown. See https://www.worldcubeassociation.org/competitions/Spain2018 for example.

AlbertoPdRF commented 5 years ago

With Active Storage set up, we could now allow organizers to add an official logo for a competition pretty easily, thus accomplishing two things:

  1. The logos will be hosted by us, so they won't eventually break.
  2. We can standardize how images are displayed.

I will label this as a good first issue!

jfly commented 5 years ago

I think this is a big more work than a "good first issue". In my mind, a good first issue should be something that an experienced member of the software team can do in <= 30 minutes. Things I can think of:

  1. You'll have to build an authenticated form for competition managers (delegates|organizers) to upload a competition logo (there will also have to be an update to the competition nav to link to this form, and you'll have to do a database migration to carve out a place to store links to the uploaded images)
    1. There should probably be some human readable guidelines on this. @AlbertoPdRF, do we have some rules written down somewhere (maybe the competition requirements doc) about what sort of things are allowed on a competition page? Maybe I'm just thinking of the advertising rules (you can say something like "the cubicle", but you cannot say something like "cubicle's pro shop valk 3"?).
    2. There should also be some hard constraints on the backend: file format, size, (aspect ratio?)
  2. We need to decide what to do with the uploaded image. This is pretty involved in itself, and informs 1.i and 1.ii above. We'll want to put it somewhere on the /competitions/:id page, but I think there are a number of choices about how to do that, and they all impact what kind of images we'll ask the competition managers for (for example, are we going to want more of a horizontal banner, or more of a postage stamp)?
    • One idea, feel free to ignore: maybe someday we will want to add a og:image tag for individual competitions (as we did in https://github.com/thewca/worldcubeassociation.org/pull/3238/). It might be at least worth thinking through what that would look like, and if it affects the kind of image we'd ask the competition manager for.

I think a good place to start with this issue is to put together a couple of designs showing how we want a page like https://www.worldcubeassociation.org/competitions/WC2019 to look with a competition logo in both desktop and mobile.

jfly commented 5 years ago

I just chatted with @AlbertoPdRF about this: we think this has the potential to be a good second issue, but it should wait until after we've figured out what's happening with the website redesign (do we have an issue for that?).

AlbertoPdRF commented 5 years ago

I don't think we have one! It's about time though, so I'll open it.

AlbertoPdRF commented 5 years ago

There it goes: #4310.

AlbertoPdRF commented 5 years ago

As now I have a bit more of time, I'll try to reply to the points made earlier (https://github.com/thewca/worldcubeassociation.org/issues/112#issuecomment-511216899.) Keeping the numbering:

  1. Is all of that really necessary? With Active Storage configured, it should be way simpler than that to allow for a logo to be uploaded -- it could just be added as an extra field on the competition form and it would only require some not-so-involved modifications to the model and controller to be able to handle them, not even a migration would be necessary.
    1. All we have is point 9. on the WCA Competition Requirements section of the WCA Competition Requirements Policy.
    2. That should be pretty simple too with Active Storage! We just need to decide which those constraints should be.
  2. Yep, agreed. We can discuss about this after #4310. And your idea regarding og:image is definitely something to think about in my opinion!
jfly commented 5 years ago
  1. not even a migration would be necessary

Really? How does that work? I may be misunderstanding something about ActiveStorage...

We just need to decide which those constraints should be.

Totally, but someone needs to decide what they should be.

AlbertoPdRF commented 5 years ago

Really? How does that work? I may be misunderstanding something about ActiveStorage...

Everything that needs to be done is described here.

Totally, but someone needs to decide what they should be.

Of course, and that can be done as soon as we get the new competition page after #4310.

jfly commented 5 years ago

Oh wow! I did not know about this table:

active_storage_attachments is a polymorphic join table that stores your model's class name. If your model's class name changes, you will need to run a migration on this table to update the underlying record_type to your model's new class name.

Dayumnnn, that's cool. Please ignore what I said above about migrations.

I do think there would be some UI work to allow uploading/removing/describing? multiple pictures, though.

AlbertoPdRF commented 5 years ago

Regarding that last part, I'm not sure how would that exactly work: maybe making a common delete_attachment method somewhere and then using it on the different places where we have Active Storage stuff? Not sure how the UI would look like either.

However, in this case, assuming we'll only have one logo per competition, this could work as it already does with Regional Organizations' logos, with no need for an extra UI.

dunkOnIT commented 1 year ago

I'm struggling to see how this is needed at the moment - but leaving it as a possible requirement for a future competition service rework