开发者

Django - Admin - 'Add Object' button on Left side

By default, in the change list page, the 'Add Object' button is in right side. Is it possible to move it to the left side? Do I need to do any change in the following lines in change_list.html?

{% block object-tools %}
  {% 开发者_开发知识库if has_add_permission %}
    <ul class="object-tools">
      <li>
        <a href="add/{% if is_popup %}?_popup=1{% endif %}" class="addlink">
          {% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}
        </a>
      </li>
    </ul>
  {% endif %}
{% endblock %}


{% block content %}
  <div id="content-main">
 <style type="text/css">
        /* Moving the ADD buttons to the left side using CSS */
     .object-tools {
      font-size: 10px;
      font-weight: bold;
      font-family: Arial,Helvetica,sans-serif;
      padding-left: 0;
      float: left;
      position: relative;
      margin-top: 0.5em;
      margin-bottom: -2em;
  }
 </style>

    {% block object-tools %}
      {% if has_add_permission %}
        <ul class="object-tools">
          <li>
            <a href="add/{% if is_popup %}?_popup=1{% endif %}" class="addlink">
              {% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}
            </a>
          </li>
        </ul>
      {% endif %}
    {% endblock %}
 <br> <br>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜