Git Product home page Git Product logo

Comments (1)

alejandroacho avatar alejandroacho commented on August 12, 2024 2

By the moment I have found a workaround to fix this.

1-. Create base_site.html

You have to create the file admin/base_site.html in the template root folder. Something like this:

└── templates/      <-  Template folder that you can set it on your Django settings.
    └── admin/
        └── base_site.html

The base_site.html file must inherit the default Django base file, and the extend it with a custom css:

{% extends 'admin/base.html' %}
{% load static %}
{% block extrastyle %}
  <link rel='stylesheet' href='{% static 'admin.css' %}'>
{% endblock %}

2-. Create the CSS file

This css file must be on the static folder (this is an example path, but you can use what ever path you want, but is mandatory to be in static folder):

└── static/      <-  Static folder that you can set it on your Django settings.
    └── css/
        └── admin_extra.css

The css file must have this styles (feel free to modify it according your needs):

.related-widget-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.related-widget-wrapper select {
  width: 20rem;
  height: 15rem;
  margin-right: 3rem;
}

.related-widget-wrapper [class*="--multiple"] [class*="selection"] {
  width: 20rem;
  height: 15rem;
}

@media screen and (max-width: 480px) {
  .related-widget-wrapper {
    flex-direction: column;
  }
  .related-widget-wrapper select {
    width: 100%;
    margin-right: 0;
  }
  .related-widget-wrapper [class*="--multiple"] [class*="selection"] {
    width: 100%;
  }
}

🚀 Results

These settings results in this output:
CleanShot 2022-07-23 at 01 21 02

And it's also kind of responsive as it restructures itself on window size changes. You can modify it for more several responsiveness.

from django-jet-reboot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.