work on admin ui

This commit is contained in:
bkfox 2019-09-05 18:55:44 +02:00
parent 3b82234cb8
commit b96f60e779
65 changed files with 314 additions and 817 deletions

View File

@ -13,6 +13,7 @@ __all__ = ['ArticleAdmin']
class ArticleAdmin(PageAdmin):
list_display = PageAdmin.list_display + ('program',)
list_filter = ('program',)
search_fields = PageAdmin.search_fields + ['program__title']
# TODO: readonly field
fieldsets = copy.deepcopy(PageAdmin.fieldsets)

View File

@ -50,6 +50,7 @@ class DiffusionInline(DiffusionBaseAdmin, admin.TabularInline):
class EpisodeAdmin(PageAdmin):
list_display = PageAdmin.list_display + ('program',)
list_filter = ('program',)
search_fields = PageAdmin.search_fields + ['program__title']
readonly_fields = ('program',)
fieldsets = copy.deepcopy(PageAdmin.fieldsets)

View File

@ -14,6 +14,7 @@ __all__ = ['CategoryAdmin', 'PageAdmin', 'NavItemInline']
class CategoryAdmin(admin.ModelAdmin):
list_display = ['pk', 'title', 'slug']
list_editable = ['title', 'slug']
search_fields = ['title']
fields = ['title', 'slug']
prepopulated_fields = {"slug": ("title",)}
@ -27,6 +28,7 @@ class PageAdmin(admin.ModelAdmin):
change_form_template = 'admin/aircox/page_change_form.html'
search_fields = ['title', 'category__title']
fieldsets = [
('', {
'fields': ['title', 'slug', 'category', 'cover', 'content'],

View File

@ -34,6 +34,8 @@ class SoundAdmin(admin.ModelAdmin):
list_display = ['id', 'name', 'program', 'type', 'duration',
'is_public', 'is_good_quality', 'episode', 'filename']
list_filter = ('program', 'type', 'is_good_quality', 'is_public')
search_fields = ['name', 'program']
fieldsets = [
(None, {'fields': ['name', 'path', 'type', 'program', 'episode']}),
(None, {'fields': ['embed', 'duration', 'is_public', 'mtime']}),
@ -50,7 +52,9 @@ class TrackAdmin(admin.ModelAdmin):
list_display = ['pk', 'artist', 'title', 'tag_list', 'episode', 'sound', 'timestamp']
list_editable = ['artist', 'title']
list_filter = ['sound', 'episode', 'artist', 'title', 'tags']
list_filter = ['artist', 'title', 'tags']
search_fields = ['artist', 'title']
fieldsets = [
(_('Playlist'), {'fields': ['episode', 'sound', 'position', 'timestamp']}),
(_('Info'), {'fields': ['artist', 'title', 'info', 'tags']}),

View File

@ -1,5 +1,5 @@
from .article import Article
from .page import Category, Page, NavItem
from .page import Category, Page, Comment, NavItem
from .program import Program, Stream, Schedule
from .episode import Episode, Diffusion
from .log import Log

View File

@ -16,7 +16,7 @@ from model_utils.managers import InheritanceQuerySet
from .station import Station
__all__ = ['Category', 'PageQuerySet', 'Page', 'NavItem']
__all__ = ['Category', 'PageQuerySet', 'Page', 'Comment', 'NavItem']
headline_re = re.compile(r'(<p>)?'

View File

@ -1,627 +0,0 @@
/**
* Define rules for the default layouts, and some useful classes
*/
/** general **/
body {
background-color: #F2F2F2;
font-family: "Myriad Pro",Calibri,Helvetica,Arial,sans-serif;
}
h1, h2, h3, h4, h5 {
font-family: "Myriad Pro",Calibri,Helvetica,Arial,sans-serif;
margin: 0.4em 0em;
}
h1:first-letter, h2:first-letter, h3:first-letter, h4:first-letter {
text-transform: capitalize;
}
h1 { font-size: 1.4em; }
h2 { font-size: 1.2em; }
h3 { font-size: 0.9em; }
h4 { font-size: 0.8em; }
h1 > *, h2 > *, h3 > *, h4 > * { vertical-align: middle; }
a {
cursor: pointer;
text-decoration: none;
color: #616161;
}
a:hover { color: #007EDF; }
a:hover > .small_icon { box-shadow: 0em 0em 0.1em #007EDF; }
ul { margin: 0em; }
/**** position & box ****/
.float_right { float: right; }
.float_left { float: left; }
.flex_row {
display: -webkit-flex;
display: flex;
-webkit-flex-direction: row;
flex-direction: row;
}
.flex_column {
display: -webkit-flex;
display: flex;
-webkit-flex-direction: column;
flex-direction: column;
}
.flex_row > .flex_item,
.flex_column > .flex_item {
-webkit-flex: auto;
flex: auto;
}
.small {
font-size: 0.8em;
}
/**** indicators & info ****/
time, .tags {
font-size: 0.9em;
color: #616161;
}
.info {
font-size: 0.9em;
padding: 0.1em;
color: #007EDF;
}
.error { color: red; }
.warning { color: orange; }
.success { color: green; }
.icon {
max-width: 2em;
max-height: 2em;
vertical-align: middle;
}
.small_icon {
max-height: 1.5em;
vertical-align: middle;
}
/** main layout **/
body > * {
max-width: 92em;
margin: 0em auto;
padding: 0em;
}
.menu {
padding: 0.4em;
}
.menu:empty {
display: none;
}
.menu.row section {
display: inline-block;
}
.menu.col > section {
margin-bottom: 1em;
}
/**** top + header layout ****/
body > .top {
position: fixed;
z-index: 10000000;
top: 0;
left: 0;
width: 100%;
max-width: 100%;
margin: 0em auto;
background-color: white;
border-bottom: 0.1em #dfdfdf solid;
box-shadow: 0em 0.1em 0.1em rgba(255,255,255,0.7);
box-shadow: 0em 0.1em 0.5em rgba(0,0,0,0.1);
transition: opacity 1.5s;
}
body > .top > .menu {
max-width: 92em;
height: 2.5em;
margin: 0em auto;
}
body[scrollY] > .top {
opacity: 0.1;
transition: opacity 1.5s 1s;
}
body > .top:hover {
opacity: 1.0;
transition: opacity 1.5s;
}
body > .header {
overflow: hidden;
margin-top: 3.3em;
margin-bottom: 1em;
}
/** FIXME: remove this once image slides impled **/
body > .header > div {
width: 15000%;
}
body > .header > div > section {
margin: 0;
margin-right: -0.4em;
}
/**** page layout ****/
.page {
display: flex;
}
.page > main {
flex: auto;
overflow: hidden;
margin: 0em 0em;
border-radius: 0.4em;
border: 0.1em #dfdfdf solid;
background-color: rgba(255,255,255,0.9);
box-shadow: inset 0.1em 0.1em 0.2em rgba(255, 255, 255, 0.8);
}
.page > nav {
flex: 1;
width: 50em;
overflow: hidden;
max-width: 16em;
}
.page > .menu.col:first-child { margin-right: 2em; }
.page > main + .menu.col { margin-left: 2em; }
/**** page main ****/
main:not(.detail) h1 {
margin: 0em 0em 0.4em 0em;
}
main .post_content {
display: block;
}
main .post_content section {
display: inline-block;
width: calc(50% - 1em);
vertical-align: top;
}
main.detail {
padding: 0em;
margin: 0em;
}
main > .content {
padding: 1em;
}
main > header {
margin: 0em;
padding: 1em;
position: relative;
}
main > header .foreground {
position: absolute;
left: 0em;
top: 0em;
width: calc(100% - 2em);
padding: 1em;
}
main > header h1 {
width: calc(100% - 2em);
margin: 0em;
margin-bottom: 0.8em;
}
main header .headline {
display: inline-block;
width: calc(60% - 0.8em);
min-height: 1.2em;
font-size: 1.2em;
font-weight: bold;
}
main > header .background {
margin: -1em;
height: 17em;
overflow: hidden;
position: relative;
}
main > header .background img {
position: absolute;
/*! top: -40%; */
/*! left: -40%; */
width: 100%;
min-height: 100%;
filter: blur(20px);
opacity: 0.3;
}
main > header .cover {
right: 0em;
top: 1em;
width: auto;
max-height: calc(100% - 2em);
max-width: calc(40% - 2em);
margin: 1em;
position: absolute;
box-shadow: 0em 0em 4em rgba(0, 0, 0, 0.4);
}
/** sections **/
body section ul {
padding: 0em;
padding-left: 1em;
}
/**** link list ****/
.menu.row .section_link_list > a {
display: inline-block;
margin: 0.2em 1em;
}
.menu.col .section_link_list > a {
display: block;
}
/** content: menus **/
/** content: list & items **/
.list {
width: 100%;
}
ul.list, .list > ul {
padding: 0.4em;
}
.list_item {
margin: 0.4em 0;
}
.list_item > *:not(:last-child) {
margin-right: 0.4em;
}
.list_item img.cover.big {
display: block;
max-width: 100%;
min-height: 15em;
margin: auto;
}
.list_item img.cover.small {
margin-right: 0.4em;
border-radius: 0.4em;
float: left;
min-height: 64px;
}
.list_item > * {
margin: 0em 0.2em;
vertical-align: middle;
}
.list nav {
text-align: center;
font-size: 0.9em;
}
/** content: list items in full page **/
.content > .list:not(.date_list) .list_item {
min-width: 20em;
display: inline-block;
min-height: 2.5em;
margin: 0.4em;
}
/** content: date list **/
.date_list nav {
text-align:center;
}
.date_list nav a {
display: inline-block;
width: 2em;
}
.date_list nav a.date {
width: 4em;
}
.date_list nav a[selected] {
color: #007EDF;
border-bottom: 0.2em #007EDF dotted;
}
.date_list ul:not([selected]) {
display: none;
}
.date_list ul:target {
display: block;
}
.date_list h2 {
display: none;
}
.date_list_item .cover.small {
width: 64px;
margin: 0.4em;
}
.date_list_item h3 {
margin-top: 0em;
}
.date_list_item time {
color: #007EDF;
}
.date_list_item.now {
padding: 0.4em;
}
.date_list_item img.now {
width: 1.3em;
vertical-align: bottom;
}
/** content: date list in full page **/
.content > .date_list .date_list_item time {
color: #007EDF;
font-size: 1.1em;
display: block;
}
.content > .date_list .date_list_item:nth-child(2n+1),
.date_list_item.now {
box-shadow: inset 0em 0em 3em rgba(0, 124, 226, 0.1);
background-color: rgba(0, 124, 226, 0.05);
}
.content > .date_list {
padding: 0 10%;
margin: auto;
width: 80%;
}
/** content: comments **/
.comments form input:not([type=checkbox]),
.comments form textarea {
display: inline-block;
width: 100%;
max-height: 6em;
margin: 0.2em 0em;
padding: 0.2em;
}
.comments form input[type=checkbox],
.comments form button[type=submit] {
vertical-align:bottom;
margin: 0.2em 0em;
text-align: center;
}
.comments form button[type=submit] {
float: right;
}
.comments form #show_more:not(:checked) ~ .extra {
display: none;
}
.comments label[for="show_more"] {
font-size: 0.8em;
}
.comments ul {
margin-top: 2.5em;
}
.comment {
list-style: none;
border: 1px #818181 dotted;
margin: 0.4em 0em;
}
.comment .metadata {
font-size: 0.9em;
}
.comment time {
float: right;
}
/** component: sound **/
.component.sound {
display: flex;
flex-direction: row;
margin: 0.2em;
width: 100%;
}
.component.sound[state="play"] button {
animation-name: sound-blink;
animation-duration: 4s;
animation-iteration-count: infinite;
animation-direction: alternate;
}
@keyframes sound-blink {
from { background-color: rgba(255, 255, 255, 0); }
to { background-color: rgba(255, 255, 255, 0.6); }
}
.component.sound .button {
width: 4em;
height: 4em;
cursor: pointer;
position: relative;
margin-right: 0.4em;
}
.component.sound .button > img {
width: 100%;
height: 100%;
}
.component.sound button {
transition: background-color 0.5s;
background-color: rgba(255,255,255,0.1);
position: absolute;
cursor: pointer;
left: 0;
top: 0;
width: 100%;
height: 100%;
border: 0;
}
.component.sound button:hover {
background-color: rgba(255,255,255,0.5);
}
.component.sound button > img {
background-color: rgba(255,255,255,0.9);
border-radius: 50%;
}
.component.sound .content {
position: relative;
}
.component.sound .info {
text-align: right;
}
.component.sound progress {
width: 100%;
position: absolute;
bottom: 0;
height: 0.4em;
}
.component.sound progress:hover {
height: 1em;
}
/** component: playlist **/
.component.playlist footer {
text-align: right;
display: block;
}
.component.playlist .read_all {
display: none;
}
.component.playlist .read_all + label {
display: inline-block;
padding: 0.1em;
margin-left: 0.2em;
cursor: pointer;
font-size: 1em;
box-shadow: inset 0em 0em 0.1em #818181;
}
.component.playlist .read_all:not(:checked) + label {
border-left: 0.1em #818181 solid;
margin-right: 0em;
}
.component.playlist .read_all:checked + label {
border-right: 0.1em #007EDF solid;
box-shadow: inset 0em 0em 0.1em #007EDF;
margin-right: 0em;
}
/** content: page **/
main .body ~ section:not(.comments) {
width: calc(50% - 1em);
vertical-align: top;
display: inline-block;
}
.meta .author .headline {
display: none;
}
.meta .link_list > a {
font-size: 0.9em;
margin: 0em 0.1em;
padding: 0.2em;
line-height: 1.4em;
}
.meta .link_list > a:hover {
border-radius: 0.2em;
background-color: rgba(0, 126, 223, 0.1);
}
/** content: others **/
.list_item.track .title {
display: inline;
font-style: italic;
font-weight: normal;
font-size: 0.9em;
}

View File

@ -1,130 +0,0 @@
This is a human-readable summary of (and not a substitute for) the license.
http://creativecommons.org/licenses/by-sa/4.0/
------
Disclaimer
This license is acceptable for Free Cultural Works.
You are free to:
Share — copy and redistribute the material in any medium or format
Adapt — remix, transform, and build upon the material
for any purpose, even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
------
Creative Commons Attribution-ShareAlike 4.0 International Public License
By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
Section 1 Definitions.
Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
BY-SA Compatible License means a license listed at creativecommons.org/compatiblelicenses, approved by Creative Commons as essentially the equivalent of this Public License.
Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
License Elements means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution and ShareAlike.
Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
Licensor means the individual(s) or entity(ies) granting rights under this Public License.
Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
Section 2 Scope.
License grant.
Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
reproduce and Share the Licensed Material, in whole or in part; and
produce, reproduce, and Share Adapted Material.
Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
Term. The term of this Public License is specified in Section 6(a).
Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
Downstream recipients.
Offer from the Licensor Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
Additional offer from the Licensor Adapted Material. Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapters License You apply.
No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
Other rights.
Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
Patent and trademark rights are not licensed under this Public License.
To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties.
Section 3 License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the following conditions.
Attribution.
If You Share the Licensed Material (including in modified form), You must:
retain the following if it is supplied by the Licensor with the Licensed Material:
identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
a copyright notice;
a notice that refers to this Public License;
a notice that refers to the disclaimer of warranties;
a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
ShareAlike.
In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply.
The Adapters License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-SA Compatible License.
You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material.
You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply.
Section 4 Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database;
if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and
You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
Section 5 Disclaimer of Warranties and Limitation of Liability.
Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
Section 6 Term and Termination.
This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
Section 7 Other Terms and Conditions.
The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
Section 8 Interpretation.
For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.

View File

@ -1,14 +0,0 @@
# Android Developer Icons
Android Developer Icons is a custom icon set, created by [Opoloo](http://www.opoloo.com/). Included are:
* 250 hand-crafted, pixel-perfect icons in 5 sizes and 14 colors
* an icon font, made from the set
* all sources: .svg, .ai, .eps, .eot, .ttf, .woff
## License
[Attribution-ShareAlike 4.0 International CC BY-SA 4.0]
(http://creativecommons.org/licenses/by-sa/4.0/)
## More
Were always happy to hear from you, whether its a question about the icon set or giving us a heads-up where you used our beautiful little icons in a project. If you like, follow us at [Google+](https://plus.google.com/u/0/b/104776915031333350956/+Opoloo/posts), on [Twitter](https://twitter.com/Opoloo), or [shoot us an email](mailto: info@opoloo.com).

Binary file not shown.

Before

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 777 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 855 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 545 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 679 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 952 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 884 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 971 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 669 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 696 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -7171,6 +7171,9 @@ label.panel-block {
a.navbar-item.is-active {
border-bottom: 1px grey solid; }
.navbar .navbar-dropdown {
z-index: 2000; }
/*
.navbar-brand img {
min-height: 6em;

View File

@ -148,7 +148,7 @@
/******/
/******/
/******/ // add entry module to deferred list
/******/ deferredModules.push(["./assets/index.js","vendor"]);
/******/ deferredModules.push(["./assets/index.js","vendor","admin"]);
/******/ // run deferred modules when ready
/******/ return checkDeferredModules();
/******/ })
@ -164,7 +164,7 @@
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _fortawesome_fontawesome_free_css_all_min_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @fortawesome/fontawesome-free/css/all.min.css */ \"./node_modules/@fortawesome/fontawesome-free/css/all.min.css\");\n/* harmony import */ var _fortawesome_fontawesome_free_css_all_min_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_fortawesome_fontawesome_free_css_all_min_css__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _fortawesome_fontawesome_free_css_fontawesome_min_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @fortawesome/fontawesome-free/css/fontawesome.min.css */ \"./node_modules/@fortawesome/fontawesome-free/css/fontawesome.min.css\");\n/* harmony import */ var _fortawesome_fontawesome_free_css_fontawesome_min_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_fortawesome_fontawesome_free_css_fontawesome_min_css__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./js */ \"./assets/js/index.js\");\n/* harmony import */ var _styles_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./styles.scss */ \"./assets/styles.scss\");\n/* harmony import */ var _styles_scss__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_styles_scss__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./vue */ \"./assets/vue/index.js\");\n\n\n\n\n\n// import './noscript.scss';\n\n\n\n\n//# sourceURL=webpack:///./assets/index.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _fortawesome_fontawesome_free_css_all_min_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @fortawesome/fontawesome-free/css/all.min.css */ \"./node_modules/@fortawesome/fontawesome-free/css/all.min.css\");\n/* harmony import */ var _fortawesome_fontawesome_free_css_all_min_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_fortawesome_fontawesome_free_css_all_min_css__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _fortawesome_fontawesome_free_css_fontawesome_min_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @fortawesome/fontawesome-free/css/fontawesome.min.css */ \"./node_modules/@fortawesome/fontawesome-free/css/fontawesome.min.css\");\n/* harmony import */ var _fortawesome_fontawesome_free_css_fontawesome_min_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_fortawesome_fontawesome_free_css_fontawesome_min_css__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./js */ \"./assets/js/index.js\");\n/* harmony import */ var _vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./vue */ \"./assets/vue/index.js\");\n/* harmony import */ var _styles_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./styles.scss */ \"./assets/styles.scss\");\n/* harmony import */ var _styles_scss__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_styles_scss__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _admin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./admin */ \"./assets/admin/index.js\");\n\n\n\n\n\n\n\n// import './noscript.scss';\n\n\n\n\n//# sourceURL=webpack:///./assets/index.js?");
/***/ }),

View File

@ -1,11 +1,6 @@
{% extends "admin/change_form.html" %}
{% load i18n static %}
{% block extrahead %}{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% static "aircox/vendor.css" %}"/>
<link rel="stylesheet" type="text/css" href="{% static "aircox/main.css" %}"/>
{% endblock %}
{% block submit_buttons_bottom %}
{% if has_change_permission %}
<div class="columns is-size-5">

View File

@ -0,0 +1,112 @@
{% load i18n static %}<!DOCTYPE html>
{% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %}
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
<head>
<title>{% block title %}{% endblock %}</title>
<link rel="stylesheet" type="text/css" href="{% static "admin/css/base.css" %}">
<link rel="stylesheet" type="text/css" href="{% static "aircox/main.css" %}">
<link rel="stylesheet" type="text/css" href="{% static "aircox/admin.css" %}">
{% block extrastyle %}{% endblock %}
{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}">{% endif %}
{% block extrahead %}{% endblock %}
{% block responsive %}
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" type="text/css" href="{% static "admin/css/responsive.css" %}">
{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% static "admin/css/responsive_rtl.css" %}">{% endif %}
{% endblock %}
{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE">{% endblock %}
</head>
{% load i18n %}
<body class="{% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}"
data-admin-utc-offset="{% now "Z" %}">
<!-- Container -->
<div id="container">
{% if not is_popup %}
<!-- Header -->
<nav class="navbar">
<div class="navbar-brand">
{% block branding %}{% endblock %}
</div>
<div class="navbar-menu">
{% block usertools %}
<div class="navbar-start">
<a class="navbar-item" href="{% url "admin:aircox_article_changelist" %}">{% trans "Articles" %}</a>
<a class="navbar-item" href="{% url "admin:aircox_episode_changelist" %}">{% trans "Episodes" %}</a>
<a class="navbar-item" href="{% url "admin:aircox_program_changelist" %}">{% trans "Programs" %}</a>
</div>
{% if has_permission %}
<div class="navbar-end">
<div class="navbar-item has-dropdown is-hoverable">
<a href="{% url "admin:auth_user_change" user.pk %}" class="navbar-link">
{% firstof user.get_short_name user.get_username %}
</a>
<div class="navbar-dropdown is-boxed is-right">
{% block userlinks %}
{% if site_url %}
<a href="{{ site_url }}" class="navbar-item">{% trans 'View site' %}</a>
{% endif %}
{% if user.is_active and user.is_staff %}
{% url 'django-admindocs-docroot' as docsroot %}
{% if docsroot %}
<a href="{{ docsroot }}" class="navbar-item">{% trans 'Documentation' %}</a>
{% endif %}
{% endif %}
{% if user.has_usable_password %}
<a href="{% url 'admin:password_change' %}" class="navbar-item">{% trans 'Change password' %}</a>
{% endif %}
<a href="{% url 'admin:logout' %}" class="navbar-item">{% trans 'Log out' %}</a>
{% endblock %}
</div>
</div>
</div>
{% endif %}
{% endblock %}
</div>
{% block nav-global %}{% endblock %}
</nav>
<!-- END Header -->
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
{% if title %} &rsaquo; {{ title }}{% endif %}
</div>
{% endblock %}
{% endif %}
{% block messages %}
{% if messages %}
<ul class="messagelist">{% for message in messages %}
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message|capfirst }}</li>
{% endfor %}</ul>
{% endif %}
{% endblock messages %}
<!-- Content -->
<div id="content" class="{% block coltype %}colM{% endblock %}">
{% block pretitle %}{% endblock %}
{% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif %}{% endblock %}
{% block content %}
{% block object-tools %}{% endblock %}
{{ content }}
{% endblock %}
{% block sidebar %}{% endblock %}
<br class="clear">
</div>
<!-- END Content -->
{% block footer %}<div id="footer"></div>{% endblock %}
</div>
<!-- END Container -->
</body>
</html>

View File

@ -0,0 +1,10 @@
{% extends "admin/base_site.html" %}
{% load static %}
{% block branding %}
<a href="{% url 'admin:index' %}">
<img src="{% static "aircox/logo.png" %}"/>
</a>
{% endblock %}

View File

@ -0,0 +1,89 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_urls static admin_list %}
{% block extrastyle %}
{{ block.super }}
{% if cl.formset %}
<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}">
{% endif %}
{% if cl.formset or action_form %}
<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
{% endif %}
{{ media.css }}
{% if not actions_on_top and not actions_on_bottom %}
<style>
#changelist table thead th:first-child {width: inherit}
</style>
{% endif %}
{% endblock %}
{% block extrahead %}
{{ block.super }}
{{ media.js }}
{% endblock %}
{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} change-list{% endblock %}
{% if not is_popup %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=cl.opts.app_label %}">{{ cl.opts.app_config.verbose_name }}</a>
&rsaquo; {{ cl.opts.verbose_name_plural|capfirst }}
</div>
{% endblock %}
{% endif %}
{% block coltype %}flex{% endblock %}
{% block content %}
<div id="content-main">
{% block object-tools %}
<ul class="object-tools">
{% block object-tools-items %}
{% change_list_object_tools %}
{% endblock %}
</ul>
{% endblock %}
{% if cl.formset and cl.formset.errors %}
<p class="errornote">
{% if cl.formset.total_error_count == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}
</p>
{{ cl.formset.non_form_errors }}
{% endif %}
<div class="columns is-fullwidth module {% if cl.has_filters %} filtered{% endif %}" id="changelist">
<div class="column">
<form id="changelist-form" method="post"{% if cl.formset and cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %} novalidate>{% csrf_token %}
{% if cl.formset %}
<div>{{ cl.formset.management_form }}</div>
{% endif %}
{% block result_list %}
{% if action_form and actions_on_top and cl.show_admin_actions %}{% admin_actions %}{% endif %}
{% result_list cl %}
{% if action_form and actions_on_bottom and cl.show_admin_actions %}{% admin_actions %}{% endif %}
{% endblock %}
{% block pagination %}{% pagination cl %}{% endblock %}
</form>
</div>
<div class="column is-one-quarter">
{% block search %}{% search_form cl %}{% endblock %}
<hr>
{% block date_hierarchy %}{% if cl.date_hierarchy %}{% date_hierarchy cl %}{% endif %}{% endblock %}
{% block filters %}
{% if cl.has_filters %}
<div id="changelist-filter">
<h2>{% trans 'Filter' %}</h2>
{% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %}
</div>
{% endif %}
{% endblock %}
</div>
</div>
</div>
{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "aircox/page.html" %}
{% extends "aircox/page_detail.html" %}
{% load i18n %}
{% block side_nav %}

View File

@ -1,6 +1,7 @@
{% load static i18n thumbnail aircox %}
{% comment %}
Context:
- cover: image cover
- site: current website
{% endcomment %}
<html>
@ -70,6 +71,7 @@ Context:
{% if show_side_nav %}
<aside class="column is-one-third-desktop">
{# FIXME: block cover into side_nav one #}
{% block cover %}
{% if cover is not None %}
<img class="cover" src="{{ cover.url }}" class="cover"/>

View File

@ -13,10 +13,7 @@
</div>
{% endblock %}
{% block main %}
{{ block.super }}
{% block main %}{{ block.super }}
{% with True as hide_schedule %}
<section>
{% unique_id "timetable" as timetable_id %}

View File

@ -1,8 +1,7 @@
{% extends "aircox/program_base.html" %}
{% load i18n %}
{% block header %}
{{ block.super }}
{% block header %}{{ block.super }}
<section class="is-size-5 has-text-weight-bold">
{% for diffusion in object.diffusion_set.all %}
@ -28,8 +27,7 @@
</section>
{% endblock %}
{% block main %}
{{ block.super }}
{% block content %}{{ block.super }}
{% if podcasts or tracks %}
<div class="columns is-desktop">

View File

@ -7,8 +7,6 @@
{% block main %}
{{ block.super }}
<section class="section">
{% if dates %}
<nav class="tabs is-medium is-centered" aria-label="{% trans "Other days' logs" %}">

View File

@ -7,13 +7,6 @@ Context:
- page: page
{% endcomment %}
{% block subtitle %}
{{ block.super }}
{% if page.category %}
<span class="column has-text-right">{{ page.category.title }}</span>
{% endif %}
{% endblock %}
{% block head_title %}
{% block title %}{{ title }}{% endblock %}
&mdash;
@ -21,11 +14,3 @@ Context:
{% endblock %}
{% block main %}
{% block content %}
{{ page.content|default_if_none:''|safe }}
{% endblock %}
{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "aircox/page.html" %}
{% extends "aircox/page_detail.html" %}
{% load i18n %}
{% block side_nav %}

View File

@ -7,8 +7,7 @@
{% endblock %}
{% block main %}
{{ block.super }}
{% block content %}{{ block.super }}
<br>

View File

@ -1,10 +1,13 @@
from django.core.exceptions import FieldDoesNotExist
from django.http import Http404
from django.http import Http404, HttpResponse
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext_lazy as _
from django.views.generic import DetailView, ListView
from ..models import Category
from honeypot.decorators import check_honeypot
from ..forms import CommentForm
from ..models import Category, Comment
from ..utils import Redirect
from .base import BaseView
@ -108,6 +111,9 @@ class PageDetailView(BaseView, DetailView):
return None
def get_object(self):
if getattr(self, 'object', None):
return self.object
obj = super().get_object()
if not obj.is_published:
redirect_url = self.not_published_redirect(obj)
@ -120,7 +126,32 @@ class PageDetailView(BaseView, DetailView):
page = kwargs.setdefault('page', self.object)
kwargs.setdefault('title', page.title)
kwargs.setdefault('cover', page.cover)
if self.object.allow_comments and not 'comment_form' in kwargs:
kwargs['comment_form'] = CommentForm()
kwargs['comments'] = Comment.objects.filter(page=self.object) \
.order_by('-date')
return super().get_context_data(**kwargs)
@classmethod
def as_view(cls, *args, **kwargs):
view = super(PageDetailView, cls).as_view(*args, **kwargs)
return check_honeypot(view, field_name='website')
def post(self, request, *args, **kwargs):
self.object = self.get_object()
if not self.object.allow_comments:
return HttpResponse(_('comments are not allowed'), status=503)
form = CommentForm(request.POST)
comment = form.save(commit=False)
comment.page = self.object
comment.save()
return self.get(request, *args, **kwargs)

26
assets/admin/admin.scss Normal file
View File

@ -0,0 +1,26 @@
// @import './bulmacolors';
.navbar {
box-shadow: 0em 0em 0.6em rgba(0, 0, 0, 0.4);
}
.navbar .navbar-brand {
padding-right: 1em;
}
.navbar .navbar-brand img {
margin: 0em 0.4em;
margin-top: 0.3em;
max-height: 3em;
}
.breadcrumbs {
margin-bottom: 1em;
}
.results > #result_list {
width: 100%;
margin: 1em 0em;
}

3
assets/admin/index.js Normal file
View File

@ -0,0 +1,3 @@
import './admin.scss';

View File

@ -2,7 +2,9 @@ import '@fortawesome/fontawesome-free/css/all.min.css';
import '@fortawesome/fontawesome-free/css/fontawesome.min.css';
import './js';
import './styles.scss';
// import './noscript.scss';
import './vue';
import './styles.scss';
// import './noscript.scss';
import './admin';

View File

@ -30,6 +30,10 @@ a.navbar-item.is-active {
border-bottom: 1px grey solid;
}
.navbar .navbar-dropdown {
z-index: 2000;
}
/*
.navbar-brand img {
min-height: 6em;

View File

@ -134,6 +134,7 @@ INSTALLED_APPS = (
# django
'django.contrib.contenttypes',
'django.contrib.auth',
'django.contrib.humanize',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',

View File

@ -29,6 +29,12 @@ module.exports = (env, argv) => Object({
test: /[\\/]node_modules[\\/]/,
},
admin: {
name: 'admin',
chunks: 'initial',
enforce: true,
test: /assets[\\/]admin[\\/]/,
},
/*noscript: {
name: 'noscript',
@ -81,12 +87,11 @@ module.exports = (env, argv) => Object({
// buefy: 'buefy/dist/buefy.js',
},
modules: [
'assets/css',
'assets/js',
'assets/vue',
'./node_modules',
],
extensions: ['.js', '.vue', '.css', '.styl', '.ttf']
extensions: ['.js', '.vue', '.css', '.scss', '.styl', '.ttf']
},
})