Calendar - divider in wrong place with two events on same date

Started by Tonyvic, July 31, 2022, 09:53:37 AM

Previous topic - Next topic

Tonyvic

When logged in as Admin or Global Mod the divider between them is ok, but Guest and Regular members see the line in the wrong place. (See attached).
I hope someone may have a clue cos I'm out of ideas. ???
You cannot view this attachment.You cannot view this attachment.

Edit: Same result with default Curve2

Kindred

The line is not in the wrong place, if you notice in your 2nd set of screenshots the 8 PM is on the line below where it is in your 1st set. Something is causing that to go down in extra line which is making the divider line look like it's in the wrong place
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

It's the edit icon. In the left hand side, the edit icon is present and it's causing the float to clear correctly.

In the right hand side, no edit icon, and the event title is trying to float left around the details of the previous event.

Tonyvic

@Kindred and @Arantor,
Thank you for your input but now I'm more confused which is not difficult to achieve these days.
As it's only boxes to complete for Event Title, Time and Details (Event) How can I solve this?
If you want to see live https://allradio.co.uk/index.php

Arantor

Does it do it in the default theme? If not, this is a theme bug and the themer needs to fix it.

(I can't switch to the default theme and don't currently have a 2.1 test setup with calendar enabled)

There is a fix to be had by modifying the calendar template to add <br class="clear"> after the <span> with event_location in it, but this really should be fixed by your theme's maintainer.

Tonyvic

@Arantor,
Many thanks for your response It does happen with Curve2 although it's a very feint line, I have changed the site to the default theme so you can see for yourself.
I will leave the default theme selected until I know you have seen it.

Tony

Arantor

That sounds like a bug in the core then if you happen to have longer lines for things.

So...

Themes/default/Calendar.template.php around line 470 onwards, you should see this:

echo '
</span><br class="clear">';
}

echo '
</div><!-- .event_wrapper -->';
}

echo '
</div><!-- .smalltext -->';

Change it to:
echo '
</span>';
}
echo '
<br class="clear">';


echo '
</div><!-- .event_wrapper -->';
}

echo '
</div><!-- .smalltext -->';

Basically, there's a thing to force a line break between thigns - but it only happens if editing or exporting to iCal is on - which in this case neither is.

Thus we need to move the br tag outside of the if statement so it's always shown, not just conditionally.

Antechinus

Add this to the CSS:
.event_wrapper {overflow: hidden;}
Should work without any template edits (just tested it live on that site).

Arantor

It's still wrong though - because there is conditionally a clear being used in some cases not others (just not the cases you can see there)

Antechinus

Maybe, but the only reason they are using a br.clear is to clear floated content in that div, and using hidden overflow on the div does that anyway. IOW, I think that whoever wrote the default code did not know enough basic CSS 101 to deal with it the easy way.

ETA: If you did want to edit the template as well, I would do it like this:
Code (Find) Select
echo '
</span><br class="clear">';
}

echo '
</div><!-- .event_wrapper -->';
}

echo '
</div><!-- .smalltext -->';

Code (Replace) Select
echo '
</span>';
}

echo '
</div><!-- .event_wrapper -->';
}

echo '
</div><!-- .smalltext -->';
Really, that (with the extra line of CSS) is how it should be by default. Although if I just wanted to get it working on top of the current default code, and wasn't a template hacker from way back, I'd just use the CSS tweak for simplicity. :)

Arantor

Um, that's now broken - you've removed the end of a span that is conditionally displayed when you can edit or when you can export iCal.


Tonyvic

Sorry I started a war of codeing guys, I'll stay quiet for a while and try the options presented.  :)

Arantor

My solution is the old fashioned and quick and dirty approach, Antechinus's is the more modern and probably more correct approach.

Both should work.

Tonyvic


Advertisement: