Commit 24c2c02d authored by onny's avatar onny
Browse files

clean up css and menu styling, main content flex box styling enhancements

parent 6cfe9d71
......@@ -16,7 +16,6 @@ from django.utils.translation import gettext_lazy as _
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
......@@ -127,6 +126,8 @@ LOCALE_PATHS = (
# https://docs.djangoproject.com/en/1.9/howto/static-files/
STATIC_URL = '/static/'
MEDIA_URL = '/uploads/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'uploads')
if DEBUG:
STATICFILES_DIRS = (
......
"""djangovuejs URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
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 ArtistViewSet, ProjectViewSet, EntryViewSet, MediaViewSet
from django.conf import settings
from django.conf.urls.static import static
# Routers provide an easy way of automatically determining the URL conf.
router = routers.DefaultRouter()
router.register(r'artist', ArtistViewSet)
router.register(r'project', ProjectViewSet)
......@@ -30,7 +16,7 @@ router.register(r'media', MediaViewSet)
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^$', index_page),
url(r'^api/', include(router.urls))
url(r'^api/', include(router.urls)),
]
urlpatterns += i18n_patterns(
......@@ -41,3 +27,5 @@ urlpatterns += i18n_patterns(
url(r'media', media_page),
url(r'(.*)$', artist_page),
)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
......@@ -97,7 +97,7 @@ class Entry(models.Model):
class Media(models.Model):
file = models.FileField(
blank=False,
upload_to='uploads'
null=False,
blank=False
)
entry = models.ForeignKey(Entry, on_delete=models.CASCADE)
......@@ -111,6 +111,7 @@ header > div {
border: none;
outline: none;
font-size: 14px;
pointer-events: all;
}
.searchArea .fa-search {
......@@ -163,7 +164,7 @@ header > div {
flex-direction: column;
}
.loginBox .content div, button, p {
.loginBox .content div, .loginBox .content button, .loginBox .content p {
padding-top: 30px;
max-width: 370px;
width: 100%;
......@@ -258,11 +259,14 @@ main > div {
}
main .sidebar {
width: 350px;
padding-top: 50px;
flex-grow: 0;
flex-shrink: 0;
flex-basis: 150px;
}
main .content {
flex: auto;
flex: 1;
}
footer {
......@@ -288,6 +292,7 @@ footer > div {
width: 220px;
margin: 10px;
font-size: 20px;
overflow-wrap: break-word;
}
.flex-container .imgbox {
......
......@@ -106,23 +106,26 @@ var demo = new Vue({
},
mounted: function()
{
switch (window.location.pathname) {
case "/de/artists":
var path = window.location.pathname.split('/');
path = path[path.length -1];
switch (path) {
case "artists":
axios
.get('/api/artist/')
.then(response => (this.entries = response.data));
break;
case "/de/projects/":
case "/projects":
axios
.get('/api/project/')
.then(response => (this.entries = response.data));
break;
case "/de/entries/":
case "entries":
axios
.get('/api/entry/')
.then(response => (this.entries = response.data));
break;
case "/de/media/":
case "media":
axios
.get('/api/media/')
.then(response => (this.entries = response.data));
......
document.addEventListener("DOMContentLoaded", function() {
window.onclick = function(event) {
console.log(event.target);
if (event.target.matches('.search')) {
if (event.target.closest('.search')) {
document.getElementsByClassName("searchArea")[0].classList.add("showFlex");
document.getElementsByClassName("search")[0].classList.add("active");
document.getElementsByClassName("icon-search")[0].classList.add("noBorder");
document.getElementsByClassName("searchBox")[0].focus();
document.getElementsByClassName("inputField")[0].focus();
searchIcon = document.getElementsByClassName('fa-search-big')[0];
searchIcon.classList.remove('fa-search');
searchIcon.classList.add('fa-times');
};
if (!event.target.matches('.search') || event.target.matches('.fa-times')) {
if (!event.target.closest('.search') || event.target.matches('.fa-times')) {
searchArea = document.getElementsByClassName("searchArea")[0];
searchArea.classList.remove('showFlex');
searchBtn = document.getElementsByClassName("search")[0];
......@@ -25,7 +23,7 @@ document.addEventListener("DOMContentLoaded", function() {
searchIcon.classList.add('fa-search');
};
if (event.target.matches('.lang')) {
if (event.target.closest('.lang')) {
document.getElementById("menu-lang").classList.toggle("show");
document.getElementsByClassName("lang")[0].classList.toggle("active");
arrowIcon = document.getElementsByClassName('fa-chevron-down')[0];
......@@ -58,20 +56,14 @@ document.addEventListener("DOMContentLoaded", function() {
};
if (event.target.matches('.login')) {
menuProfile = document.getElementById("menu-profile")
if (menuProfile) {
menuProfile.classList.toggle("show");
document.getElementsByClassName("login")[0].classList.toggle("active");
} else {
document.getElementsByClassName("loginOverlay")[0].classList.toggle("showFlex");
};
} else {
loginBtn = document.getElementsByClassName("login")[0];
if (loginBtn.classList.contains('active')) {
loginBtn.classList.remove('active');
......@@ -84,7 +76,11 @@ document.addEventListener("DOMContentLoaded", function() {
openDropdown.classList.remove('show');
}
}
}
};
if (event.target.matches('.header .fa-times') || event.target.matches('.loginOverlay')) {
document.getElementsByClassName("loginOverlay")[0].classList.toggle("showFlex");
};
}
......
......@@ -63,33 +63,33 @@
{% else %}
<i class="fa fa-lock fa-margin"></i>
<span>{% trans "Sign In" %}</span>
<div class='loginOverlay'>
<div class='loginBox'>
<div class='header'>
<div class='title'>{% trans "Sign In" %}</div>
<i class="fa fa-times"></i>
{% endif %}
</span>
</div>
<div class='loginOverlay'>
<div class='loginBox'>
<div class='header'>
<div class='title'>{% trans "Sign In" %}</div>
<i class="fa fa-times"></i>
</div>
<div class='content'>
<div>
<div class='inputArea'>
<input type='email' class='inputField' placeholder="E-Mail *"></input>
</div>
<div class='content'>
<div>
<div class='inputArea'>
<input type='email' class='inputField' placeholder="E-Mail *"></input>
</div>
<div class='inputArea'>
<input type='password' class='inputField' placeholder="{% trans "Password" %} *"></input>
</div>
<p>
<a href=#>{% trans "Forgot password?" %}</a>
</p>
<button class='btn' type='submit'>{% trans "Sign In" %}</button>
<p>
{% trans "Don't have an account? Sign up." %}
</p>
</div>
<div class='inputArea'>
<input type='password' class='inputField' placeholder="{% trans "Password" %} *"></input>
</div>
<p>
<a href=#>{% trans "Forgot password?" %}</a>
</p>
<button class='btn' type='submit'>{% trans "Sign In" %}</button>
<p>
{% trans "Don't have an account? Sign up." %}
</p>
</div>
</div>
{% endif %}
</span>
</div>
</div>
</div>
</header>
......
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