From 3ca4fa394ff13a685ecbe9ffc9ad76e29075e214 Mon Sep 17 00:00:00 2001 From: Eleonore9 Date: Sun, 7 Jul 2013 18:19:33 +0200 Subject: [PATCH] for #308 this styles the save_on_top --- .../themes/bootstrap/css/bootstrap-custom.css | 67 ++++++++++++++++ .../admin2/bootstrap/model_update_form.html | 78 ++++++++++++++----- 2 files changed, 127 insertions(+), 18 deletions(-) diff --git a/djadmin2/static/themes/bootstrap/css/bootstrap-custom.css b/djadmin2/static/themes/bootstrap/css/bootstrap-custom.css index 1afca49..f46ff59 100644 --- a/djadmin2/static/themes/bootstrap/css/bootstrap-custom.css +++ b/djadmin2/static/themes/bootstrap/css/bootstrap-custom.css @@ -24,3 +24,70 @@ .space-below { margin-bottom: 10px; } + + +.history_btn { + float: right; + margin-bottom: 10px; + margin-right: 3px; +} + +.change_form { + border: 1px solid #C6BCBC; + border-radius: 5px; + height: 360px; +} + +label { + float: left; + margin-right : 40px; + font-weight: bold; +} + +p { + margin-bottom: 30px; +} + +.checkbox { + +} + +.comments_form { + clear: both; + margin-top: 40px; +} + +.control-group { + /*margin-bottom: 20px;*/ + padding-top: 10px; + padding-left: 20px; + border-bottom: 1px solid #CCCCC1; +} + +input { + width: 400px; + margin-left: 5px; +} +.textarea { + width: 800px; +} +textarea { + width: 800px; +} + +.add_comment { + margin-top: 0; + height: 25px; + padding: 5px; + /*border: 1px solid #CCCCC1; + border-radius: 5px;*/ +} + +.save_btns { + margin-top: 10px; + border: 1px solid #CCCCC1; + border-radius: 5px; + padding: 10px; + padding-left: 15px; + margin-bottom: 20px; +} \ No newline at end of file diff --git a/djadmin2/templates/admin2/bootstrap/model_update_form.html b/djadmin2/templates/admin2/bootstrap/model_update_form.html index f9cd750..d6860eb 100644 --- a/djadmin2/templates/admin2/bootstrap/model_update_form.html +++ b/djadmin2/templates/admin2/bootstrap/model_update_form.html @@ -1,14 +1,20 @@ -{% extends "admin2/bootstrap/base.html" %} +{% extends "djadmin2/bootstrap/base.html" %} -{% load admin2_tags i18n %} +{% load admin2_tags i18n crispy_forms_tags %} -{% block title %}{% blocktrans with action=action model_name=model_name %}{{ action }} {{ model_name }}{% endblocktrans %}{% endblock title %} +{# Translators : examples : Add post, Change object #} +{% block title %}{% blocktrans with action=action model_name=model_name %}{{ action_name }} {{ model_name }}{% endblocktrans %}{% endblock title %} -{% block page_title %}{% blocktrans with action=action model_name=model_name %}{{ action }} {{ model_name }}{% endblocktrans %}{% endblock page_title %} +{# Translators : examples : Add post, Change object #} +{% block page_title %}{% blocktrans with action=action model_name=model_name %}{{ action_name }} {{ model_name }}{% endblocktrans %}{% endblock page_title %} + +{% block page_title_link %} +History +{% endblock page_title_link %} {% block breadcrumbs %}
  • - Home + {% trans "Home" %} /
  • @@ -20,7 +26,7 @@ /
  • {% if action == 'Add' %} -
  • {{ action }}
  • +
  • {{ action_name }}
  • {% else %}
  • {{ object }} @@ -28,6 +34,7 @@
  • {% trans 'Change' %}
  • {% endif %} + {% endblock breadcrumbs %} @@ -36,10 +43,31 @@
    - {% csrf_token %} - {{ form.as_p }} + + {% if view.model_admin.save_on_top %} +
    + {# TODO - fix the format of the HTML #} + + {% if object %} + + + {% trans "Delete" %} + + {% endif %} + {% include "djadmin2/bootstrap/includes/save_buttons.html" %} + +
    + {% endif %} + + +
    + {% csrf_token %} + {{ form|crispy }} {% for formset in inlines %} +
    + +

    {{ formset.model|model_verbose_name_plural|capfirst }}

    {{ formset.management_form }} @@ -65,20 +93,34 @@ {% endfor %} {% endfor %} + + + +
    + +
    {% endfor %} - -
    - {% if object %} - {% trans "Delete" %} - {% endif %} - -
    - - - + + {% if view.model_admin.save_on_bottom %} +
    + + {% if object %} + + + {% trans "Delete" %} + + {% endif %} + {% include "djadmin2/bootstrap/includes/save_buttons.html" %}
    + {% endif %} +