Skip to main content

Django template tag that checks if given view or path is active.

Project description

PyPi MIT TravisCI Coverage Updates Supported Python implementations Supported Python versions

Introduction

Django template tag that checks if given view or path is active.

Installation

  • Supported Python versions are: 2.7, 3.4, 3.5, 3.6 and pypy.

  • Supported Django versions are: 1.8.x, 1.9.x, 1.10.x and 1.11.x.

pip install --upgrade django-activeview

Add activeview to INSTALLED_APPS:

INSTALLED_APPS = [
    # ...
    'activeview',
    # ...
]

Usage

Template tag isactive accepts name of url OR path.

{% load activeview %}

{% isactive "/" %}
    Root path ("/") is active
{% endisactive %}

Or:

{% isactive "index" %}
    Url with name "index" is active
{% endisactive %}

Else is supported:

{% isactive "contact_us" %}
    Url with name "contact_us" is active.
    {% else %}
    "contact_us" is NOT active
{% endisactive %}

Inspiration and Credits

License

The MIT License (MIT)

Copyright (c) 2016–2017 Vašek Dohnal (@illagrenan)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-activeview-0.1.3.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

django_activeview-0.1.3-py2.py3-none-any.whl (8.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-activeview-0.1.3.tar.gz.

File metadata

File hashes

Hashes for django-activeview-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c7339a97cb643860a688c84fa584320dcea7e0bd47d10c1d4965fc8870133ce4
MD5 301640565e48fd02590df39cdb878f9c
BLAKE2b-256 0d721fa697eae1a19335f7ffb7a12c32020a2be6c9fb3a79149fcda473399643

See more details on using hashes here.

File details

Details for the file django_activeview-0.1.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_activeview-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 908c0fc20624c016a8fb80dc822de695a6466f94e1d38e473fc952147b488ef0
MD5 998164fb777ade5e28254e56192df6b4
BLAKE2b-256 91f74d6e968f846976870c06ced82a564a19ac566506fe8112ea1f7a2e5f14b7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page