Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've created a template for date_view module (that is part of date module) and that is used in calendar module for styling the calendar. As calendar module is propular like webforms it should be added to the theme.
The buttons on top left are improperly aligned and look totally broken without this template. See the screenshots attached.
Before:
After
Comment | File | Size | Author |
---|---|---|---|
#18 | add_date_calendar-2839880-18.patch | 5.26 KB | markhalliwell |
2016-12-29_131443.png | 9.06 KB | hass | |
2016-12-29_131320.png | 9.28 KB | hass |
Comments
Comment #2
hass CreditAttribution: hass commentedComment #3
markhalliwellThe folder beneath
templates
should just bedate
(notdate_view
) since that is the project name this module is bundled with.Incorrect/inadequate description of what this template file is for.
These variables should follow existing core standards: https://www.drupal.org/docs/develop/coding-standards/api-documentation-a...
It's also a couple missing variables being used in the template below that aren't described here:
$pager_prefix
(no suffix?) and$extra_classes
.Missing
@ingroup templates
at the bottom of the file's doxygen comment. Despite what the above link says, this is necessary for http://drupal-bootstrap.org to pick up and categorize this file properly.Why is this using
col-md-offset-4
? Please tell me this isn't to "align" the text in the center.I'm assuming this is the month? If so, it should just be using the
text-center
class.Is
$nav_title
already sanitized?Should be a
<nav>
element since there's a<ul>
element immediately inside it.This should also be before the header so it can be floated to the right properly on larger screens.
Um. No.
All this should be done in a preprocess function, creating new variables if necessary (to compensate for module's laziness of proper theming I'm assuming).
Furthermore, it should be using _bootstrap_icon() with something like
menu-left
instead of«
andmenu-right
instead of»
.Finally, we shouldn't be passing a variable to
t()
just to pass tol()
, especially since it's already been translated above that.Comment #4
hass CreditAttribution: hass commentedCorrect. The month name need to be aligned to the center.
text-center
does not work as the buttons on the right will move the month outside the center to the left. Additionally on small devices the prev/next buttons need to move to the next line so that month and buttons are both centered and stacked above with each other. I wish we would havefloat-xs-right
in bootstrap 3, but this is v4 only.If you have a solution how to solve this I'm happy to improve the code.
Comment #5
markhalliwellI already did.
Comment #6
hass CreditAttribution: hass commentedWhat you suggested does not work.
Comment #7
markhalliwellNever mind... I was thinking of something else.
Comment #8
hass CreditAttribution: hass commentedDate module does not document all these params. This is not my code. The closer it is to the original the easier it is to maintain. I reviewed the date module, but have not found the vars. I'm not sure what module may add these vars. We should wait until D8 calendar is available and see how the templates are changing then.
I have not made a security review of date module if you are asking for this. If it would not, we may have seen a security release of date module in past. But it looks to be safe.
It could, but it must not. See the original file at http://cgit.drupalcode.org/date/tree/date_views/theme/date-views-pager.t...
This are valid signs. See https://getbootstrap.com/components/#pagination that is also using them. I attached the standard and the gly one, but prefer the standard as the gly one is not looking so great.
Fixed all the other fixable things that makes sense.
Comment #9
markhalliwellComment #10
hass CreditAttribution: hass commentedThis patch needs no work.
Comment #11
markhalliwellThe above patch is not up to par with the quality of code that is currently in this base theme.
It will not be committed as is.
Like many other templates, complex variables (display logic), is done in preprocess functions.
Please follow the existing workflow and structure of this base theme.
You're not the maintainer of this project. I outlined what needed to be fixed above and you ignored what you deemed "didn't make sense".
That's not how contrib works and certainly not how I work.
Comment #12
hass CreditAttribution: hass commentedIt looks like the rules you are making are not for the project and only for me. I see http://cgit.drupalcode.org/bootstrap/tree/templates/system/pager.func.ph... that shows that the
pagination
is a<DIV>
and not a<NAV>
. Additionally they are using«
and»
and others and not the_bootstrap_icon()
. This means the patch above with_bootstrap_icon()
must not used for consistency reasons.It looks like all other tpl.php files are such type of code. format_plural in a tpl.php. No idea what should be changed now as all is clean..
Comment #13
markhalliwellNo I'm not "making up rules just for you". The code you reference already exists (long before I made this project into what it is). Would I like to change it, sure, but I can't. That is code that has been out for some time and cannot be changed because it'd introduce a BC break.
This patch is introducing new code. Code that should, regardless of where it came from, utilize a preprocess function for all that PHP logic (which is mostly what I was referring to).
Furthermore, you seem to keep forgetting that 7.x-3.x isn't HEAD; 8.x-3.x is and it's using
<nav>
:http://drupal-bootstrap.org/api/bootstrap/templates%21system%21pager.htm...
Regarding the icons, no, neither 8.x-3.x or 7.x-3.x are using them, specifically for the pager, but that's really not the point. This isn't a pager. It's a different theme hook/template all together. One that you're making look like a pager, nothing more.
If I could go back and put icons in the pagers, I would. It just makes it look sharper and also helps with accessibility.
---
I was attempting to give you the benefit of the doubt since you at least provided a patch.
I was originally tempted to mark this as "Closed (won't fix)" solely for the following reasons:
However, since you already provided a patch and this is just an addition, I gave feedback.
You implemented some changes and ignored some feedback entirely.
I'm really not an unreasonable guy, but if this is how you're going to be then I have no qualms about rejecting this issue based solely on your attitude and the above reasons.
Comment #14
hass CreditAttribution: hass commentedThis is a pager. 100%. You may like to install calendar module and take a look into the view. It pice of code is named pager everywhere in views/date/calendar code.
My attitude is to fix issues that affect me and others.
Comment #15
hass CreditAttribution: hass commentedComment #16
hass CreditAttribution: hass commentedComment #17
hass CreditAttribution: hass commentedComment #18
markhalliwellNo, they're just navigation links, so probably ~16% a "pager". A true pager (historically) also has numbers indicating the actual page you are currently on and subsequent pages you can navigate to before and after.
Just because they use the term "pager" through out the code doesn't actually mean that it's a "pager". They could easily, just as well, be just simple inline links.
No, your attitude has been to undermine and berate this issue queue whenever something you don't find appealing to your satisfaction. It's actually been quite a rude experience.
---
Now, to actually get back to the code. I was going to add another lengthy list of reviews, but I figured it's just be easier to code it so you can see what I mean.
Note: this does require the latest dev as the following was just backported to 7.x-3.x #2840791: Add icon support to "link" theme hook.
Comment #20
markhalliwellComment #21
hass CreditAttribution: hass commentedHeavy patch, but ok.
Comment #22
markhalliwellComment #24
markhalliwellI created this related follow-up.