forked from rc/aircox
		
	work on sections
This commit is contained in:
		
							
								
								
									
										
											BIN
										
									
								
								website/static/website/colony.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								website/static/website/colony.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 15 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								website/static/website/logo.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								website/static/website/logo.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 41 KiB  | 
							
								
								
									
										44
									
								
								website/static/website/styles.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								website/static/website/styles.css
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,44 @@
 | 
			
		||||
 | 
			
		||||
body {
 | 
			
		||||
    background-color: #F2F2F2;
 | 
			
		||||
    font-family: "Myriad Pro",Calibri,Helvetica,Arial,sans-serif;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
h1, h2, h3 {
 | 
			
		||||
    font-family: "Myriad Pro",Calibri,Helvetica,Arial,sans-serif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
nav.menu {
 | 
			
		||||
    padding: 0.5em;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
nav.menu_top {
 | 
			
		||||
    background-color: #212121;
 | 
			
		||||
    color: #007EDF;
 | 
			
		||||
    font-size: 1.1em;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    header {
 | 
			
		||||
        height: 9em;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    header img {
 | 
			
		||||
        height: 100%;
 | 
			
		||||
        float: left;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    header .colony {
 | 
			
		||||
        position: fixed;
 | 
			
		||||
        top: 0em;
 | 
			
		||||
        right: 0;
 | 
			
		||||
        z-index: -1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
.page {
 | 
			
		||||
    width: 100%;
 | 
			
		||||
    background-color: rgba(255, 255, 255, 0.8);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -4,7 +4,7 @@ from website.models import *
 | 
			
		||||
from website.views import *
 | 
			
		||||
 | 
			
		||||
from aircox_cms.models import Article
 | 
			
		||||
from aircox_cms.views import ViewSet, Menu, Section
 | 
			
		||||
from aircox_cms.views import Menu, Section, Sections, ViewSet
 | 
			
		||||
from aircox_cms.routes import *
 | 
			
		||||
from aircox_cms.website import Website
 | 
			
		||||
 | 
			
		||||
@ -17,8 +17,8 @@ class ProgramSet (ViewSet):
 | 
			
		||||
        DateRoute,
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
    detail_sections = [
 | 
			
		||||
        ScheduleSection
 | 
			
		||||
    detail_sections = ViewSet.detail_sections + [
 | 
			
		||||
        ScheduleSection,
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
class EpisodeSet (ViewSet):
 | 
			
		||||
@ -42,17 +42,33 @@ class ArticleSet (ViewSet):
 | 
			
		||||
 | 
			
		||||
website = Website(
 | 
			
		||||
    name = 'RadioCampus',
 | 
			
		||||
    styles = 'website/styles.css',
 | 
			
		||||
 | 
			
		||||
    menus = [
 | 
			
		||||
        Menu(
 | 
			
		||||
            position = 'header',
 | 
			
		||||
            sections = [
 | 
			
		||||
                Sections.Image(url = 'website/logo.png'),
 | 
			
		||||
                Sections.Image(url = 'website/colony.png', classes='colony'),
 | 
			
		||||
            ]
 | 
			
		||||
        ),
 | 
			
		||||
 | 
			
		||||
        Menu(
 | 
			
		||||
            position = 'top',
 | 
			
		||||
            sections = [
 | 
			
		||||
                Section(content = "Radio Campus le SITE")
 | 
			
		||||
            ]
 | 
			
		||||
        )
 | 
			
		||||
        ),
 | 
			
		||||
 | 
			
		||||
        Menu(
 | 
			
		||||
            position = 'left',
 | 
			
		||||
            sections = [
 | 
			
		||||
                Section(content = 'loool<br>blob')
 | 
			
		||||
            ],
 | 
			
		||||
        ),
 | 
			
		||||
    ],
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
website.register_set(ProgramSet)
 | 
			
		||||
website.register_set(EpisodeSet)
 | 
			
		||||
website.register_set(ArticleSet)
 | 
			
		||||
 | 
			
		||||
@ -6,21 +6,21 @@ from django.core import serializers
 | 
			
		||||
from django.utils.translation import ugettext as _, ugettext_lazy
 | 
			
		||||
 | 
			
		||||
import aircox_programs.models as programs
 | 
			
		||||
from aircox_cms.views import ListSection
 | 
			
		||||
from aircox_cms.views import Sections
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class PlaylistSection (ListSection):
 | 
			
		||||
class PlayListSection (Sections.List):
 | 
			
		||||
    title = _('Playlist')
 | 
			
		||||
 | 
			
		||||
    def get_object_list (self):
 | 
			
		||||
        tracks = programs.Track.objects \
 | 
			
		||||
                     .filter(episode = self.object) \
 | 
			
		||||
                     .order_by('position')
 | 
			
		||||
        return [ ListSection.Item(None, track.title, track.artist)
 | 
			
		||||
        return [ Sections.List.Item(None, track.title, track.artist)
 | 
			
		||||
                    for track in tracks ]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class ScheduleSection (ListSection):
 | 
			
		||||
class ScheduleSection (Sections.List):
 | 
			
		||||
    title = _('Schedule')
 | 
			
		||||
 | 
			
		||||
    def get_object_list (self):
 | 
			
		||||
@ -28,7 +28,7 @@ class ScheduleSection (ListSection):
 | 
			
		||||
                    .filter(program = self.object.pk)
 | 
			
		||||
 | 
			
		||||
        return [
 | 
			
		||||
            ListSection.Item(None, sched.get_frequency_display(),
 | 
			
		||||
            Sections.List.Item(None, sched.get_frequency_display(),
 | 
			
		||||
                             _('rerun') if sched.rerun else None)
 | 
			
		||||
            for sched in scheds
 | 
			
		||||
        ]
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user