Commit b6845bcc authored by onny's avatar onny
Browse files

text clickable, alphabet listning

parent e16c4cb6
......@@ -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, search_page
from openart.views import index_page, add_page, page_alphabet, 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
......@@ -23,11 +23,11 @@ urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += static('/fonts', document_root=settings.FONT_ROOT)
urlpatterns += i18n_patterns(
url(r'add', add_page),
url(r'artists', artists_page),
url(r'projects', projects_page),
url(r'entries', entries_page),
url(r'media', media_page),
url(r'Search/(.*)$', search_page),
url(r'^add', add_page),
url(r'^Alphabet/([a-z])$', page_alphabet),
url(r'^projects', projects_page),
url(r'^entries', entries_page),
url(r'^media', media_page),
url(r'^Search/(.*)$', search_page),
url(r'(.*)$', artist_page),
)
......@@ -37,12 +37,20 @@ def add_page(request):
html = TemplateResponse(request, 'add.html', context)
return HttpResponse(html.render())
def artists_page(request):
def page_alphabet(request, alphaChar):
context = {}
alphaList = []
for artist in Artist.objects.all():
alphaChar = str(artist).split(" ")[-1][0]
if not alphaChar in alphaList:
alphaList.append(alphaChar)
context['artist'] = Artist.objects.all()
context['alphaList'] = alphaList
context['authenticated'] = request.user.is_authenticated
html = TemplateResponse(request, 'artists.html', context)
html = TemplateResponse(request, 'alphabet.html', context)
return HttpResponse(html.render())
def artist_page(request, slug):
......
......@@ -37,6 +37,23 @@ ul li{
list-style-type: none;
}
ul.alphaSelect li {
display: inline-block;
width: 40px;
height: 35px;
text-align: center;
border: 1px solid #d6d6d6;
margin-right: 5px;
}
ul.alphaSelect li a {
color: black;
margin: auto;
padding: auto;
width: 100%;
height: 100%;
}
.btn {
border: none;
padding: 10px;
......
......@@ -29,6 +29,7 @@
font-weight: bold;
text-transform: lowercase;
font-size: 25px;
pointer-events: all;
}
.logo-text > div {
......@@ -249,6 +250,10 @@
.search .logo-text:not(.hide) {
display: flex;
}
.search .icon-search {
pointer-events: all;
}
}
@media (max-width: 760px) {
......
......@@ -26,6 +26,24 @@ function post_data(url, data, target_class) {
var VueMasonryPlugin = window["vue-masonry-plugin"].VueMasonryPlugin
Vue.component('media-element', {
props: ['name', 'title', 'image'],
template: `<div v-masonry-tile class='imageItem mediaItem'>
<div class='imgbox'>
<img :src='{{ image }}'>
<div class='controlBoxes'>
<i class="icon ion-ios-heart-empty"></i>
<i class="icon ion-ios-expand"></i>
</div>
</div>
<span class='entryTitle'>{{ title }}</span>
{% if authenticated %}
<button v-on:click="removeEntry('media', [[ index ]])">Delete</button>
<button v-on:click="editEntry([[ index ]])">Edit</button>
{% endif %}
</div>`
});
Vue.use(VueMasonryPlugin)
var demo = new Vue({
......
......@@ -62,7 +62,11 @@ document.addEventListener("DOMContentLoaded", function() {
};
if (event.target.closest('.search')) {
if (window.screen.width <= 1000) {
window.location = "/";
} else {
toggle_search(true);
}
};
if (!event.target.closest('.search') || event.target.matches('.ion-md-close')) {
......@@ -129,7 +133,6 @@ document.addEventListener("DOMContentLoaded", function() {
};
if (event.target.matches('.menu') && window.screen.width <= 1000) {
console.log("catched");
sidebar = document.getElementsByClassName("sidebar")[0]
if (sidebar.classList.contains('active')) {
sidebar.classList.remove('active');
......
{% extends 'base.html' %}
{% load i18n %}
{% block content %}
<h2>Artists</h2>
<p v-if="entries.length == 0">Sorry, no entires currently available</p>
<div class='imageGrid' v-masonry transition-duration="0.3s" item-selector=".imageItem" :origin-top="true" :horizontal-order="false">
<div v-masonry-tile class='imageItem' v-for="(entry, index) in entries">
<div class='imgbox'>
<img src='https://uploads.wikiart.org/Content/images/ARTIST-480x600.jpg'>
<div class='controlBoxes'>
<i class="fa fa-heart"></i>
<i class="fa fa-search-plus"></i>
</div>
</div>
<span class='entryTitle'>[[ entry.name ]]</span>
<span>German, 1552 - 1615<br>
41 projects</span><br>
{% if authenticated %}
<button v-on:click="removeEntry('media', [[ index ]])">Delete</button>
<button v-on:click="editEntry([[ index ]])">Edit</button>
{% endif %}
</div>
</div>
{% endblock %}
......@@ -31,7 +31,7 @@
<div class='search menuItem'>
<div class='searchArea'>
<input class='inputField' type='text' placeholder="{% trans "Search" %}">
<i class="icon ion-md-search"></i>
<i class="icon ion-md-search"></i> <!-- DOKU icon usage -->
</div>
<div class='logo-text'>
open<div>saai</div>
......
......@@ -2,7 +2,8 @@
{% load i18n %}
{% block content %}
<h1>Hallo</h1>
<h1>Spotlight</h1>
<p>Herzlich Willkommen beim Saasilord</p>
<media-element name="hallo"></media-element>
{% 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