Commit d4f733af authored by alexandre's avatar alexandre

wip on a few issues in the list

parent f6e8df4b
......@@ -104,7 +104,12 @@ body {
a {
color: inherit;
text-decoration-skip: ink;
text-decoration: none;
}
a:hover {
color: var(--background-color);
filter: brightness(200%);
}
sub,
......@@ -299,6 +304,7 @@ section.hidden { display: none; }
========================================================================== */
.main-header { width: 300px; }
.main-header.is-collapsed { margin-left: -300px; }
.main-header__content {
......@@ -308,18 +314,9 @@ section.hidden { display: none; }
box-sizing: border-box;
}
.main-header__menu--primary {
flex-grow: 1;
}
.main-header a { text-decoration: none; }
.main-header a:hover { color: var(--background-color); filter: brightness(200%); }
.main-header__create { flex-grow: 1; }
.main-header__logo {
margin-bottom: 42px;
}
.main-header__logo { margin-bottom: 42px; }
.logo__name {
font-size: 3em;
......@@ -329,6 +326,51 @@ section.hidden { display: none; }
.logo_link { text-decoration: none; }
.panel-form { display: flex; }
.panel-form__textfield,
.panel-form__submit {
padding: 0;
margin: 0;
font-size: inherit;
font-family: inherit;
background: none;
border: none;
color: inherit;
}
.panel-form__submit {
margin-left: 10px;
border: 2px solid white;
padding: 0 4px;
background-color: white;
color: #183a42;
}
.panel-form__submit:hover {
color: white;
background-color: #183a42;
cursor: pointer;
}
.panel-form__textfield {
border-bottom: 2px solid;
padding-bottom: 6px;
flex: 1 1 100px;
min-width: 0px; /* Fixes Firefox issue with flex-box */
}
.panel-form__textfield::placeholder { /* Most modern browsers support this now. */
color: #173a42;
filter: brightness(200%);
}
.create__form--inactive { display: none; }
.menu--inline .menu__item {
display: inline;
margin-right: 1em;
}
......@@ -1561,50 +1603,6 @@ ol {
color: rgb(202, 027, 027);
}
/* #create { margin-top: 1em;} */
.create-form { display: none; }
/* #create:hover .create-form { display: flex; } */
.create-form--active { display: flex; }
.create-form input[type="text"],
.create-form input[type="submit"] {
padding: 0;
margin: 0;
font-size: inherit;
font-family: inherit;
background: none;
border: none;
color: inherit;
}
.create-form input[type="submit"] {
/* text-decoration: underline; */
margin-left: 10px;
border: 2px solid white;
padding: 0 4px;
background-color: white;
color: #183a42;
}
.create-form input[type="submit"]:hover {
color: white;
background-color: #183a42;
cursor: pointer;
}
.create-form input[type="text"] {
border-bottom: 2px solid;
padding-bottom: 6px;
/* margin-bottom: 18px; */
flex: 1 1 100px;
min-width: 0px; /* Fixes Firefox issue with flex-box */
}
.create-form input[type="text"]::placeholder { /* Most modern browsers support this now. */
color: #173a42;
filter: brightness(200%);
}
......@@ -1673,7 +1671,7 @@ ol {
}
.help__inner h3,
.help__inner .help__inner { margin-left: 3em; }
.help__inner .help__inner { margin-left: 1.5em; }
.help__toc {
/* position: sticky; */
......@@ -1740,6 +1738,23 @@ ol {
color: var(--button-color-disabled);
}
.filter__item {
display: inline-block;
/* background-color: #24788a; */
/* padding: 4px; */
margin-right: 14px;
}
.filter__item:hover {
cursor: pointer;
}
#tag-filter .filter__item + .filter__item:before {
content: ", ";
}
.search__heading { font-weight: bold; }
......@@ -1806,25 +1821,38 @@ ol {
padding: 30px;
}
.score-list { display: flex; }
.scores { display: flex; overflow-x: hidden; }
.scores__content { flex: 1; overflow: auto; }
.scores { flex: 1; overflow: auto; }
.score-filters {
.scores__filters {
height: 100vh;
}
.score-filters .content {
.scores__filters .content {
width: 300px;
transition: all .2s;
}
.score-filters.is-collapsed .content {
.scores__filters.is-collapsed .content {
margin-right: -360px;
}
.scores__search {
margin-bottom: 28px;
}
.scores__filter {
margin-bottom: 14px;
}
.filter__heading {
font-weight: bold;
}
.btn {
font-size: 85% !important;
......@@ -1844,22 +1872,15 @@ ol {
}
.search__form {
display: flex;
}
.search__textfield { width: 30px; flex: 1 1 30px;
}
.search__submit {
.scores__item {
margin-top: 10.5px;
}
.score-list-foo li + li {
margin-top: 10.5px;
.item__title {
font-weight: bold;
}
.score-list-foo__meta {
.item__meta {
font-size: 85%;
}
......
This diff is collapsed.
<a href="#"><%- t('Créer une partition') %></a>
<h1 class="create__heading"><a href="#"><%- t('Créer une partition') %></a></h1>
<form class="create-form" action="" method="post">
<input type="text" name="title" placeholder="<%- t('Titre') %>" required>
<input type="submit" name="submit" value="<%- t('Créer') %>">
<form class="create__form create__form--inactive panel-form" action="" method="post">
<input class="create__textfield panel-form__textfield" type="text" name="title" placeholder="<%- t('Titre') %>" required>
<input class="create__submit panel-form__submit" type="submit" name="submit" value="<%- t('Créer') %>">
</form>
......@@ -10,10 +10,11 @@
<ul>
<li><a href="/la-notation-w/"><%- t('La notation W') %></a></li>
<li><a href="/partitions/"><%- t('Répertoire de partitions') %></a></li>
<li id="create"></li>
</ul>
</nav>
<div id="create"></div>
<nav class="main-header__user">
<% if (username) { %>
<%- t('Bienvenue') %> <a href="/compte"><%- username %></a> <a href="#" class="js-logout">(←)</a>
......@@ -28,15 +29,15 @@
</ul>
</nav>
<nav class="main-header__menu main-header__menu--secondary">
<ul>
<nav class="main-header__menu main-header__menu--secondary menu menu--inline">
<ul class="menu__list">
<% if (W.config.lang === "fr") { %>
<li><a href="#" class="js-lang" data-lang="en">English</a></li>
<li class="menu__item"><a href="#" class="js-lang" data-lang="en">English</a></li>
<% } else { %>
<li><a href="#" class="js-lang" data-lang="fr">Français</a></li>
<li class="menu__item"><a href="#" class="js-lang" data-lang="fr">Français</a></li>
<% } %>
<li><a href="#"><%- t('Crédits') %></a></li>
<li><a href="http://1110111.org"><%- t('Site W') %></a></li>
<li class="menu__item"><a href="#"><%- t('Crédits') %></a></li>
<li class="menu__item"><a href="http://1110111.org"><%- t('Site W') %></a></li>
</ul>
</nav>
</div>
<a href="/partitions/<%- id %>"><%- title %></a> &mdash;
<span class="score-list-foo__meta">
<a class="item__title" href="/partitions/<%- id %>"><%- title %></a> &mdash;
<span class="item__meta">
<% if (score_author) { %> par <%- score_author %>, <% } %>
le <%- humanDate %>
<% if (tags.length) { %> <br> <% } %>
<% for (var i = 0; i < tags.length; i++) { %>
#<%- tags[i] %>
<% } %>
......
<div class="scores content">
<h1><%- t('Partitions existantes') %></h1>
<br>
<div class="scores__content content">
<div id="list"></div>
</div>
<div id="search-panel" class="score-filters panel panel--right"></div>
<div id="search-panel"></div>
<div class="panel__toggle js-collapse">filtres</div>
<div class="content">
<div id="search"></div>
<div id="applied-filters"></div>
<div class="filters">
<div class="filters__filter">
<p><%- t('type de partition') %></p>
<div id="score-type-filter"></div>
</div>
<div id="score-type-filter"></div>
<div class="filters__filter">
<p><%- t('tags') %></p>
<div id="tag-filter"></div>
</div>
<div id="tag-filter"></div>
<div class="filters__filter">
<p><%- t('langue') %></p>
<div id="language-filter"></div>
</div>
</div>
<div id="language-filter"></div>
</div>
<form class="search__form" action="search_submit" method="get" accept-charset="utf-8">
<input class="search__textfield search-input" type="text" placeholder="<%- t('Titre ou auteur') %>">
<button class="search"><%- t('rechercher') %></button>
<h1 class="search__heading">Recherche</h1>
<form class="search__form panel-form" action="search_submit" method="get" accept-charset="utf-8">
<input class="search__textfield search-input panel-form__textfield" type="text" placeholder="<%- t('Titre ou auteur') %>">
<button class="search__submit panel-form__submit"><%- t('Ok') %></button>
</form>
......@@ -150,12 +150,15 @@ class ScoreViewSet(viewsets.ModelViewSet):
shared_with = self.request.query_params.get('shared_with', None)
if shared_with is not None:
queryset = get_objects_for_user(self.request.user, 'playground.view_score')
# Do not return scores for AnonymousUser
if (self.request.user.is_anonymous()):
return queryset.none()
return get_objects_for_user(self.request.user, 'playground.view_score')
is_featured = self.request.query_params.get('is_featured', None)
is_featured= self.request.query_params.get('is_featured', None)
if is_featured is not None:
ids = FeaturedScore.objects.all().order_by('-order').values_list("score__id", flat=True)
queryset = queryset.filter(id__in=ids)
return queryset.filter(id__in=ids)
return queryset
......
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