diff options
| author | 2019-04-19 14:22:51 +0100 | |
|---|---|---|
| committer | 2019-04-19 14:22:51 +0100 | |
| commit | 6bd4ba5359a8eddd07dddf24bf341eac362a324e (patch) | |
| tree | d8233c1976417913cfb306b348c51bf2641b8dec | |
| parent | Move JS into files (diff) | |
Continued cleanup
| -rw-r--r-- | pydis_site/apps/home/templatetags/wiki_extra.py | 50 | ||||
| -rw-r--r-- | pydis_site/static/js/wiki/delete.js | 1 | ||||
| -rw-r--r-- | pydis_site/static/js/wiki/edit.js | 4 | ||||
| -rw-r--r-- | pydis_site/static/js/wiki/move.js | 2 | ||||
| -rw-r--r-- | pydis_site/templates/wiki/delete.html | 6 | ||||
| -rw-r--r-- | pydis_site/templates/wiki/edit.html | 5 | ||||
| -rw-r--r-- | pydis_site/templates/wiki/move.html | 6 | 
7 files changed, 35 insertions, 39 deletions
| diff --git a/pydis_site/apps/home/templatetags/wiki_extra.py b/pydis_site/apps/home/templatetags/wiki_extra.py index 58612cc8..16539ded 100644 --- a/pydis_site/apps/home/templatetags/wiki_extra.py +++ b/pydis_site/apps/home/templatetags/wiki_extra.py @@ -19,34 +19,34 @@ TEMPLATE_PATH = "wiki/forms/fields/{0}.html"  TEMPLATES = {      BooleanField: TEMPLATE_PATH.format("boolean"),      CharField: TEMPLATE_PATH.format("char"), -    ChoiceField: TEMPLATE_PATH.format("choice"), -    TypedChoiceField: TEMPLATE_PATH.format("typed_choice"), -    DateField: TEMPLATE_PATH.format("date"), -    DateTimeField: TEMPLATE_PATH.format("date_time"), -    DecimalField: TEMPLATE_PATH.format("decimal"), -    DurationField: TEMPLATE_PATH.format("duration"), -    EmailField: TEMPLATE_PATH.format("email"), -    FileField: TEMPLATE_PATH.format("file"), -    FilePathField: TEMPLATE_PATH.format("file_path"), -    FloatField: TEMPLATE_PATH.format("float"), +    ChoiceField: TEMPLATE_PATH.format("in_place_render"), +    TypedChoiceField: TEMPLATE_PATH.format("in_place_render"), +    DateField: TEMPLATE_PATH.format("in_place_render"), +    DateTimeField: TEMPLATE_PATH.format("in_place_render"), +    DecimalField: TEMPLATE_PATH.format("in_place_render"), +    DurationField: TEMPLATE_PATH.format("in_place_render"), +    EmailField: TEMPLATE_PATH.format("in_place_render"), +    FileField: TEMPLATE_PATH.format("in_place_render"), +    FilePathField: TEMPLATE_PATH.format("in_place_render"), +    FloatField: TEMPLATE_PATH.format("in_place_render"),      ImageField: TEMPLATE_PATH.format("image"), -    IntegerField: TEMPLATE_PATH.format("integer"), -    GenericIPAddressField: TEMPLATE_PATH.format("generic_ip_address"), -    MultipleChoiceField: TEMPLATE_PATH.format("multiple_choice"), -    TypedMultipleChoiceField: TEMPLATE_PATH.format("typed_multiple_choice"), -    NullBooleanField: TEMPLATE_PATH.format("null_boolean"), -    RegexField: TEMPLATE_PATH.format("regex"), -    SlugField: TEMPLATE_PATH.format("slug"), -    TimeField: TEMPLATE_PATH.format("time"), -    URLField: TEMPLATE_PATH.format("url"), -    UUIDField: TEMPLATE_PATH.format("uuid"), - -    ComboField: TEMPLATE_PATH.format("combo"), -    MultiValueField: TEMPLATE_PATH.format("multi_value"), -    SplitDateTimeField: TEMPLATE_PATH.format("split_date_time"), +    IntegerField: TEMPLATE_PATH.format("in_place_render"), +    GenericIPAddressField: TEMPLATE_PATH.format("in_place_render"), +    MultipleChoiceField: TEMPLATE_PATH.format("in_place_render"), +    TypedMultipleChoiceField: TEMPLATE_PATH.format("in_place_render"), +    NullBooleanField: TEMPLATE_PATH.format("in_place_render"), +    RegexField: TEMPLATE_PATH.format("in_place_render"), +    SlugField: TEMPLATE_PATH.format("in_place_render"), +    TimeField: TEMPLATE_PATH.format("in_place_render"), +    URLField: TEMPLATE_PATH.format("in_place_render"), +    UUIDField: TEMPLATE_PATH.format("in_place_render"), + +    ComboField: TEMPLATE_PATH.format("in_place_render"), +    MultiValueField: TEMPLATE_PATH.format("in_place_render"), +    SplitDateTimeField: TEMPLATE_PATH.format("in_place_render"),      ModelChoiceField: TEMPLATE_PATH.format("model_choice"), -    ModelMultipleChoiceField: TEMPLATE_PATH.format("model_multiple_choice"), +    ModelMultipleChoiceField: TEMPLATE_PATH.format("in_place_render"),      SettingsModelChoiceField: TEMPLATE_PATH.format("model_choice"),      WikiSlugField: TEMPLATE_PATH.format("wiki_slug_render"), diff --git a/pydis_site/static/js/wiki/delete.js b/pydis_site/static/js/wiki/delete.js deleted file mode 100644 index 91531137..00000000 --- a/pydis_site/static/js/wiki/delete.js +++ /dev/null @@ -1 +0,0 @@ -$('#id_revision').val('{{ article.current_revision.id }}'); diff --git a/pydis_site/static/js/wiki/edit.js b/pydis_site/static/js/wiki/edit.js index 3c9c70a4..0af44431 100644 --- a/pydis_site/static/js/wiki/edit.js +++ b/pydis_site/static/js/wiki/edit.js @@ -56,7 +56,3 @@ $(document).ready( function() {      });    });  }); - -$(document).ready(function() { -  $("#id_revision").val('{{ article.current_revision.id }}'); -}); diff --git a/pydis_site/static/js/wiki/move.js b/pydis_site/static/js/wiki/move.js index 948917f6..ddab06f5 100644 --- a/pydis_site/static/js/wiki/move.js +++ b/pydis_site/static/js/wiki/move.js @@ -1,7 +1,5 @@  $('#id_destination').after($('#dest_selector').remove());  $('#id_destination').attr('type', 'hidden'); -$('#id_slug').val('{{ urlpath.slug }}'); -select_path('{{urlpath.parent.pk}}', '{{urlpath.parent}}');  function select_path(path, title) {    $('#id_destination').val(path); diff --git a/pydis_site/templates/wiki/delete.html b/pydis_site/templates/wiki/delete.html index f4ed9dd7..755e8d7a 100644 --- a/pydis_site/templates/wiki/delete.html +++ b/pydis_site/templates/wiki/delete.html @@ -41,7 +41,7 @@      {% endif %}      {% if delete_children %} -      <div class="message"> +      <div class="message is-danger">          <div class="message-body">            <p>              You are deleting an article with children. If you delete this article, then its children will also be deleted. @@ -87,8 +87,4 @@        </form>      {% endif %}    {% endif %} - -  {% addtoblock "js" %} -  <script type="text/javascript" src="{% static "js/wiki/delete.js" %}"></script> -  {% endaddtoblock %}  {% endblock %} diff --git a/pydis_site/templates/wiki/edit.html b/pydis_site/templates/wiki/edit.html index 8472d555..622e98eb 100644 --- a/pydis_site/templates/wiki/edit.html +++ b/pydis_site/templates/wiki/edit.html @@ -100,4 +100,9 @@    <script src="{% static "js/wiki/modal.js" %}" type="text/javascript"></script>    <script src="{% static "js/wiki/edit.js" %}" type="text/javascript"></script> +  <script type="text/javascript"> +    $(document).ready(function() { +      $("#id_revision").val('{{ article.current_revision.id }}'); +    }); +  </script>  {% endblock %} diff --git a/pydis_site/templates/wiki/move.html b/pydis_site/templates/wiki/move.html index 1d797e86..6452ffa2 100644 --- a/pydis_site/templates/wiki/move.html +++ b/pydis_site/templates/wiki/move.html @@ -59,9 +59,11 @@  </form>  {% addtoblock "js" %} -    <script type="text/javascript" src="{% static "js/wiki/move.js" %}"></script> - +  <script type="text/javascript"> +    $('#id_slug').val('{{ urlpath.slug }}'); +    select_path('{{urlpath.parent.pk}}', '{{urlpath.parent}}'); +  </script>  {% endaddtoblock %}  {% endblock %} | 
