Skip to content

Commit

Permalink
Remove unnecessary | length > 0 from jinja templates
Browse files Browse the repository at this point in the history
  • Loading branch information
ZedThree committed Apr 3, 2024
1 parent 5c80d55 commit 2abfe4a
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 29 deletions.
6 changes: 3 additions & 3 deletions ford/templates/block_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1>{{ blockdat.name }}
{{ blockdat.doc }}
<br>

{% if blockdat.common|length > 0 %}
{% if blockdat.common %}
<section>
<h2>Common Blocks</h2>
{% for com in blockdat.common %}
Expand All @@ -37,15 +37,15 @@ <h2>Common Blocks</h2>
</script>
{% endif %}

{% if blockdat.variables|length > 0 %}
{% if blockdat.variables %}
<section>
<h2>Variables</h2>
{{ macros.variable_list(blockdat.variables) }}
</section>
<br>
{% endif %}

{% if blockdat.types|length > 0 %}
{% if blockdat.types %}
<section>
<h2>Derived Types</h2>
{% for type in blockdat.types %}
Expand Down
12 changes: 6 additions & 6 deletions ford/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ <h4 class="card-text">{{ author }}</h4>
</div>
{% set count=0 %}
{% if incl_src %}{% set count = count + 1 %}{% endif %}
{% if project.modules|length > 0 %}{% set count = count + 1 %}{% endif %}
{% if project.procedures|length > 0 %}{% set count = count + 1 %}{% endif %}
{% if project.types|length > 0 %}{% set count = count + 1 %}{% endif %}
{% if project.modules %}{% set count = count + 1 %}{% endif %}
{% if project.procedures %}{% set count = count + 1 %}{% endif %}
{% if project.types %}{% set count = count + 1 %}{% endif %}
{% set max_length = max_frontpage_items|int %}
{% if count and max_length %}
{% set width = (12/count)|int %}
Expand All @@ -96,7 +96,7 @@ <h3>Source Files</h3>
</div>
</div>
{% endif %}
{% if project.modules|length > 0 %}
{% if project.modules %}
<div class="col-xs-6 col-sm-{{ width }}">
<div>
<h3>Modules</h3>
Expand All @@ -113,7 +113,7 @@ <h3>Modules</h3>
</div>
</div>
{% endif %}
{% if project.procedures|length > 0 %}
{% if project.procedures %}
<div class="col-xs-6 col-sm-{{ width }}">
<div>
<h3>Procedures</h3>
Expand All @@ -130,7 +130,7 @@ <h3>Procedures</h3>
</div>
</div>
{% endif %}
{% if project.types|length > 0 %}
{% if project.types %}
<div class="col-xs-6 col-sm-{{ width }}">
<div>
<h3>Derived Types</h3>
Expand Down
4 changes: 2 additions & 2 deletions ford/templates/nongenint_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ <h2>{% if interface.abstract %}abstract {% endif %}interface <br>
{{ macros.use_list(interface) }}

<h3>Arguments</h3>
{% if procedure.args|length > 0 %}
{% if procedure.args %}
{{ macros.variable_list(procedure.args, intent=True) }}
{% else %}
<em>None</em>
Expand All @@ -74,7 +74,7 @@ <h3>Arguments</h3>
{% if var.kind %}{% set args = args + 1 %}{% endif %}
{% if var.strlen %}{% set args = args + 1 %}{% endif %}
{% if var.proto %}{% set args = args + 1 %}{% endif %}
<h3>Return Value <span class="anchor" id="{{ var.anchor }}"></span><small>{{ var.vartype }}{% if args > 0 -%}({% if var.kind -%}kind={{ var.kind }}{%- endif %}{% if args > 1 -%},{%- endif %}{% if var.strlen -%}len={{ var.strlen }}{%- endif %}{% if var.proto -%}{% if not var.proto[0].permission or var.proto[0].visible -%}{{ var.proto[0] }}{% else %}{{ var.proto[0].name }}{%- endif %}{{ var.proto[1] }}{%- endif %}){%- endif %}{% if var.attribs|length > 0 -%},{%- endif %}
<h3>Return Value <span class="anchor" id="{{ var.anchor }}"></span><small>{{ var.vartype }}{% if args > 0 -%}({% if var.kind -%}kind={{ var.kind }}{%- endif %}{% if args > 1 -%},{%- endif %}{% if var.strlen -%}len={{ var.strlen }}{%- endif %}{% if var.proto -%}{% if not var.proto[0].permission or var.proto[0].visible -%}{{ var.proto[0] }}{% else %}{{ var.proto[0].name }}{%- endif %}{{ var.proto[1] }}{%- endif %}){%- endif %}{% if var.attribs -%},{%- endif %}
{% for attrib in var.attribs -%}{{ attrib }}{% if not loop.last or var.dimension -%}, {%- endif %}{%- endfor %}{{ var.dimension }}</small></h3>
{{ var.doc }}
{% endif %}
Expand Down
18 changes: 9 additions & 9 deletions ford/templates/proc_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h3>Type Bound</h3>
{% endif %}

<h3>Arguments</h3>
{% if procedure.args|length > 0 %}
{% if procedure.args %}
{{ macros.variable_list(procedure.args, intent=True) }}
{% else %}
<em>None</em>
Expand Down Expand Up @@ -72,7 +72,7 @@ <h3 class="card-title">Called by</h3>
{% endif %}
<br>

{% if procedure.common|length > 0 %}
{% if procedure.common %}
<section>
<h2>Common Blocks</h2>
{% for com in procedure.common %}
Expand All @@ -87,15 +87,15 @@ <h2>Common Blocks</h2>
</script>
{% endif %}

{% if procedure.variables|length > 0 %}
{% if procedure.variables %}
<section>
<h2>Variables</h2>
{{ macros.variable_list(procedure.variables, permission=True) }}
</section>
<br>
{% endif %}

{% if procedure.enums|length > 0 %}
{% if procedure.enums %}
<section>
<h2>Enumerations</h2>
{% for enum in procedure.enums %}
Expand All @@ -105,7 +105,7 @@ <h2>Enumerations</h2>
<br>
{% endif %}

{% if procedure.interfaces|length > 0 %}
{% if procedure.interfaces %}
<section>
<h2>Interfaces</h2>
{% for intr in procedure.interfaces %}
Expand All @@ -115,7 +115,7 @@ <h2>Interfaces</h2>
<br>
{% endif %}

{% if procedure.absinterfaces|length > 0 %}
{% if procedure.absinterfaces %}
<section>
<h2>Abstract Interfaces</h2>
{% for intr in procedure.absinterfaces %}
Expand All @@ -125,7 +125,7 @@ <h2>Abstract Interfaces</h2>
<br>
{% endif %}

{% if procedure.types|length > 0 %}
{% if procedure.types %}
<section>
<h2>Derived Types</h2>
{% for type in procedure.types %}
Expand All @@ -135,7 +135,7 @@ <h2>Derived Types</h2>
<br>
{% endif %}

{% if procedure.functions|length > 0 %}
{% if procedure.functions %}
<section>
<h2>Functions</h2>
{% for proc in procedure.functions %}
Expand All @@ -146,7 +146,7 @@ <h2>Functions</h2>
{% endif %}


{% if procedure.subroutines|length > 0 %}
{% if procedure.subroutines %}
<section>
<h2>Subroutines</h2>
{% for proc in procedure.subroutines %}
Expand Down
16 changes: 8 additions & 8 deletions ford/templates/prog_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h3 class="card-title">Calls</h3>
{% endif %}
{% if program.doc or program.callsgraph %}<br>{% endif %}

{% if program.common|length > 0 %}
{% if program.common %}
<section>
<h2>Common Blocks</h2>
{% for com in program.common %}
Expand All @@ -48,15 +48,15 @@ <h2>Common Blocks</h2>
</script>
{% endif %}

{% if program.variables|length > 0 %}
{% if program.variables %}
<section>
<h2>Variables</h2>
{{ macros.variable_list(program.variables) }}
</section>
<br>
{% endif %}

{% if program.enums|length > 0 %}
{% if program.enums %}
<section>
<h2>Enumerations</h2>
{% for enum in program.enums %}
Expand All @@ -66,7 +66,7 @@ <h2>Enumerations</h2>
<br>
{% endif %}

{% if program.interfaces|length > 0 %}
{% if program.interfaces %}
<section>
<h2>Interfaces</h2>
{% for intr in program.interfaces %}
Expand All @@ -76,7 +76,7 @@ <h2>Interfaces</h2>
<br>
{% endif %}

{% if program.absinterfaces|length > 0 %}
{% if program.absinterfaces %}
<section>
<h2>Abstract Interfaces</h2>
{% for intr in program.absinterfaces %}
Expand All @@ -86,7 +86,7 @@ <h2>Abstract Interfaces</h2>
<br>
{% endif %}

{% if program.types|length > 0 %}
{% if program.types %}
<section>
<h2>Derived Types</h2>
{% for type in program.types %}
Expand All @@ -96,7 +96,7 @@ <h2>Derived Types</h2>
<br>
{% endif %}

{% if program.functions|length > 0 %}
{% if program.functions %}
<section>
<h2>Functions</h2>
{% for proc in program.functions %}
Expand All @@ -107,7 +107,7 @@ <h2>Functions</h2>
{% endif %}


{% if program.subroutines|length > 0 %}
{% if program.subroutines %}
<section>
<h2>Subroutines</h2>
{% for proc in program.subroutines %}
Expand Down
2 changes: 1 addition & 1 deletion ford/templates/type_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h3 class="card-title">Inherited by</h3>
{% endif %}
<br>

{% if dtype.variables|length > 0 %}
{% if dtype.variables %}
<section>
<h2>Components</h2>
{{ macros.variable_list(dtype.variables, permission=True) }}
Expand Down

0 comments on commit 2abfe4a

Please sign in to comment.