Commit 03da430a authored by onny's avatar onny
Browse files

split up javascript files

parent ec717580
......@@ -14,9 +14,10 @@ Including another URLconf
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, login
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
# Routers provide an easy way of automatically determining the URL conf.
......@@ -29,12 +30,14 @@ router.register(r'media', MediaViewSet)
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^$', index_page),
url(r'^add/', add_page),
url(r'^artists/', artists_page),
url(r'^en/(.*)$', artist_page),
url(r'^projects/', projects_page),
url(r'^entries/', entries_page),
url(r'^media/', media_page),
url(r'^api/', include(router.urls)),
url(r'^login/$', login)
url(r'^api/', include(router.urls))
]
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'(.*)$', artist_page),
)
......@@ -118,8 +118,11 @@ header > div {
margin-right: 15px;
}
input {
.searchbox {
width: 100%;
border: none;
outline: none;
font-size: 14px;
}
.dropdown {
......
......@@ -130,72 +130,3 @@ var demo = new Vue({
};
}
});
document.addEventListener("DOMContentLoaded", function() {
window.onclick = function(event) {
if (event.target.closest('.search')) {
document.getElementsByClassName("search")[0].classList.toggle("active");
} else {
searchBtn = document.getElementsByClassName("search")[0];
if (searchBtn.classList.contains('active')) {
searchBtn.classList.remove('active');
};
};
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];
if (arrowIcon) {
arrowIcon.classList.remove('fa-chevron-down');
arrowIcon.classList.add('fa-chevron-up');
} else {
arrowIcon = document.getElementsByClassName('fa-chevron-up')[0];
arrowIcon.classList.remove('fa-chevron-up');
arrowIcon.classList.add('fa-chevron-down');
}
} else {
langBtn = document.getElementsByClassName("lang")[0];
if (langBtn.classList.contains('active')) {
langBtn.classList.remove('active');
};
var dropdowns = document.getElementsByClassName("dropdown-lang");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
arrowIcon = document.getElementsByClassName('fa-chevron-up')[0];
arrowIcon.classList.remove('fa-chevron-up');
arrowIcon.classList.add('fa-chevron-down');
};
if (event.target.closest('.login')) {
document.getElementById("menu-login").classList.toggle("show");
document.getElementsByClassName("login")[0].classList.toggle("active");
} else {
loginBtn = document.getElementsByClassName("login")[0];
if (loginBtn.classList.contains('active')) {
loginBtn.classList.remove('active');
};
var dropdowns = document.getElementsByClassName("dropdown-login");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}
});
document.addEventListener("DOMContentLoaded", function() {
window.onclick = function(event) {
if (event.target.closest('.search')) {
document.getElementsByClassName("search")[0].classList.toggle("active");
searchIcon = document.getElementsByClassName('fa-search')[0];
if (searchIcon) {
searchIcon.classList.remove('fa-search');
searchIcon.classList.add('fa-times');
} else {
searchIcon = document.getElementsByClassName('fa-times')[0];
searchIcon.classList.remove('fa-times');
searchIcon.classList.add('fa-search');
}
} else {
searchBtn = document.getElementsByClassName("search")[0];
if (searchBtn.classList.contains('active')) {
searchBtn.classList.remove('active');
};
searchIcon = document.getElementsByClassName('fa-times')[0];
if (searchIcon) {
searchIcon.classList.remove('fa-times');
searchIcon.classList.add('fa-search');
};
};
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];
if (arrowIcon) {
arrowIcon.classList.remove('fa-chevron-down');
arrowIcon.classList.add('fa-chevron-up');
} else {
arrowIcon = document.getElementsByClassName('fa-chevron-up')[0];
arrowIcon.classList.remove('fa-chevron-up');
arrowIcon.classList.add('fa-chevron-down');
}
} else {
langBtn = document.getElementsByClassName("lang")[0];
if (langBtn.classList.contains('active')) {
langBtn.classList.remove('active');
};
var dropdowns = document.getElementsByClassName("dropdown-lang");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
arrowIcon = document.getElementsByClassName('fa-chevron-up')[0];
if (arrowIcon) {
arrowIcon.classList.remove('fa-chevron-up');
arrowIcon.classList.add('fa-chevron-down');
};
};
if (event.target.closest('.login')) {
document.getElementById("menu-login").classList.toggle("show");
document.getElementsByClassName("login")[0].classList.toggle("active");
} else {
loginBtn = document.getElementsByClassName("login")[0];
if (loginBtn.classList.contains('active')) {
loginBtn.classList.remove('active');
};
var dropdowns = document.getElementsByClassName("dropdown-login");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}
});
......@@ -23,9 +23,9 @@
</div>
</div>
<div class='search'>
<input class='searchbox' type='text' placeholder="{% trans "Search" %}">
<span class='icon icon-search'>
<i class="fa fa-search"></i>
<!-- <input type='text'> -->
</span>
</div>
<div class='lang'>
......@@ -96,5 +96,6 @@
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script type="text/javascript" src="{% static 'js/vue-resource-1.5.1.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/main.js' %}"></script>
<script type="text/javascript" src="{% static 'js/menu.js' %}"></script>
</body>
</html>
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