order thinks on the front page by time of last edit
instead of time of creation
This commit is contained in:
parent
dcdb3d87be
commit
4f92cbf450
5 changed files with 35 additions and 3 deletions
|
@ -32,6 +32,9 @@ class JJController:
|
|||
if force or not (self.root / '.jj').exists():
|
||||
self.run(['jj','git','init'])
|
||||
self.ignore_paths(['.make.*'])
|
||||
self.set_git_url()
|
||||
|
||||
def set_git_url(self):
|
||||
git_url = settings.GIT_REPO_URL_TEMPLATE.format(name=self.think.slug)
|
||||
self.run(['jj','git','remote','add','origin', git_url])
|
||||
|
||||
|
|
18
thinks/migrations/0005_think_last_edited.py
Normal file
18
thinks/migrations/0005_think_last_edited.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 5.0.3 on 2025-04-26 07:50
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('thinks', '0004_think_creation_time'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='think',
|
||||
name='last_edited',
|
||||
field=models.DateTimeField(blank=True, null=True),
|
||||
),
|
||||
]
|
|
@ -13,6 +13,7 @@ class Think(models.Model):
|
|||
slug = models.SlugField()
|
||||
category = models.CharField(max_length=100, blank=True, null=True)
|
||||
creation_time = models.DateTimeField(auto_now_add=True)
|
||||
last_edited = models.DateTimeField(blank=True, null=True)
|
||||
|
||||
is_template = models.BooleanField(default=False)
|
||||
|
||||
|
|
|
@ -33,7 +33,8 @@ body {
|
|||
|
||||
display: grid;
|
||||
grid-template-rows: auto 1fr;
|
||||
min-height: 100vh;
|
||||
min-height: 100svh;
|
||||
max-height: 100svh;
|
||||
margin: 0;
|
||||
padding: var(--half-spacing);
|
||||
|
||||
|
@ -128,8 +129,8 @@ input[type="file"] {
|
|||
overflow: hidden;
|
||||
--col-1-width: auto;
|
||||
grid-template:
|
||||
"nav editor preview" min-content
|
||||
"log editor preview" 1fr
|
||||
"nav editor preview" 1fr
|
||||
"log log log" min-content
|
||||
/ var(--col-1-width) var(--editor-size) var(--preview-size)
|
||||
;
|
||||
|
||||
|
|
9
thinks/templates/thinks/think_form.html
Normal file
9
thinks/templates/thinks/think_form.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
<html>
|
||||
<body>
|
||||
<form method="POST" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{{form}}
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue