diff options
| author | Tom Christie | 2014-10-15 10:04:01 +0100 | 
|---|---|---|
| committer | Tom Christie | 2014-10-15 10:04:01 +0100 | 
| commit | e558f806c0e87a329915b7077783f9ed3a79bb07 (patch) | |
| tree | a34d62c090b709611f95dd43bfc542dd6f987949 /rest_framework/templates | |
| parent | faa5bd9f5361643725f2d1cda8fe9f4ad8273624 (diff) | |
| download | django-rest-framework-e558f806c0e87a329915b7077783f9ed3a79bb07.tar.bz2 | |
Drop template includes
Diffstat (limited to 'rest_framework/templates')
22 files changed, 62 insertions, 30 deletions
| diff --git a/rest_framework/templates/rest_framework/fields/attrs.html b/rest_framework/templates/rest_framework/fields/attrs.html deleted file mode 100644 index 1e23c465..00000000 --- a/rest_framework/templates/rest_framework/fields/attrs.html +++ /dev/null @@ -1 +0,0 @@ -name="{{ field.name }}" {% if field.style.placeholder %}placeholder="{{ field.style.placeholder }}"{% endif %} {% if field.style.rows %}rows="{{ field.style.rows }}"{% endif %} diff --git a/rest_framework/templates/rest_framework/fields/horizontal/input.html b/rest_framework/templates/rest_framework/fields/horizontal/input.html index 6f1a504b..6621c7e6 100644 --- a/rest_framework/templates/rest_framework/fields/horizontal/input.html +++ b/rest_framework/templates/rest_framework/fields/horizontal/input.html @@ -1,7 +1,9 @@  <div class="form-group"> -    {% include "rest_framework/fields/horizontal/label.html" %} +    {% if field.label %} +        <label class="col-sm-2 control-label {% if field.style.hide_label %}sr-only{% endif %}">{{ field.label }}</label> +    {% endif %}      <div class="col-sm-10"> -        <input type="{{ input_type }}" class="form-control" {% include "rest_framework/fields/attrs.html" %} {% if field.value %}value="{{ field.value }}"{% endif %}> +        <input name="{{ field.name }}" type="{{ input_type }}" class="form-control" {% if field.style.placeholder %}placeholder="{{ field.style.placeholder }}"{% endif %} {% if field.value %}value="{{ field.value }}"{% endif %}>          {% if field.help_text %}<p class="help-block">{{ field.help_text }}</p>{% endif %}      </div>  </div> diff --git a/rest_framework/templates/rest_framework/fields/horizontal/label.html b/rest_framework/templates/rest_framework/fields/horizontal/label.html deleted file mode 100644 index bf21f78c..00000000 --- a/rest_framework/templates/rest_framework/fields/horizontal/label.html +++ /dev/null @@ -1 +0,0 @@ -{% if field.label %}<label class="col-sm-2 control-label {% if field.style.hide_label %}sr-only{% endif %}">{{ field.label }}</label>{% endif %} diff --git a/rest_framework/templates/rest_framework/fields/horizontal/select.html b/rest_framework/templates/rest_framework/fields/horizontal/select.html index 10b4b139..eaa6d575 100644 --- a/rest_framework/templates/rest_framework/fields/horizontal/select.html +++ b/rest_framework/templates/rest_framework/fields/horizontal/select.html @@ -1,10 +1,12 @@  <div class="form-group"> -    {% include "rest_framework/fields/horizontal/label.html" %} +    {% if field.label %} +        <label class="col-sm-2 control-label {% if field.style.hide_label %}sr-only{% endif %}">{{ field.label }}</label> +    {% endif %}      <div class="col-sm-10">          <select class="form-control" name="{{ field.name }}"> -            {% for key, text in field.choices.items %} +        {% for key, text in field.choices.items %}              <option value="{{ key }}" {% if key == field.value %}selected{% endif %}>{{ text }}</option> -            {% endfor %} +        {% endfor %}          </select>      </div>  </div> diff --git a/rest_framework/templates/rest_framework/fields/horizontal/select_checkbox.html b/rest_framework/templates/rest_framework/fields/horizontal/select_checkbox.html index 6041fa74..ff3fab57 100644 --- a/rest_framework/templates/rest_framework/fields/horizontal/select_checkbox.html +++ b/rest_framework/templates/rest_framework/fields/horizontal/select_checkbox.html @@ -1,5 +1,7 @@  <div class="form-group"> -    {% include "rest_framework/fields/horizontal/label.html" %} +    {% if field.label %} +        <label class="col-sm-2 control-label {% if field.style.hide_label %}sr-only{% endif %}">{{ field.label }}</label> +    {% endif %}      <div class="col-sm-10">      {% if field.style.inline %}          {% for key, text in field.choices.items %} diff --git a/rest_framework/templates/rest_framework/fields/horizontal/select_multiple.html b/rest_framework/templates/rest_framework/fields/horizontal/select_multiple.html index c0dbb989..3ed2874b 100644 --- a/rest_framework/templates/rest_framework/fields/horizontal/select_multiple.html +++ b/rest_framework/templates/rest_framework/fields/horizontal/select_multiple.html @@ -1,5 +1,7 @@  <div class="form-group"> -    {% include "rest_framework/fields/horizontal/label.html" %} +    {% if field.label %} +        <label class="col-sm-2 control-label {% if field.style.hide_label %}sr-only{% endif %}">{{ field.label }}</label> +    {% endif %}      <div class="col-sm-10">          <select multiple class="form-control" name="{{ field.name }}">              {% for key, text in field.choices.items %} diff --git a/rest_framework/templates/rest_framework/fields/horizontal/select_radio.html b/rest_framework/templates/rest_framework/fields/horizontal/select_radio.html index 0eeb9bc6..6e56afb5 100644 --- a/rest_framework/templates/rest_framework/fields/horizontal/select_radio.html +++ b/rest_framework/templates/rest_framework/fields/horizontal/select_radio.html @@ -1,5 +1,7 @@  <div class="form-group"> -    {% include "rest_framework/fields/horizontal/label.html" %} +    {% if field.label %} +        <label class="col-sm-2 control-label {% if field.style.hide_label %}sr-only{% endif %}">{{ field.label }}</label> +    {% endif %}      <div class="col-sm-10">      {% if field.style.inline %}          {% for key, text in field.choices.items %} diff --git a/rest_framework/templates/rest_framework/fields/horizontal/textarea.html b/rest_framework/templates/rest_framework/fields/horizontal/textarea.html index 3d016195..ae263c48 100644 --- a/rest_framework/templates/rest_framework/fields/horizontal/textarea.html +++ b/rest_framework/templates/rest_framework/fields/horizontal/textarea.html @@ -1,7 +1,9 @@  <div class="form-group"> -    {% include "rest_framework/fields/horizontal/label.html" %} +    {% if field.label %} +        <label class="col-sm-2 control-label {% if field.style.hide_label %}sr-only{% endif %}">{{ field.label }}</label> +    {% endif %}      <div class="col-sm-10"> -        <textarea class="form-control" {% include "rest_framework/fields/attrs.html" %}>{% if field.value %}{{ field.value }}{% endif %}</textarea> +        <textarea name="{{ field.name }}" class="form-control" {% if field.style.placeholder %}placeholder="{{ field.style.placeholder }}"{% endif %} {% if field.style.rows %}rows="{{ field.style.rows }}"{% endif %}>{% if field.value %}{{ field.value }}{% endif %}</textarea>          {% if field.help_text %}<p class="help-block">{{ field.help_text }}</p>{% endif %}      </div>  </div> diff --git a/rest_framework/templates/rest_framework/fields/inline/input.html b/rest_framework/templates/rest_framework/fields/inline/input.html index e4a92ccd..bdf25ffe 100644 --- a/rest_framework/templates/rest_framework/fields/inline/input.html +++ b/rest_framework/templates/rest_framework/fields/inline/input.html @@ -1,4 +1,6 @@  <div class="form-group"> -    {% include "rest_framework/fields/inline/label.html" %} -    <input type="{{ input_type }}" class="form-control" {% include "rest_framework/fields/attrs.html" %} {% if field.value %}value="{{ field.value }}"{% endif %}> +    {% if field.label %} +        <label class="sr-only">{{ field.label }}</label> +    {% endif %} +    <input name="{{ field.name }}" type="{{ input_type }}" class="form-control" {% if field.style.placeholder %}placeholder="{{ field.style.placeholder }}"{% endif %} {% if field.value %}value="{{ field.value }}"{% endif %}>  </div> diff --git a/rest_framework/templates/rest_framework/fields/inline/label.html b/rest_framework/templates/rest_framework/fields/inline/label.html deleted file mode 100644 index 7d546a57..00000000 --- a/rest_framework/templates/rest_framework/fields/inline/label.html +++ /dev/null @@ -1 +0,0 @@ -{% if field.label %}<label class="sr-only">{{ field.label }}</label>{% endif %} diff --git a/rest_framework/templates/rest_framework/fields/inline/select.html b/rest_framework/templates/rest_framework/fields/inline/select.html index eebb91d2..730fcce6 100644 --- a/rest_framework/templates/rest_framework/fields/inline/select.html +++ b/rest_framework/templates/rest_framework/fields/inline/select.html @@ -1,5 +1,7 @@  <div class="form-group"> -    {% include "rest_framework/fields/inline/label.html" %} +    {% if field.label %} +        <label class="sr-only">{{ field.label }}</label> +    {% endif %}      <select class="form-control" name="{{ field.name }}">          {% for key, text in field.choices.items %}          <option value="{{ key }}" {% if key == field.value %}selected{% endif %}>{{ text }}</option> diff --git a/rest_framework/templates/rest_framework/fields/inline/select_checkbox.html b/rest_framework/templates/rest_framework/fields/inline/select_checkbox.html index b7561cd4..cca71d68 100644 --- a/rest_framework/templates/rest_framework/fields/inline/select_checkbox.html +++ b/rest_framework/templates/rest_framework/fields/inline/select_checkbox.html @@ -1,5 +1,7 @@  <div class="form-group"> -    {% include "rest_framework/fields/inline/label.html" %} +    {% if field.label %} +        <label class="sr-only">{{ field.label }}</label> +    {% endif %}      {% for key, text in field.choices.items %}      <div class="checkbox">          <label> diff --git a/rest_framework/templates/rest_framework/fields/inline/select_multiple.html b/rest_framework/templates/rest_framework/fields/inline/select_multiple.html index 74e17f9f..3f9b2701 100644 --- a/rest_framework/templates/rest_framework/fields/inline/select_multiple.html +++ b/rest_framework/templates/rest_framework/fields/inline/select_multiple.html @@ -1,5 +1,7 @@  <div class="form-group"> -    {% include "rest_framework/fields/inline/label.html" %} +    {% if field.label %} +        <label class="sr-only">{{ field.label }}</label> +    {% endif %}      <select multiple class="form-control" name="{{ field.name }}">          {% for key, text in field.choices.items %}          <option value="{{ key }}" {% if key in field.value %}selected{% endif %}>{{ text }}</option> diff --git a/rest_framework/templates/rest_framework/fields/inline/select_radio.html b/rest_framework/templates/rest_framework/fields/inline/select_radio.html index 27927a62..3fffceac 100644 --- a/rest_framework/templates/rest_framework/fields/inline/select_radio.html +++ b/rest_framework/templates/rest_framework/fields/inline/select_radio.html @@ -1,5 +1,7 @@  <div class="form-group"> -    {% include "rest_framework/fields/inline/label.html" %} +    {% if field.label %} +        <label class="sr-only">{{ field.label }}</label> +    {% endif %}      {% for key, text in field.choices.items %}          <div class="radio">              <label> diff --git a/rest_framework/templates/rest_framework/fields/inline/textarea.html b/rest_framework/templates/rest_framework/fields/inline/textarea.html index 8259487b..a644ea38 100644 --- a/rest_framework/templates/rest_framework/fields/inline/textarea.html +++ b/rest_framework/templates/rest_framework/fields/inline/textarea.html @@ -1,4 +1,6 @@  <div class="form-group"> -    {% include "rest_framework/fields/inline/label.html" %} -    <textarea class="form-control" {% include "rest_framework/fields/attrs.html" %}>{% if field.value %}{{ field.value }}{% endif %}</textarea> +    {% if field.label %} +        <label class="sr-only">{{ field.label }}</label> +    {% endif %} +    <textarea name="{{ field.name }}" class="form-control" {% if field.style.placeholder %}placeholder="{{ field.style.placeholder }}"{% endif %} {% if field.style.rows %}rows="{{ field.style.rows }}"{% endif %}>{% if field.value %}{{ field.value }}{% endif %}</textarea>  </div> diff --git a/rest_framework/templates/rest_framework/fields/vertical/input.html b/rest_framework/templates/rest_framework/fields/vertical/input.html index 3ee2716a..10a576b2 100644 --- a/rest_framework/templates/rest_framework/fields/vertical/input.html +++ b/rest_framework/templates/rest_framework/fields/vertical/input.html @@ -1,5 +1,7 @@  <div class="form-group"> -    {% include "rest_framework/fields/vertical/label.html" %} -    <input type="{{ input_type }}" class="form-control" {% include "rest_framework/fields/attrs.html" %} {% if field.value %}value="{{ field.value }}"{% endif %}> +    {% if field.label %} +        <label {% if field.style.hide_label %}class="sr-only"{% endif %}>{{ field.label }}</label> +    {% endif %} +    <input name="{{ field.name }}" type="{{ input_type }}" class="form-control" {% if field.style.placeholder %}placeholder="{{ field.style.placeholder }}"{% endif %} {% if field.style.rows %}rows="{{ field.style.rows }}"{% endif %} {% if field.value %}value="{{ field.value }}"{% endif %}>      {% if field.help_text %}<p class="help-block">{{ field.help_text }}</p>{% endif %}  </div> diff --git a/rest_framework/templates/rest_framework/fields/vertical/label.html b/rest_framework/templates/rest_framework/fields/vertical/label.html deleted file mode 100644 index 651939b2..00000000 --- a/rest_framework/templates/rest_framework/fields/vertical/label.html +++ /dev/null @@ -1 +0,0 @@ -{% if field.label %}<label {% if field.style.hide_label %}class="sr-only"{% endif %}>{{ field.label }}</label>{% endif %} diff --git a/rest_framework/templates/rest_framework/fields/vertical/select.html b/rest_framework/templates/rest_framework/fields/vertical/select.html index 1a651663..b0545f7e 100644 --- a/rest_framework/templates/rest_framework/fields/vertical/select.html +++ b/rest_framework/templates/rest_framework/fields/vertical/select.html @@ -1,5 +1,7 @@  <div class="form-group"> -    {% include "rest_framework/fields/vertical/label.html" %} +    {% if field.label %} +        <label {% if field.style.hide_label %}class="sr-only"{% endif %}>{{ field.label }}</label> +    {% endif %}      <select class="form-control" name="{{ field.name }}">          {% for key, text in field.choices.items %}          <option value="{{ key }}" {% if key == field.value %}selected{% endif %}>{{ text }}</option> diff --git a/rest_framework/templates/rest_framework/fields/vertical/select_checkbox.html b/rest_framework/templates/rest_framework/fields/vertical/select_checkbox.html index 2e792e6a..c486b1b3 100644 --- a/rest_framework/templates/rest_framework/fields/vertical/select_checkbox.html +++ b/rest_framework/templates/rest_framework/fields/vertical/select_checkbox.html @@ -1,5 +1,7 @@  <div class="form-group"> -    {% include "rest_framework/fields/vertical/label.html" %} +    {% if field.label %} +        <label {% if field.style.hide_label %}class="sr-only"{% endif %}>{{ field.label }}</label> +    {% endif %}      {% if field.style.inline %}          <div>          {% for key, text in field.choices.items %} diff --git a/rest_framework/templates/rest_framework/fields/vertical/select_multiple.html b/rest_framework/templates/rest_framework/fields/vertical/select_multiple.html index 5f4166cd..ca63192e 100644 --- a/rest_framework/templates/rest_framework/fields/vertical/select_multiple.html +++ b/rest_framework/templates/rest_framework/fields/vertical/select_multiple.html @@ -1,5 +1,7 @@  <div class="form-group"> -    {% include "rest_framework/fields/vertical/label.html" %} +    {% if field.label %} +        <label {% if field.style.hide_label %}class="sr-only"{% endif %}>{{ field.label }}</label> +    {% endif %}      <select multiple class="form-control" name="{{ field.name }}">          {% for key, text in field.choices.items %}          <option value="{{ key }}" {% if key in field.value %}selected{% endif %}>{{ text }}</option> diff --git a/rest_framework/templates/rest_framework/fields/vertical/select_radio.html b/rest_framework/templates/rest_framework/fields/vertical/select_radio.html index 2aa0fe28..d7655b00 100644 --- a/rest_framework/templates/rest_framework/fields/vertical/select_radio.html +++ b/rest_framework/templates/rest_framework/fields/vertical/select_radio.html @@ -1,5 +1,7 @@  <div class="form-group"> -    {% include "rest_framework/fields/vertical/label.html" %} +    {% if field.label %} +        <label {% if field.style.hide_label %}class="sr-only"{% endif %}>{{ field.label }}</label> +    {% endif %}      {% if field.style.inline %}          <div>          {% for key, text in field.choices.items %} diff --git a/rest_framework/templates/rest_framework/fields/vertical/textarea.html b/rest_framework/templates/rest_framework/fields/vertical/textarea.html index 406cfa77..8d951496 100644 --- a/rest_framework/templates/rest_framework/fields/vertical/textarea.html +++ b/rest_framework/templates/rest_framework/fields/vertical/textarea.html @@ -1,5 +1,7 @@  <div class="form-group"> -    {% include "rest_framework/fields/vertical/label.html" %} -    <textarea class="form-control" {% include "rest_framework/fields/attrs.html" %}>{% if field.value %}{{ field.value }}{% endif %}</textarea> +    {% if field.label %} +        <label {% if field.style.hide_label %}class="sr-only"{% endif %}>{{ field.label }}</label> +    {% endif %} +    <textarea name="{{ field.name }}" class="form-control" {% if field.style.placeholder %}placeholder="{{ field.style.placeholder }}"{% endif %} {% if field.style.rows %}rows="{{ field.style.rows }}"{% endif %}>{% if field.value %}{{ field.value }}{% endif %}</textarea>      {% if field.help_text %}<p class="help-block">{{ field.help_text }}</p>{% endif %}  </div> | 
