Commit 7ecae34b authored by onny's avatar onny

click on logo redirect page

parent 7e36cc8a
......@@ -2,7 +2,7 @@ from django.conf.urls import url, include
from django.conf.urls.i18n import i18n_patterns
from django.contrib import admin
from rest_framework import routers
from openart.views import index_page, add_page, artists_page, projects_page, entries_page, artist_page, media_page
from openart.views import index_page, add_page, artists_page, projects_page, entries_page, artist_page, media_page, search_page
from openart.views import ArtistViewSet, ProjectViewSet, EntryViewSet, MediaViewSet
from django.conf import settings
from django.conf.urls.static import static
......@@ -28,5 +28,6 @@ urlpatterns += i18n_patterns(
url(r'projects', projects_page),
url(r'entries', entries_page),
url(r'media', media_page),
url(r'Search/(.*)$', search_page),
url(r'(.*)$', artist_page),
)
......@@ -53,6 +53,14 @@ def artist_page(request, slug):
html = TemplateResponse(request, 'artist_page.html', context)
return HttpResponse(html.render())
def search_page(request, query):
context = {}
context['query'] = query
context['authenticated'] = request.user.is_authenticated
html = TemplateResponse(request, 'search.html', context)
return HttpResponse(html.render())
def projects_page(request):
context = {}
context['artist'] = Artist.objects.all()
......
......@@ -113,6 +113,7 @@
left: 0px;
justify-content: center;
align-items: center;
z-index: 10;
display: none;
}
......
......@@ -47,6 +47,10 @@ document.onkeydown = function(evt) {
document.addEventListener("DOMContentLoaded", function() {
window.onclick = function(event) {
if (event.target.matches('.logo')) {
window.location = "/";
};
if (event.target.closest('.search')) {
toggle_search(true);
};
......
......@@ -32,7 +32,7 @@
<div class='searchArea'>
<input class='inputField' type='text' placeholder="{% trans "Search" %}">
<i class="icon ion-md-search"></i>
</div>
</div>
<div class='logo-text'>
open<div>saai</div>
</div>
......
{% extends 'base.html' %}
{% load i18n %}
{% block content %}
<h2>Search results for <i>"{{ query }}"</i></h2>
{% endblock %}
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