فهرست منبع

Rename gfm filter to render_markdown

Jeremy Stretch 6 سال پیش
والد
کامیت
1423fd9024

+ 1 - 1
netbox/templates/circuits/circuit.html

@@ -119,7 +119,7 @@
             </div>
             </div>
             <div class="panel-body rendered-markdown">
             <div class="panel-body rendered-markdown">
                 {% if circuit.comments %}
                 {% if circuit.comments %}
-                    {{ circuit.comments|gfm }}
+                    {{ circuit.comments|markdown }}
                 {% else %}
                 {% else %}
                     <span class="text-muted">None</span>
                     <span class="text-muted">None</span>
                 {% endif %}
                 {% endif %}

+ 3 - 3
netbox/templates/circuits/provider.html

@@ -88,11 +88,11 @@
                 </tr>
                 </tr>
                 <tr>
                 <tr>
                     <td>NOC Contact</td>
                     <td>NOC Contact</td>
-                    <td class="rendered-markdown">{{ provider.noc_contact|gfm|placeholder }}</td>
+                    <td class="rendered-markdown">{{ provider.noc_contact|markdown|placeholder }}</td>
                 </tr>
                 </tr>
                 <tr>
                 <tr>
                     <td>Admin Contact</td>
                     <td>Admin Contact</td>
-                    <td class="rendered-markdown">{{ provider.admin_contact|gfm|placeholder }}</td>
+                    <td class="rendered-markdown">{{ provider.admin_contact|markdown|placeholder }}</td>
                 </tr>
                 </tr>
                 <tr>
                 <tr>
                     <td>Circuits</td>
                     <td>Circuits</td>
@@ -110,7 +110,7 @@
             </div>
             </div>
             <div class="panel-body rendered-markdown">
             <div class="panel-body rendered-markdown">
                 {% if provider.comments %}
                 {% if provider.comments %}
-                    {{ provider.comments|gfm }}
+                    {{ provider.comments|markdown }}
                 {% else %}
                 {% else %}
                     <span class="text-muted">None</span>
                     <span class="text-muted">None</span>
                 {% endif %}
                 {% endif %}

+ 1 - 1
netbox/templates/dcim/device.html

@@ -325,7 +325,7 @@
                 </div>
                 </div>
                 <div class="panel-body rendered-markdown">
                 <div class="panel-body rendered-markdown">
                     {% if device.comments %}
                     {% if device.comments %}
-                        {{ device.comments|gfm }}
+                        {{ device.comments|markdown }}
                     {% else %}
                     {% else %}
                         <span class="text-muted">None</span>
                         <span class="text-muted">None</span>
                     {% endif %}
                     {% endif %}

+ 1 - 1
netbox/templates/dcim/devicetype.html

@@ -149,7 +149,7 @@
             </div>
             </div>
             <div class="panel-body rendered-markdown">
             <div class="panel-body rendered-markdown">
                 {% if devicetype.comments %}
                 {% if devicetype.comments %}
-                    {{ devicetype.comments|gfm }}
+                    {{ devicetype.comments|markdown }}
                 {% else %}
                 {% else %}
                     <span class="text-muted">None</span>
                     <span class="text-muted">None</span>
                 {% endif %}
                 {% endif %}

+ 1 - 1
netbox/templates/dcim/powerfeed.html

@@ -158,7 +158,7 @@
             </div>
             </div>
             <div class="panel-body rendered-markdown">
             <div class="panel-body rendered-markdown">
                 {% if powerfeed.comments %}
                 {% if powerfeed.comments %}
-                    {{ powerfeed.comments|gfm }}
+                    {{ powerfeed.comments|markdown }}
                 {% else %}
                 {% else %}
                     <span class="text-muted">None</span>
                     <span class="text-muted">None</span>
                 {% endif %}
                 {% endif %}

+ 1 - 1
netbox/templates/dcim/rack.html

@@ -198,7 +198,7 @@
             </div>
             </div>
             <div class="panel-body rendered-markdown">
             <div class="panel-body rendered-markdown">
                 {% if rack.comments %}
                 {% if rack.comments %}
-                    {{ rack.comments|gfm }}
+                    {{ rack.comments|markdown }}
                 {% else %}
                 {% else %}
                     <span class="text-muted">None</span>
                     <span class="text-muted">None</span>
                 {% endif %}
                 {% endif %}

+ 1 - 1
netbox/templates/dcim/site.html

@@ -206,7 +206,7 @@
             </div>
             </div>
             <div class="panel-body rendered-markdown">
             <div class="panel-body rendered-markdown">
                 {% if site.comments %}
                 {% if site.comments %}
-                    {{ site.comments|gfm }}
+                    {{ site.comments|markdown }}
                 {% else %}
                 {% else %}
                     <span class="text-muted">None</span>
                     <span class="text-muted">None</span>
                 {% endif %}
                 {% endif %}

+ 1 - 1
netbox/templates/extras/script.html

@@ -47,7 +47,7 @@
                                     <tr>
                                     <tr>
                                         <td>{{ forloop.counter }}</td>
                                         <td>{{ forloop.counter }}</td>
                                         <td>{% log_level level %}</td>
                                         <td>{% log_level level %}</td>
-                                        <td class="rendered-markdown">{{ message|gfm }}</td>
+                                        <td class="rendered-markdown">{{ message|markdown }}</td>
                                     </tr>
                                     </tr>
                                 {% empty %}
                                 {% empty %}
                                     <tr>
                                     <tr>

+ 1 - 1
netbox/templates/extras/tag.html

@@ -90,7 +90,7 @@
                 </div>
                 </div>
                 <div class="panel-body rendered-markdown">
                 <div class="panel-body rendered-markdown">
                     {% if tag.comments %}
                     {% if tag.comments %}
-                        {{ tag.comments|gfm }}
+                        {{ tag.comments|markdown }}
                     {% else %}
                     {% else %}
                         <span class="text-muted">None</span>
                         <span class="text-muted">None</span>
                     {% endif %}
                     {% endif %}

+ 1 - 1
netbox/templates/tenancy/tenant.html

@@ -87,7 +87,7 @@
             </div>
             </div>
             <div class="panel-body rendered-markdown">
             <div class="panel-body rendered-markdown">
                 {% if tenant.comments %}
                 {% if tenant.comments %}
-                    {{ tenant.comments|gfm }}
+                    {{ tenant.comments|markdown }}
                 {% else %}
                 {% else %}
                     <span class="text-muted">None</span>
                     <span class="text-muted">None</span>
                 {% endif %}
                 {% endif %}

+ 1 - 1
netbox/templates/virtualization/cluster.html

@@ -115,7 +115,7 @@
             </div>
             </div>
             <div class="panel-body rendered-markdown">
             <div class="panel-body rendered-markdown">
                 {% if cluster.comments %}
                 {% if cluster.comments %}
-                    {{ cluster.comments|gfm }}
+                    {{ cluster.comments|markdown }}
                 {% else %}
                 {% else %}
                     <span class="text-muted">None</span>
                     <span class="text-muted">None</span>
                 {% endif %}
                 {% endif %}

+ 1 - 1
netbox/templates/virtualization/virtualmachine.html

@@ -152,7 +152,7 @@
             </div>
             </div>
             <div class="panel-body rendered-markdown">
             <div class="panel-body rendered-markdown">
                 {% if virtualmachine.comments %}
                 {% if virtualmachine.comments %}
-                    {{ virtualmachine.comments|gfm }}
+                    {{ virtualmachine.comments|markdown }}
                 {% else %}
                 {% else %}
                     <span class="text-muted">None</span>
                     <span class="text-muted">None</span>
                 {% endif %}
                 {% endif %}

+ 1 - 2
netbox/utilities/templatetags/helpers.py

@@ -31,9 +31,8 @@ def placeholder(value):
     return mark_safe(placeholder)
     return mark_safe(placeholder)
 
 
 
 
-# TODO: Rename this filter as py-gfm is no longer in use
 @register.filter(is_safe=True)
 @register.filter(is_safe=True)
-def gfm(value):
+def render_markdown(value):
     """
     """
     Render text as Markdown
     Render text as Markdown
     """
     """