zdpdjango_argonadmin Django后台管理系统中的常见功能开发

news2024/10/6 4:06:44

效果预览

首先,看一下这个项目最开始的样子:
在这里插入图片描述

左侧优化

将左侧优化为下面的样子:
在这里插入图片描述

代码位置:
在这里插入图片描述

代码如下:

{% load i18n static admin_argon %}

<aside class="sidenav bg-white navbar navbar-vertical navbar-expand-xs border-0 border-radius-xl my-3 fixed-start ms-4 "
       id="sidenav-main">
    {#左侧LOGO#}
    <div class="sidenav-header">
        <i class="fas fa-times p-3 cursor-pointer text-secondary opacity-5 position-absolute end-0 top-0 d-none d-xl-none"
           aria-hidden="true" id="iconSidenav"></i>
        <a class="navbar-brand m-0" href="/">
            <img src="{% static 'img/logo-ct-dark.png' %}" class="navbar-brand-img h-100" alt="main_logo">
            <span class="ms-1 font-weight-bold">Django后台管理系统</span>
        </a>
    </div>

    <hr class="horizontal dark mt-0">
    <div class="collapse navbar-collapse  w-auto " id="sidenav-collapse-main">
        <ul class="navbar-nav">
            {% admin_get_menu as app_list %}
            {% if app_list %}
                {% for app in app_list %}
                    {% if app.has_perms and not app.pinned %}
                        <li class="nav-item">
                            <a class="nav-link {% if app_label != app.label and app.url not in request.path|urlencode %} collapsed{% endif %}"
                               data-bs-toggle="collapse" data-bs-target="#submenu-{{ app.app_label }}"
                               href="{{ app.url }}">
                                <div class="icon icon-shape icon-sm border-radius-md text-center me-2 d-flex align-items-center justify-content-center">
                                    <i class="{{ app.icon }} text-primary text-sm opacity-10"></i>
                                </div>
                                <span class="nav-link-text ms-1">{{ app.label|slice:10 }}{% if app.label|length > 10 %}
                                    ..{% endif %}</span>
                            </a>

                            {% if app.models %}
                                <div class="multi-level ms-5 collapse {% if 'tables-bootstrap-' in segment or app_label == app.label or app.url in request.path|urlencode %} show {% endif %}"
                                     role="list" id="submenu-{{ app.app_label }}"
                                     aria-expanded="{% if app_label == app.label or app.url in request.path|urlencode %}true{% else %}false{% endif %}">
                                    <ul class="flex-column nav">
                                        {% for model in app.models %}
                                            {% if model.url %}
                                                <li class="nav-item{% if 'bootstrap-tables' in segment or model.url in request.path|urlencode %} active {% endif %} list-unstyled">
                                                    <a class="nav-link" href="{{ model.url }}">
                                                        <span class="nav-link-text ms-1">{{ model.label }}</span>
                                                    </a>
                                                </li>
                                            {% else %}
                                                <li class="nav-item list-unstyled">{{ model.label }}</li>
                                            {% endif %}
                                        {% endfor %}
                                    </ul>
                                </div>
                            {% endif %}
                        </li>
                    {% endif %}
                {% endfor %}
            {% endif %}

            <li class="nav-item">
                {% if request.user.is_superuser %}
                    <a href="{% url 'admin:index' %}" class="nav-link {% if 'index' in segment %} active {% endif %}">
                        <div class="icon icon-shape icon-sm border-radius-md text-center me-2 d-flex align-items-center justify-content-center">
                            <i class="ni ni-tv-2 text-primary text-sm opacity-10"></i>
                        </div>
                        <span class="nav-link-text ms-1">数据面板</span>
                    </a>
                {% else %}
                    <a href="{% url 'index' %}" class="nav-link {% if 'index' in segment %} active {% endif %}">
                        <div class="icon icon-shape icon-sm border-radius-md text-center me-2 d-flex align-items-center justify-content-center">
                            <i class="ni ni-tv-2 text-primary text-sm opacity-10"></i>
                        </div>
                        <span class="nav-link-text ms-1">数据面板</span>
                    </a>
                {% endif %}

            </li>

            {% if request.user.is_authenticated and not request.user.is_superuser %}
                <li class="nav-item">
                    <a class="nav-link " href="{% url 'tables' %}">
                        <div class="icon icon-shape icon-sm border-radius-md text-center me-2 d-flex align-items-center justify-content-center">
                            <i class="ni ni-calendar-grid-58 text-warning text-sm opacity-10"></i>
                        </div>
                        <span class="nav-link-text ms-1">Tables</span>
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link " href="{% url 'billing' %}">
                        <div class="icon icon-shape icon-sm border-radius-md text-center me-2 d-flex align-items-center justify-content-center">
                            <i class="ni ni-credit-card text-success text-sm opacity-10"></i>
                        </div>
                        <span class="nav-link-text ms-1">Billing</span>
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link " href="{% url 'vr' %}">
                        <div class="icon icon-shape icon-sm border-radius-md text-center me-2 d-flex align-items-center justify-content-center">
                            <i class="ni ni-app text-info text-sm opacity-10"></i>
                        </div>
                        <span class="nav-link-text ms-1">Virtual Reality</span>
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link " href="{% url 'rtl' %}">
                        <div class="icon icon-shape icon-sm border-radius-md text-center me-2 d-flex align-items-center justify-content-center">
                            <i class="ni ni-world-2 text-danger text-sm opacity-10"></i>
                        </div>
                        <span class="nav-link-text ms-1">RTL</span>
                    </a>
                </li>
                <li class="nav-item mt-3">
                    <h6 class="ps-4 ms-2 text-uppercase text-xs font-weight-bolder opacity-6">Account pages</h6>
                </li>
                <li class="nav-item">
                    <a class="nav-link " href="{% url 'profile' %}">
                        <div class="icon icon-shape icon-sm border-radius-md text-center me-2 d-flex align-items-center justify-content-center">
                            <i class="ni ni-single-02 text-dark text-sm opacity-10"></i>
                        </div>
                        <span class="nav-link-text ms-1">Profile</span>
                    </a>
                </li>
            {% endif %}
        </ul>
    </div>
    <div class="sidenav-footer mx-3 ">
        <div class="card card-plain shadow-none" id="sidenavCard">
            <img class="w-50 mx-auto" src="{% static 'img/illustrations/icon-documentation.svg' %}"
                 alt="sidebar_illustration">
            <div class="card-body text-center p-3 w-100 pt-0">
                <div class="docs-info">
                    <h6 class="mb-0">需要帮助?</h6>
                    <p class="text-xs font-weight-bold mb-0">请点击链接</p>
                </div>
            </div>
        </div>
        <a href="https://github.com/zhangdapeng520" target="_blank"
           class="btn btn-dark btn-sm w-100 mb-3">源码下载</a>
        <a class="btn btn-primary btn-sm mb-0 w-100" href="https://github.com/zhangdapeng520"
           target="_blank" type="button">旗舰版本</a>
    </div>
</aside>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1573720.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

华为OD机试 - 全排列 - 回溯(Java 2024 C卷 100分)

华为OD机试 2024C卷题库疯狂收录中&#xff0c;刷题点这里 专栏导读 本专栏收录于《华为OD机试&#xff08;JAVA&#xff09;真题&#xff08;A卷B卷C卷&#xff09;》。 刷的越多&#xff0c;抽中的概率越大&#xff0c;每一题都有详细的答题思路、详细的代码注释、样例测试…

【Python时序预测系列】基于ACO+LSTM实现单变量时间序列预测(源码)

这是我的第253篇原创文章。 一、引言 蚁群优化&#xff08;Ant Colony Optimization&#xff0c;ACO&#xff09;是一种启发式算法&#xff0c;受到蚂蚁寻找食物的行为启发而来。它可以用于优化问题&#xff0c;包括调整神经网络的超参数。长短期记忆网络&#xff08;LSTM&…

wheeltec轮趣ROS教育机器人的网络连接

一、术语解析 宿主机&#xff1a;宿主机是指物理主机&#xff0c;比如用于开发测试的笔记本电脑和台式机电脑。 虚拟机&#xff1a;虚拟机是指安装在宿主机的VMware&#xff0c;推荐在宿主机上安装虚拟机&#xff0c;官方提供虚拟机的镜像以及配套的开发环境。 ROS主机&…

HTML:表单

案例&#xff1a; <!DOCTYPE html> <html> <head><meta charset"UTF-8"><title>报名表</title> </head> <body><form action"demo/welcome.php" method"post">名字&#xff1a;<inpu…

【Linux】进程初步理解

个人主页 &#xff1a; zxctscl 如有转载请先通知 文章目录 1. 冯诺依曼体系结构1.1 认识冯诺依曼体系结构1.2 存储金字塔 2. 操作系统2.1 概念2.2 结构2.3 操作系统的管理 3. 进程3.1 进程描述3.2 Linux下的PCB 4. task_struct本身内部属性4.1 启动4.2 进程的创建方式4.2.1 父…

如何不编程用 ChatGPT 爬取网站数据?

敢于大胆设想&#xff0c;才能在 AI 时代提出好问题。 需求 很多小伙伴&#xff0c;都需要为研究获取数据。从网上爬取数据&#xff0c;是其中关键一环。以往&#xff0c;这都需要编程来实现。 可最近&#xff0c;一位星友在知识星球提问&#xff1a; 这里涉及到一些个人隐私&a…

秋招刷题4(动态规划)

1.购物单 import java.util.Scanner;public class Main {public static void main(String[] args){Scanner sc new Scanner(System.in);int N sc.nextInt();int m sc.nextInt();Goods[] goods new Goods[m];for(int i 0; i < m; i){goods[i] new Goods();}for(int i …

Dev c++ C语言实现第一个 dll 动态链接库 创建与调用

代码来源&#xff1a; 极简版 C 动态链接库&#xff08;DLL&#xff09;创建与调用 - 知乎 (zhihu.com) 现在移植到Devc 里 首先创建DLL 项目&#xff0c;如果不创建&#xff0c;直接粘贴代码编译不通过&#xff0c;应该是项目里指定了链接类型。 如图&#xff1a; 然后选择…

【数据结构(二)】顺序表与ArrayList

❣博主主页: 33的博客❣ ▶文章专栏分类:数据结构◀ &#x1f69a;我的代码仓库: 33的代码仓库&#x1f69a; &#x1faf5;&#x1faf5;&#x1faf5;关注我带你学更多数据结构知识 目录 1.前言2.定义IList接口3.MyArraylist实现接口3.1定义成员变量与构造方法3.2添加元素3.3…

Jackson 2.x 系列【14】特征配置篇之 MapperFeature

有道无术&#xff0c;术尚可求&#xff0c;有术无道&#xff0c;止于术。 本系列Jackson 版本 2.17.0 源码地址&#xff1a;https://gitee.com/pearl-organization/study-jaskson-demo 文章目录 1. 前言2. 通用2.1 USE_ANNOTATIONS2.2 USE_GETTERS_AS_SETTERS2.3 PROPAGATE_TR…

c 语言 指数搜索(Exponential Search)

该搜索算法的名称可能会产生误导&#xff0c;因为它的工作时间为 O(Log n)。该名称来自于它搜索元素的方式。 给定一个已排序的数组和要 搜索的元素 x&#xff0c;找到 x 在数组中的位置。 输入&#xff1a;arr[] {10, 20, 40, 45, 55} x 45 输出&#xff1a;在索…

多语言婚恋交友APP开发的关键成功因素

随着移动互联网的快速发展&#xff0c;多语言婚恋交友APP的需求和发展逐渐成为了一个备受关注的话题。在全球范围内&#xff0c;人们希望通过移动应用来寻找爱情、建立关系和拓展社交圈子&#xff0c;因此开发一款具有全球影响力的多语言婚恋交友APP成为了许多开发者的目标。针…

支持编写任何类型的爬虫:基于 Golang 的优雅爬虫框架 | 开源日报 No.216

gocolly/colly Stars: 21.5k License: Apache-2.0 colly 是 Golang 的优雅爬虫和爬虫框架。 该项目提供了一个清晰的接口&#xff0c;用于编写任何类型的爬虫/抓取器/蜘蛛。Colly 可以轻松从网站中提取结构化数据&#xff0c;可用于数据挖掘、数据处理或存档等各种应用。 其主…

使用免费开源AI平台:OCR识别抖音短视频及网络图片中文字内容(可本地部署)

在数字化时代&#xff0c;信息的快速获取和处理变得尤为重要。网络图片文字识别技术作为一项重要的人工智能应用&#xff0c;已经在多个领域展现出其独特的价值。本文将基于思通数科AI开放平台提供的网络图片文字识别服务&#xff0c;探讨该技术的应用场景、特色优势以及如何有…

超声波清洗机哪家强?超声波清洗机排行榜!最强超声波清洗机推荐

眼镜作为日常生活中不可或缺的用品&#xff0c;对于很多人来说是必备的。然而&#xff0c;随着使用时间的增长&#xff0c;眼镜表面往往会沾染灰尘、污垢等&#xff0c;这不仅影响了镜片的透光性&#xff0c;也可能影响到使用者的视力和舒适度。因此&#xff0c;清洁眼镜成了一…

PowerShell正则表达式匹配文件内容并输出到屏幕(或保存到文件)

代码&#xff1a; foreach ($line in Get-Content -path .\test.sql) { if ($line -match bdw_\w*.\w*) {write-output $matches[0]}}思路&#xff1a; 读取文件并遍历 foreach ($line in Get-Content -path .\test.sql) 正则匹配 if ($line -match ‘bdw_\w*.\w*’) 这个匹配…

Spring拓展点之SmartLifecycle如何感知容器启动和关闭

Spring为我们提供了拓展点感知容器的启动与关闭&#xff0c;从而使我们可以在容器启动或者关闭之时进行定制的操作。Spring提供了Lifecycle上层接口&#xff0c;这个接口只有两个方法start和stop两个方法&#xff0c;但是这个接口并不是直接提供给开发者做拓展点&#xff0c;而…

Spring的事务详解

Spring的事务详解 一&#xff0c;什么是Spring事务 Spring 事务是 Spring 框架提供的一种对事务进行管理的机制。在使用 Spring 事务时&#xff0c;可以通过注解或编程方式将需要进行事务管理的方法和代码块标记为事务性操作&#xff0c;当这些操作被执行时&#xff0c;Spring…

吴恩达:AI 智能体工作流

热门文章推荐&#xff1a; &#xff08;1&#xff09;《为什么很多人工作 3 年 却只有 1 年经验&#xff1f;》&#xff08;2&#xff09;《一文掌握大模型提示词技巧&#xff1a;从战略到战术巧》&#xff08;3&#xff09;《AI 时代&#xff0c;程序员的出路在何方&#xff1…