Skip to content
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

refactor item detail templates #206

Merged
merged 19 commits into from
Apr 18, 2017
Merged

refactor item detail templates #206

merged 19 commits into from
Apr 18, 2017

Conversation

vellip
Copy link
Collaborator

@vellip vellip commented Apr 12, 2017

  • add template tag for permissions
  • add template tag for item urls
  • unify/update permissions for item subclasses (propose -> add, modify -> change)
  • change url namespaces from item apps to reflect the app_label
  • add basic item_detail and let mapidea, idea and budgeting extend it

Next steps would be to do the same with the create/update forms and possibly the delete view.

Right now, the get_item_add_permission tag is useless as there is no item to get the app_label/model_name. I felt it was out of scope of this pull request to get a solution for that one because this permission is only used in the list-view which ain't topic of this PR.

@kleingeist
Copy link
Contributor

looks good to me.
only thing to note is that assignment tags will be deprecated with version 1.9 (simple_tag can now store results in a template variable and should be used instead).
but for now it is fine to use them


@register.assignment_tag
def get_item_delete_url(item):
return get_item_url(item, 'delete')
Copy link
Contributor

@xi xi Apr 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are there all these additional tags? We can just use {% get_item_url object 'delete' as delete_url %}, right?

# Conflicts:
#	apps/budgeting/templates/meinberlin_budgeting/proposal_detail.html
#	apps/ideas/templates/meinberlin_ideas/idea_detail.html
#	apps/mapideas/templates/meinberlin_mapideas/mapidea_detail.html
@xi
Copy link
Contributor

xi commented Apr 18, 2017

LGTM, too. I feel that some documentation (how does this work, what conventions should I follow, why was this approach chosen over others) would be a good addition, but that can be done separately.

@xi xi merged commit 254fe9d into master Apr 18, 2017
@kleingeist kleingeist deleted the 2017-04-pv-refactor-idea-details branch December 13, 2017 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants