|
@@ -38,6 +38,104 @@
|
|
|
<link rel="stylesheet" href="{% static 'highlightjs/styles/androidstudio.min.css' %}">
|
|
|
<link rel="stylesheet" href="{% static 'css/fonts.css' %}">
|
|
|
<link rel="shortcut icon" href="{% static 'favicon.ico' %}">
|
|
|
+ <style>
|
|
|
+ :root {
|
|
|
+ --primary: #000000;
|
|
|
+ --bg-light: #f8f8f8;
|
|
|
+ --text: #333;
|
|
|
+ --gray: #666;
|
|
|
+ --line-height: 1.8;
|
|
|
+ --max-width: 900px;
|
|
|
+ --sidebar-width: 300px;
|
|
|
+ }
|
|
|
+ body {
|
|
|
+ color: var(--text);
|
|
|
+ background-color: #fff;
|
|
|
+ line-height: var(--line-height);
|
|
|
+ }
|
|
|
+
|
|
|
+ a {
|
|
|
+ color: var(--primary);
|
|
|
+ transition: color .2s;
|
|
|
+ }
|
|
|
+
|
|
|
+ a:hover {
|
|
|
+ color: darken(var(--primary), 10%);
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 主容器:限制最大宽度并居中 */
|
|
|
+ .ui.grid.stackable.container {
|
|
|
+ max-width: var(--max-width);
|
|
|
+ margin: 2rem auto;
|
|
|
+ padding: 0 1rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 段落与标题留白 */
|
|
|
+ p {
|
|
|
+ margin-bottom: 1rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ h2.ui.header {
|
|
|
+ margin-top: 2rem;
|
|
|
+ margin-bottom: 1rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 卡片式内容区 */
|
|
|
+ .eleven.wide.column {
|
|
|
+ background: #fff;
|
|
|
+ padding: 2rem;
|
|
|
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
|
|
|
+ border-radius: 4px;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 代码块滚动与样式 */
|
|
|
+ .pre {
|
|
|
+ overflow-x: auto;
|
|
|
+ padding: 1rem;
|
|
|
+ background: #fafafa;
|
|
|
+ border-left: 3px solid var(--primary);
|
|
|
+ margin: 1.5rem 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 顶部菜单去掉死板的灰色,增加一点阴影 */
|
|
|
+ .ui.top.fixed.menu {
|
|
|
+ background: #fff;
|
|
|
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 菜单项内边距更舒适 */
|
|
|
+ .ui.menu .item {
|
|
|
+ padding: 0.8rem 1.2rem;
|
|
|
+ font-size: 1rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 移动端:展开动画更顺滑 */
|
|
|
+ .ui.vertical.menu {
|
|
|
+ transition: max-height .3s ease-out;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ui.vertical.menu.collapsed {
|
|
|
+ max-height: 0 !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ui.vertical.menu.expanded {
|
|
|
+ max-height: 500px !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 右侧 Archiv/Top 区域在大屏下保持粘性 */
|
|
|
+ .four.wide.right.floated.column {
|
|
|
+ position: sticky;
|
|
|
+ top: 80px; /* 根据你的导航高度微调 */
|
|
|
+ max-width: var(--sidebar-width);
|
|
|
+ margin-left: 2rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 调整归档和标签列表间距 */
|
|
|
+ .ui.list .item {
|
|
|
+ padding: .5rem 0;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
|
|
|
<style type="text/css">
|
|
|
p > a > img {
|
|
@@ -144,7 +242,7 @@
|
|
|
<div class="ui tablet computer only padded grid">
|
|
|
<div class="ui top fixed borderless fluid huge menu">
|
|
|
<div class="ui container">
|
|
|
- <a href="/" class="header item"><img style="width: 7em;" src="{% static '/img.png' %}"/></a>
|
|
|
+ <a href="/" class="header item " >CyberSicko.net</a>
|
|
|
<a href="/" class="item">主页</a>
|
|
|
|
|
|
{% for item in category %}
|
|
@@ -164,7 +262,7 @@
|
|
|
</div>
|
|
|
<div class="ui mobile only padded grid">
|
|
|
<div class="ui top fixed borderless huge fluid menu">
|
|
|
- <a href="/" class="header item"><img style="width: 7em;" src="{% static '/img.png' %}"/></a>
|
|
|
+ <a href="/" class="header item " >CyberSicko.net</a>
|
|
|
<div class="right menu">
|
|
|
<div class="item">
|
|
|
<button class="ui icon toggle basic button">
|
|
@@ -235,12 +333,13 @@
|
|
|
|
|
|
</div>
|
|
|
|
|
|
- <form onsubmit="save()" method="post" action="/comment/add" id="comment_form" style="margin-top: 10px"
|
|
|
+ <form method="post" action="/comment/add" id="comment_form" style="margin-top: 10px"
|
|
|
class="ui form">
|
|
|
{% csrf_token %}
|
|
|
<input hidden="hidden" name="article_id" value="{{ article.id }}">
|
|
|
+ <input hidden="hidden" name="article_title" value="{{ article.title }}">
|
|
|
<h4 class="ui dividing header">发表评论</h4>
|
|
|
-
|
|
|
+ <input id="veryCode" type="text" name="veryCode" hidden="hidden">
|
|
|
<div class="field">
|
|
|
<div class="two fields">
|
|
|
<div class="field">
|
|
@@ -328,19 +427,34 @@
|
|
|
<a class="item" href="/date/{{ record.datetime }}?page=1">{{ record.datetime }}
|
|
|
({{ record.count }})</a>
|
|
|
{% endfor %}
|
|
|
-
|
|
|
</div>
|
|
|
+
|
|
|
<h4 class="ui header">Top</h4>
|
|
|
<div class="ui list">
|
|
|
{% for tag in tags %}
|
|
|
<a class="item" href="/tag/{{ tag.name }}?page=1">{{ tag.name }} ({{ tag.count }})</a>
|
|
|
{% endfor %}
|
|
|
-
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
+<div class="ui mini test modal">
|
|
|
+ <div class="header">
|
|
|
+ 请输入验证码
|
|
|
+ </div>
|
|
|
+ <div class="content">
|
|
|
+ <p id="veryCodeSet"></p>
|
|
|
+ <div class="ui input">
|
|
|
+ <input id="veryCodeInput" type="text" placeholder="请输入验证码">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="actions">
|
|
|
+ <a onclick="submitComment()" id="confirmBtn" class="ui positive right labeled icon button">
|
|
|
+ 确认
|
|
|
+ <i class="checkmark icon"></i>
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
|
|
|
<footer style="margin-top: 50px" class="ui secondary segment">
|
|
|
<div class="ui two column stackable grid">
|
|
@@ -382,15 +496,47 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- function save() {
|
|
|
+ function submitComment() {
|
|
|
+ var veryCodeInput = $("#veryCodeInput").val()
|
|
|
+ $("#veryCode").attr("value", veryCodeInput)
|
|
|
+ document.getElementById("comment_form").submit()
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ document.getElementById("comment_form").addEventListener("submit", function (event) {
|
|
|
+ event.preventDefault(); // 阻止表单提交
|
|
|
+ // 表单验证逻辑
|
|
|
+ var veryCode = $('#veryCode').val()
|
|
|
+ if (veryCode === undefined || veryCode === '') {
|
|
|
+ getVeryCode()
|
|
|
+ return
|
|
|
+ }
|
|
|
var data = $('#comment_form').serializeArray();
|
|
|
+
|
|
|
localStorage.setItem('nick_name', $('#nick_name').val())
|
|
|
localStorage.setItem('email', $('#email').val())
|
|
|
localStorage.setItem('website', $('#website').val())
|
|
|
return true
|
|
|
- }
|
|
|
+ // 其他处理逻辑
|
|
|
+ });
|
|
|
+
|
|
|
</script>
|
|
|
<script>
|
|
|
+
|
|
|
+ function getVeryCode() {
|
|
|
+ $.ajax('/comment/getVeryCode', {
|
|
|
+ method: 'get',
|
|
|
+ contentType: false,
|
|
|
+ processData: false,
|
|
|
+ success: function (res) {
|
|
|
+ $('.mini.modal').modal('show')
|
|
|
+ $("#veryCodeSet").html("请输入数字: " + res.data)
|
|
|
+ },
|
|
|
+ error: function (err) {
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
$(document).ready(function () {
|
|
|
$(".ui.toggle.button").click(function () {
|
|
|
$(".mobile.only.grid .ui.vertical.menu").toggle(100);
|