-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add hero and project information page #6030
Conversation
93eeec9
to
c73128e
Compare
meinberlin/apps/contrib/templates/meinberlin_contrib/components/hero.html
Show resolved
Hide resolved
register = template.Library() | ||
|
||
@register.simple_tag | ||
def modify_hero_content(content): |
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.
for the plan detail page, we need to replace the content of the with another object (point_label) - again brings the lack of consistency in our naming throughout the apps. probably something to add to a documentation/ set of rules whenever we create a new app/model.
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 not lack of consistency, but different needs for the plan and project model. Plan have points for geolocation, projects do not have that.
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.
@m4ra Thanks for the feedback — I get that plans and projects have different needs. What I meant by 'lack of consistency' is more about standardizing shared building blocks across models. Right now, they both have a name/title, a description, and sometimes a short description, but we're naming these differently (title vs. name, description vs. details, etc).
It’d be helpful if we kept these core properties consistent across models. That way, the code becomes more predictable and easier to work with while still giving space for each model’s unique specifics. Probably something worth documenting as a guideline for future apps.
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.
In this particular case, we also need to do some frontend magic because the design isn’t aware of the different building blocks. That’s another issue — and honestly, it highlights a bigger problem with how features are designed across the team.
Nowadays, we tend to build websites that are more agnostic of the content, so data models become less rigid and more reusable across the platform, that would also be an argument to unify things a little better.
meinberlin/apps/projects/templates/meinberlin_projects/project_information.html
Show resolved
Hide resolved
f560c13
to
8ab5969
Compare
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.
LGTM, thanks for the large changes! I'd suggest waiting for @m4ra or @partizipation to also have a look regarding the django code.
meinberlin/apps/projects/templates/meinberlin_projects/project_information.html
Outdated
Show resolved
Hide resolved
meinberlin/apps/projects/templates/meinberlin_projects/project_information.html
Show resolved
Hide resolved
meinberlin/assets/scss/components_user_facing/adhocracy4/_a4-follow.scss
Outdated
Show resolved
Hide resolved
meinberlin/apps/contrib/templates/meinberlin_contrib/components/hero.html
Outdated
Show resolved
Hide resolved
meinberlin/apps/projects/templates/meinberlin_projects/includes/contact_person.html
Show resolved
Hide resolved
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 biggie indeed! Thanks for all the refactoring @hom3mad3
Few things need still some work. See my inline comments.
meinberlin/apps/contrib/templates/meinberlin_contrib/components/hero.html
Show resolved
Hide resolved
meinberlin/apps/plans/templates/meinberlin_plans/plan_detail.html
Outdated
Show resolved
Hide resolved
meinberlin/apps/projects/templates/meinberlin_projects/includes/contact_organisation.html
Show resolved
Hide resolved
meinberlin/apps/plans/templates/meinberlin_plans/plan_detail.html
Outdated
Show resolved
Hide resolved
meinberlin/apps/projects/templates/meinberlin_projects/project_information.html
Show resolved
Hide resolved
register = template.Library() | ||
|
||
@register.simple_tag | ||
def modify_hero_content(content): |
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 not lack of consistency, but different needs for the plan and project model. Plan have points for geolocation, projects do not have that.
meinberlin/apps/contrib/templates/meinberlin_contrib/components/hero.html
Outdated
Show resolved
Hide resolved
8ab5969
to
c9deda8
Compare
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.
Looks good to me. I just left one comment regarding the view. After that feel free to merge, unlees you want to wait for @m4ra ofc.
meinberlin/apps/contrib/templates/meinberlin_contrib/components/hero.html
Show resolved
Hide resolved
meinberlin/apps/projects/views.py
Outdated
def get_context_data(self, **kwargs): | ||
context = super().get_context_data(**kwargs) | ||
return context |
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.
you can remove this if it's not needed.
I am not sure about the other two functions, they might work as is as well.
def get_permission_object(self):
return self.get_object()
is the default afaik
and
@cached_property
def project(self):
return self.get_object()
is not used anywhere, is 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.
Cool, it makes the code cleaner! I actually just learned that PermissionRequiredMixin
defaults to get_object() for permissions, so I simplified it and kept only the basic settings.
c9deda8
to
71672e0
Compare
changed based on your suggestions, but needed to merge so there are no blockers and impediments! thanks again 🙏
Description:
This PR combines two originally separate stories due to their high interdependence:
Hero Project Page
Hero without buttons | Plan Page
Project information page
Contact info section (updated in plan detail and project information)
Changes