Browse Source

Beginnings of board index page

Ralfp 12 years ago
parent
commit
134ceb8c33

+ 3 - 0
misago/forums/acl.py

@@ -16,6 +16,9 @@ def make_forum_form(request, role, form):
     
     
 
 
 class ForumsACL(BaseACL):
 class ForumsACL(BaseACL):
+    def known_forums(self):
+        return self.acl['can_see']
+    
     def can_see(self, forum):
     def can_see(self, forum):
         try:
         try:
             return forum.pk in self.acl['can_see']
             return forum.pk in self.acl['can_see']

+ 0 - 12
misago/forums/forms.py

@@ -10,11 +10,6 @@ class CategoryForm(Form):
     description = forms.CharField(widget=forms.Textarea,required=False)
     description = forms.CharField(widget=forms.Textarea,required=False)
     closed = forms.BooleanField(widget=YesNoSwitch,required=False)
     closed = forms.BooleanField(widget=YesNoSwitch,required=False)
     style = forms.CharField(max_length=255,required=False)
     style = forms.CharField(max_length=255,required=False)
-    template = forms.ChoiceField(choices=(
-                                          ('rows', _('One forum per row')),
-                                          ('fifty', _('Two forums per row')),
-                                          ('thirty', _('Three forums per row')),
-                                          ))
     
     
     layout = (
     layout = (
               (
               (
@@ -30,7 +25,6 @@ class CategoryForm(Form):
                _("Display Options"),
                _("Display Options"),
                (
                (
                 ('style', {'label': _("Category Style"), 'help_text': _('You can add custom CSS classess to this category, to change way it looks on board index.')}),
                 ('style', {'label': _("Category Style"), 'help_text': _('You can add custom CSS classess to this category, to change way it looks on board index.')}),
-                ('template', {'label': _("Category Layout")}),
                 ),
                 ),
               ),
               ),
              )
              )
@@ -46,11 +40,6 @@ class ForumForm(Form):
     description = forms.CharField(widget=forms.Textarea,required=False)
     description = forms.CharField(widget=forms.Textarea,required=False)
     closed = forms.BooleanField(widget=YesNoSwitch,required=False)
     closed = forms.BooleanField(widget=YesNoSwitch,required=False)
     style = forms.CharField(max_length=255,required=False)
     style = forms.CharField(max_length=255,required=False)
-    template = forms.ChoiceField(choices=(
-                                          ('rows', _('One forum per row')),
-                                          ('fifty', _('Two forums per row')),
-                                          ('thirty', _('Three forums per row')),
-                                          ))
     prune_start = forms.IntegerField(min_value=0,initial=0)
     prune_start = forms.IntegerField(min_value=0,initial=0)
     prune_last = forms.IntegerField(min_value=0,initial=0)
     prune_last = forms.IntegerField(min_value=0,initial=0)
     
     
@@ -75,7 +64,6 @@ class ForumForm(Form):
                _("Display Options"),
                _("Display Options"),
                (
                (
                 ('style', {'label': _("Forum Style"), 'help_text': _('You can add custom CSS classess to this forum to change way it looks on forums lists.')}),
                 ('style', {'label': _("Forum Style"), 'help_text': _('You can add custom CSS classess to this forum to change way it looks on forums lists.')}),
-                ('template', {'label': _("Subforums List Layout")}),
                 ),
                 ),
               ),
               ),
              )
              )

+ 20 - 1
misago/forums/models.py

@@ -3,6 +3,20 @@ from django.db import models
 from django.utils.translation import ugettext_lazy as _
 from django.utils.translation import ugettext_lazy as _
 from mptt.models import MPTTModel, TreeForeignKey
 from mptt.models import MPTTModel, TreeForeignKey
 
 
+class ForumManager(models.Manager):
+    def treelist(self, forums, parent=None):
+        forums_list = []
+        parents = {}
+        for forum in Forum.objects.filter(pk__in=forums).filter(level__lte=3).order_by('lft'):
+            forum.subforums = []
+            parents[forum.pk] = forum
+            if forum.parent_id in parents:
+                parents[forum.parent_id].subforums.append(forum)
+            else:
+                forums_list.append(forum)
+        return forums_list
+
+
 class Forum(MPTTModel):
 class Forum(MPTTModel):
     parent = TreeForeignKey('self', null=True, blank=True, related_name='children')
     parent = TreeForeignKey('self', null=True, blank=True, related_name='children')
     type = models.CharField(max_length=12)
     type = models.CharField(max_length=12)
@@ -12,7 +26,11 @@ class Forum(MPTTModel):
     description = models.TextField(null=True, blank=True)
     description = models.TextField(null=True, blank=True)
     description_preparsed = models.TextField(null=True, blank=True)
     description_preparsed = models.TextField(null=True, blank=True)
     threads = models.PositiveIntegerField(default=0)
     threads = models.PositiveIntegerField(default=0)
+    threads_delta = models.PositiveIntegerField(default=0)
     posts = models.PositiveIntegerField(default=0)
     posts = models.PositiveIntegerField(default=0)
+    posts_delta = models.IntegerField(default=0)
+    redirects = models.PositiveIntegerField(default=0)
+    redirects_delta = models.IntegerField(default=0)
     #last_thread = models.ForeignKey('threads.Thread', related_name='+', null=True, blank=True)
     #last_thread = models.ForeignKey('threads.Thread', related_name='+', null=True, blank=True)
     last_thread_name = models.CharField(max_length=255, null=True, blank=True)
     last_thread_name = models.CharField(max_length=255, null=True, blank=True)
     last_thread_slug = models.SlugField(null=True, blank=True)
     last_thread_slug = models.SlugField(null=True, blank=True)
@@ -25,9 +43,10 @@ class Forum(MPTTModel):
     prune_last = models.PositiveIntegerField(default=0)
     prune_last = models.PositiveIntegerField(default=0)
     redirect = models.CharField(max_length=255, null=True, blank=True)
     redirect = models.CharField(max_length=255, null=True, blank=True)
     style = models.CharField(max_length=255, null=True, blank=True)
     style = models.CharField(max_length=255, null=True, blank=True)
-    template = models.CharField(max_length=255, null=True, blank=True)
     closed = models.BooleanField(default=False)
     closed = models.BooleanField(default=False)
     
     
+    objects = ForumManager()   
+    
     def __unicode__(self):
     def __unicode__(self):
         if self.token == 'root':
         if self.token == 'root':
            return unicode(_('Root Category')) 
            return unicode(_('Root Category')) 

+ 3 - 7
misago/forums/views.py

@@ -85,7 +85,6 @@ class NewCategory(FormWidget):
                      slug=slugify(form.cleaned_data['name']),
                      slug=slugify(form.cleaned_data['name']),
                      type='category',
                      type='category',
                      style=form.cleaned_data['style'],
                      style=form.cleaned_data['style'],
-                     template=form.cleaned_data['template'],
                      closed=form.cleaned_data['closed'],
                      closed=form.cleaned_data['closed'],
                      )
                      )
         new_forum.set_description(form.cleaned_data['description'])
         new_forum.set_description(form.cleaned_data['description'])
@@ -112,10 +111,9 @@ class NewForum(FormWidget):
                      slug=slugify(form.cleaned_data['name']),
                      slug=slugify(form.cleaned_data['name']),
                      type='forum',
                      type='forum',
                      style=form.cleaned_data['style'],
                      style=form.cleaned_data['style'],
-                     template=form.cleaned_data['template'],
                      closed=form.cleaned_data['closed'],
                      closed=form.cleaned_data['closed'],
-                     prune_days=form.cleaned_data['prune_days'],
                      prune_start=form.cleaned_data['prune_start'],
                      prune_start=form.cleaned_data['prune_start'],
+                     prune_last=form.cleaned_data['prune_last'],
                      )
                      )
         new_forum.set_description(form.cleaned_data['description'])
         new_forum.set_description(form.cleaned_data['description'])
         new_forum.insert_at(form.cleaned_data['parent'], position='last-child', save=True)
         new_forum.insert_at(form.cleaned_data['parent'], position='last-child', save=True)
@@ -228,7 +226,6 @@ class Edit(FormWidget):
         if model.type == 'redirect':
         if model.type == 'redirect':
             initial['redirect'] = model.redirect
             initial['redirect'] = model.redirect
         else:
         else:
-            initial['template'] = model.template
             initial['style'] = model.style
             initial['style'] = model.style
             initial['closed'] = model.closed
             initial['closed'] = model.closed
             
             
@@ -245,7 +242,6 @@ class Edit(FormWidget):
             target.redirect = form.cleaned_data['redirect']
             target.redirect = form.cleaned_data['redirect']
         else:
         else:
             target.style = form.cleaned_data['style']
             target.style = form.cleaned_data['style']
-            target.template = form.cleaned_data['template']
             target.closed = form.cleaned_data['closed']
             target.closed = form.cleaned_data['closed']
             
             
         if target.type == 'forum':
         if target.type == 'forum':
@@ -291,8 +287,8 @@ class Delete(FormWidget):
             for child in target.get_descendants():
             for child in target.get_descendants():
                 child.move_to(new_parent, 'last-child')
                 child.move_to(new_parent, 'last-child')
                 child.save(force_update=True)
                 child.save(force_update=True)
-            target.delete()
         else:
         else:
-            for child in target.get_descendants(include_self=True):
+            for child in target.get_descendants():
                 child.delete()
                 child.delete()
+        target.delete()
         return target, Message(_('Forum "%(name)s" has been deleted.') % {'name': self.original_name}, 'success')
         return target, Message(_('Forum "%(name)s" has been deleted.') % {'name': self.original_name}, 'success')

+ 13 - 2
misago/views.py

@@ -1,11 +1,22 @@
 from django.core.urlresolvers import reverse
 from django.core.urlresolvers import reverse
 from django.shortcuts import redirect
 from django.shortcuts import redirect
 from django.template import RequestContext
 from django.template import RequestContext
-
+from misago.sessions.models import Session
+from misago.forums.models import Forum
 
 
 def home(request):
 def home(request):
+    team_online = []
+    team_pks = []
+    for session in Session.objects.filter(team=1).filter(admin=0).order_by('-start').select_related('user', 'user__rank'):
+        if session.user.pk not in team_pks:
+            team_pks.append(session.user.pk)
+            team_online.append(session.user)
+            
     return request.theme.render_to_response('index.html',
     return request.theme.render_to_response('index.html',
-                                        {'page_title': 'Hello World!'},
+                                        {
+                                         'forums_list': Forum.objects.treelist(request.acl.forums.known_forums()),
+                                         'team_online': team_online,
+                                         },
                                         context_instance=RequestContext(request));
                                         context_instance=RequestContext(request));
 
 
 
 

+ 17 - 1
static/sora/css/sora.css

@@ -825,7 +825,9 @@ a.label:hover,a.badge:hover{color:#ffffff;text-decoration:none;cursor:pointer;}
 .show{display:block;}
 .show{display:block;}
 .invisible{visibility:hidden;}
 .invisible{visibility:hidden;}
 .affix{position:fixed;}
 .affix{position:fixed;}
-@media (min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1;}.row:before,.row:after{display:table;content:"";line-height:0;} .row:after{clear:both;} [class*="span"]{float:left;min-height:1px;margin-left:20px;} .container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px;} .span12{width:724px;} .span11{width:662px;} .span10{width:600px;} .span9{width:538px;} .span8{width:476px;} .span7{width:414px;} .span6{width:352px;} .span5{width:290px;} .span4{width:228px;} .span3{width:166px;} .span2{width:104px;} .span1{width:42px;} .offset12{margin-left:764px;} .offset11{margin-left:702px;} .offset10{margin-left:640px;} .offset9{margin-left:578px;} .offset8{margin-left:516px;} .offset7{margin-left:454px;} .offset6{margin-left:392px;} .offset5{margin-left:330px;} .offset4{margin-left:268px;} .offset3{margin-left:206px;} .offset2{margin-left:144px;} .offset1{margin-left:82px;} .row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:"";line-height:0;} .row-fluid:after{clear:both;} .row-fluid [class*="span"]{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;} .row-fluid [class*="span"]:first-child{margin-left:0;} .row-fluid .span12{width:100%;*width:99.94680851063829%;} .row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%;} .row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%;} .row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%;} .row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%;} .row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%;} .row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%;} .row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%;} .row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%;} .row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%;} .row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%;} .row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%;} .row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%;} .row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%;} .row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%;} .row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%;} .row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%;} .row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%;} .row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%;} .row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%;} .row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%;} .row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%;} .row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%;} .row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%;} .row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%;} .row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%;} .row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%;} .row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%;} .row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%;} .row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%;} .row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%;} .row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%;} .row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%;} .row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%;} .row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%;} .row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%;} input,textarea,.uneditable-input{margin-left:0;} .controls-row [class*="span"]+[class*="span"]{margin-left:20px;} input.span12, textarea.span12, .uneditable-input.span12{width:710px;} input.span11, textarea.span11, .uneditable-input.span11{width:648px;} input.span10, textarea.span10, .uneditable-input.span10{width:586px;} input.span9, textarea.span9, .uneditable-input.span9{width:524px;} input.span8, textarea.span8, .uneditable-input.span8{width:462px;} input.span7, textarea.span7, .uneditable-input.span7{width:400px;} input.span6, textarea.span6, .uneditable-input.span6{width:338px;} input.span5, textarea.span5, .uneditable-input.span5{width:276px;} input.span4, textarea.span4, .uneditable-input.span4{width:214px;} input.span3, textarea.span3, .uneditable-input.span3{width:152px;} input.span2, textarea.span2, .uneditable-input.span2{width:90px;} input.span1, textarea.span1, .uneditable-input.span1{width:28px;}}@media (min-width:1200px){.row{margin-left:-30px;*zoom:1;}.row:before,.row:after{display:table;content:"";line-height:0;} .row:after{clear:both;} [class*="span"]{float:left;min-height:1px;margin-left:30px;} .container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px;} .span12{width:1170px;} .span11{width:1070px;} .span10{width:970px;} .span9{width:870px;} .span8{width:770px;} .span7{width:670px;} .span6{width:570px;} .span5{width:470px;} .span4{width:370px;} .span3{width:270px;} .span2{width:170px;} .span1{width:70px;} .offset12{margin-left:1230px;} .offset11{margin-left:1130px;} .offset10{margin-left:1030px;} .offset9{margin-left:930px;} .offset8{margin-left:830px;} .offset7{margin-left:730px;} .offset6{margin-left:630px;} .offset5{margin-left:530px;} .offset4{margin-left:430px;} .offset3{margin-left:330px;} .offset2{margin-left:230px;} .offset1{margin-left:130px;} .row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:"";line-height:0;} .row-fluid:after{clear:both;} .row-fluid [class*="span"]{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;} .row-fluid [class*="span"]:first-child{margin-left:0;} .row-fluid .span12{width:100%;*width:99.94680851063829%;} .row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%;} .row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%;} .row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%;} .row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%;} .row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%;} .row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%;} .row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%;} .row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%;} .row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%;} .row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%;} .row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%;} .row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%;} .row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%;} .row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%;} .row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%;} .row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%;} .row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%;} .row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%;} .row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%;} .row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%;} .row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%;} .row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%;} .row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%;} .row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%;} .row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%;} .row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%;} .row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%;} .row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%;} .row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%;} .row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%;} .row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%;} .row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%;} .row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%;} .row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%;} .row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%;} input,textarea,.uneditable-input{margin-left:0;} .controls-row [class*="span"]+[class*="span"]{margin-left:30px;} input.span12, textarea.span12, .uneditable-input.span12{width:1156px;} input.span11, textarea.span11, .uneditable-input.span11{width:1056px;} input.span10, textarea.span10, .uneditable-input.span10{width:956px;} input.span9, textarea.span9, .uneditable-input.span9{width:856px;} input.span8, textarea.span8, .uneditable-input.span8{width:756px;} input.span7, textarea.span7, .uneditable-input.span7{width:656px;} input.span6, textarea.span6, .uneditable-input.span6{width:556px;} input.span5, textarea.span5, .uneditable-input.span5{width:456px;} input.span4, textarea.span4, .uneditable-input.span4{width:356px;} input.span3, textarea.span3, .uneditable-input.span3{width:256px;} input.span2, textarea.span2, .uneditable-input.span2{width:156px;} input.span1, textarea.span1, .uneditable-input.span1{width:56px;} .thumbnails{margin-left:-30px;} .thumbnails>li{margin-left:30px;} .row-fluid .thumbnails{margin-left:0;}}footer{padding-top:16px;padding-bottom:32px;color:#b0b0b0;}footer a,footer a:link,footer a:active,footer a:visited{color:#b0b0b0;text-decoration:underline;}
+@media (min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1;}.row:before,.row:after{display:table;content:"";line-height:0;} .row:after{clear:both;} [class*="span"]{float:left;min-height:1px;margin-left:20px;} .container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px;} .span12{width:724px;} .span11{width:662px;} .span10{width:600px;} .span9{width:538px;} .span8{width:476px;} .span7{width:414px;} .span6{width:352px;} .span5{width:290px;} .span4{width:228px;} .span3{width:166px;} .span2{width:104px;} .span1{width:42px;} .offset12{margin-left:764px;} .offset11{margin-left:702px;} .offset10{margin-left:640px;} .offset9{margin-left:578px;} .offset8{margin-left:516px;} .offset7{margin-left:454px;} .offset6{margin-left:392px;} .offset5{margin-left:330px;} .offset4{margin-left:268px;} .offset3{margin-left:206px;} .offset2{margin-left:144px;} .offset1{margin-left:82px;} .row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:"";line-height:0;} .row-fluid:after{clear:both;} .row-fluid [class*="span"]{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;} .row-fluid [class*="span"]:first-child{margin-left:0;} .row-fluid .span12{width:100%;*width:99.94680851063829%;} .row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%;} .row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%;} .row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%;} .row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%;} .row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%;} .row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%;} .row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%;} .row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%;} .row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%;} .row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%;} .row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%;} .row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%;} .row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%;} .row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%;} .row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%;} .row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%;} .row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%;} .row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%;} .row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%;} .row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%;} .row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%;} .row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%;} .row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%;} .row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%;} .row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%;} .row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%;} .row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%;} .row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%;} .row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%;} .row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%;} .row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%;} .row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%;} .row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%;} .row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%;} .row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%;} input,textarea,.uneditable-input{margin-left:0;} .controls-row [class*="span"]+[class*="span"]{margin-left:20px;} input.span12, textarea.span12, .uneditable-input.span12{width:710px;} input.span11, textarea.span11, .uneditable-input.span11{width:648px;} input.span10, textarea.span10, .uneditable-input.span10{width:586px;} input.span9, textarea.span9, .uneditable-input.span9{width:524px;} input.span8, textarea.span8, .uneditable-input.span8{width:462px;} input.span7, textarea.span7, .uneditable-input.span7{width:400px;} input.span6, textarea.span6, .uneditable-input.span6{width:338px;} input.span5, textarea.span5, .uneditable-input.span5{width:276px;} input.span4, textarea.span4, .uneditable-input.span4{width:214px;} input.span3, textarea.span3, .uneditable-input.span3{width:152px;} input.span2, textarea.span2, .uneditable-input.span2{width:90px;} input.span1, textarea.span1, .uneditable-input.span1{width:28px;}}@media (min-width:1200px){.row{margin-left:-30px;*zoom:1;}.row:before,.row:after{display:table;content:"";line-height:0;} .row:after{clear:both;} [class*="span"]{float:left;min-height:1px;margin-left:30px;} .container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px;} .span12{width:1170px;} .span11{width:1070px;} .span10{width:970px;} .span9{width:870px;} .span8{width:770px;} .span7{width:670px;} .span6{width:570px;} .span5{width:470px;} .span4{width:370px;} .span3{width:270px;} .span2{width:170px;} .span1{width:70px;} .offset12{margin-left:1230px;} .offset11{margin-left:1130px;} .offset10{margin-left:1030px;} .offset9{margin-left:930px;} .offset8{margin-left:830px;} .offset7{margin-left:730px;} .offset6{margin-left:630px;} .offset5{margin-left:530px;} .offset4{margin-left:430px;} .offset3{margin-left:330px;} .offset2{margin-left:230px;} .offset1{margin-left:130px;} .row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:"";line-height:0;} .row-fluid:after{clear:both;} .row-fluid [class*="span"]{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;} .row-fluid [class*="span"]:first-child{margin-left:0;} .row-fluid .span12{width:100%;*width:99.94680851063829%;} .row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%;} .row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%;} .row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%;} .row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%;} .row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%;} .row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%;} .row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%;} .row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%;} .row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%;} .row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%;} .row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%;} .row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%;} .row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%;} .row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%;} .row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%;} .row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%;} .row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%;} .row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%;} .row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%;} .row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%;} .row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%;} .row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%;} .row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%;} .row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%;} .row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%;} .row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%;} .row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%;} .row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%;} .row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%;} .row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%;} .row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%;} .row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%;} .row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%;} .row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%;} .row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%;} input,textarea,.uneditable-input{margin-left:0;} .controls-row [class*="span"]+[class*="span"]{margin-left:30px;} input.span12, textarea.span12, .uneditable-input.span12{width:1156px;} input.span11, textarea.span11, .uneditable-input.span11{width:1056px;} input.span10, textarea.span10, .uneditable-input.span10{width:956px;} input.span9, textarea.span9, .uneditable-input.span9{width:856px;} input.span8, textarea.span8, .uneditable-input.span8{width:756px;} input.span7, textarea.span7, .uneditable-input.span7{width:656px;} input.span6, textarea.span6, .uneditable-input.span6{width:556px;} input.span5, textarea.span5, .uneditable-input.span5{width:456px;} input.span4, textarea.span4, .uneditable-input.span4{width:356px;} input.span3, textarea.span3, .uneditable-input.span3{width:256px;} input.span2, textarea.span2, .uneditable-input.span2{width:156px;} input.span1, textarea.span1, .uneditable-input.span1{width:56px;} .thumbnails{margin-left:-30px;} .thumbnails>li{margin-left:30px;} .row-fluid .thumbnails{margin-left:0;}}.spanHalf{width:50%;}
+.spanQuarter{width:25%;}
+footer{padding-top:16px;padding-bottom:32px;color:#b0b0b0;}footer a,footer a:link,footer a:active,footer a:visited{color:#b0b0b0;text-decoration:underline;}
 footer a:hover{color:#7d7d7d;}
 footer a:hover{color:#7d7d7d;}
 footer .go-to-top{float:right;}footer .go-to-top,footer .go-to-top:link,footer .go-to-top:active,footer .go-to-top:visited{text-decoration:none;}footer .go-to-top i,footer .go-to-top:link i,footer .go-to-top:active i,footer .go-to-top:visited i{opacity:0.4;filter:alpha(opacity=40);}
 footer .go-to-top{float:right;}footer .go-to-top,footer .go-to-top:link,footer .go-to-top:active,footer .go-to-top:visited{text-decoration:none;}footer .go-to-top i,footer .go-to-top:link i,footer .go-to-top:active i,footer .go-to-top:visited i{opacity:0.4;filter:alpha(opacity=40);}
 footer .go-to-top:hover i{opacity:0.65;filter:alpha(opacity=65);}
 footer .go-to-top:hover i{opacity:0.65;filter:alpha(opacity=65);}
@@ -934,6 +936,18 @@ th.table-sort.sort-desc a:hover{border-bottom:3px solid #eca09a;padding-bottom:5
 .nav-tabs .tab-search form{marging:0px;margin-bottom:-4px;}
 .nav-tabs .tab-search form{marging:0px;margin-bottom:-4px;}
 .nav-tabs .tab-search.tab-search-no-tabs{position:relative;bottom:12px;}
 .nav-tabs .tab-search.tab-search-no-tabs{position:relative;bottom:12px;}
 .nav-tabs button{padding-left:7px;padding-right:7px;}
 .nav-tabs button{padding-left:7px;padding-right:7px;}
+.forums-list{padding-top:4px;}.forums-list .category{margin-bottom:12px;}.forums-list .category h2{color:#666666;font-size:110%;margin-bottom:0px;}.forums-list .category h2 small{color:#a6a6a6;font-size:100%;}
+.forums-list .category-important .well-forum{border:1px solid #b3e5ff;-webkit-box-shadow:0px 0px 0px 3px #e6f7ff;-moz-box-shadow:0px 0px 0px 3px #e6f7ff;box-shadow:0px 0px 0px 3px #e6f7ff;}
+.forums-list .well-forum{margin:0px -8px;margin-bottom:14px;overflow:auto;padding:12px 8px;padding-bottom:8px;}.forums-list .well-forum .row .span3{margin-left:0px;padding-left:16px;}
+.forums-list .well-forum .forum-icon{background-color:#0088cc;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;float:left;padding:3px 6px;position:relative;bottom:4px;margin-bottom:-4px;}
+.forums-list .well-forum .forum-details{margin-left:36px;overflow:auto;}
+.forums-list .well-forum .forum-stat{margin-left:16px;margin-right:4px;padding:8px 12px;font-size:140%;}.forums-list .well-forum .forum-stat .muted{color:#999999;}
+.forums-list .well-forum .forum-stat .stag,.forums-list .well-forum .forum-stat .positive{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;margin:-2px 0px;padding:2px 5px;text-shadow:0px 1px 0px #ffffff;}
+.forums-list .well-forum .forum-stat .stag{background-color:#eeeeee;color:#8c8c8c;}
+.forums-list .well-forum .forum-stat .positive{background-color:#cdeacd;color:#3e933e;}
+.forums-list .well-forum h3{margin:0px;padding:0px;font-size:110%;line-height:100%;}.forums-list .well-forum h3 a:link,.forums-list .well-forum h3 a:active,.forums-list .well-forum h3 a:visited{color:#333333;}
+.forums-list .well-forum .muted{margin-top:4px;color:#737373;}
+.forum-list-side{padding-top:10px;}
 .editor{background-color:#e3e3e3;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}.editor .editor-input{padding:8px;}.editor .editor-input div{margin-right:14px;}
 .editor{background-color:#e3e3e3;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}.editor .editor-input{padding:8px;}.editor .editor-input div{margin-right:14px;}
 .editor .editor-input textarea{margin:0px;width:100%;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;}
 .editor .editor-input textarea{margin:0px;width:100%;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;}
 .editor .editor-actions{border-top:2px solid #c9c9c9;overflow:auto;padding:8px;}
 .editor .editor-actions{border-top:2px solid #c9c9c9;overflow:auto;padding:8px;}
@@ -946,3 +960,5 @@ th.table-sort.sort-desc a:hover{border-bottom:3px solid #eca09a;padding-bottom:5
 .profile-header .avatar-height .lead{color:#555555;}.profile-header .avatar-height .lead .muted{color:#959595;}
 .profile-header .avatar-height .lead{color:#555555;}.profile-header .avatar-height .lead .muted{color:#959595;}
 .profile-header .nav-tabs{margin-top:-22px;margin-bottom:0px;padding-left:142px;}
 .profile-header .nav-tabs{margin-top:-22px;margin-bottom:0px;padding-left:142px;}
 .avatar-menu h3{margin-top:0px;}
 .avatar-menu h3{margin-top:0px;}
+.board-team{font-weight:bold;}.board-team a:link,.board-team a:active,.board-team a:visited,.board-team a:hover{color:#333333;font-size:130%;}
+.board-stat{font-size:180%;}.board-stat small{color:#999999;font-size:70%;}

+ 1 - 0
static/sora/css/sora.less

@@ -80,6 +80,7 @@
 @import "sora/avatars.less";
 @import "sora/avatars.less";
 @import "sora/navs.less";
 @import "sora/navs.less";
 @import "sora/navbar.less";
 @import "sora/navbar.less";
+@import "sora/forums.less";
 
 
 @import "sora/editor.less";
 @import "sora/editor.less";
 @import "sora/markdown.less";
 @import "sora/markdown.less";

+ 109 - 0
static/sora/css/sora/forums.less

@@ -0,0 +1,109 @@
+// Misago Forums Lists
+// --------------------------------------------------
+.forums-list {
+  padding-top: 4px;
+  
+  .category {
+    h2 {
+      color: lighten(@textColor, 20%);
+      font-size: 110%;
+      margin-bottom: 0px;
+      
+      small {
+        color: lighten(@textColor, 45%);
+        font-size: 100%;
+      }
+    } 
+    
+    margin-bottom: 12px;
+  }
+  
+  .category-important {
+    .well-forum {
+      border: 1px solid lighten(@linkColor, 45%);
+      .box-shadow(0px 0px 0px 3px lighten(@linkColor, 55%));
+    }
+  }
+  
+  .well-forum {
+    margin: 0px -8px;
+    margin-bottom: 14px;
+    overflow: auto;
+    padding: 12px 8px;
+    padding-bottom: 8px;
+    
+    .row {
+      .span3 {
+        margin-left: 0px;
+        padding-left: 16px;
+      }
+    }
+    
+    .forum-icon {
+      background-color: @linkColor; 
+      .border-radius(3px);
+      float: left;
+      padding: 3px 6px;
+      position: relative;
+      bottom: 4px;
+      margin-bottom: -4px;
+    }
+    
+    .forum-details {
+      margin-left: 36px;
+      overflow: auto;
+    }
+    
+    .forum-stat {
+      margin-left: 16px;
+      margin-right: 4px;
+      padding: 8px 12px;
+      
+      font-size: 140%;
+      
+      .muted {
+        color: @grayLight;
+      }
+      
+      .stag, .positive {
+        .border-radius(3px);
+        margin: -2px 0px;
+        padding: 2px 5px;
+        
+        text-shadow: 0px 1px 0px @white;
+      }
+      
+      .stag {
+        background-color: @grayLighter;
+        color: darken(@grayLight, 5%);
+      }
+      
+      .positive {
+        background-color: lighten(@green, 40%);
+        color: darken(@green, 5%);
+      }
+    }
+    
+    h3 {
+      margin: 0px;
+      padding: 0px;
+      
+      font-size: 110%;
+      line-height: 100%;
+      
+      a:link, a:active, a:visited {
+        color: @textColor;
+      }
+    }
+    
+    .muted {
+      margin-top: 4px;
+        
+      color: lighten(@textColor, 25%);
+    }
+  }
+}
+
+.forum-list-side {
+  padding-top: 10px;
+}

+ 9 - 0
static/sora/css/sora/scaffolding.less

@@ -1,6 +1,15 @@
 // Layout elements that dont deserve their own file go there
 // Layout elements that dont deserve their own file go there
 // -------------------------
 // -------------------------
 
 
+// Custom grid columns
+.spanHalf {
+  width: 50%;
+}
+
+.spanQuarter {
+  width: 25%;
+}
+
 // Footer
 // Footer
 footer {
 footer {
   padding-top: 16px;
   padding-top: 16px;

+ 19 - 1
static/sora/css/sora/utilities.less

@@ -43,4 +43,22 @@
   h3 {
   h3 {
     margin-top: 0px;
     margin-top: 0px;
   }
   }
-}
+}
+
+.board-team {
+  font-weight: bold;
+    
+  a:link, a:active, a:visited, a:hover {
+    color: @textColor;
+    font-size: 130%;
+  }
+}
+
+.board-stat {
+  font-size: 180%;
+  
+  small {
+    color: @grayLight;
+    font-size: 70%;
+  }
+}

+ 44 - 4
templates/sora/index.html

@@ -9,9 +9,49 @@
 {% endif %}{% endblock %}
 {% endif %}{% endblock %}
       
       
 {% block content %}
 {% block content %}
-<div class="page-header">
-  <h1>TODO: Misago Forum Index</h1>
+<div class="row">
+  <div class="span9">
+    <div class="forums-list">
+      {% for category in forums_list %}{% if category.subforums %}
+      <div class="category{% if category.style %} {{ category.style }}{% endif %}">
+        <h2>{{ category.name }}{% if category.description %} <small><strong>{{ category.description }}</strong></small>{% endif %}</h2>
+        {% for forum in category.subforums %}
+        <div class="well well-forum{% if forum.style %} {{ forum.style }}{% endif %}">
+          <div class="forum-icon"><i class="icon-comment icon-white"></i></div>
+          <div class="forum-details">
+            <div class="pull-left">
+              <h3><a href="#">{{ forum.name }}</a></h3>
+              {% if forum.description %}<div class="muted">{{ forum.description }}</div>{% endif %}
+            </div>
+            <div class="pull-right forum-stat stat-posts">
+              <span class="stat {% if forum.posts_delta > 0 %}positive{% else %}stag{% endif %}">{% if forum.posts_delta > 0 %}+{{ forum.posts_delta }}{% else %}{{ forum.posts }}{% endif %}</span> <span class="muted">{% trans %}posts{% endtrans %}</span>
+            </div>
+            <div class="pull-right forum-stat stat-topics">
+              <span class="stat {% if forum.threads_delta > 0 %}positive{% else %}stag{% endif %}">{% if forum.posts_delta > 0 %}+{{ forum.threads_delta }}{% else %}{{ forum.threads }}{% endif %}</span> <span class="muted">{% trans %}threads{% endtrans %}</span>
+            </div>
+          </div>
+        </div>
+        {% endfor %}
+      </div>{% endif %}{% endfor %}
+    </div>
+  </div>
+  <div class="span3 forum-list-side">
+    {% if team_online %}
+    <h3>{% trans %}Team Online{% endtrans %}</h3>
+    {% for user in team_online %}
+    <div class="board-team">
+      <img src="{{ user.get_avatar() }}" alt="" class="avatar-small"> <a href="{% url 'user' username=user.username_slug, user=user.pk %}">{{ user.username }}</a>{% if user.get_title() %} <span class="muted">{{ _(user.get_title()) }}</span>{% endif %}
+    </div>
+    <hr>
+    {% endfor %}
+    {% endif %}
+    
+    <h3>{% trans %}Popular Topics{% endtrans %}</h3>
+    <hr>
+    
+    <h3>{% trans %}Forum Stats{% endtrans %}</h3>
+    <p class="lead board-stat">{{ monitor.posts|int|intcomma }} <small>{% trans %}Posts{% endtrans %}</small></p>
+    <p class="lead board-stat">{{ monitor.users|int|intcomma }} <small>{% trans %}Members{% endtrans %}</small></p>
+  </div>
 </div>
 </div>
-<h2>Work in progress.</h2>
-<p>Check out <a href="http://area51.misago-project.org">project forums</a> if you want to discuss.</p>
 {% endblock %}
 {% endblock %}