Add template for results; remove some unused code

This commit is contained in:
Daoud Clarke 2023-10-29 14:22:25 +00:00
parent 95f9c56ba6
commit ff212d6e15
3 changed files with 18 additions and 25 deletions

View file

@ -0,0 +1,16 @@
{% for result in results %}
<div class="result-container">
<div class="curation-buttons">
<button class="curation-button curate-delete" is="delete-button"></button>
<button class="curation-button curate-approve" is="validate-button"></button>
<button class="curation-button curate-add" is="add-button"></button>
</div>
<div class="result-link">
<a href="{{result.url}}">
<p class='link'>{{result.url}}}</p>
<p class='title'>{{result.title}}</p>
<p class='extract'>{{result.extract}}</p>
</a>
</div>
</div>
{% end for %}

View file

@ -15,12 +15,10 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.contrib.auth import login, logout
from django.template.defaulttags import url
from django.urls import path, include
from mwmbl.api import api_original as api, api_v1
from mwmbl.views import signup, profile
from mwmbl.views import profile
urlpatterns = [
path('admin/', admin.site.urls),
@ -28,9 +26,5 @@ urlpatterns = [
path('api/v1/', api_v1.urls),
path('accounts/', include('allauth.urls')),
# path("accounts/", include("django.contrib.auth.urls")),
# path('accounts/new/', signup, name='signup'),
path('accounts/profile/', profile, name='profile'),
# path('login/', login, {'template_name': 'login.html'}, name='login'),
# path('logout/', logout, {'next_page': 'login'}, name='logout'),
]

View file

@ -1,22 +1,5 @@
from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import UserCreationForm
from django.shortcuts import redirect, render
def signup(request):
if request.method == 'POST':
form = UserCreationForm(request.POST)
if form.is_valid():
form.save()
username = form.cleaned_data.get('username')
raw_password = form.cleaned_data.get('password1')
user = authenticate(username=username, password=raw_password)
login(request, user)
return redirect('/')
else:
form = UserCreationForm()
return render(request, 'signup.html', {'form': form})
from django.shortcuts import render
@login_required