cms icon indicating copy to clipboard operation
cms copied to clipboard

Language list too long in AWS contest configuration

Open andreyv opened this issue 6 years ago • 8 comments

In the AWS contest configuration page, the "Allowed programming languages" row is becoming too long to fit on screen. See attached screenshot.

screenshot-2018-4-8 admin test

Listing one language per line (using <br/>) seems wasteful too, so I looked into allowing content wrapping in the corresponding table cell. The typical advice is to use table-layout: fixed; width: 100%; to achieve text wrapping in a table. However, this doesn't seem to work for me in Firefox. Furthermore, table-layout: fixed; results in a weird-looking first column (takes half of vertical space).

andreyv avatar Apr 08 '18 10:04 andreyv

display: flex; flex-wrap: wrap;

On Sun, Apr 8, 2018, 12:15 PM Andrey Vihrov [email protected] wrote:

In the AWS contest configuration page, the "Allowed programming languages" row is becoming too long to fit on screen. See attached screenshot.

[image: screenshot-2018-4-8 admin test] https://user-images.githubusercontent.com/397308/38466183-ebaae626-3b2d-11e8-8adb-ad0b77bd61e5.png

Listing one language per line (using
) seems wasteful too, so I looked into allowing content wrapping in the corresponding table cell. The typical advice is to use table-layout: fixed; width: 100%; to achieve text wrapping in a table. However, this doesn't seem to work for me in Firefox. Furthermore, table-layout: fixed; results in a weird-looking first column (takes half of vertical space).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cms-dev/cms/issues/930, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOc8aUhb6GTVKHFTENIVdorX-wSeTYKks5tmeMtgaJpZM4TLewh .

wil93 avatar Apr 09 '18 07:04 wil93

<select multiple>?

lw avatar Apr 09 '18 07:04 lw

I didn't know select multiple (it can be tested here), it's neat but you have to CTRL + click (so a help text is needed) and, most importantly, a misclick can cause you to lose the subset you selected (and at that point you have to refresh the page to restore the list)

IMO in this case the wrapping works better

wil93 avatar Apr 09 '18 07:04 wil93

If someone wants to open a PR, I just tested that it's enough to add these CSS rules to the parent <td>:

display: flex
flex-wrap: wrap
width: 100%

wil93 avatar Apr 09 '18 13:04 wil93

From a technical perspective, @lerks suggestion is on point. It does exactly what is needed and joins the choices semantically.

andreyv avatar Apr 09 '18 18:04 andreyv

And, possibly, with enough CSS and JS it will even render nicely! ;)

Here is something I just found on Google: https://silviomoreto.github.io/bootstrap-select/examples/

lw avatar Apr 09 '18 18:04 lw

How about we use @wil93 suggestion and move to select multiple when we'll have a framework handling the "enough JS and CSS"?

stefano-maggiolo avatar Sep 14 '18 21:09 stefano-maggiolo

2018-09-14-221203_1246x446_scrot

https://github.com/stefano-maggiolo/cms/commit/ded1e19b556d968d12dea1e215225d448184dfc0

stefano-maggiolo avatar Sep 14 '18 21:09 stefano-maggiolo