meeting-room-booking-system / mrbs-code

MRBS application code
Other
124 stars 61 forks source link

Two lines of text when using periods #3150

Open jberanek opened 2 years ago

jberanek commented 2 years ago

Hi.

I'm currently using the period setup which works well but have been asked if it was possible to add in the actual time slots so that staff know which period refers to which time slot:

As it stands, I use the following

unset($periods); // Include this line when copying to config.inc.php $periods[] = "08:10 - 09:10"; $periods[] = "Period 1"; $periods[] = "Period 2"; $periods[] = "Period 3"; $periods[] = "Period 4"; $periods[] = "Period 5";

I can set the time in as follows as it only text

unset($periods); // Include this line when copying to config.inc.php $periods[] = "08:10 - 09:10"; $periods[] = "Period 1 - (09:10 - 09:45)"; $periods[] = "Period 2 - (09:45 - 10:15)"; $periods[] = "Period 3 - (10:15 - 10:45)";

but as this all appears on one line, is it possible to format it in such a way that the time is on another line under the relevant Period.

i.e

Period 1 (09:10 - 09:45)

Period 2 (09:45 - 10:15)

etc..etc

Thanks

Reported by: *anonymous

Original Ticket: mrbs/support-requests/2465

jberanek commented 2 years ago

Not very easily, but it's possible. To do it you have to

(1) Insert non-breaking spaces in your period names where you want to stop the line wrapping, eg between "Period" and "1". See for example this post on how to do it.

(2) Create a custom CSS file (see systemdefaults.inc.php for how to do this) and add the rule

.dwm_main tbody th {
    max-width: 7em;  // You will need to play with these values
    min-width: 7em;  // to get the right result
    white-space: normal;
}

Original comment by: campbell-m

jberanek commented 2 years ago

Hmm!! Not sure what I'm doing wrong but putting the   just displays the   along with the other text

As a test, I put in $periods[] = "09:55 - 10:35 - Bit of example text";

It doesn't seem to be treating the   as html code. The css info seems to be working okay as changing the values widens or shorten the column but the '09:55 - 10:35 - Bit of example text' just appears as is.

Original comment by: *anonymous

jberanek commented 2 years ago

lol!! the " " obviously worked above

Original comment by: *anonymous

jberanek commented 2 years ago

Sorry. the 'nbsp;' code works here but not in my testsite:

http://mrbs.assumptiongrammarschool.education/index.php?csrf_token=7d8e8d3db6834a2c19f6199afa2f0012818371525cf23fe50b4cdcacce533bae&view=week&page_date=2021-11-22&area=8

Original comment by: *anonymous

jberanek commented 2 years ago

I don't know if it makes any difference but when I tested it I inserted the non-breaking space using the keyboard when I edited the area settings through the browser on the Rooms page, not by putting the nbsp in the config file.

Original comment by: campbell-m

jberanek commented 2 years ago

Do you mind if I asked what browser and keystroke you used. Ive tried a combination and nothing happening to indicate that a non-breaking space is being inserted.

My hosting system is a linux server

Thanks

Original comment by: *anonymous

jberanek commented 2 years ago

Yes, I used Chrome on Windows and Left Alt and 255 as in the article linked to above. Note that you need to use the number pad: it doesn't work if you use the numbers along the top row of the keyboard.

Original comment by: campbell-m

jberanek commented 2 years ago

Ahh!! Every day is a school day. Got sorted now. Wasn't using the keypad.

Cheers

Original comment by: *anonymous