File tree 14 files changed +33
-62
lines changed
14 files changed +33
-62
lines changed Original file line number Diff line number Diff line change 1
1
{% extends "base.html" %}
2
2
{% load i18n %}
3
+ {% load promgen %}
3
4
4
5
{% block content %}
5
6
12
13
</ h1 >
13
14
</ div >
14
15
15
- < ol class ="breadcrumb " v-pre >
16
- < li > < a href ="{% url 'service-list' %} "> Home</ a > </ li >
17
- < li > < a href ="{% url 'farm-list' %} "> Farms</ a > </ li >
18
- < li class ="active "> < a href ="{% url 'farm-detail' farm.id %} "> {{ farm.name }}</ a > </ li >
19
- </ ol >
16
+ {% breadcrumb farm %}
20
17
21
18
< div class ="row " v-pre >
22
19
Original file line number Diff line number Diff line change 1
1
{% extends "base.html" %}
2
+ {% load promgen %}
2
3
3
4
{% block content %}
4
5
5
- < ol class ="breadcrumb ">
6
- < li > < a href ="{% url 'service-list' %} "> Home</ a > </ li >
7
- < li class ="active "> Convert Farm</ li >
8
- </ ol >
6
+ {% breadcrumb label="Convert Farm" %}
9
7
10
8
< div class ="panel panel-warning " v-pre >
11
9
< div class ="panel-heading "> Error converting farm. Duplicate detected</ div >
Original file line number Diff line number Diff line change 1
1
{% extends "base.html" %}
2
+ {% load promgen %}
2
3
3
4
{% block content %}
4
5
5
6
< div class ="page-header " v-pre >
6
7
< h1 > Project: {{ project.name }}</ h1 >
7
8
</ div >
8
9
9
- < ol class ="breadcrumb " v-pre >
10
- < li > < a href ="{% url 'service-list' %} "> Home</ a > </ li >
11
- < li > < a href ="{% url 'service-detail' project.service.id %} "> {{ project.service.name }}</ a > </ li >
12
- < li > < a href ="{% url 'project-detail' project.id %} "> {{ project.name }}</ a > </ li >
13
- < li class ="active "> {{ view.button_label }}</ li >
14
- </ ol >
10
+ {% breadcrumb project view.button_label %}
15
11
16
12
< form method ="post " v-pre > {% csrf_token %}
17
13
{{ form.as_p }}
Original file line number Diff line number Diff line change 1
1
{% extends "base.html" %}
2
+ {% load promgen %}
2
3
3
4
{% block title %}No hosts found for {{ slug }}{% endblock %}
4
5
7
8
< h1 > Host: {{ slug }}</ h1 >
8
9
</ div >
9
10
10
- < ol class ="breadcrumb " v-pre >
11
- < li > < a href ="{% url 'service-list' %} "> Home</ a > </ li >
12
- < li class ="active "> {{ slug }}</ li >
13
- </ ol >
11
+ {% breadcrumb label=slug %}
14
12
15
13
< div class ="alert alert-danger " role ="alert " v-pre >
16
14
No hosts found for {{ slug }}
Original file line number Diff line number Diff line change 1
1
{% extends "base.html" %}
2
2
{% load i18n %}
3
+ {% load promgen %}
3
4
{% block content %}
4
5
5
6
< div class ="page-header " v-pre >
6
7
< h1 > Host: {{ slug }}</ h1 >
7
8
</ div >
8
9
9
- < ol class ="breadcrumb " v-pre >
10
- < li > < a href ="{% url 'service-list' %} "> Home</ a > </ li >
11
- < li class ="active "> {{ slug }}</ li >
12
- </ ol >
10
+ {% breadcrumb label=slug %}
13
11
14
12
< div style ="display:none " data-instance ="{{slug}} " class ="panel panel-danger promgen-alert ">
15
13
< div class ="panel-heading "> Alerts</ div >
Original file line number Diff line number Diff line change 1
1
{% extends "base.html" %}
2
2
{% load i18n %}
3
+ {% load promgen %}
3
4
4
5
{% block content %}
5
6
6
7
< div class ="page-header " v-pre >
7
8
< h1 > Farm: {{ farm.name }}</ h1 >
8
9
</ div >
9
10
10
- < ol class ="breadcrumb " v-pre >
11
- < li > < a href ="{% url 'service-list' %} "> Home</ a > </ li >
12
- < li > < a href ="{% url 'service-detail' project.service.id %} "> {{ project.service.name }}</ a > </ li >
13
- < li > < a href ="{% url 'project-detail' project.id %} "> {{ project.name }}</ a > </ li >
14
- < li class ="active "> Add hosts to {{ farm.name }}</ li >
15
- </ ol >
11
+ {% breadcrumb project label="Add hosts to "|add:farm.name %}
16
12
17
13
< form action ="{% url 'hosts-add' farm.id %} " method ="post " v-pre > {% csrf_token %}
18
14
< table >
Original file line number Diff line number Diff line change 1
1
{% extends "base.html" %}
2
+ {% load promgen %}
2
3
3
4
{% block content %}
4
5
5
6
< div class ="page-header ">
6
7
< h1 > Hosts</ h1 >
7
8
</ div >
8
9
9
- < ol class ="breadcrumb ">
10
- < li > < a href ="{% url 'service-list' %} "> Home</ a > </ li >
11
- < li class ="active "> All Hosts</ li >
12
- </ ol >
10
+ {% breadcrumb label="All Hosts" %}
11
+
13
12
{% include "promgen/pagination_short.html" with page_obj=host_groups %}
14
13
< div class ="panel panel-default ">
15
14
< table class ="table table-bordered table-condensed ">
Original file line number Diff line number Diff line change 1
1
{% extends "base.html" %}
2
+ {% load promgen %}
2
3
3
4
{% block content %}
4
5
5
6
< div class ="page-header ">
6
7
< h1 > Import Configs</ h1 >
7
8
</ div >
8
9
9
- < ol class ="breadcrumb ">
10
- < li > < a href ="{% url 'service-list' %} "> Home</ a > </ li >
11
- < li class ="active "> Import Service</ li >
12
- </ ol >
10
+ {% breadcrumb label="Import Service" %}
13
11
14
12
< div class ="panel panel-default ">
15
13
< div class ="panel-heading "> Import Targets</ div >
Original file line number Diff line number Diff line change 1
1
{% extends "base.html" %}
2
+ {% load promgen %}
2
3
3
4
{% block content %}
4
5
5
6
< div class ="page-header " v-pre >
6
7
< h1 > Project: {{ project.name }}</ h1 >
7
8
</ div >
8
9
9
- < ol class ="breadcrumb " v-pre >
10
- < li > < a href ="{% url 'service-list' %} "> Home</ a > </ li >
11
- < li > < a href ="{% url 'service-detail' project.service.id %} "> {{ project.service.name }}</ a > </ li >
12
- < li > < a href ="{% url 'project-detail' project.id %} "> {{ project.name }}</ a > </ li >
13
- < li class ="active "> Link Farm {{ source }}</ li >
14
- </ ol >
10
+ {% breadcrumb project label="Link Farm "|add:source %}
15
11
16
12
< div class ="panel panel-default " v-pre >
17
13
< div class ="panel-heading ">
Original file line number Diff line number Diff line change 1
1
{% extends "base.html" %}
2
+ {% load promgen %}
2
3
3
4
{% block content %}
4
5
5
6
< div class ="page-header ">
6
7
< h1 > Import Rules</ h1 >
7
8
</ div >
8
9
9
- < ol class ="breadcrumb ">
10
- < li > < a href ="{% url 'service-list' %} "> Home</ a > </ li >
11
- < li class ="active "> Import Rule</ li >
12
- </ ol >
10
+ {% breadcrumb label="Import Rule" %}
13
11
14
12
< div class ="panel panel-default ">
15
13
< div class ="panel-heading "> Import Rules</ div >
Original file line number Diff line number Diff line change 7
7
< h1 > Rules</ h1 >
8
8
</ div >
9
9
10
- < ol class ="breadcrumb ">
11
- < li > < a href ="{% url 'service-list' %} "> Home</ a > </ li >
12
- < li class ="active "> List Rules</ li >
13
- </ ol >
10
+ {% breadcrumb label="List Rules" %}
14
11
{% include "promgen/pagination_short.html" %}
15
12
{% regroup rule_list by content_object as grouped_rule_list %}
16
13
Original file line number Diff line number Diff line change 1
1
{% extends "base.html" %}
2
2
{% load i18n %}
3
+ {% load promgen %}
3
4
{% block content %}
4
5
5
6
< div class ="page-header ">
6
7
< h1 > Search</ h1 >
7
8
</ div >
8
9
9
- < ol class ="breadcrumb ">
10
- < li > < a href ="{% url 'service-list' %} "> Home</ a > </ li >
11
- < li class ="active "> Search</ li >
12
- </ ol >
10
+ {% breadcrumb label="Search" %}
13
11
14
12
{% include "promgen/pagination_short.html" %}
15
13
{% if service_list %}
Original file line number Diff line number Diff line change 1
1
{% extends "base.html" %}
2
+ {% load promgen %}
2
3
3
4
{% block content %}
4
5
5
6
< div class ="page-header ">
6
7
< h1 v-pre > Project: {{ project.name }}</ h1 >
7
8
</ div >
8
9
9
- < ol class ="breadcrumb " v-pre >
10
- < li > < a href ="{% url 'service-list' %} "> Home</ a > </ li >
11
- < li > < a href ="{% url 'service-detail' project.service.id %} "> {{ project.service.name }}</ a > </ li >
12
- < li > < a href ="{% url 'project-detail' project.id %} "> {{ project.name }}</ a > </ li >
13
- < li class ="active "> Add URL to {{ farm.name }}</ li >
14
- </ ol >
10
+ {% breadcrumb project label="Add URL" %}
15
11
16
12
< form action ="{% url 'url-new' project.id %} " method ="post " v-pre > {% csrf_token %}
17
13
< table >
Original file line number Diff line number Diff line change @@ -155,6 +155,10 @@ def sender(obj):
155
155
if obj .content_type .model == "project" :
156
156
yield from project (obj .content_object )
157
157
158
+ def farm (obj ):
159
+ yield reverse ("farm-list" ), _ ("Farms" )
160
+ yield obj .get_absolute_url (), obj .name
161
+
158
162
def generator ():
159
163
yield reverse ("home" ), _ ("Home" )
160
164
if isinstance (instance , models .Sender ):
@@ -169,9 +173,11 @@ def generator():
169
173
yield from rule (instance )
170
174
if isinstance (instance , models .Alert ):
171
175
yield from alert (instance )
176
+ if isinstance (instance , models .Farm ):
177
+ yield from farm (instance )
172
178
173
179
def to_tag ():
174
- yield '<ol class="breadcrumb">'
180
+ yield '<ol class="breadcrumb" v-pre >'
175
181
for href , text in generator ():
176
182
yield format_html ('<li><a href="{}">{}</a></li>' , mark_safe (href ), text )
177
183
if label :
You can’t perform that action at this time.
0 commit comments