-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0fd0903
commit 72fbe21
Showing
17 changed files
with
360 additions
and
6,793 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 4 additions & 8 deletions
12
flask_nemo/data/templates_plugins/breadcrumb/breadcrumb.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
<nav id="breadcrumb"> | ||
<ol class="breadcrumb"> | ||
<li class="breadcrumb-item"><a href="{{url_for(".r_index")}}">Home</a></li> | ||
{% for crumb in breadcrumbs: %} | ||
{%if crumb["link"] != None %} | ||
|
||
<li class="breadcrumb-item"><a href="{{url_for(crumb["link"], **crumb["args"])}}">{{crumb["title"]}}</a></li> | ||
{% else %} | ||
<li class="breadcrumb-item active">{{crumb["title"]}}</li> | ||
{% endif %} | ||
{% endfor %} | ||
{% for crumb in breadcrumbs: -%} | ||
{%- if crumb["link"] != None -%}<li class="breadcrumb-item"><a href="{{url_for(crumb["link"], **crumb["args"])}}">{{crumb["title"]}}</a></li> | ||
{% else %}<li class="breadcrumb-item active">{{crumb["title"]}}</li>{% endif %} | ||
{%- endfor %} | ||
</ol> | ||
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from jinja2 import nodes | ||
from jinja2.ext import Extension | ||
|
||
|
||
class FakeCacheExtension(Extension): | ||
""" This extension exists only to avoid breaks in Nemo if FlaskCache is not used. | ||
Not that if you'd load Flask Cache en | ||
""" | ||
tags = set(['cache']) | ||
|
||
def parse(self, parser): | ||
# the first token is the token that started the tag. In our case | ||
# we only listen to ``'cache'`` so this will be a name token with | ||
# `cache` as value. We get the line number so that we can give | ||
# that line number to the nodes we create by hand. | ||
lineno = next(parser.stream).lineno | ||
|
||
# now we parse a single expression that is used as cache key. | ||
args = [parser.parse_expression()] | ||
|
||
# if there is a comma, the user provided a timeout. If not use | ||
# None as second parameter. | ||
if parser.stream.skip_if('comma'): | ||
args.append(parser.parse_expression()) | ||
else: | ||
args.append(nodes.Const(None)) | ||
|
||
# now we parse the body of the cache block up to `endcache` and | ||
# drop the needle (which would always be `endcache` in that case) | ||
body = parser.parse_statements(['name:endcache'], drop_needle=True) | ||
|
||
# now return a `CallBlock` node that calls our _cache_support | ||
# helper method on this extension. | ||
return nodes.CallBlock(self.call_method('_do_nothing', args), | ||
[], [], body).set_lineno(lineno) | ||
|
||
def _do_nothing(self, timeout, fragment_name, vary_on, caller): | ||
return caller() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
MyCapytain>=2.0.0b4 | ||
requests_cache>=0.4.9 | ||
Flask>=0.10.1 | ||
Flask-Caching>=1.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.