加入「拾源」:想法 → GitHub 条件 → 仓库 → AI 解读与存档
- 新增 explore 应用:Idea / SearchSpec / Repository / Note 及迁移 - Ollama 生成 GitHub 检索条件(language / stars / topic / sort),并批量解读仓库简介 - 接入 GitHub 仓库搜索 REST API,结果入库并按想法关联 - 想法级与仓库级「我的其他思考」,支持多条添加与删除 - 新增存档页:按想法 / 有想法的仓库两个视角,跨想法合并仓库 - 前端 /explore/ 四步流程、条件展示、筛选器、AI 解读目录、?idea= 恢复现场 - settings 增加 OLLAMA_* / GITHUB_* 配置
This commit is contained in:
@@ -0,0 +1,173 @@
|
||||
{% extends "base_content.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}拾源 · 存档{% endblock %}
|
||||
{% block description %}按想法回看每次检索与思考,也可以从有过想法的仓库倒查。{% endblock %}
|
||||
{% block brand_sub %}MIND MAP · ARCHIVE{% endblock %}
|
||||
{% block footer %}© 2026 拾光<span class="dot"></span>向外探索 · 向内生长{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="ar">
|
||||
|
||||
<header class="ar-head">
|
||||
<p class="ar-eyebrow"><span aria-hidden="true">✦</span>拾源 · ARCHIVE</p>
|
||||
<h1>想法与仓库的存档</h1>
|
||||
<p class="ar-sub">按想法回看每次检索和思考,也可以从「有想法的仓库」倒着找回来。</p>
|
||||
<a class="ar-back" href="{% url 'blog:explore' %}">← 回到拾源</a>
|
||||
</header>
|
||||
|
||||
<nav class="ar-tabs" aria-label="存档视角">
|
||||
<a class="ar-tab{% if view == 'ideas' %} is-active{% endif %}" href="?view=ideas">
|
||||
按想法 <b>{{ idea_total }}</b>
|
||||
</a>
|
||||
<a class="ar-tab{% if view == 'repos' %} is-active{% endif %}" href="?view=repos">
|
||||
有想法的仓库 <b>{{ repo_total }}</b>
|
||||
</a>
|
||||
</nav>
|
||||
|
||||
{% if view == 'ideas' %}
|
||||
<div class="ar-list">
|
||||
{% for card in idea_cards %}
|
||||
<article class="ar-card">
|
||||
<header class="ar-card-head">
|
||||
<a class="ar-title" href="{% url 'blog:explore' %}?idea={{ card.idea.id }}"
|
||||
title="{{ card.idea.text }}">{{ card.idea.text|truncatechars:78 }}</a>
|
||||
<time>{{ card.idea.created_at|date:"Y-m-d H:i" }}</time>
|
||||
</header>
|
||||
|
||||
<div class="ar-stats">
|
||||
<span><b>{{ card.idea.spec_count }}</b> 次提炼</span>
|
||||
<span><b>{{ card.idea.repo_count }}</b> 个仓库</span>
|
||||
<span><b>{{ card.idea.idea_note_count }}</b> 条想法思考</span>
|
||||
<span><b>{{ card.idea.repo_note_count }}</b> 条仓库思考</span>
|
||||
</div>
|
||||
|
||||
{% if card.latest %}
|
||||
<div class="ar-spec">
|
||||
<code>{{ card.latest.query }}</code>
|
||||
<div class="ar-conds">
|
||||
{% if card.latest.language %}<span>语言 {{ card.latest.language }}</span>{% endif %}
|
||||
{% if card.latest.min_stars %}<span>Star ≥ {{ card.latest.min_stars }}</span>{% endif %}
|
||||
{% if card.latest.topic %}<span>Topic {{ card.latest.topic }}</span>{% endif %}
|
||||
{% if card.latest.sort %}<span>排序 {% if card.latest.sort == 'stars' %}Star 最多{% else %}最近更新{% endif %}</span>{% endif %}
|
||||
{% if not card.latest.language and not card.latest.min_stars and not card.latest.topic and not card.latest.sort %}
|
||||
<span>仅关键词</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if card.idea_notes %}
|
||||
<div class="ar-notes">
|
||||
<p class="ar-label">关于这个想法</p>
|
||||
{% for note in card.idea_notes %}
|
||||
<div class="ar-note">
|
||||
<p>{{ note.content }}</p>
|
||||
<time>{{ note.created_at|date:"m-d H:i" }}</time>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if card.specs %}
|
||||
<details class="ar-detail">
|
||||
<summary>检索历史 · {{ card.specs|length }} 次</summary>
|
||||
<ul class="ar-spec-list">
|
||||
{% for spec in card.specs %}
|
||||
<li>
|
||||
<time>{{ spec.created_at|date:"m-d H:i" }}</time>
|
||||
<code>{{ spec.query }}</code>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</details>
|
||||
{% endif %}
|
||||
|
||||
{% if card.repos %}
|
||||
<details class="ar-detail">
|
||||
<summary>检索到的仓库 · {{ card.repos|length }}</summary>
|
||||
<ul class="ar-repo-list">
|
||||
{% for repo in card.repos %}
|
||||
<li>
|
||||
<div class="ar-repo-line">
|
||||
<a href="{{ repo.html_url }}" target="_blank" rel="noopener noreferrer">{{ repo.full_name }}</a>
|
||||
<span>★ {{ repo.stars }}</span>
|
||||
{% if repo.notes.all %}<span class="ar-mini">{{ repo.notes.all|length }} 条思考</span>{% endif %}
|
||||
</div>
|
||||
{% if repo.ai_analysis.summary %}
|
||||
<p class="ar-repo-ai">{{ repo.ai_analysis.summary }}</p>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</details>
|
||||
{% endif %}
|
||||
|
||||
<a class="ar-open" href="{% url 'blog:explore' %}?idea={{ card.idea.id }}">打开这条想法 →</a>
|
||||
</article>
|
||||
{% empty %}
|
||||
<div class="ar-empty">
|
||||
<p class="ar-empty-mark" aria-hidden="true">✦</p>
|
||||
<h2>还没有存档</h2>
|
||||
<p>去 <a href="{% url 'blog:explore' %}">拾源</a> 输入第一条想法吧。</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="ar-list">
|
||||
{% for group in repo_groups %}
|
||||
<article class="ar-card ar-repo-card">
|
||||
<header class="ar-card-head">
|
||||
<a class="ar-title" href="{{ group.repo.html_url }}" target="_blank"
|
||||
rel="noopener noreferrer">{{ group.repo.full_name }}</a>
|
||||
<span class="ar-repo-meta">
|
||||
★ {{ group.repo.stars }}
|
||||
{% if group.repo.language %} · {{ group.repo.language }}{% endif %}
|
||||
</span>
|
||||
</header>
|
||||
|
||||
{% if group.repo.description %}
|
||||
<p class="ar-desc">{{ group.repo.description }}</p>
|
||||
{% endif %}
|
||||
|
||||
{% if group.repo.ai_analysis.summary %}
|
||||
<p class="ar-ai"><span>AI</span>{{ group.repo.ai_analysis.summary }}</p>
|
||||
{% endif %}
|
||||
|
||||
<div class="ar-note-list">
|
||||
{% for item in group.notes %}
|
||||
<div class="ar-note">
|
||||
<p>{{ item.note.content }}</p>
|
||||
<footer>
|
||||
<a href="{% url 'blog:explore' %}?idea={{ item.idea.id }}">{{ item.idea.text|truncatechars:44 }}</a>
|
||||
<time>{{ item.note.created_at|date:"Y-m-d H:i" }}</time>
|
||||
</footer>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% if group.idea_list %}
|
||||
<div class="ar-ideas">
|
||||
<span>出现于</span>
|
||||
{% for idea in group.idea_list %}
|
||||
<a href="{% url 'blog:explore' %}?idea={{ idea.id }}">{{ idea.text|truncatechars:24 }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</article>
|
||||
{% empty %}
|
||||
<div class="ar-empty">
|
||||
<p class="ar-empty-mark" aria-hidden="true">✦</p>
|
||||
<h2>还没有仓库思考</h2>
|
||||
<p>在拾源里对某个仓库写下第一条思考,就会出现在这里。</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_css %}
|
||||
<link rel="stylesheet" href="{% static 'blog/css/archive.css' %}">
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user