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

All modal dialogs should have "close" buttons #274

Closed
rolandgeider opened this issue Mar 12, 2016 · 6 comments
Closed

All modal dialogs should have "close" buttons #274

rolandgeider opened this issue Mar 12, 2016 · 6 comments
Milestone

Comments

@rolandgeider
Copy link
Member

For GUI consistency, all modal dialogs in the application should have a "close" button at the bottom. It might be also be a good idea to think a bit about making this some kind of django template tag or such, but it is enough to just edit the HTML

@jstoebel
Copy link

If no one else is working on this, I would like to take it on.

@rolandgeider
Copy link
Member Author

Go ahead!

@jstoebel
Copy link

jstoebel commented Jul 16, 2016

I've taken a look around and here's my idea:

  • move all modals into their own template files
  • create a template tag called that accepts as an argument the location of the template to render.
  • render a standard modal (with close button) with the content included.

Is this the general idea you had in mind? I'm relatively new to Django coming from a Rails background so let me know if there is a better way of going about this.

@rolandgeider
Copy link
Member Author

That would definitely be a solution. The only drawback I see is that there would be quite a bit of new templates (also, we need to pass template context to the templates, I think this is not the case by default but there's probably a flag to activate this).

In an ideal world, I'd like something like this:

{% modal %}
    {% title %}Foo{% endtitle %}
    {% content %}
        <p>Some HTML-content here</p>
    {% endcontent %}
{% endmodal %}

but I honestly don't know how difficult it would be to write such a tag in django (there is low-level API for this, but I have never used it much) and perhaps this is a bit overkill

@jstoebel
Copy link

Thanks! I think I'll proceed with just editing the HTML to add a close button. I don't want to introduce another layer of complexity without good reason.

@rolandgeider
Copy link
Member Author

This was fixed in pull request #305, closing there

@rolandgeider rolandgeider added this to the 1.8 milestone Jul 22, 2016
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

No branches or pull requests

2 participants