@ -1,7 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Black">
|
||||
<option name="sdkName" value="Python 3.12" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,6 @@
|
||||
<<<<<<< HEAD
|
||||
这是我的个人分支说明
|
||||
=======
|
||||
# software-engineering-methodology
|
||||
|
||||
>>>>>>> f783378e06d6abd4513ad3220bf6f630b2fb7263
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
||||
1
|
||||
Binary file not shown.
@ -1,46 +0,0 @@
|
||||
# Generated by Django 4.2.5 on 2023-09-06 13:13
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.utils.timezone
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounts', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='bloguser',
|
||||
options={'get_latest_by': 'id', 'ordering': ['-id'], 'verbose_name': 'user', 'verbose_name_plural': 'user'},
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='bloguser',
|
||||
name='created_time',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='bloguser',
|
||||
name='last_mod_time',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='bloguser',
|
||||
name='creation_time',
|
||||
field=models.DateTimeField(default=django.utils.timezone.now, verbose_name='creation time'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='bloguser',
|
||||
name='last_modify_time',
|
||||
field=models.DateTimeField(default=django.utils.timezone.now, verbose_name='last modify time'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='bloguser',
|
||||
name='nickname',
|
||||
field=models.CharField(blank=True, max_length=100, verbose_name='nick name'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='bloguser',
|
||||
name='source',
|
||||
field=models.CharField(blank=True, max_length=100, verbose_name='create source'),
|
||||
),
|
||||
]
|
||||
@ -1,30 +0,0 @@
|
||||
# Generated by Django 5.2.6 on 2025-11-22 23:35
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('blog', '0006_alter_blogsettings_options'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Favorite',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='favorites', to='blog.article')),
|
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='favorite_articles', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '收藏',
|
||||
'verbose_name_plural': '收藏',
|
||||
'unique_together': {('article', 'user')},
|
||||
},
|
||||
),
|
||||
]
|
||||
@ -1,37 +0,0 @@
|
||||
# Generated by Django 5.2.6 on 2025-11-23 00:03
|
||||
|
||||
import blog.models
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('blog', '0007_favorite'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='UserProfile',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('avatar', models.ImageField(blank=True, help_text='Upload your avatar image (recommended size: 100x100px)', null=True, upload_to=blog.models.user_avatar_path, verbose_name='Avatar')),
|
||||
('bio', models.TextField(blank=True, help_text='Tell us a little about yourself', null=True, verbose_name='Biography')),
|
||||
('website', models.URLField(blank=True, null=True, verbose_name='Website')),
|
||||
('github', models.URLField(blank=True, null=True, verbose_name='GitHub')),
|
||||
('twitter', models.URLField(blank=True, null=True, verbose_name='Twitter')),
|
||||
('weibo', models.URLField(blank=True, null=True, verbose_name='Weibo')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created At')),
|
||||
('updated_at', models.DateTimeField(auto_now=True, verbose_name='Updated At')),
|
||||
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='profile', to=settings.AUTH_USER_MODEL, verbose_name='User')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'User Profile',
|
||||
'verbose_name_plural': 'User Profiles',
|
||||
'ordering': ['-created_at'],
|
||||
},
|
||||
),
|
||||
]
|
||||
@ -1,87 +0,0 @@
|
||||
codecov:
|
||||
require_ci_to_pass: yes
|
||||
|
||||
coverage:
|
||||
precision: 2
|
||||
round: down
|
||||
range: "70...100"
|
||||
|
||||
status:
|
||||
project:
|
||||
default:
|
||||
target: auto
|
||||
threshold: 1%
|
||||
informational: true
|
||||
patch:
|
||||
default:
|
||||
target: auto
|
||||
threshold: 1%
|
||||
informational: true
|
||||
|
||||
parsers:
|
||||
gcov:
|
||||
branch_detection:
|
||||
conditional: yes
|
||||
loop: yes
|
||||
method: no
|
||||
macro: no
|
||||
|
||||
comment:
|
||||
layout: "reach,diff,flags,tree"
|
||||
behavior: default
|
||||
require_changes: no
|
||||
|
||||
ignore:
|
||||
# Django 相关
|
||||
- "*/migrations/*"
|
||||
- "manage.py"
|
||||
- "*/settings.py"
|
||||
- "*/wsgi.py"
|
||||
- "*/asgi.py"
|
||||
|
||||
# 测试相关
|
||||
- "*/tests/*"
|
||||
- "*/test_*.py"
|
||||
- "*/*test*.py"
|
||||
|
||||
# 静态文件和模板
|
||||
- "*/static/*"
|
||||
- "*/templates/*"
|
||||
- "*/collectedstatic/*"
|
||||
|
||||
# 国际化文件
|
||||
- "*/locale/*"
|
||||
- "**/*.po"
|
||||
- "**/*.mo"
|
||||
|
||||
# 文档和部署
|
||||
- "*/docs/*"
|
||||
- "*/deploy/*"
|
||||
- "README*.md"
|
||||
- "LICENSE"
|
||||
- "Dockerfile"
|
||||
- "docker-compose*.yml"
|
||||
- "*.yaml"
|
||||
- "*.yml"
|
||||
|
||||
# 开发环境
|
||||
- "*/venv/*"
|
||||
- "*/__pycache__/*"
|
||||
- "*.pyc"
|
||||
- ".coverage"
|
||||
- "coverage.xml"
|
||||
|
||||
# 日志文件
|
||||
- "*/logs/*"
|
||||
- "*.log"
|
||||
|
||||
# 特定文件
|
||||
- "*/whoosh_cn_backend.py" # 搜索后端
|
||||
- "*/elasticsearch_backend.py" # 搜索后端
|
||||
- "*/MemcacheStorage.py" # 缓存存储
|
||||
- "*/robot.py" # 机器人相关
|
||||
|
||||
# 配置文件
|
||||
- "codecov.yml"
|
||||
- ".coveragerc"
|
||||
- "requirements*.txt"
|
||||
|
Before Width: | Height: | Size: 175 KiB |
|
Before Width: | Height: | Size: 175 KiB |
|
Before Width: | Height: | Size: 755 KiB |
@ -1,30 +0,0 @@
|
||||
{% extends 'share_layout/base_account.html' %}
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
|
||||
<h2 class="form-signin-heading text-center">{% trans 'forget the password' %}</h2>
|
||||
|
||||
<div class="card card-signin">
|
||||
<img class="img-circle profile-img" src="{% static 'blog/img/avatar.png' %}" alt="">
|
||||
<form class="form-signin" action="{% url 'account:forget_password' %}" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.non_field_errors }}
|
||||
{% for field in form %}
|
||||
{{ field }}
|
||||
{{ field.errors }}
|
||||
{% endfor %}
|
||||
<input type="button" class="button" id="btn" value="{% trans 'get verification code' %}">
|
||||
<button class="btn btn-lg btn-primary btn-block" type="submit">{% trans 'submit' %}</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<p class="text-center">
|
||||
<a href="/">Home Page</a>
|
||||
|
|
||||
<a href="{% url "account:login" %}">login page</a>
|
||||
</p>
|
||||
|
||||
</div> <!-- /container -->
|
||||
{% endblock %}
|
||||
@ -1,46 +0,0 @@
|
||||
{% extends 'share_layout/base_account.html' %}
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
|
||||
<h2 class="form-signin-heading text-center">Sign in with your Account</h2>
|
||||
|
||||
<div class="card card-signin">
|
||||
<img class="img-circle profile-img" src="{% static 'blog/img/avatar.png' %}" alt="">
|
||||
<form class="form-signin" action="{% url 'account:login' %}" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.non_field_errors }}
|
||||
{% for field in form %}
|
||||
{{ field }}
|
||||
{{ field.errors }}
|
||||
{% endfor %}
|
||||
|
||||
<input type="hidden" name="next" value="{{ redirect_to }}">
|
||||
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
|
||||
|
||||
<div class="checkbox">
|
||||
{% comment %}<a class="pull-right">Need help?</a>{% endcomment %}
|
||||
<label>
|
||||
<input type="checkbox" value="remember-me" name="remember"> Stay signed in
|
||||
</label>
|
||||
</div>
|
||||
{% load oauth_tags %}
|
||||
{% load_oauth_applications request%}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<p class="text-center">
|
||||
<a href="{% url "account:register" %}">
|
||||
{% trans 'Create Account' %}
|
||||
</a>
|
||||
|
|
||||
<a href="/">Home Page</a>
|
||||
|
|
||||
<a href="{% url "account:forget_password" %}">
|
||||
{% trans 'Forget Password' %}
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</div> <!-- /container -->
|
||||
{% endblock %}
|
||||
@ -1,29 +0,0 @@
|
||||
{% extends 'share_layout/base_account.html' %}
|
||||
{% load static %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
|
||||
<h2 class="form-signin-heading text-center">Create Your Account</h2>
|
||||
|
||||
<div class="card card-signin">
|
||||
<img class="img-circle profile-img" src="{% static 'blog/img/avatar.png' %}" alt="">
|
||||
<form class="form-signin" action="{% url 'account:register' %}" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.non_field_errors }}
|
||||
{% for field in form %}
|
||||
{{ field }}
|
||||
{{ field.errors }}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
<button class="btn btn-lg btn-primary btn-block" type="submit">Create Your Account</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<p class="text-center">
|
||||
<a href="{% url "account:login" %}">Sign In</a>
|
||||
</p>
|
||||
|
||||
</div> <!-- /container -->
|
||||
{% endblock %}
|
||||
@ -1,27 +0,0 @@
|
||||
{% extends 'share_layout/base.html' %}
|
||||
{% load i18n %}
|
||||
{% block header %}
|
||||
<title> {{ title }}</title>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div id="primary" class="site-content">
|
||||
<div id="content" role="main">
|
||||
|
||||
<header class="archive-header">
|
||||
|
||||
<h2 class="archive-title"> {{ content }}</h2>
|
||||
</header><!-- .archive-header -->
|
||||
<br/>
|
||||
<header class="archive-header" style="text-align: center">
|
||||
|
||||
<a href="{% url "account:login" %}">
|
||||
{% trans 'login' %}
|
||||
</a>
|
||||
|
|
||||
<a href="/">
|
||||
{% trans 'back to the homepage' %}
|
||||
</a>
|
||||
</header><!-- .archive-header -->
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@ -1,60 +0,0 @@
|
||||
{% extends 'share_layout/base.html' %}
|
||||
{% load blog_tags %}
|
||||
{% load cache %}
|
||||
{% load i18n %}
|
||||
{% block header %}
|
||||
|
||||
<title>{% trans 'article archive' %} | {{ SITE_DESCRIPTION }}</title>
|
||||
|
||||
<meta name="description" content="{{ SITE_SEO_DESCRIPTION }}"/>
|
||||
<meta name="keywords" content="{{ SITE_KEYWORDS }}"/>
|
||||
<meta property="og:type" content="blog"/>
|
||||
<meta property="og:title" content="{{ SITE_NAME }}"/>
|
||||
<meta property="og:description" content="{{ SITE_DESCRIPTION }}"/>
|
||||
<meta property="og:url" content="{{ SITE_BASE_URL }}"/>
|
||||
<meta property="og:site_name" content="{{ SITE_NAME }}"/>
|
||||
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div id="primary" class="site-content">
|
||||
<div id="content" role="main">
|
||||
|
||||
<header class="archive-header">
|
||||
|
||||
<p class="archive-title">{% trans 'article archive' %}</p>
|
||||
</header><!-- .archive-header -->
|
||||
|
||||
<div class="entry-content">
|
||||
|
||||
{% regroup article_list by pub_time.year as year_post_group %}
|
||||
<ul>
|
||||
{% for year in year_post_group %}
|
||||
<li>{{ year.grouper }} {% trans 'year' %}
|
||||
{% regroup year.list by pub_time.month as month_post_group %}
|
||||
<ul>
|
||||
{% for month in month_post_group %}
|
||||
<li>{{ month.grouper }} {% trans 'month' %}
|
||||
<ul>
|
||||
{% for article in month.list %}
|
||||
<li><a href="{{ article.get_absolute_url }}">{{ article.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div><!-- #content -->
|
||||
</div><!-- #primary -->
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block sidebar %}
|
||||
{% load_sidebar user 'i' %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
@ -1,45 +0,0 @@
|
||||
{% extends 'share_layout/base.html' %}
|
||||
{% load blog_tags %}
|
||||
{% load cache %}
|
||||
{% block header %}
|
||||
{% if tag_name %}
|
||||
{% if statuscode == '404' %}
|
||||
<title>404 NotFound</title>
|
||||
{% elif statuscode == '403' %}
|
||||
<title>Permission Denied</title>
|
||||
{% elif statuscode == '500' %}
|
||||
<title>500 Error</title>
|
||||
{% else %}
|
||||
<title></title>
|
||||
{% endif %}
|
||||
{% comment %}<meta name="description" content="{{ page_type }}:{{ tag_name }}"/>{% endcomment %}
|
||||
{% else %}
|
||||
<title>{{ SITE_NAME }} | {{ SITE_DESCRIPTION }}</title>
|
||||
{% endif %}
|
||||
<meta name="description" content="{{ SITE_SEO_DESCRIPTION }}"/>
|
||||
<meta name="keywords" content="{{ SITE_KEYWORDS }}"/>
|
||||
<meta property="og:type" content="blog"/>
|
||||
<meta property="og:title" content="{{ SITE_NAME }}"/>
|
||||
<meta property="og:description" content="{{ SITE_DESCRIPTION }}"/>
|
||||
<meta property="og:url" content="{{ SITE_BASE_URL }}"/>
|
||||
<meta property="og:site_name" content="{{ SITE_NAME }}"/>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div id="primary" class="site-content">
|
||||
<div id="content" role="main">
|
||||
|
||||
<header class="archive-header">
|
||||
<h1 class="archive-title">{{ message }}</h1>
|
||||
</header><!-- .archive-header -->
|
||||
|
||||
</div><!-- #content -->
|
||||
</div><!-- #primary -->
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block sidebar %}
|
||||
{% load_sidebar user 'i' %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
@ -1,44 +0,0 @@
|
||||
{% extends 'share_layout/base.html' %}
|
||||
{% load blog_tags %}
|
||||
{% load cache %}
|
||||
{% block header %}
|
||||
|
||||
<title>友情链接 | {{ SITE_DESCRIPTION }}</title>
|
||||
|
||||
<meta name="description" content="{{ SITE_SEO_DESCRIPTION }}"/>
|
||||
<meta name="keywords" content="{{ SITE_KEYWORDS }}"/>
|
||||
<meta property="og:type" content="blog"/>
|
||||
<meta property="og:title" content="{{ SITE_NAME }}"/>
|
||||
<meta property="og:description" content="{{ SITE_DESCRIPTION }}"/>
|
||||
<meta property="og:url" content="{{ SITE_BASE_URL }}"/>
|
||||
<meta property="og:site_name" content="{{ SITE_NAME }}"/>
|
||||
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div id="primary" class="site-content">
|
||||
<div id="content" role="main">
|
||||
|
||||
<header class="archive-header">
|
||||
|
||||
<p class="archive-title">友情链接</p>
|
||||
</header><!-- .archive-header -->
|
||||
|
||||
<div class="entry-content">
|
||||
<ul>
|
||||
{% for obj in object_list %}
|
||||
<li>
|
||||
<a href="{{ obj.link }}">{{ obj.name }}</a>
|
||||
</li>
|
||||
{% endfor %} </ul>
|
||||
</div>
|
||||
</div><!-- #content -->
|
||||
</div><!-- #primary -->
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block sidebar %}
|
||||
{% load_sidebar user 'i' %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
@ -1,54 +0,0 @@
|
||||
{% load i18n %}
|
||||
{% load blog_tags %}
|
||||
|
||||
<footer class="entry-meta">
|
||||
{% trans 'posted in' %}
|
||||
<a href="{{ article.category.get_absolute_url }}" rel="category tag">{{ article.category.name }}</a>
|
||||
|
||||
{% if article.type == 'a' %}
|
||||
{% if article.tags.all %}
|
||||
{% trans 'and tagged' %}
|
||||
{% for t in article.tags.all %}
|
||||
<a href="{{ t.get_absolute_url }}" rel="tag">{{ t.name }}</a>
|
||||
{% if t != article.tags.all.last %}
|
||||
,
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
. {% trans 'by ' %}
|
||||
<span class="by-author">
|
||||
<span class="author vcard">
|
||||
<a class="url fn n" href="{{ article.author.get_absolute_url }}"
|
||||
{% blocktranslate %}
|
||||
title="View all articles published by {{ article.author.username }}"
|
||||
{% endblocktranslate %}
|
||||
rel="author">
|
||||
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
|
||||
<span itemprop="name" itemprop="publisher">
|
||||
{{ article.author.username }}
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
</span>
|
||||
</span>
|
||||
{% trans 'on' %}
|
||||
<a href="{{ article.get_absolute_url }}"
|
||||
title="{% datetimeformat article.pub_time %}"
|
||||
itemprop="datePublished" content="{% datetimeformat article.pub_time %}"
|
||||
rel="bookmark">
|
||||
<time class="entry-date updated"
|
||||
datetime="{{ article.pub_time }}">
|
||||
{% datetimeformat article.pub_time %}
|
||||
</time>
|
||||
</a>
|
||||
<!-- 新增:显示阅读量 -->
|
||||
<span class="meta-sep"> | </span>
|
||||
<span class="views">
|
||||
{% trans 'Views' %}: <span itemprop="interactionCount">{{ article.views }}</span>
|
||||
</span>
|
||||
{% if user.is_superuser %}
|
||||
<span class="meta-sep"> | </span>
|
||||
<a href="{{ article.get_admin_url }}">{% trans 'edit' %}</a>
|
||||
{% endif %}
|
||||
</footer><!-- .entry-meta -->
|
||||
@ -1,17 +0,0 @@
|
||||
{% load i18n %}
|
||||
<nav id="nav-below" class="navigation" role="navigation">
|
||||
<h3 class="assistive-text">
|
||||
{% trans 'article navigation' %}
|
||||
</h3>
|
||||
{% if page_obj.has_next and next_url%}
|
||||
<div class="nav-previous"><a
|
||||
href="{{ next_url }}"><span
|
||||
class="meta-nav">←</span> {% trans 'earlier articles' %}</a></div>
|
||||
{% endif %}
|
||||
{% if page_obj.has_previous and previous_url %}
|
||||
<div class="nav-next"><a href="{{ previous_url }}">{% trans 'newer articles' %}
|
||||
<span
|
||||
class="meta-nav">→</span></a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</nav><!-- .navigation -->
|
||||
@ -1,19 +0,0 @@
|
||||
{% load i18n %}
|
||||
{% if article_tags_list %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
{% trans 'tags' %}
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
||||
{% for url,count,tag,color in article_tags_list %}
|
||||
<a class="label label-{{ color }}" style="display: inline-block;" href="{{ url }}"
|
||||
title="{{ tag.name }}">
|
||||
{{ tag.name }}
|
||||
<span class="badge">{{ count }}</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@ -1,19 +0,0 @@
|
||||
<ul itemscope itemtype="https://schema.org/BreadcrumbList" class="breadcrumb">
|
||||
|
||||
{% for name,url in names %}
|
||||
<li itemprop="itemListElement" itemscope
|
||||
itemtype="https://schema.org/ListItem">
|
||||
<a href="{{ url }}" itemprop="item" >
|
||||
<span itemprop="name">{{ name }}</span></a>
|
||||
<meta itemprop="position" content="{{ forloop.counter }}"/>
|
||||
|
||||
</li>
|
||||
{% endfor %}
|
||||
<li class="active" itemprop="itemListElement" itemscope
|
||||
itemtype="https://schema.org/ListItem">
|
||||
<span itemprop="name">{{ title }}</span>
|
||||
<meta itemprop="position" content="{{ count }}"/>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
@ -1,97 +0,0 @@
|
||||
<!-- blog/templates/blog/user_favorites.html -->
|
||||
{% extends 'share_layout/base.html' %}
|
||||
{% load static %}
|
||||
{% load blog_tags %}
|
||||
|
||||
{% block header %}
|
||||
<title>我的收藏 | {{ SITE_NAME }}</title>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="primary" class="site-content">
|
||||
<div id="content" role="main">
|
||||
|
||||
<article class="hentry">
|
||||
<header class="entry-header">
|
||||
<h1 class="entry-title">我的收藏</h1>
|
||||
<p>这里是你收藏的所有文章。</p>
|
||||
</header>
|
||||
|
||||
<div class="entry-content">
|
||||
{% if favorite_articles %}
|
||||
<ul class="article-list">
|
||||
{% for article in favorite_articles %}
|
||||
<li>
|
||||
<h2><a href="{{ article.get_absolute_url }}">{{ article.title }}</a></h2>
|
||||
<div class="meta">
|
||||
<time datetime="{{ article.pub_time|date:"c" }}">
|
||||
{{ article.pub_time|date:"F j, Y" }}
|
||||
</time>
|
||||
<span>作者: <a href="{% url 'blog:author_detail' article.author.username %}">{{ article.author.username }}</a></span>
|
||||
<!-- 修正第 31 行的 URL 名称 -->
|
||||
<span>分类:<a href="{% url 'blog:category_detail' article.category.slug %}">{{ article.category.name }}</a></span>
|
||||
</div>
|
||||
<div class="summary">
|
||||
{{ article.body|striptags|truncatechars:150 }}
|
||||
</div>
|
||||
<a href="{{ article.get_absolute_url }}" class="read-more">阅读全文</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p class="no-favorites">你还没有收藏任何文章。快去 <a href="{% url 'blog:index' %}">文章列表</a> 看看吧!</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</article>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{% load_sidebar profile_user "p" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_footer %}
|
||||
<style>
|
||||
.article-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
.article-list li {
|
||||
padding: 20px 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.article-list li:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.article-list h2 {
|
||||
margin-top: 0;
|
||||
}
|
||||
.meta {
|
||||
color: #777;
|
||||
font-size: 0.9em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.summary {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.read-more {
|
||||
display: inline-block;
|
||||
padding: 5px 10px;
|
||||
background-color: #007bff;
|
||||
color: white;
|
||||
border-radius: 3px;
|
||||
text-decoration: none;
|
||||
}
|
||||
.read-more:hover {
|
||||
background-color: #0056b3;
|
||||
color: white;
|
||||
}
|
||||
.no-favorites {
|
||||
text-align: center;
|
||||
padding: 50px 0;
|
||||
color: #555;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
@ -1,230 +0,0 @@
|
||||
<!-- blog/templates/blog/user_profile_detail.html -->
|
||||
{% extends 'share_layout/base.html' %}
|
||||
{% load static %}
|
||||
{% load blog_tags %} <!-- 添加这一行,加载自定义标签库 -->
|
||||
|
||||
{% block header %}
|
||||
<title>{{ profile.user.username }}'s Profile | {{ SITE_NAME }}</title>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="primary" class="site-content">
|
||||
<div id="content" role="main">
|
||||
|
||||
<article class="hentry">
|
||||
<header class="entry-header profile-header">
|
||||
<div class="profile-avatar">
|
||||
{% if profile.avatar %}
|
||||
<img src="{{ profile.avatar.url }}" alt="{{ profile.user.username }}'s avatar">
|
||||
{% else %}
|
||||
<img src="{% static 'blog/images/default-avatar.png' %}" alt="Default Avatar">
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="profile-info">
|
||||
<h1 class="entry-title">{{ profile.user.username }}</h1>
|
||||
<div class="profile-meta">
|
||||
<span>Joined on {{ profile.created_at|date:"F j, Y" }}</span>
|
||||
{% if user.is_authenticated and user == profile.user %}
|
||||
<a href="{% url 'blog:user_profile_update' %}" class="edit-profile-btn">
|
||||
Edit Profile
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="entry-content profile-content">
|
||||
{% if profile.bio %}
|
||||
<section class="profile-bio">
|
||||
<h3>About Me</h3>
|
||||
<p>{{ profile.bio|linebreaks }}</p>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
{% if profile.website or profile.github or profile.twitter or profile.weibo %}
|
||||
<section class="profile-links">
|
||||
<h3>Connect with Me</h3>
|
||||
<ul>
|
||||
{% if profile.website %}
|
||||
<li><a href="{{ profile.website }}" target="_blank" rel="noopener noreferrer"><i class="fas fa-globe"></i> {{ profile.website }}</a></li>
|
||||
{% endif %}
|
||||
{% if profile.github %}
|
||||
<li><a href="{{ profile.github }}" target="_blank" rel="noopener noreferrer"><i class="fab fa-github"></i> GitHub</a></li>
|
||||
{% endif %}
|
||||
{% if profile.twitter %}
|
||||
<li><a href="{{ profile.twitter }}" target="_blank" rel="noopener noreferrer"><i class="fab fa-twitter"></i> Twitter</a></li>
|
||||
{% endif %}
|
||||
{% if profile.weibo %}
|
||||
<li><a href="{{ profile.weibo }}" target="_blank" rel="noopener noreferrer"><i class="fab fa-weibo"></i> Weibo</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
<!-- ==================== 新增:我的收藏链接 ==================== -->
|
||||
{% if user.is_authenticated and user == profile.user %}
|
||||
<section class="profile-actions">
|
||||
<a href="{% url 'blog:user_favorites' %}" class="btn-favorite">
|
||||
<i class="fas fa-heart"></i> 我的收藏 ({{ user.favorite_articles.count }})
|
||||
</a>
|
||||
</section>
|
||||
{% endif %}
|
||||
<!-- ========================================================== -->
|
||||
|
||||
</div>
|
||||
</article>
|
||||
|
||||
{% if user_articles %}
|
||||
<section class="profile-articles">
|
||||
<h2>Articles by {{ profile.user.username }} <span>({{ user_articles|length }})</span></h2>
|
||||
<ul>
|
||||
{% for article in user_articles %}
|
||||
<li>
|
||||
<a href="{{ article.get_absolute_url }}">{{ article.title }}</a>
|
||||
<time datetime="{{ article.pub_time|date:"c" }}">{{ article.pub_time|date:"F j, Y" }}</time>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{% load_sidebar user "p" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_footer %}
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
|
||||
<style>
|
||||
/* 个人资料头部布局 */
|
||||
.profile-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #eee;
|
||||
padding-bottom: 20px;
|
||||
margin-bottom: 30px; /* 增加了下边距,与内容区隔开 */
|
||||
}
|
||||
|
||||
/* 头像样式调整 */
|
||||
.profile-avatar img {
|
||||
width: 80px; /* 从 120px 调整为 80px */
|
||||
height: 80px; /* 从 120px 调整为 80px */
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
margin-right: 20px; /* 稍微减少了右边距 */
|
||||
border: 3px solid #fff;
|
||||
box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* 增强了一点阴影 */
|
||||
}
|
||||
|
||||
/* 个人信息区域 */
|
||||
.profile-info h1 {
|
||||
margin-bottom: 5px; /* 减少了标题下边距 */
|
||||
}
|
||||
|
||||
.edit-profile-btn {
|
||||
display: inline-block;
|
||||
margin-top: 10px;
|
||||
padding: 5px 15px;
|
||||
background-color: #007bff;
|
||||
color: white;
|
||||
border-radius: 4px;
|
||||
text-decoration: none;
|
||||
font-size: 0.9em; /* 字体稍小 */
|
||||
}
|
||||
|
||||
.edit-profile-btn:hover {
|
||||
background-color: #0056b3;
|
||||
color: white;
|
||||
}
|
||||
|
||||
/* 内容区块通用样式 */
|
||||
.profile-bio, .profile-links, .profile-articles, .profile-actions { /* 新增 .profile-actions */
|
||||
margin-bottom: 30px;
|
||||
padding: 20px;
|
||||
background: #f9f9f9;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #eee; /* 增加了一个边框 */
|
||||
}
|
||||
|
||||
/* ==================== 新增:我的收藏链接样式 ==================== */
|
||||
.btn-favorite {
|
||||
display: inline-flex; /* 使用 flex 布局让图标和文字垂直居中 */
|
||||
align-items: center;
|
||||
padding: 10px 20px;
|
||||
background-color: #f0ad4e; /* 使用一个醒目的颜色,如橙色 */
|
||||
color: white;
|
||||
border-radius: 4px;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
transition: background-color 0.2s ease;
|
||||
}
|
||||
|
||||
.btn-favorite i {
|
||||
margin-right: 8px;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
.btn-favorite:hover {
|
||||
background-color: #ec971f; /* hover 时颜色加深 */
|
||||
color: white;
|
||||
}
|
||||
/* ================================================================ */
|
||||
|
||||
/* 链接列表 */
|
||||
.profile-links ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.profile-links li {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.profile-links a {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #007bff;
|
||||
text-decoration: none;
|
||||
transition: color 0.2s; /* 增加了过渡效果 */
|
||||
}
|
||||
|
||||
.profile-links a:hover {
|
||||
text-decoration: underline;
|
||||
color: #0056b3; /* hover 时颜色加深 */
|
||||
}
|
||||
|
||||
.profile-links i {
|
||||
margin-right: 10px;
|
||||
font-size: 1.2em;
|
||||
width: 20px;
|
||||
text-align: center;
|
||||
color: #555; /* 图标颜色稍微暗一点 */
|
||||
}
|
||||
|
||||
/* 文章列表 */
|
||||
.profile-articles ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.profile-articles li {
|
||||
padding: 10px 0;
|
||||
border-bottom: 1px dotted #ddd;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center; /* 垂直居中对齐 */
|
||||
}
|
||||
|
||||
.profile-articles li:last-child {
|
||||
border-bottom: none; /* 去掉最后一个的边框 */
|
||||
}
|
||||
|
||||
.profile-articles li time {
|
||||
color: #777;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
@ -1,104 +0,0 @@
|
||||
<!-- blog/templates/blog/user_profile_update.html -->
|
||||
{% extends 'share_layout/base.html' %}
|
||||
{% load static %}
|
||||
{% load blog_tags %} <!-- 加载自定义标签库 -->
|
||||
|
||||
{% block header %}
|
||||
<title>Edit Profile | {{ SITE_NAME }}</title>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="primary" class="site-content">
|
||||
<div id="content" role="main">
|
||||
|
||||
<article class="hentry">
|
||||
<header class="entry-header">
|
||||
<h1 class="entry-title">Edit Your Profile</h1>
|
||||
</header>
|
||||
|
||||
<div class="entry-content">
|
||||
<form enctype="multipart/form-data" method="post" action="{% url 'blog:user_profile_update' %}">
|
||||
{% csrf_token %}
|
||||
|
||||
{% if form.errors %}
|
||||
<div class="alert alert-danger">
|
||||
<strong>Please correct the errors below.</strong>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="form-group">
|
||||
<label for="{{ form.avatar.id_for_label }}">Current Avatar:</label><br>
|
||||
{% if user.profile.avatar %}
|
||||
<img src="{{ user.profile.avatar.url }}" alt="Current Avatar" style="width: 100px; border-radius: 50%; margin-bottom: 10px;">
|
||||
{% else %}
|
||||
<img src="{% static 'blog/images/default-avatar.png' %}" alt="Default Avatar" style="width: 100px; border-radius: 50%; margin-bottom: 10px;">
|
||||
{% endif %}
|
||||
<br>
|
||||
{{ form.avatar.label_tag }} {{ form.avatar }}
|
||||
<small class="form-text text-muted">{{ form.avatar.help_text }}</small>
|
||||
{{ form.avatar.errors }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ form.bio.label_tag }}
|
||||
{{ form.bio }}
|
||||
{{ form.bio.errors }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ form.website.label_tag }}
|
||||
{{ form.website }}
|
||||
{{ form.website.errors }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ form.github.label_tag }}
|
||||
{{ form.github }}
|
||||
{{ form.github.errors }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ form.twitter.label_tag }}
|
||||
{{ form.twitter }}
|
||||
{{ form.twitter.errors }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ form.weibo.label_tag }}
|
||||
{{ form.weibo }}
|
||||
{{ form.weibo.errors }}
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">Save Changes</button>
|
||||
<a href="{% url 'blog:user_profile' username=user.username %}" class="btn btn-secondary">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{% load_sidebar user "p" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_footer %}
|
||||
<style>
|
||||
.form-group { margin-bottom: 20px; }
|
||||
label { font-weight: bold; display: block; margin-bottom: 5px; }
|
||||
input[type="text"], input[type="url"], textarea {
|
||||
width: 100%; padding: 8px 12px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box;
|
||||
}
|
||||
textarea { resize: vertical; }
|
||||
.btn {
|
||||
display: inline-block; padding: 10px 16px; margin-bottom: 0; font-size: 14px; font-weight: 400; line-height: 1.42857143; text-align: center; white-space: nowrap; vertical-align: middle; cursor: pointer; background-image: none; border: 1px solid transparent; border-radius: 4px; text-decoration: none;
|
||||
}
|
||||
.btn-primary { color: #fff; background-color: #337ab7; border-color: #2e6da4; }
|
||||
.btn-primary:hover { background-color: #286090; border-color: #204d74; color: #fff; }
|
||||
.btn-secondary { color: #333; background-color: #fff; border-color: #ccc; }
|
||||
.btn-secondary:hover { background-color: #e6e6e6; border-color: #adadad; color: #333; }
|
||||
.alert { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px; }
|
||||
.alert-danger { color: #a94442; background-color: #f2dede; border-color: #ebccd1; }
|
||||
</style>
|
||||
{% endblock %}
|
||||
@ -1,37 +0,0 @@
|
||||
{% load blog_tags %}
|
||||
<li class="comment even thread-even depth-{{ depth }} parent" id="comment-{{ comment_item.pk }}">
|
||||
<div id="div-comment-{{ comment_item.pk }}" class="comment-body">
|
||||
<div class="comment-author vcard">
|
||||
<img alt="{{ comment_item.author.username }}的头像"
|
||||
src="{{ comment_item.author.email|gravatar_url:150 }}"
|
||||
srcset="{{ comment_item.author.email|gravatar_url:150 }}"
|
||||
class="avatar avatar-96 photo"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
style="max-width:100%;height:auto;">
|
||||
<cite class="fn">
|
||||
<a rel="nofollow"
|
||||
{% if comment_item.author.is_superuser %}
|
||||
href="{{ comment_item.author.get_absolute_url }}"
|
||||
{% else %}
|
||||
href="#"
|
||||
{% endif %}
|
||||
rel="external nofollow"
|
||||
class="url">{{ comment_item.author.username }}
|
||||
</a>
|
||||
</cite>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="comment-meta commentmetadata">
|
||||
<div>{{ comment_item.creation_time }}</div>
|
||||
<div>回复给:@{{ comment_item.author.parent_comment.username }}</div>
|
||||
</div>
|
||||
<p>{{ comment_item.body|escape|comment_markdown }}</p>
|
||||
<div class="reply"><a rel="nofollow" class="comment-reply-link"
|
||||
href="javascript:void(0)"
|
||||
onclick="do_reply({{ comment_item.pk }})"
|
||||
aria-label="回复给{{ comment_item.author.username }}">回复</a></div>
|
||||
</div>
|
||||
|
||||
</li><!-- #comment-## -->
|
||||
@ -1,57 +0,0 @@
|
||||
{% load blog_tags %}
|
||||
<li class="comment even thread-even depth-{{ depth }} parent" id="comment-{{ comment_item.pk }}"
|
||||
style="margin-left: {% widthratio depth 1 3 %}rem">
|
||||
<div id="div-comment-{{ comment_item.pk }}" class="comment-body">
|
||||
<div class="comment-author vcard">
|
||||
<img alt="{{ comment_item.author.username }}的头像"
|
||||
src="{{ comment_item.author.email|gravatar_url:150 }}"
|
||||
srcset="{{ comment_item.author.email|gravatar_url:150 }}"
|
||||
class="avatar avatar-96 photo"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
style="max-width:100%;height:auto;">
|
||||
<cite class="fn">
|
||||
<a rel="nofollow"
|
||||
{% if comment_item.author.is_superuser %}
|
||||
href="{{ comment_item.author.get_absolute_url }}"
|
||||
{% else %}
|
||||
href="#"
|
||||
{% endif %}
|
||||
rel="external nofollow"
|
||||
class="url">{{ comment_item.author.username }}
|
||||
</a>
|
||||
</cite>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="comment-meta commentmetadata">
|
||||
{{ comment_item.creation_time }}
|
||||
</div>
|
||||
<p>
|
||||
{% if comment_item.parent_comment %}
|
||||
<div>回复 <a
|
||||
href="#comment-{{ comment_item.parent_comment.pk }}">@{{ comment_item.parent_comment.author.username }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
<p>{{ comment_item.body|escape|comment_markdown }}</p>
|
||||
|
||||
<div class="reply"><a rel="nofollow" class="comment-reply-link"
|
||||
href="javascript:void(0)" data-pk="{{ comment_item.pk }}"
|
||||
aria-label="回复给{{ comment_item.author.username }}">回复</a></div>
|
||||
</div>
|
||||
|
||||
</li><!-- #comment-## -->
|
||||
{% query article_comments parent_comment=comment_item as cc_comments %}
|
||||
{% for cc in cc_comments %}
|
||||
{% with comment_item=cc template_name="comments/tags/comment_item_tree.html" %}
|
||||
{% if depth >= 1 %}
|
||||
{% include template_name %}
|
||||
{% else %}
|
||||
{% with depth=depth|add:1 %}
|
||||
{% include template_name %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
@ -1,45 +0,0 @@
|
||||
<dev>
|
||||
<section id="comments" class="themeform">
|
||||
{% load blog_tags %}
|
||||
{% load comments_tags %}
|
||||
{% load cache %}
|
||||
|
||||
<ul class="comment-tabs group">
|
||||
<li class="active"><a href="#commentlist-container"><i
|
||||
class="fa fa-comments-o"></i>评论<span>{{ comment_count }}</span></a></li>
|
||||
|
||||
</ul>
|
||||
{% if article_comments %}
|
||||
<div id="commentlist-container" class="comment-tab" style="display: block;">
|
||||
<ol class="commentlist">
|
||||
{# {% query article_comments parent_comment=None as parent_comments %}#}
|
||||
{% for comment_item in p_comments %}
|
||||
|
||||
{% with 0 as depth %}
|
||||
{% include "comments/tags/comment_item_tree.html" %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
|
||||
</ol><!--/.commentlist-->
|
||||
<div class="navigation">
|
||||
<nav class="nav-single">
|
||||
{% if comment_prev_page_url %}
|
||||
<div class="nav-previous">
|
||||
<span><a href="{{ comment_prev_page_url }}" rel="prev"><span
|
||||
class="meta-nav">←</span> 上一页</a></span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if comment_next_page_url %}
|
||||
<div class="nav-next">
|
||||
<span><a href="{{ comment_next_page_url }}" rel="next">下一页 <span
|
||||
class="meta-nav">→</span></a></span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</nav>
|
||||
</div>
|
||||
<br/>
|
||||
</div>
|
||||
{% endif %}
|
||||
</section>
|
||||
|
||||
</dev>
|
||||
@ -1,22 +0,0 @@
|
||||
{% extends 'share_layout/base.html' %}
|
||||
{% block header %}
|
||||
<title> {{ title }}</title>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div id="primary" class="site-content">
|
||||
<div id="content" role="main">
|
||||
|
||||
<header class="archive-header">
|
||||
|
||||
<h2 class="archive-title"> {{ content }}</h2>
|
||||
</header><!-- .archive-header -->
|
||||
<br/>
|
||||
<header class="archive-header" style="text-align: center">
|
||||
|
||||
<a href="{% url "account:login" %}">登录</a>
|
||||
|
|
||||
<a href="/">回到首页</a>
|
||||
</header><!-- .archive-header -->
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@ -1,13 +0,0 @@
|
||||
{% load i18n %}
|
||||
<div class="widget-login">
|
||||
{% if apps %}
|
||||
<small>
|
||||
{% trans 'quick login' %}:
|
||||
</small>
|
||||
{% for icon,url in apps %}
|
||||
<a href="{{ url }}" rel="nofollow">
|
||||
<span class="icon-sn-{{ icon }}"></span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
@ -1,46 +0,0 @@
|
||||
{% extends 'share_layout/base_account.html' %}
|
||||
|
||||
{% load static %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
|
||||
<h2 class="form-signin-heading text-center">绑定您的邮箱账号</h2>
|
||||
|
||||
<div class="card card-signin">
|
||||
{% if picture %}
|
||||
<img class="img-circle profile-img" src="{{ picture }}" alt="">
|
||||
{% else %}
|
||||
<img class="img-circle profile-img" src="{% static 'blog/img/avatar.png' %}" alt="">
|
||||
{% endif %}
|
||||
<form class="form-signin" action="" method="post">
|
||||
{% csrf_token %}
|
||||
{% comment %}<label for="inputEmail" class="sr-only">Email address</label>
|
||||
<input type="email" id="inputEmail" class="form-control" placeholder="Email" required autofocus>
|
||||
<label for="inputPassword" class="sr-only">Password</label>
|
||||
<input type="password" id="inputPassword" class="form-control" placeholder="Password" required>{% endcomment %}
|
||||
{{ form.non_field_errors }}
|
||||
{% for field in form %}
|
||||
{{ field }}
|
||||
{{ field.errors }}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
<button class="btn btn-lg btn-primary btn-block" type="submit">提交</button>
|
||||
|
||||
{% comment %}
|
||||
<div class="checkbox">
|
||||
<a class="pull-right">Need help?</a>
|
||||
<label>
|
||||
<input type="checkbox" value="remember-me"> Stay signed in
|
||||
</label>
|
||||
</div>
|
||||
{% endcomment %}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<p class="text-center">
|
||||
<a href="{% url "account:login" %}">登录</a>
|
||||
</p>
|
||||
|
||||
</div> <!-- /container -->
|
||||
{% endblock %}
|
||||
@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>记录日期</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<ul>
|
||||
{% for date in results %}
|
||||
<li>
|
||||
<a href="{% url 'owntracks:show_maps' %}?date={{ date }}" target="_blank">{{ date }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,3 +0,0 @@
|
||||
{{ object.title }}
|
||||
{{ object.author.username }}
|
||||
{{ object.body }}
|
||||
@ -1,66 +0,0 @@
|
||||
{% extends 'share_layout/base.html' %}
|
||||
{% load blog_tags %}
|
||||
{% block header %}
|
||||
<title>{{ SITE_NAME }} | {{ SITE_DESCRIPTION }}</title>
|
||||
<meta name="description" content="{{ SITE_SEO_DESCRIPTION }}"/>
|
||||
<meta name="keywords" content="{{ SITE_KEYWORDS }}"/>
|
||||
<meta property="og:type" content="blog"/>
|
||||
<meta property="og:title" content="{{ SITE_NAME }}"/>
|
||||
<meta property="og:description" content="{{ SITE_DESCRIPTION }}"/>
|
||||
<meta property="og:url" content="{{ SITE_BASE_URL }}"/>
|
||||
<meta property="og:site_name" content="{{ SITE_NAME }}"/>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div id="primary" class="site-content">
|
||||
<div id="content" role="main">
|
||||
{% if query %}
|
||||
<header class="archive-header">
|
||||
{% if suggestion %}
|
||||
<h2 class="archive-title">
|
||||
已显示<span style="color: red"> “{{ suggestion }}” </span>的搜索结果。
|
||||
仍然搜索:<a style="text-transform: none;" href="/search/?q={{ query }}&is_suggest=no">{{ query }}</a> <br>
|
||||
</h2>
|
||||
{% else %}
|
||||
<h2 class="archive-title">
|
||||
搜索:<span style="color: red">{{ query }} </span>
|
||||
</h2>
|
||||
{% endif %}
|
||||
</header><!-- .archive-header -->
|
||||
{% endif %}
|
||||
{% if query and page.object_list %}
|
||||
{% for article in page.object_list %}
|
||||
{% load_article_detail article.object True user %}
|
||||
{% endfor %}
|
||||
{% if page.has_previous or page.has_next %}
|
||||
<nav id="nav-below" class="navigation" role="navigation">
|
||||
<h3 class="assistive-text">文章导航</h3>
|
||||
{% if page.has_previous %}
|
||||
<div class="nav-previous"><a
|
||||
href="?q={{ query }}&page={{ page.previous_page_number }}"><span
|
||||
class="meta-nav">←</span> 早期文章</a></div>
|
||||
{% endif %}
|
||||
{% if page.has_next %}
|
||||
<div class="nav-next"><a href="?q={{ query }}&page={{ page.next_page_number }}">较新文章
|
||||
<span
|
||||
class="meta-nav">→</span></a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</nav><!-- .navigation -->
|
||||
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<header class="archive-header">
|
||||
|
||||
<h1 class="archive-title">哎呀,关键字:<span>{{ query }}</span>没有找到结果,要不换个词再试试?</h1>
|
||||
</header><!-- .archive-header -->
|
||||
{% endif %}
|
||||
</div><!-- #content -->
|
||||
</div><!-- #primary -->
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block sidebar %}
|
||||
{% load_sidebar request.user 'i' %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
<aside id="text-2" class="widget widget_text"><h3 class="widget-title">Google AdSense</h3>
|
||||
<div class="textwidget">
|
||||
|
||||
{{ GOOGLE_ADSENSE_CODES }}
|
||||
</div>
|
||||
</aside>
|
||||
@ -1,157 +0,0 @@
|
||||
{% load static %}
|
||||
{% load cache %}
|
||||
{% load i18n %}
|
||||
{% load compress %}
|
||||
<!DOCTYPE html>
|
||||
<!--[if IE 7]>
|
||||
<html class="ie ie7" lang="zh-CN"
|
||||
prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#">
|
||||
<![endif]-->
|
||||
<!--[if IE 8]>
|
||||
<html class="ie ie8" lang="zh-CN"
|
||||
prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#">
|
||||
<![endif]-->
|
||||
<!--[if !(IE 7) & !(IE 8)]><!-->
|
||||
<html lang="zh-CN" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#">
|
||||
<!--<![endif]-->
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<meta name="format-detection" content="telephone=no"/>
|
||||
<meta name="theme-color" content="#21759b"/>
|
||||
{% load blog_tags %}
|
||||
{% head_meta %}
|
||||
{% block header %}
|
||||
<!-- SEO插件会自动生成title、description、keywords等标签 -->
|
||||
{% endblock %}
|
||||
<link rel="profile" href="http://gmpg.org/xfn/11"/>
|
||||
|
||||
<!-- DNS预解析 -->
|
||||
<link rel="dns-prefetch" href="//cdn.mathjax.org"/>
|
||||
<link rel="dns-prefetch" href="//cdn.jsdelivr.net"/>
|
||||
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin/>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="{% static 'blog/js/html5.js' %}" type="text/javascript"></script>
|
||||
<![endif]-->
|
||||
|
||||
<!-- RSS和图标 -->
|
||||
<link rel="alternate" type="application/rss+xml" title="{{ SITE_NAME }} » Feed" href="/feed"/>
|
||||
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="icon" href="/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="apple-touch-icon" href="/favicon.ico"/>
|
||||
|
||||
<!-- 本地字体加载 -->
|
||||
<link rel="stylesheet" href="{% static 'blog/fonts/open-sans.css' %}">
|
||||
|
||||
<!-- 新增:阅读进度条样式 -->
|
||||
<style>
|
||||
#reading-progress-bar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 3px;
|
||||
background-color: #007bff; /* 你可以更改进度条颜色 */
|
||||
z-index: 9999; /* 确保在最上层 */
|
||||
width: 0%;
|
||||
transition: width 0.1s ease; /* 平滑过渡效果 */
|
||||
}
|
||||
</style>
|
||||
|
||||
{% compress css %}
|
||||
|
||||
<link rel='stylesheet' id='twentytwelve-style-css' href='{% static 'blog/css/style.css' %}' type='text/css'
|
||||
media='all'/>
|
||||
<link href="{% static 'blog/css/oauth_style.css' %}" rel="stylesheet">
|
||||
{% comment %}<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>{% endcomment %}
|
||||
<!--[if lt IE 9]>
|
||||
<link rel='stylesheet' id='twentytwelve-ie-css' href='{% static 'blog/css/ie.css' %}' type='text/css' media='all' />
|
||||
<![endif]-->
|
||||
<link rel="stylesheet" href="{% static 'pygments/default.css' %}"/>
|
||||
<link rel="stylesheet" href="{% static 'blog/css/nprogress.css' %}">
|
||||
{% block compress_css %}
|
||||
{% endblock %}
|
||||
{% endcompress %}
|
||||
|
||||
{% if GLOBAL_HEADER %}
|
||||
{{ GLOBAL_HEADER|safe }}
|
||||
{% endif %}
|
||||
</head>
|
||||
|
||||
<body class="home blog custom-font-enabled">
|
||||
<!-- 新增:阅读进度条 DOM 元素 -->
|
||||
<div id="reading-progress-bar"></div>
|
||||
|
||||
<div id="page" class="hfeed site">
|
||||
<header id="masthead" class="site-header" role="banner">
|
||||
<hgroup>
|
||||
<h1 class="site-title"><a href="/" title="{{ SITE_NAME }}" rel="home">{{ SITE_NAME }}</a>
|
||||
</h1>
|
||||
<h2 class="site-description">{{ SITE_DESCRIPTION }}</h2>
|
||||
</hgroup>
|
||||
{% load i18n %}
|
||||
{% include 'share_layout/nav.html' %}
|
||||
</header><!-- #masthead -->
|
||||
|
||||
<div id="main" class="wrapper">
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{% endblock %}
|
||||
</div><!-- #main .wrapper -->
|
||||
|
||||
{% include 'share_layout/footer.html' %}
|
||||
</div><!-- #page -->
|
||||
|
||||
<!-- JavaScript资源 -->
|
||||
{% compress js %}
|
||||
<script src="{% static 'blog/js/jquery-3.6.0.min.js' %}"></script>
|
||||
<script src="{% static 'blog/js/nprogress.js' %}"></script>
|
||||
<script src="{% static 'blog/js/blog.js' %}"></script>
|
||||
<script src="{% static 'blog/js/navigation.js' %}"></script>
|
||||
{% block compress_js %}
|
||||
{% endblock %}
|
||||
{% endcompress %}
|
||||
|
||||
<!-- MathJax智能加载器 -->
|
||||
<script src="{% static 'blog/js/mathjax-loader.js' %}" async defer></script>
|
||||
|
||||
<!-- 新增:阅读进度条 JavaScript -->
|
||||
<script>
|
||||
(function($) {
|
||||
$(document).ready(function() {
|
||||
var $progressBar = $('#reading-progress-bar');
|
||||
var $articleContent = $('#article-content'); // 假设文章内容容器的ID是 'article-content'
|
||||
|
||||
// 仅在文章详情页执行
|
||||
if ($articleContent.length > 0) {
|
||||
var articleTop = $articleContent.offset().top;
|
||||
var articleHeight = $articleContent.outerHeight();
|
||||
var windowHeight = $(window).height();
|
||||
var scrollableDistance = articleHeight - windowHeight;
|
||||
|
||||
$(window).on('scroll', function() {
|
||||
var scrollPosition = $(window).scrollTop();
|
||||
|
||||
// 计算阅读进度百分比
|
||||
var scrollPercent = (scrollPosition - articleTop) / scrollableDistance;
|
||||
|
||||
// 确保百分比在 0 到 1 之间
|
||||
scrollPercent = Math.max(0, Math.min(1, scrollPercent));
|
||||
|
||||
// 更新进度条宽度
|
||||
$progressBar.css('width', (scrollPercent * 100) + '%');
|
||||
});
|
||||
|
||||
// 初始化时触发一次滚动事件,以设置初始状态
|
||||
$(window).trigger('scroll');
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
||||
|
||||
{% block footer %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
@ -1,47 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{% load static %}
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
<link rel="icon" href="../../favicon.ico">
|
||||
<meta name="robots" content="noindex">
|
||||
<title>{{ SITE_NAME }} | {{ SITE_DESCRIPTION }}</title>
|
||||
<link href="{% static 'account/css/account.css' %}" rel="stylesheet">
|
||||
{% load compress %}
|
||||
{% compress css %}
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="{% static 'assets/css/bootstrap.min.css' %}" rel="stylesheet">
|
||||
<link href="{% static 'blog/css/oauth_style.css' %}" rel="stylesheet">
|
||||
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
|
||||
<link href="{% static 'assets/css/ie10-viewport-bug-workaround.css' %}" rel="stylesheet">
|
||||
<!-- TODC Bootstrap core CSS -->
|
||||
<link href="{% static 'assets/css/todc-bootstrap.min.css' %}" rel="stylesheet">
|
||||
<!-- Custom styles for this template -->
|
||||
<link href="{% static 'assets/css/signin.css' %}" rel="stylesheet">
|
||||
{% endcompress %}
|
||||
{% compress js %}
|
||||
<script src="{% static 'assets/js/ie10-viewport-bug-workaround.js' %}"></script>
|
||||
<script src="{% static 'assets/js/ie-emulation-modes-warning.js' %}"></script>
|
||||
{% endcompress %}
|
||||
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
|
||||
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
|
||||
|
||||
</body>
|
||||
<script type="text/javascript" src="{% static 'blog/js/jquery-3.6.0.min.js' %}"></script>
|
||||
<script src="{% static 'account/js/account.js' %}" type="text/javascript"></script>
|
||||
</html>
|
||||
@ -1,56 +0,0 @@
|
||||
<footer id="colophon" role="contentinfo">
|
||||
<div class="site-info" style="text-align: center">
|
||||
Copyright© {{ CURRENT_YEAR }}
|
||||
<a href="/" target="blank">{{ SITE_NAME }}</a>
|
||||
|
|
||||
|
||||
<a href="/sitemap.xml" title="SiteMap" target="_blank">
|
||||
SiteMap
|
||||
</a>
|
||||
|
|
||||
<a href="/feed" title="RSS Feed" target="_blank">
|
||||
RSS Feed
|
||||
</a>
|
||||
|
|
||||
<a href="/links.html" title="友情链接" rel="nofollow" target="_blank">
|
||||
友情链接
|
||||
</a>
|
||||
| Hosting On
|
||||
<a href="https://www.linode.com/?r=b0d38794d05ef8816b357a929106e89b7c6452f9" target="blank" rel="nofollow">Linode</a>
|
||||
|
||||
|
|
||||
<a href="https://tongji.baidu.com/sc-web/3478620/home/ico?siteId=11261596" target="_blank"
|
||||
rel="nofollow">百度统计</a>
|
||||
|
||||
</div>
|
||||
<div class="site-info" style="text-align: center">
|
||||
Powered by
|
||||
<a href="https://www.djangoproject.com/" rel="nofollow" target="blank">Django</a>
|
||||
|
|
||||
<a href="https://github.com/liangliangyy/DjangoBlog" rel="nofollow" target="blank">liangliangyy</a>
|
||||
|
|
||||
<a href="https://www.lylinux.net" target="blank">lylinux</a>
|
||||
|
|
||||
本页面加载耗时:<!!LOAD_TIMES!!>s
|
||||
</div>
|
||||
{% if BEIAN_CODE %}
|
||||
<div class="site-info" style="text-align: center">
|
||||
<a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">
|
||||
<p style=" height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;">
|
||||
{{ BEIAN_CODE }}
|
||||
</p>
|
||||
</a>
|
||||
{% if BEIAN_CODE_GONGAN and SHOW_GONGAN_CODE %}
|
||||
{{ BEIAN_CODE_GONGAN |safe }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if ANALYTICS_CODE %}
|
||||
{{ ANALYTICS_CODE| safe }}
|
||||
{% endif %}
|
||||
{% if GLOBAL_FOOTER %}
|
||||
{{ GLOBAL_FOOTER|safe }}
|
||||
{% endif %}
|
||||
</footer><!-- #colophon -->
|
||||
|
||||
|
||||
@ -1,131 +0,0 @@
|
||||
{% load i18n %}
|
||||
{% load blog_tags %} <!-- 确保 blog_tags 已加载 -->
|
||||
|
||||
<nav id="site-navigation" class="main-navigation" role="navigation">
|
||||
<div class="menu-%e8%8f%9c%e5%8d%95-container">
|
||||
<ul id="menu-%e8%8f%9c%e5%8d%95" class="nav-menu">
|
||||
<li id="menu-item-3498"
|
||||
class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-3498">
|
||||
<a href="/">{% trans 'index' %}</a></li>
|
||||
|
||||
{% query nav_category_list parent_category=None as root_categorys %}
|
||||
{% for node in root_categorys %}
|
||||
{% include 'share_layout/nav_node.html' %}
|
||||
{% endfor %}
|
||||
|
||||
{% if nav_pages %}
|
||||
{% for node in nav_pages %}
|
||||
<li id="menu-item-{{ node.pk }}"
|
||||
class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-{{ node.pk }}">
|
||||
<a href="{{ node.get_absolute_url }}">{{ node.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
<li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children">
|
||||
<a href="{% url "blog:archives" %}">{% trans 'Article archive' %}</a>
|
||||
</li>
|
||||
|
||||
<!-- 新增:用户菜单 -->
|
||||
<li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children user-menu">
|
||||
{% if user.is_authenticated %}
|
||||
<a href="javascript:void(0);">
|
||||
{% if user.profile.avatar %}
|
||||
<img src="{{ user.profile.avatar.url }}" alt="{{ user.username }}" class="avatar">
|
||||
{% else %}
|
||||
<i class="fas fa-user"></i>
|
||||
{% endif %}
|
||||
{{ user.username }}
|
||||
</a>
|
||||
<ul class="sub-menu">
|
||||
<li class="menu-item">
|
||||
<a href="{% url 'blog:user_profile' username=user.username %}">
|
||||
<i class="fas fa-id-card"></i> {% trans 'My Profile' %}
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-item">
|
||||
<a href="{% url 'blog:user_profile_update' %}">
|
||||
<i class="fas fa-edit"></i> {% trans 'Edit Profile' %}
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-item">
|
||||
<a href="{% url 'account:logout' %}"> <!-- 假设你的登出URL名称是 account:logout -->
|
||||
<i class="fas fa-sign-out-alt"></i> {% trans 'Logout' %}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% else %}
|
||||
<a href="{% url 'account:login' %}"> <!-- 假设你的登录URL名称是 account:login -->
|
||||
<i class="fas fa-sign-in-alt"></i> {% trans 'Login / Register' %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
<!-- 用户菜单结束 -->
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</nav><!-- #site-navigation -->
|
||||
|
||||
<!-- 新增:引入 Font Awesome 用于显示图标 -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
|
||||
|
||||
<!-- 新增:一些简单的 CSS 来美化用户菜单 -->
|
||||
<style>
|
||||
/* 让用户菜单靠右浮动 */
|
||||
.nav-menu .user-menu {
|
||||
float: right;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* 美化头像 */
|
||||
.nav-menu .user-menu .avatar {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border-radius: 50%;
|
||||
vertical-align: middle;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
/* 子菜单样式 */
|
||||
.nav-menu .user-menu .sub-menu {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
right: 0;
|
||||
background: #fff;
|
||||
min-width: 180px;
|
||||
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
||||
padding: 10px 0;
|
||||
z-index: 1000;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.nav-menu .user-menu:hover .sub-menu {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.nav-menu .user-menu .sub-menu li {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.nav-menu .user-menu .sub-menu a {
|
||||
display: block;
|
||||
padding: 10px 20px;
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.nav-menu .user-menu .sub-menu a:hover {
|
||||
background-color: #f5f5f5;
|
||||
color: #007bff;
|
||||
}
|
||||
|
||||
.nav-menu .user-menu .sub-menu i {
|
||||
width: 20px; /* 图标宽度固定,使文字对齐 */
|
||||
text-align: center;
|
||||
margin-right: 8px;
|
||||
}
|
||||
</style>
|
||||
@ -1,19 +0,0 @@
|
||||
<li id="menu-item-{{ node.pk }}"
|
||||
class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-{{ node.pk }}">
|
||||
<a href="{{ node.get_absolute_url }}">{{ node.name }}</a>
|
||||
{% load blog_tags %}
|
||||
{% query nav_category_list parent_category=node as child_categorys %}
|
||||
{% if child_categorys %}
|
||||
|
||||
<ul class="sub-menu">
|
||||
{% for child in child_categorys %}
|
||||
{% with node=child template_name="share_layout/nav_node.html" %}
|
||||
{% include template_name %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
|
||||
|
||||
Loading…
Reference in new issue