-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial DSC & Django update #660
Conversation
Mostly ensuring the app starts up, the app is still thoroughly FUBAR
Switches to new app-specific base-template, and initial refactor to new bootstrap CSS classes
File is still there to avoid errors on non-migrated form-pages. To be removed later
The old file is added bak-file, so we can pull out relevant sections when needed
Yes, totally unnecessary, but I like it
main/static/main/style.css
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved the original contents to style.css.bak
. I did this because I want us to manually review anything we need from there. A lot of it is unneeded now, and other stuff might be better implemented using existing classes from BS.
main/templates/base/fetc_base.html
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the new base template for ethics, to be used by all pages either directly or indirectly. It mostly implements the header styling, leaving the main content styling up to the DSC provided template.
Note: the current header isn't quite finished, it still needs a polishing pass. However, that would delay this PR, and it's functional enough for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the more controversial one of the two new base templates. This template is designed to be used by most 'form'-templates (with 'form templates' I only mean the ones part of the actual application. We have other forms in the app, like 'copy', that should just the normal base template. (Altough, we could create a more generic form-template that handles for FormView
-derivatives, that handles the HTML for forms.)
Note: some of our application-form-pages are a bit special, and might need a custom template instead of this 'automagic' template.
This template sets a pre-set layout, providing specific blocks to override to put content in said content. See the following image for a visual overview of the available blocks and where they are:
Notes:
- The sizes of the blocks were hardcoded by me, they scale dynamically to the content (vertically)
- All blocks can be left empty. In the pages I've conferted I've used
pre-form
to add the page-title - The stepper is a block, but ideally that block would never need to be overwritten by any implementing page.
- The're a block
form-css-classes
not visually present in the image above. This is a block one can use to add extra css-classes to theuu-form
element. (For exampleuu-form-no-gap
, oruu-form-no-help
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work, and great image.
I think the pre-form
, form-buttons
, and post-form
should be easily splittable into a their main content and an aside, as with the actual form.
This makes a more sense stylistically, for example to align the buttons to the main form body. This also allows for an aside to the pre-form intro text, for example with some "handige links" like we do in procreg.
Of course this is already possible if you code it yourself or reuse the classes. However, it would be nice to have it supported by default everywhere in the form by having separate pre-form-content
and pre-form-aside
blocks you could use right away.
And then a parent pre-form
block which gives you the full width if you replace it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great suggestion! As it's quite easy to implement, I've done so:
Some notes:
- As you suggested, these new blocks are childs of the existing
pre/post-form
blocks, so you can still override those as before. - I called
pre-form-content
pre-form-text
instead, as that mirrors the class.uu-form
provides for this usecase - I didn't split up
form-buttons
into an aside, as I don't see a usecase where that makes sense to actually use. I did change the HTML to use the sametext
classes as the new blocks, such that the buttons are aligned with the form as you suggested. - With this buttons-change, we probably want make those form buttons smaller. Currently I think it's a bit claustrophobic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Controversially, I removed all buttons aside from next/prev. Mostly because the new stepper should be the new best-way to nagivate to things.
main/templates/base/navigation.html
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the old stepper. It's still referenced on a lot of pages, so I just made an empty file for now
main/templates/base/stepper.html
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a exceptionally terrible implementation of the new stepper on top of the old stepper code; it's mostly for show.
In a different issue, this should be replaced with a properly working one (ideally with status indication, and better hierarchy).
@@ -57,8 +57,58 @@ def get_queryset(self): | |||
return self.model.objects.filter(not_after__gt=now, not_before__lt=now) | |||
|
|||
|
|||
class HomeView(LoginRequiredMixin, _SystemMessageView): | |||
class SeasonalCoverImageMixin: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay so this addition is 100% unnecessary. I just wanted to have a bit of fun during a boring meeting.
It adds a seasonal-appropiate cover-image automatically.
The winter and autumn covers are the ones we already had, the spring and summer ones are new.
Note 1: I made the old 'summer' version the 'autumn' one. Mostly because it had people in winter-coats in it, so it wasn't really summer.
Note 2: I found out that our attributions we had before were wrong! We listed the person who added the image to the image-bank, not the actual photographer themselves. The ones listed here now are correct.
def form_valid(self, form): | ||
messages.success(self.request, self.success_message) | ||
return super(DeleteView, self).delete(request, *args, **kwargs) | ||
return super(DeleteView, self).form_valid(form) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Django 4 changed how deleteviews worked. For those wondering where this and other similar changes comes from.
Wth? Was djlint unhappy with its own output?!
Okay, this should be all of them now. RIGHT?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, very good work :) I mainly looked at what you changed, not so much at what stayed the same. And i did some, but non-exhaustive testing. It all looks good and consistent. The one thing I think you overlooked is to remove {% load uil_filters %}
from a few templates. This caused an error for me at one point in testing.
I also quite like the philosophy of the new fetc_form_base template. I think the places you've used the new boxes, show the potential of this nicely.
All in all, I'm happy and excited to continue working on this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a btn class to the submit button on this page. My bad, i think :p
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is one of the files only touched by my automatic refactoring runs; and I didn't do a check for naked submit buttons. (There are probably more?)
And not really your fault; the previous CSS handled that automatically for you, the new one doesn't.
Thanks for the review! I've added a commit that refactors all uses of There are probably more of these 'well you could've done that in bulk' problems still living in other places; I've only done those I was aware of, and those I found during my work on the pages I gave individual attention. Normally we go with the 'one approval is enough' strategy, but I really want @miggol's review before merging, as it's quite an impactfull PR. |
main/templates/main/landing.html
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah honestly I think the menu should just be empty if you're not logged in, especially if we add the footer from index.html here as well.
It's middle-aligned because procreg is middle-aligned, and it's a bit annoying to fix that manually for this one case
main/templates/main/landing.html
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I would like to add the footer from
index.html
to this page. The documents links might not be as relevant, but all the support addresses are.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea!
However, it's (sadly) not as simple as moving some HTML around. landing.html
has some extra JS to protect against spambots scanning mailto:
links, which we'd have to re-introduce. I'd rather create a separate issue for this, to implement that correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work, and great image.
I think the pre-form
, form-buttons
, and post-form
should be easily splittable into a their main content and an aside, as with the actual form.
This makes a more sense stylistically, for example to align the buttons to the main form body. This also allows for an aside to the pre-form intro text, for example with some "handige links" like we do in procreg.
Of course this is already possible if you code it yourself or reuse the classes. However, it would be nice to have it supported by default everywhere in the form by having separate pre-form-content
and pre-form-aside
blocks you could use right away.
And then a parent pre-form
block which gives you the full width if you replace it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I've been browsing for a while and overall I'm very impressed. Most things are simply working.
There's some stuff still missing but I'm sure we'll get to it soon enough in the django-4 branch.
This PR lays the foundations to built V4 upon.
Note: this PR targets the
major/4
branch for now. This is a fork of develop made at the same time as the source branch, to have a clear diff. New changes in develop will need to be merged into there as well.It's a rather large PR; I've tried to make proper commits for individual changes, to help reviewing. I've also added some comments over adding them here, such that the comment is located near the relevant code.
Also, please ignore the changes in the docs folder. Those are caused by my bulk-refactors.
Highlights:
Still todo:
Well, a lot. A non-exhaustive list: