Update url, views

parent 61b13744
...@@ -38,31 +38,6 @@ ...@@ -38,31 +38,6 @@
</div> </div>
</nav> </nav>
<!-- Masthead -->
<!-- <header class="masthead text-white text-center">
<div class="overlay"></div>
<div class="container">
<div class="row">
<div class="col-xl-9 mx-auto">
<h1 class="mb-5">\_</h1>
</div>
<div class="col-md-10 col-lg-8 col-xl-7 mx-auto">
<form method="POST" action="/search">
<div class="form-row">
<div class="col-12 col-md-9 mb-2 mb-md-0">
<input type="text" class="form-control form-control-lg" name="querysearch" placeholder="Masukkan Query Anda...">
</div>
<div class="col-12 col-md-3">
<button type="submit" class="btn btn-block btn-lg btn-primary">Cari!</button>
</div>
</div>
</form>
</div>
</div>
</div>
</header> -->
<!-- Testimonials --> <!-- Testimonials -->
<section class="testimonials text-center bg-light"> <section class="testimonials text-center bg-light">
<div class="container"> <div class="container">
......
...@@ -38,31 +38,6 @@ ...@@ -38,31 +38,6 @@
</div> </div>
</nav> </nav>
<!-- Masthead -->
<!-- <header class="masthead text-white text-center">
<div class="overlay"></div>
<div class="container">
<div class="row">
<div class="col-xl-9 mx-auto">
<h1 class="mb-5">\_</h1>
</div>
<div class="col-md-10 col-lg-8 col-xl-7 mx-auto">
<form method="POST" action="/search">
<div class="form-row">
<div class="col-12 col-md-9 mb-2 mb-md-0">
<input type="text" class="form-control form-control-lg" name="querysearch" placeholder="Masukkan Query Anda...">
</div>
<div class="col-12 col-md-3">
<button type="submit" class="btn btn-block btn-lg btn-primary">Cari!</button>
</div>
</div>
</form>
</div>
</div>
</div>
</header> -->
<!-- Testimonials --> <!-- Testimonials -->
<section class="testimonials text-center bg-light"> <section class="testimonials text-center bg-light">
<div class="container"> <div class="container">
......
...@@ -38,30 +38,6 @@ ...@@ -38,30 +38,6 @@
</div> </div>
</nav> </nav>
<!-- Masthead -->
<!-- <header class="masthead text-white text-center">
<div class="overlay"></div>
<div class="container">
<div class="row">
<div class="col-xl-9 mx-auto">
<h1 class="mb-5">\_</h1>
</div>
<div class="col-md-10 col-lg-8 col-xl-7 mx-auto">
<form method="POST" action="/search">
<div class="form-row">
<div class="col-12 col-md-9 mb-2 mb-md-0">
<input type="text" class="form-control form-control-lg" name="querysearch" placeholder="Masukkan Query Anda...">
</div>
<div class="col-12 col-md-3">
<button type="submit" class="btn btn-block btn-lg btn-primary">Cari!</button>
</div>
</div>
</form>
</div>
</div>
</div>
</header> -->
<!-- Testimonials --> <!-- Testimonials -->
<section class="testimonials text-center bg-light"> <section class="testimonials text-center bg-light">
......
...@@ -38,30 +38,6 @@ ...@@ -38,30 +38,6 @@
</div> </div>
</nav> </nav>
<!-- Masthead -->
<!-- <header class="masthead text-white text-center">
<div class="overlay"></div>
<div class="container">
<div class="row">
<div class="col-xl-9 mx-auto">
<h1 class="mb-5">\_</h1>
</div>
<div class="col-md-10 col-lg-8 col-xl-7 mx-auto">
<form method="POST" action="/search">
<div class="form-row">
<div class="col-12 col-md-9 mb-2 mb-md-0">
<input type="text" class="form-control form-control-lg" name="querysearch" placeholder="Masukkan Query Anda...">
</div>
<div class="col-12 col-md-3">
<button type="submit" class="btn btn-block btn-lg btn-primary">Cari!</button>
</div>
</div>
</form>
</div>
</div>
</div>
</header> -->
<!-- Testimonials --> <!-- Testimonials -->
<section class="testimonials text-center bg-light"> <section class="testimonials text-center bg-light">
......
...@@ -38,31 +38,6 @@ ...@@ -38,31 +38,6 @@
</div> </div>
</nav> </nav>
<!-- Masthead -->
<!-- <header class="masthead text-white text-center">
<div class="overlay"></div>
<div class="container">
<div class="row">
<div class="col-xl-9 mx-auto">
<h1 class="mb-5">\_</h1>
</div>
<div class="col-md-10 col-lg-8 col-xl-7 mx-auto">
<form method="POST" action="/search">
<div class="form-row">
<div class="col-12 col-md-9 mb-2 mb-md-0">
<input type="text" class="form-control form-control-lg" name="querysearch" placeholder="Masukkan Query Anda...">
</div>
<div class="col-12 col-md-3">
<button type="submit" class="btn btn-block btn-lg btn-primary">Cari!</button>
</div>
</div>
</form>
</div>
</div>
</div>
</header> -->
<!-- Testimonials --> <!-- Testimonials -->
<section class="testimonials text-center bg-light"> <section class="testimonials text-center bg-light">
<div class="container"> <div class="container">
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<div class="col-lg-4"> <div class="col-lg-4">
<div class="testimonial-item mx-auto mb-5 mb-lg-0"> <div class="testimonial-item mx-auto mb-5 mb-lg-0">
<img class="img-fluid rounded-circle mb-3" src="../../static/img/resep.jpg" alt=""> <img class="img-fluid rounded-circle mb-3" src="../../static/img/resep.jpg" alt="">
<h5><a href="/resep/{{j.DOCNO}}">Resep No:{{ j.DOCNO }}</a></h5> <h5><a href="/resepayam/{{j.DOCNO}}">Resep No:{{ j.DOCNO }}</a></h5>
<h5>"{{ j.Title }}"</h5> <h5>"{{ j.Title }}"</h5>
<p class="font-weight-light mb-0">score :{{ j.score }}</p> <p class="font-weight-light mb-0">score :{{ j.score }}</p>
</div> </div>
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<div class="col-lg-4"> <div class="col-lg-4">
<div class="testimonial-item mx-auto mb-5 mb-lg-0"> <div class="testimonial-item mx-auto mb-5 mb-lg-0">
<img class="img-fluid rounded-circle mb-3" src="../../static/img/resep.jpg" alt=""> <img class="img-fluid rounded-circle mb-3" src="../../static/img/resep.jpg" alt="">
<h5><a href="/resep/{{j.DOCNO}}">Resep No:{{ j.DOCNO }}</a></h5> <h5><a href="/resepikan/{{j.DOCNO}}">Resep No:{{ j.DOCNO }}</a></h5>
<h5>"{{ j.Title }}"</h5> <h5>"{{ j.Title }}"</h5>
<p class="font-weight-light mb-0">score :{{ j.score }}</p> <p class="font-weight-light mb-0">score :{{ j.score }}</p>
</div> </div>
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<div class="col-lg-4"> <div class="col-lg-4">
<div class="testimonial-item mx-auto mb-5 mb-lg-0"> <div class="testimonial-item mx-auto mb-5 mb-lg-0">
<img class="img-fluid rounded-circle mb-3" src="../../static/img/resep.jpg" alt=""> <img class="img-fluid rounded-circle mb-3" src="../../static/img/resep.jpg" alt="">
<h5><a href="/resepudang/{{j.DOCNO}}">Resep No:{{ j.DOCNO }}</a></h5> <h5><a href="/reseptelur/{{j.DOCNO}}">Resep No:{{ j.DOCNO }}</a></h5>
<h5>"{{ j.Title }}"</h5> <h5>"{{ j.Title }}"</h5>
<p class="font-weight-light mb-0">score :{{ j.score }}</p> <p class="font-weight-light mb-0">score :{{ j.score }}</p>
</div> </div>
......
...@@ -11,15 +11,26 @@ urlpatterns = [ ...@@ -11,15 +11,26 @@ urlpatterns = [
path('indexikan/', views.indexikan), path('indexikan/', views.indexikan),
path('indexkambing/', views.indexkambing), path('indexkambing/', views.indexkambing),
path('indexsapi/', views.indexsapi), path('indexsapi/', views.indexsapi),
path('indextahu/', views.indextahu),
path('indextelur/', views.indextelur),
path('indextempe/', views.indextempe),
path('indexudang/', views.indexudang),
path('result/', views.result), path('result/', views.result),
path('resultayam/', views.resultayam), path('resultayam/', views.resultayam),
path('resultikan/', views.resultikan), path('resultikan/', views.resultikan),
path('resultkambing/', views.resultkambing), path('resultkambing/', views.resultkambing),
path('resultsapi/', views.resultsapi), path('resultsapi/', views.resultsapi),
path('resulttahu/', views.resulttahu),
path('resulttelur/', views.resulttelur),
path('resulttempe/', views.resulttempe),
path('resultudang/', views.resultudang),
path('resep/<int:id>', views.resep, name='resep'), path('resep/<int:id>', views.resep, name='resep'),
path('resepayam/<int:id>', views.resepayam, name='resepayam'), path('resepayam/<int:id>', views.resepayam, name='resepayam'),
path('resepikan/<int:id>', views.resepikan, name='resepikan'), path('resepikan/<int:id>', views.resepikan, name='resepikan'),
path('resepkambing/<int:id>', views.resepkambing, name='resepkambing'), path('resepkambing/<int:id>', views.resepkambing, name='resepkambing'),
path('resepsapi/<int:id>', views.resepsapi, name='resepsapi'), path('resepsapi/<int:id>', views.resepsapi, name='resepsapi'),
path('reseptahu/<int:id>', views.reseptahu, name='reseptahu'),
path('reseptelur/<int:id>', views.reseptelur, name='reseptelur'),
path('reseptempe/<int:id>', views.reseptempe, name='reseptempe'),
path('resepudang/<int:id>', views.resepudang, name='resepudang'),
] ]
\ No newline at end of file
from django.shortcuts import render from django.shortcuts import render
from django.http import HttpResponse from django.http import HttpResponse
from apps.inverted import main, mainayam, mainikan, mainkambing, mainsapi from apps.inverted import main, mainayam, mainikan, mainkambing, mainsapi, maintahu, maintelur, maintempe, mainudang
# Create your views here. # Create your views here.
# def index(request): # def index(request):
...@@ -90,7 +90,49 @@ def resultsapi(request): ...@@ -90,7 +90,49 @@ def resultsapi(request):
} }
return render(request, 'apps/resultsapi.html', content) return render(request, 'apps/resultsapi.html', content)
def resulttahu(request):
if request.method == 'POST':
query = request.POST['querysearch']
hasil = maintahu.main(query)
content={
'hasil':hasil,
'query':query
}
return render(request, 'apps/resulttahu.html', content)
def resulttelur(request):
if request.method == 'POST':
query = request.POST['querysearch']
hasil = maintelur.main(query)
content={
'hasil':hasil,
'query':query
}
return render(request, 'apps/resulttelur.html', content)
def resulttempe(request):
if request.method == 'POST':
query = request.POST['querysearch']
hasil = maintempe.main(query)
content={
'hasil':hasil,
'query':query
}
return render(request, 'apps/resulttempe.html', content)
def resultudang(request):
if request.method == 'POST':
query = request.POST['querysearch']
hasil = mainudang.main(query)
content={
'hasil':hasil,
'query':query
}
return render(request, 'apps/resultudanng.html', content)
def resep(request,id): def resep(request,id):
...@@ -142,3 +184,44 @@ def resepsapi(request,id): ...@@ -142,3 +184,44 @@ def resepsapi(request,id):
'Steps':step 'Steps':step
} }
return render(request, 'apps/resepsapi.html', content) return render(request, 'apps/resepsapi.html', content)
def reseptahu(request,id):
text, judul, step = maintahu.detail(id)
content={
'no': id,
'Title':judul,
'Ingredients':text,
'Steps':step
}
return render(request, 'apps/reseptahu.html', content)
def reseptelur(request,id):
text, judul, step = maintelur.detail(id)
content={
'no': id,
'Title':judul,
'Ingredients':text,
'Steps':step
}
return render(request, 'apps/reseptelur.html', content)
def reseptempe(request,id):
text, judul, step = maintempe.detail(id)
content={
'no': id,
'Title':judul,
'Ingredients':text,
'Steps':step
}
return render(request, 'apps/reseptempe.html', content)
def resepudang(request,id):
text, judul, step = mainudang.detail(id)
content={
'no': id,
'Title':judul,
'Ingredients':text,
'Steps':step
}
return render(request, 'apps/resepudang.html', content)
...@@ -24,15 +24,27 @@ urlpatterns = [ ...@@ -24,15 +24,27 @@ urlpatterns = [
path('indexikan/', views.indexikan), path('indexikan/', views.indexikan),
path('indexkambing/', views.indexkambing), path('indexkambing/', views.indexkambing),
path('indexsapi/', views.indexsapi), path('indexsapi/', views.indexsapi),
path('indextahu/', views.indextahu),
path('indextelur/', views.indextelur),
path('indextempe/', views.indextempe),
path('indexudang/', views.indexudang),
path('result/', views.result), path('result/', views.result),
path('resultayam/', views.resultayam), path('resultayam/', views.resultayam),
path('resultikan/', views.resultikan), path('resultikan/', views.resultikan),
path('resultkambing/', views.resultkambing), path('resultkambing/', views.resultkambing),
path('resultsapi/', views.resultsapi), path('resultsapi/', views.resultsapi),
path('resulttahu/', views.resulttahu),
path('resulttelur/', views.resulttelur),
path('resulttempe/', views.resulttempe),
path('resultudang/', views.resultudang),
path('resep/<int:id>', views.resep, name='resep'), path('resep/<int:id>', views.resep, name='resep'),
path('resepayam/<int:id>', views.resepayam, name='resepayam'), path('resepayam/<int:id>', views.resepayam, name='resepayam'),
path('resepikan/<int:id>', views.resepikan, name='resepikan'), path('resepikan/<int:id>', views.resepikan, name='resepikan'),
path('resepkambing/<int:id>', views.resepkambing, name='resepkambing'), path('resepkambing/<int:id>', views.resepkambing, name='resepkambing'),
path('resepsapi/<int:id>', views.resepsapi, name='resepsapi'), path('resepsapi/<int:id>', views.resepsapi, name='resepsapi'),
path('reseptahu/<int:id>', views.reseptahu, name='reseptahu'),
path('reseptelur/<int:id>', views.reseptelur, name='reseptelur'),
path('reseptempe/<int:id>', views.reseptempe, name='reseptempe'),
path('resepudang/<int:id>', views.resepudang, name='resepudang'),
path('apps/', include('apps.urls')), path('apps/', include('apps.urls')),
] ]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment