Compare commits

..

1 commit

Author SHA1 Message Date
Christian Lawson-Perfect
94643dc2c7 order thinks on the front page by time of last edit
instead of time of creation
2025-05-04 08:22:31 +01:00
4 changed files with 0 additions and 17 deletions

View file

@ -32,9 +32,6 @@ 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])

View file

@ -7,15 +7,6 @@
{% endblock header %}
{% block main %}
<form id="search" method="GET" action="{% url 'search' %}">
<label for="query">Search</label>
<input type="search" id="query" name="query" list="slugs">
<datalist id="slugs">
{% for think in thinks %}<option value="{{think.slug}}"/>{% endfor %}
</datalist>
</form>
<section id="templates">
<h2>Templates</h2>
<ul id="templates-list">

View file

@ -18,6 +18,5 @@ urlpatterns = [
path('think/<slug:slug>/jj/commit', JJCommitView.as_view(), name='jj_commit'),
path('new', CreateThinkView.as_view(), name='new_think'),
path('new/<slug:slug>', RemixThinkView.as_view(), name='remix_think'),
path('search', search, name='search'),
]

View file

@ -33,10 +33,6 @@ class ThinkMixin(LoginRequiredMixin):
model = Think
context_object_name = 'think'
def search(request, *args, **kwargs):
query = request.GET.get('query','')
think = Think.objects.get(slug__icontains=query)
return redirect(think.get_absolute_url())
class IndexView(ThinkMixin, generic.ListView):
template_name = 'thinks/index.html'