Changeset - d3db3c085912
[Not reviewed]
default
0 12 0
Branko Majic (branko) - 10 years ago 2013-11-10 14:22:44
branko@majic.rs
CONNT-24: Fix the ampersands in HTML (& instead of &). Fix the headers to be XHTML5-comliant. Make sure that all tags are closed (like input, hr etc). Use non-empty actions for forms. Replace invalid use of width attribute for img with CSS styling. Don't use readonly attribute for select fields. Set an empty label instead (one option in drop-box).
12 files changed with 38 insertions and 34 deletions:
0 comments (0 inline, 0 general)
conntrackt/static/custom.css
Show inline comments
 
@@ -42,3 +42,7 @@ parent div instead). */
 
 * END (search suggestions)
 
 */
 

	
 
/* Project diagram should have maximum width */
 
#project_diagram {
 
    width: 100%;
 
}
 
\ No newline at end of file
conntrackt/templates/admin/conntrackt/communication/change_list.html
Show inline comments
 
@@ -7,7 +7,7 @@
 
            <li>
 
              {# Add the GET parameters from the admin's filter to 'Add entity' button #}
 
              {# so we can perform some filtering on source/destination interfaces. #}
 
              <a href="{% url cl.opts|admin_urlname:'add' %}?{% if is_popup %}_popup=1{% endif %}{% if 'location' in cl.params %}&location={{ cl.params.location }}{% endif %}{% if 'project' in cl.params %}&project={{ cl.params.project }}{% endif %}" class="addlink">
 
              <a href="{% url cl.opts|admin_urlname:'add' %}?{% if is_popup %}_popup=1{% endif %}{% if 'location' in cl.params %}&amp;location={{ cl.params.location }}{% endif %}{% if 'project' in cl.params %}&amp;project={{ cl.params.project }}{% endif %}" class="addlink">
 
                {% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}
 
              </a>
 
            </li>
conntrackt/templates/conntrackt/base.html
Show inline comments
 
{% load conntrackt_tags %}
 

	
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
<!DOCTYPE html>
 
<html xmlns="http://www.w3.org/1999/xhtml">
 
  <head>
 
    <title>{% block title %}Conntrackt{% endblock %}</title>
 
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
 
    <meta charset="utf-8" />
 
    <link rel="stylesheet" type="text/css" href="/static/bootstrap/css/bootstrap.css" />
 
    <style>
 
    body {
 
      padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
 
    }
 
    </style>
 
    <link href="/static/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
 
    <link href="/static/custom.css" rel="stylesheet">
 
    <link href="/static/bootstrap/css/bootstrap-responsive.css" rel="stylesheet" />
 
    <link href="/static/custom.css" rel="stylesheet" />
 
    <script>
 
    /* Set-up the base URL for sending out AJAX API calls. */
 
    var conntrackt_api_url = location.protocol + "//" + location.hostname + ":" + location.port + {% url "index" %} + "api";
 
@@ -42,7 +42,7 @@
 
                <form action="{% url "search" %}" class="navbar-search pull-left" method="GET">
 
                  <div class="input-prepend">
 
                    <button type="submit" class="btn btn-link"><span class="icon-search icon-white"></span></button>
 
                    <input id="search" class="search-query" type="text" autocomplete="off" name="q"  placeholder="Search">
 
                    <input id="search" class="search-query" type="text" autocomplete="off" name="q"  placeholder="Search" />
 
                    <div id="search-suggestions" class="dropdown">
 
                      <ul class="dropdown-menu">
 
                      </ul>
conntrackt/templates/conntrackt/create_form.html
Show inline comments
 
@@ -11,7 +11,7 @@
 
</div>
 
<div class="row">
 
  <div class="span6">
 
    <form action="" method="post">
 
    <form action="#" method="post">
 
      <div class="controls controls-row">
 
      {% csrf_token %}
 
      {{ form | crispy }}
conntrackt/templates/conntrackt/delete_form.html
Show inline comments
 
@@ -11,7 +11,7 @@
 
</div>
 
<div class="row">
 
  <div class="span12">
 
    <form action="" method="post">
 
    <form action="#" method="post">
 
      <div class="controls controls-row">
 
        {% csrf_token %}
 
        {{ form }}
 
@@ -21,7 +21,7 @@
 
        </ul>
 
        Are you sure you want to remove them?
 
      </div>
 
      <hr>
 
      <hr />
 
      <div class="controls">
 
        <button type="submit" class="btn btn-primary">Remove</button>
 
      </div>
conntrackt/templates/conntrackt/entity_detail.html
Show inline comments
 
@@ -9,7 +9,7 @@
 
<div class="row">
 
  <h1 class="span12">{{entity.name}}</h1>
 
</div>
 
<hr>
 
<hr />
 

	
 
{% if entity.description %}
 
<div class="row">
 
@@ -17,7 +17,7 @@
 
    {{entity.description}}
 
  </div>
 
</div>
 
<hr>
 
<hr />
 
{% endif %}
 

	
 
<div class="row">
 
@@ -28,7 +28,7 @@
 
  </div>
 
</div>
 

	
 
<hr>
 
<hr />
 

	
 
<div class="row">
 

	
 
@@ -91,7 +91,7 @@
 
      <div>
 
        {% with entity_id=entity.id|slugify %}
 
        {% url "entity" entity.id as next %}
 
        {% html_link "Add communication" "communication_create" class="btn btn-primary btn-mini" get="to_entity="|add:entity_id|add:"&next="|add:next %}
 
        {% html_link "Add communication" "communication_create" class="btn btn-primary btn-mini" get="to_entity="|add:entity_id|add:"&amp;next="|add:next %}
 
        {% endwith %}
 
      </div>
 
    </div>
 
@@ -116,7 +116,7 @@
 
      <div>
 
        {% with entity_id=entity.id|slugify %}
 
        {% url "entity" entity.id as next %}
 
        {% html_link "Add communication" "communication_create" class="btn btn-primary btn-mini" get="from_entity="|add:entity_id|add:"&next="|add:next %}
 
        {% html_link "Add communication" "communication_create" class="btn btn-primary btn-mini" get="from_entity="|add:entity_id|add:"&amp;next="|add:next %}
 
        {% endwith %}
 
      </div>
 
    </div>
conntrackt/templates/conntrackt/index.html
Show inline comments
 
@@ -13,7 +13,7 @@
 
    <div class="span12">Below you may find the list of projects that are available to you. Clicking on the project will take you to the summary page for that particular project. Clicking on an entity inside of a project will take you to the summary page of an entity.</div>
 
</div>
 

	
 
<hr>
 
<hr />
 

	
 
<div class="row">
 
  <div class="span12">
 
@@ -22,7 +22,7 @@
 
  </div>
 
</div>
 

	
 
<hr>
 
<hr />
 

	
 
<div class="row">
 

	
conntrackt/templates/conntrackt/location_widget.html
Show inline comments
 
@@ -16,7 +16,7 @@
 
{% endfor %}
 
    {% with project_id=project.id|slugify location_id=location.id|slugify %}
 
    <tr>
 
      <td>{% html_link "Add entity" "entity_create" class="btn btn-primary btn-mini" get="project="|add:project_id|add:"&location="|add:location_id|add:"&next="|add:request.path %}</td>
 
      <td>{% html_link "Add entity" "entity_create" class="btn btn-primary btn-mini" get="project="|add:project_id|add:"&amp;location="|add:location_id|add:"&amp;next="|add:request.path %}</td>
 
      <td></td>
 
      <td></td>
 
      <td></td>
conntrackt/templates/conntrackt/project_detail.html
Show inline comments
 
@@ -7,7 +7,7 @@
 
<div class="row">
 
  <h1 class="span12">{{project.name}}</h1>
 
</div>
 
<hr>
 
<hr />
 

	
 
{% if project.description %}
 
<div class="row">
 
@@ -15,7 +15,7 @@
 
    {{project.description}}
 
  </div>
 
</div>
 
<hr>
 
<hr />
 
{% endif %}
 

	
 
<div class="row">
 
@@ -23,13 +23,13 @@
 
    {% html_link "Edit" "project_update" project.id class="btn btn-primary" %}
 
    {% html_link "Remove" "project_delete" project.id class="btn btn-primary" %}
 
    {% with project_id=project.id|slugify %}
 
    {% html_link "Add entity" "entity_create" class="btn btn-primary" get="project="|add:project_id|add:"&next="|add:request.path %}
 
    {% html_link "Add communication" "communication_create" class="btn btn-primary" get="project="|add:project_id|add:"&next="|add:request.path %}
 
    {% html_link "Add entity" "entity_create" class="btn btn-primary" get="project="|add:project_id|add:"&amp;next="|add:request.path %}
 
    {% html_link "Add communication" "communication_create" class="btn btn-primary" get="project="|add:project_id|add:"&amp;next="|add:request.path %}
 
    {% endwith %}
 
    {% html_link "Get Iptables" 'project_iptables' project.id class="btn btn-primary" %}
 
  </div>
 
</div>
 
<hr>
 
<hr />
 
{% if location_entities %}
 
<div class="row">
 
  {% for location, entities in location_entities %}
 
@@ -65,7 +65,7 @@
 
<div class="row">
 
  <div class="span12">
 
    <h2>Communications diagram</h2>
 
    <img src="{% url "project_diagram" project.id %}" width="100%">
 
    <img id="project_diagram" src="{% url "project_diagram" project.id %}" alt="communications diagram" />
 
  </div>
 
</div>
 
{% endif %}
conntrackt/templates/conntrackt/search.html
Show inline comments
 
@@ -12,12 +12,12 @@
 
  </div>
 

	
 
  <div class="span12">
 
    <hr>
 
    <hr />
 
    <form action="{% url "search" %}" class="form-search" method="GET">
 
      <input class="search-query" type="text" name="q"  placeholder="Search" value="{{ search_term }}"/>
 
      <button type="submit" class="btn"><span class="icon-search"></span> Search</button>
 
    </form>
 
    <hr>
 
    <hr />
 

	
 
    {% if projects %}
 
      <h2><small>Matched projects</small></h2>
 
@@ -26,10 +26,10 @@
 
          <li><a href="{{ project.get_absolute_url }}">{{ project.name }}</a></li>
 
        {% endfor %}
 
      </ul>
 
      <hr>
 
      <hr />
 
    {% elif search_term %}
 
      <p>There are no projects matching your query.</p>
 
      <hr>
 
      <hr />
 
    {% endif %}
 

	
 
    {% if entities %}
 
@@ -39,10 +39,10 @@
 
          <li><a href="{{ entity.get_absolute_url }}">{{ entity.name }}</a> (from {{ entity.project.name }})</li>
 
        {% endfor %}
 
      </ul>
 
      <hr>
 
      <hr />
 
    {% elif search_term %}
 
      <p>There are no entities matching your query.</p>
 
      <hr>
 
      <hr />
 
    {% endif %}
 

	
 
  </div>
conntrackt/templates/conntrackt/update_form.html
Show inline comments
 
@@ -11,7 +11,7 @@
 
</div>
 
<div class="row">
 
  <div class="span6">
 
    <form action="" method="post">
 
    <form action="#" method="post">
 
      <div class="controls controls-row">
 
      {% csrf_token %}
 
      {{ form | crispy }}
conntrackt/views.py
Show inline comments
 
@@ -530,13 +530,13 @@ class EntityCreateView(RedirectToNextMix
 
        project_id = self.request.GET.get("project", None)
 
        if project_id:
 
            form.fields["project"].queryset = Project.objects.filter(pk=project_id)
 
            form.fields["project"].widget.attrs["readonly"] = True
 
            form.fields["project"].empty_label = None
 

	
 
        # Limit the location selection if required.
 
        location_id = self.request.GET.get("location", None)
 
        if location_id:
 
            form.fields["location"].queryset = Location.objects.filter(pk=location_id)
 
            form.fields["location"].widget.attrs["readonly"] = True
 
            form.fields["location"].empty_label = None
 

	
 
        return form
 

	
 
@@ -657,7 +657,7 @@ class InterfaceCreateView(RedirectToNext
 
        entity_id = self.request.GET.get("entity", None)
 
        if entity_id:
 
            form.fields["entity"].queryset = Entity.objects.filter(pk=entity_id)
 
            form.fields["entity"].widget.attrs["readonly"] = True
 
            form.fields["entity"].empty_label = False
 

	
 
        return form
 

	
0 comments (0 inline, 0 general)