Compare commits
1 commit
c12f637d17
...
94643dc2c7
Author | SHA1 | Date | |
---|---|---|---|
![]() |
94643dc2c7 |
4 changed files with 0 additions and 17 deletions
|
@ -32,9 +32,6 @@ class JJController:
|
||||||
if force or not (self.root / '.jj').exists():
|
if force or not (self.root / '.jj').exists():
|
||||||
self.run(['jj','git','init'])
|
self.run(['jj','git','init'])
|
||||||
self.ignore_paths(['.make.*'])
|
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)
|
git_url = settings.GIT_REPO_URL_TEMPLATE.format(name=self.think.slug)
|
||||||
self.run(['jj','git','remote','add','origin', git_url])
|
self.run(['jj','git','remote','add','origin', git_url])
|
||||||
|
|
||||||
|
|
|
@ -7,15 +7,6 @@
|
||||||
{% endblock header %}
|
{% endblock header %}
|
||||||
|
|
||||||
{% block main %}
|
{% 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">
|
<section id="templates">
|
||||||
<h2>Templates</h2>
|
<h2>Templates</h2>
|
||||||
<ul id="templates-list">
|
<ul id="templates-list">
|
||||||
|
|
|
@ -18,6 +18,5 @@ urlpatterns = [
|
||||||
path('think/<slug:slug>/jj/commit', JJCommitView.as_view(), name='jj_commit'),
|
path('think/<slug:slug>/jj/commit', JJCommitView.as_view(), name='jj_commit'),
|
||||||
path('new', CreateThinkView.as_view(), name='new_think'),
|
path('new', CreateThinkView.as_view(), name='new_think'),
|
||||||
path('new/<slug:slug>', RemixThinkView.as_view(), name='remix_think'),
|
path('new/<slug:slug>', RemixThinkView.as_view(), name='remix_think'),
|
||||||
path('search', search, name='search'),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -33,10 +33,6 @@ class ThinkMixin(LoginRequiredMixin):
|
||||||
model = Think
|
model = Think
|
||||||
context_object_name = '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):
|
class IndexView(ThinkMixin, generic.ListView):
|
||||||
template_name = 'thinks/index.html'
|
template_name = 'thinks/index.html'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue