Browse Source

Dropped global announcements.

Ralfp 12 years ago
parent
commit
8417377c5e

+ 1 - 1
misago/acl/builder.py

@@ -60,7 +60,7 @@ def acl(request, user):
 
 def build_acl(request, roles):
     acl = ACL(request.monitor['acl_version'])
-    forums = (Forum.objects.filter(special__in=('announcements', 'private', 'reports'))
+    forums = (Forum.objects.filter(special__in=('private', 'reports'))
               | Forum.objects.get(special='root').get_descendants().order_by('lft'))
     perms = []
     forum_roles = {}

+ 1 - 3
misago/apps/admin/roles/views.py

@@ -131,9 +131,7 @@ class Forums(ListWidget):
     
     def sort_items(self, page_items, sorting_method):
         final_items = []
-        for forum in Forum.objects.filter(special__in=['announcements', 'reports', 'private']).order_by('special'):
-            if forum.special == 'announcements':
-                forum.name = _("Global Announcements")
+        for forum in Forum.objects.filter(special__in=['reports', 'private']).order_by('special'):
             if forum.special == 'reports':
                 forum.name = _("Reports")
             if forum.special == 'private':

+ 0 - 0
misago/apps/announcements/__init__.py


+ 0 - 10
misago/apps/announcements/forms.py

@@ -1,10 +0,0 @@
-from misago.apps.threadtype.posting.forms import (NewThreadForm as NewThreadBaseForm,
-                                                  EditThreadForm as EditThreadBaseForm)
-
-class NewThreadForm(NewThreadBaseForm):
-    include_thread_weight = False
-
-
-class EditThreadForm(EditThreadBaseForm):
-    include_thread_weight = False
-    

+ 0 - 41
misago/apps/announcements/list.py

@@ -1,41 +0,0 @@
-from django.utils.translation import ugettext as _
-from misago.apps.threadtype.list import ThreadsListBaseView, ThreadsListModeration
-from misago.models import Forum, Thread
-from misago.readstrackers import ThreadsTracker
-from misago.utils.pagination import make_pagination
-from misago.apps.announcements.mixins import TypeMixin
-
-class ThreadsListView(ThreadsListBaseView, ThreadsListModeration, TypeMixin):
-    def fetch_forum(self):
-        self.forum = Forum.objects.get(special='announcements')
-
-    def fetch_threads(self):
-        queryset = self.request.acl.threads.filter_threads(self.request, self.forum, Thread.objects.filter(forum=self.forum)).order_by('-start')
-        self.count = queryset.count()
-        self.pagination = make_pagination(self.kwargs.get('page', 0), self.count, self.request.settings.threads_per_page)
-        
-        if self.request.settings.avatars_on_threads_list:
-            queryset = queryset.prefetch_related('start_poster', 'last_poster')
-
-        tracker = ThreadsTracker(self.request, self.forum)
-        for thread in queryset[self.pagination['start']:self.pagination['stop']]:
-            thread.is_read = tracker.is_read(thread)
-            self.threads.append(thread)
-
-    def threads_actions(self):
-        acl = self.request.acl.threads.get_role(self.forum)
-        actions = []
-        try:
-            if acl['can_approve']:
-                actions.append(('accept', _('Accept threads')))
-            if acl['can_close_threads']:
-                actions.append(('open', _('Open threads')))
-                actions.append(('close', _('Close threads')))
-            if acl['can_delete_threads']:
-                actions.append(('undelete', _('Undelete threads')))
-                actions.append(('soft', _('Soft delete threads')))
-            if acl['can_delete_threads'] == 2:
-                actions.append(('hard', _('Hard delete threads')))
-        except KeyError:
-            pass
-        return actions

+ 0 - 8
misago/apps/announcements/mixins.py

@@ -1,8 +0,0 @@
-from django.core.urlresolvers import reverse
-from django.shortcuts import redirect
-
-class TypeMixin(object):
-    type_prefix = 'announcement'
-
-    def threads_list_redirect(self):
-        return redirect(reverse('announcements'))

+ 0 - 31
misago/apps/announcements/posting.py

@@ -1,31 +0,0 @@
-from django.core.urlresolvers import reverse
-from django.shortcuts import redirect
-from django.utils.translation import ugettext as _
-from misago.apps.threadtype.posting import NewThreadBaseView, EditThreadBaseView, NewReplyBaseView, EditReplyBaseView
-from misago.messages import Message
-from misago.models import Forum, Thread, Post
-from misago.apps.announcements.forms import NewThreadForm, EditThreadForm
-from misago.apps.announcements.mixins import TypeMixin
-
-class NewThreadView(NewThreadBaseView, TypeMixin):
-    action = 'new_thread'
-    form_type = NewThreadForm
-
-    def set_forum_context(self):
-        self.forum = Forum.objects.get(special='announcements')
-
-    def response(self):
-        if self.post.moderated:
-            self.request.messages.set_flash(Message(_("New announcement has been posted. It will be hidden from other members until moderator reviews it.")), 'success', 'threads')
-        else:
-            self.request.messages.set_flash(Message(_("New announcement has been posted.")), 'success', 'threads')
-        return redirect(reverse('announcement', kwargs={'thread': self.thread.pk, 'slug': self.thread.slug}) + ('#post-%s' % self.post.pk))
-
-
-class EditThreadView(EditThreadBaseView, TypeMixin):
-    action = 'edit_thread'
-    form_type = EditThreadForm
-    
-    def response(self):
-        self.request.messages.set_flash(Message(_("Announcement has been edited.")), 'success', 'threads_%s' % self.post.pk)
-        return redirect(reverse('announcement', kwargs={'thread': self.thread.pk, 'slug': self.thread.slug}) + ('#post-%s' % self.post.pk))

+ 0 - 7
misago/apps/announcements/urls.py

@@ -1,7 +0,0 @@
-from django.conf.urls import patterns, url
-
-urlpatterns = patterns('misago.apps.announcements',
-    url(r'^$', 'list.ThreadsListView', name="announcements"),
-    url(r'^(?P<page>\d+)/$', 'list.ThreadsListView', name="announcements"),
-    url(r'^new/$', 'posting.NewThreadView', name="announcement_start"),
-)

+ 10 - 19
misago/apps/threads/list.py

@@ -11,39 +11,30 @@ class ThreadsListView(ThreadsListBaseView, ThreadsListModeration, TypeMixin):
         self.forum = Forum.objects.get(pk=self.kwargs.get('forum'), type='forum')
 
     def threads_queryset(self):
-        announcements = Forum.objects.special_model('announcements')
-        annos_global = announcements.thread_set.filter(deleted=False).filter(moderated=False).order_by('-pk')
-        annos_forum = self.request.acl.threads.filter_threads(self.request, self.forum, self.forum.thread_set).filter(weight=2).order_by('-pk')
-        rest = self.request.acl.threads.filter_threads(self.request, self.forum, self.forum.thread_set).filter(weight__lt=2).order_by('-last')
+        announcements = self.request.acl.threads.filter_threads(self.request, self.forum, self.forum.thread_set).filter(weight=2).order_by('-pk')
+        threads = self.request.acl.threads.filter_threads(self.request, self.forum, self.forum.thread_set).filter(weight__lt=2).order_by('-last')
 
         # Dont display threads by ignored users (unless they are important)
         if self.request.user.is_authenticated():
             ignored_users = self.request.user.ignored_users()
             if ignored_users:
-                rest = rest.extra(where=["`threads_thread`.`start_poster_id` IS NULL OR `threads_thread`.`start_poster_id` NOT IN (%s)" % ','.join([str(i) for i in ignored_users])])
+                threads = threads.extra(where=["`threads_thread`.`start_poster_id` IS NULL OR `threads_thread`.`start_poster_id` NOT IN (%s)" % ','.join([str(i) for i in ignored_users])])
 
         # Add in first and last poster
         if self.request.settings.avatars_on_threads_list:
-            annos_global = annos_global.prefetch_related('start_poster', 'last_poster')
-            annos_forum = annos_forum.prefetch_related('start_poster', 'last_poster')
-            rest = rest.prefetch_related('start_poster', 'last_poster')
+            announcements = announcements.prefetch_related('start_poster', 'last_poster')
+            threads = threads.prefetch_related('start_poster', 'last_poster')
 
-        return annos_global, annos_forum, rest
+        return announcements, threads
 
     def fetch_threads(self):
-        qs_global, qs_forum, qs_rest = self.threads_queryset()
-        self.count = qs_rest.count()
+        qs_announcements, qs_threads = self.threads_queryset()
+        self.count = qs_threads.count()
         self.pagination = make_pagination(self.kwargs.get('page', 0), self.count, self.request.settings.threads_per_page)
 
-        tracker_annos = ThreadsTracker(self.request, Forum.objects.special_model('announcements'))
         tracker_forum = ThreadsTracker(self.request, self.forum)
-
-        for thread in list(chain(qs_global, qs_forum, qs_rest[self.pagination['start']:self.pagination['stop']])):
-            if thread.forum_id == self.forum.pk:
-                thread.is_read = tracker_forum.is_read(thread)
-            else:
-                thread.weight = 2
-                thread.is_read = tracker_annos.is_read(thread)
+        for thread in list(chain(qs_announcements, qs_threads[self.pagination['start']:self.pagination['stop']])):
+            thread.is_read = tracker_forum.is_read(thread)
             self.threads.append(thread)
 
     def threads_actions(self):

+ 0 - 1
misago/context_processors.py

@@ -19,7 +19,6 @@ def common(request):
             'stopwatch': request.stopwatch.time(),
             'user': request.user,
             'version': __version__,
-            'announcements': Forum.objects.special_model('announcements'),
             'private': Forum.objects.special_model('private'),
             'reports': Forum.objects.special_model('reports'),
         }

+ 0 - 1
misago/fixtures/forums.py

@@ -4,7 +4,6 @@ from misago.utils.fixtures import load_monitor_fixture
 from misago.utils.strings import slugify
 
 def load():
-    Forum(special='announcements', name='announcements', slug='announcements', type='forum').insert_at(None, save=True)
     Forum(special='private', name='private', slug='private', type='forum').insert_at(None, save=True)
     Forum(special='reports', name='reports', slug='reports', type='forum').insert_at(None, save=True)
 

+ 1 - 3
misago/models/forummodel.py

@@ -152,12 +152,10 @@ class Forum(MPTTModel):
         super(Forum, self).delete(*args, **kwargs)
 
     def __unicode__(self):
-        if self.special == 'announcements':
-           return unicode(_('Global Announcements'))
         if self.special == 'private':
            return unicode(_('Private Threads'))
         if self.special == 'reports':
-           return unicode(_('Content Report'))
+           return unicode(_('Reports'))
         if self.special == 'root':
            return unicode(_('Root Category'))
         return unicode(self.name)

+ 0 - 1
misago/urls.py

@@ -27,7 +27,6 @@ urlpatterns += patterns('',
     (r'^activate/', include('misago.apps.activation.urls')),
     (r'^watched-threads/', include('misago.apps.watchedthreads.urls')),
     (r'^reset-password/', include('misago.apps.resetpswd.urls')),
-    (r'^announcements/', include('misago.apps.announcements.urls')),
     #(r'^private-discussions/', include('misago.apps.privatethreads.urls')),
     #(r'^reports/', include('misago.apps.reports.urls')),
     (r'^', include('misago.apps.threads.urls')),

+ 0 - 207
templates/cranefly/announcements/list.html

@@ -1,207 +0,0 @@
-{% extends "cranefly/layout.html" %}
-{% import "_forms.html" as form_theme with context %}
-{% import "cranefly/macros.html" as macros with context %}
-
-{% block title %}{{ macros.page_title(title=_('Global Announcements'),page=pagination['page']) }}{% endblock %}
-
-{% block container %}
-<div class="page-header header-primary">
-  <div class="container">
-    {{ messages_list(messages) }}
-    <h1>{% trans %}Global Announcements{% endtrans %}</h1>
-  </div>
-</div>
-
-<div class="container container-primary">
-
-  <div class="lead page-description">
-    <p>{% trans%}Global announcements are visible of top of all forums threads lists.{% endtrans %}</p>
-  </div>
-
-  {% if message %}
-  <div class="messages-list">
-    {{ macros.draw_message(message) }}
-  </div>
-  {% endif %}
-
-  <div class="forum-threads-extra extra-top">
-    {{ pager() }}
-    {% if user.is_authenticated() and acl.threads.can_start_threads(forum) %}
-    <a href="{% url 'announcement_start' %}" class="btn btn-inverse pull-right"><i class="icon-plus"></i> {% trans %}Make Announcement{% endtrans %}</a>
-    {% endif %}
-  </div>
-
-  <div class="forum-threads-list">
-    <table class="table">
-      <thead>
-        <tr>
-          <th>{% trans %}Thread{% endtrans %}</th>
-          <th class="span1">{% trans %}Rating{% endtrans %}</th>
-          <th class="span5">{% trans %}Activity{% endtrans %}</th>
-          {% if user.is_authenticated() and list_form %}
-          <th class="check-cell"><label class="checkbox"><input type="checkbox" class="checkbox-master"></label></th>
-          {% endif %}
-        </tr>
-      </thead>
-      <tbody>
-        {% for thread in threads %}
-        <tr>
-          <td>
-            <a href="{% url 'thread_new' thread=thread.pk, slug=thread.slug %}" class="thread-icon{% if not thread.is_read %} thread-new{% endif %} tooltip-top" title="{% if not thread.is_read -%}
-            {% trans %}Click to see first unread post{% endtrans %}
-            {%- else -%}
-            {% trans %}Click to see last post{% endtrans %}
-            {%- endif %}"><i class="icon-comment"></i></a>
-            <a href="{% url 'thread' thread=thread.pk, slug=thread.slug %}" class="thread-name">{{ thread.name }}</a>
-            <span class="thread-details">
-              {% trans user=thread_starter(thread), start=thread.start|reltimesince|low %}by {{ user }} {{ start }}{% endtrans %}
-            </span>
-            <ul class="unstyled thread-flags">
-              {% if thread.replies_reported %}
-              <li><i class="icon-warning-sign tooltip-top" title="{% trans %}This thread has reported replies{% endtrans %}"></i></li>
-              {% endif %}
-              {% if thread.replies_moderated %}
-              <li><i class="icon-question-sign tooltip-top" title="{% trans %}This thread has unreviewed replies{% endtrans %}"></i></li>
-              {% endif %}
-              {% if thread.weight == 2 %}
-              <li><i class="icon-star tooltip-top" title="{% trans %}This thread is an annoucement{% endtrans %}"></i></li>
-              {% endif %}
-              {% if thread.weight == 1 %}
-              <li><i class="icon-star-empty tooltip-top" title="{% trans %}This thread is sticky{% endtrans %}"></i></li>
-              {% endif %}
-              {% if thread.moderated  %}
-              <li><i class="icon-eye-close tooltip-top" title="{% trans %}This thread awaits review{% endtrans %}"></i></li>
-              {% endif %}
-              {% if thread.deleted %}
-              <li><i class="icon-trash tooltip-top" title="{% trans %}This thread is deleted{% endtrans %}"></i></li>
-              {% endif %}
-              {% if thread.closed %}
-              <li><i class="icon-lock tooltip-top" title="{% trans %}This thread is closed{% endtrans %}"></i></li>
-              {% endif %}
-            </ul>
-          </td>
-          <td>
-            <div class="thread-rating{% if (thread.upvotes-thread.downvotes) > 0 %} thread-rating-positive{% elif (thread.upvotes-thread.downvotes) < 0 %} thread-rating-negative{% endif %}">
-              {% if (thread.upvotes-thread.downvotes) > 0 %}+{% elif (thread.upvotes-thread.downvotes) < 0 %}-{% endif %}{{ (thread.upvotes-thread.downvotes)|abs|intcomma }}
-            </div>
-          </td>
-          <td>
-            <div class="thread-last-reply">
-              {{ replies(thread.replies) }} - {% trans user=thread_reply(thread), last=thread.last|reldate|low %}last by {{ user }} {{ last }}{% endtrans %}
-            </div>
-          </td>
-          {% if user.is_authenticated() and list_form %}
-          <td class="check-cell">{% if thread.forum_id == forum.pk %}<label class="checkbox"><input form="threads_form" name="{{ list_form['list_items']['html_name'] }}" type="checkbox" class="checkbox-member" value="{{ thread.pk }}"{% if list_form['list_items']['has_value'] and ('' ~ thread.pk) in list_form['list_items']['value'] %} checked="checked"{% endif %}></label>{% else %}&nbsp;{% endif %}</td>
-          {% endif %}
-        </tr>
-        {% else %}
-        <tr>
-          <td colspan="4" class="threads-list-empty">
-            {% trans %}No global announcements are currently defined.{% endtrans %}
-          </td>
-        </tr>
-        {% endfor %}
-      </tbody>
-    </table>
-    {% if user.is_authenticated() and list_form %}
-    <div class="threads-actions">
-      <form id="threads_form" class="form-inline pull-right" action="{% url 'announcements' page=pagination['page'] %}" method="POST">
-        <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
-        {{ form_theme.input_select(list_form['list_action'],width=3) }}
-        <button type="submit" class="btn btn-danger">{% trans %}Go{% endtrans %}</button>
-      </form>
-    </div>
-    {% endif %}
-  </div>
-
-  <div class="forum-threads-extra">
-    {{ pager() }}
-    {% if user.is_authenticated() and acl.threads.can_start_threads(forum) %}
-    <a href="{% url 'announcement_start' %}" class="btn btn-inverse pull-right"><i class="icon-plus"></i> {% trans %}Make Announcement{% endtrans %}</a>
-    {% endif %}
-  </div>
-
-</div>
-{% endblock %}
-
-
-{% macro forum_stats(forum) -%}
-{% if forum.last_thread_id and not forum.attr('hidethread') -%}
-  {% trans count=forum.posts, posts=fancy_number(forum.posts, forum.posts_delta), thread=forum_thread(forum) -%}
-  {{ posts }} post - last in {{ thread }}
-  {%- pluralize -%}
-  {{ posts }} posts - last in {{ thread }}
-  {%- endtrans %}
-{%- else -%}
-  {% trans count=forum.posts, posts=fancy_number(forum.posts, forum.posts_delta) -%}
-  {{ posts }} post
-  {%- pluralize -%}
-  {{ posts }} posts
-  {%- endtrans %}
-{%- endif %}
-{%- endmacro %}
-
-{% macro forum_thread(forum) -%}
-<a href="{% url 'thread_new' thread=forum.last_thread_id, slug=forum.last_thread_slug %}">{{ forum.last_thread_name }}</a>
-{%- endmacro %}
-
-{% macro redirect_stats(forum) -%}
-{% trans count=forum.redirects, redirects=fancy_number(forum.redirects, forum.redirects_delta) -%}
-{{ redirects }} click
-{%- pluralize -%}
-{{ redirects }} clicks
-{%- endtrans %}
-{%- endmacro %}
-
-{% macro fancy_number(number, delta) -%}
-<strong{% if delta < number %} class="stat-increment"{% endif %}>{{ number|intcomma }}</strong>
-{%- endmacro %}
-
-{% macro replies(thread_replies) -%}
-{% trans count=thread_replies, replies=('<strong>' ~ (thread_replies|intcomma) ~ '</strong>')|safe -%}
-{{ replies }} reply
-{%- pluralize -%}
-{{ replies }} replies
-{%- endtrans %}
-{%- endmacro %}
-
-{% macro thread_starter(thread) -%}
-{% if thread.start_poster_id %}<a href="{% url 'user' user=thread.start_poster_id, username=thread.start_poster_slug %}" class="user-link">{{ thread.start_poster_name }}</a>{% else %}{{ thread.start_poster_name }}{% endif %}
-{%- endmacro %}
-
-{% macro thread_reply(thread) -%}
-{% if thread.last_poster_id %}<a href="{% url 'user' user=thread.last_poster_id, username=thread.last_poster_slug %}" class="user-link">{{ thread.last_poster_name }}</a>{% else %}{{ thread.last_poster_name }}{% endif %}
-{%- endmacro %}
-
-{% macro pager() %}
-{% if pagination['total'] > 0 %}
-<div class="pagination pull-left">
-  <ul>
-    <li class="count">{{ macros.pager_label(pagination) }}</li>
-    {%- if pagination['prev'] > 1 %}<li><a href="{% url 'announcements' %}" class="tooltip-top" title="{% trans %}First Page{% endtrans %}"><i class="icon-chevron-left"></i> {% trans %}First{% endtrans %}</a></li>{% endif -%}
-    {%- if pagination['prev'] > 0 %}<li><a href="{%- if pagination['prev'] > 1 %}{% url 'announcements' page=pagination['prev'] %}{% else %}{% url 'announcements' %}{% endif %}" class="tooltip-top" title="{% trans %}Newest Threads{% endtrans %}"><i class="icon-chevron-left"></i></a></li>{% endif -%}
-    {%- if pagination['next'] > 0 %}<li><a href="{% url 'announcements' page=pagination['next'] %}" class="tooltip-top" title="{% trans %}Older Threads{% endtrans %}"><i class="icon-chevron-right"></i></a></li>{% endif -%}
-  </ul>
-</div>
-{% endif %}
-{% endmacro %}
-
-{% block javascripts -%}
-{{ super() }}
-{%- if user.is_authenticated() and list_form %}
-  <script type="text/javascript">
-    $(function () {
-      $('#threads_form').submit(function() {
-        if ($('.check-cell[]:checked').length == 0) {
-          alert("{% trans %}You have to select at least one thread.{% endtrans %}");
-          return false;
-        }
-        if ($('#id_list_action').val() == 'hard') {
-          var decision = confirm("{% trans %}Are you sure you want to delete selected threads? This action is not reversible!{% endtrans %}");
-          return decision;
-        }
-        return true;
-      });
-    });
-  </script>{% endif %}
-{%- endblock %}

+ 0 - 57
templates/cranefly/announcements/merge.html

@@ -1,57 +0,0 @@
-{% extends "cranefly/layout.html" %}
-{% import "_forms.html" as form_theme with context %}
-{% import "cranefly/macros.html" as macros with context %}
-
-{% block title %}{{ macros.page_title(title=_("Merge Announcements"),parent=_('Global Announcements')) }}{% endblock %}
-
-{% block breadcrumb %}{{ super() }} <span class="divider"><i class="icon-chevron-right"></i></span></li>
-<li><a href="{% url 'announcements' %}">{% trans %}Global Announcements{% endtrans %}</a> <span class="divider"><i class="icon-chevron-right"></i></span></li>
-<li class="active">{% trans %}Merge Announcements{% endtrans %}
-{%- endblock %}
-
-{% block container %}
-<div class="page-header header-primary">
-  <div class="container">
-    {{ messages_list(messages) }}
-    <ul class="breadcrumb">
-      {{ self.breadcrumb() }}</li>
-    </ul>
-    <h1>{% trans %}Merge Announcements{% endtrans %} <small>{% trans %}Global Announcements{% endtrans %}</small></h1>
-  </div>
-</div>
-
-<div class="container container-primary">
-  <div class="row">
-    <div class="span6 offset3">
-      <div class="form-container">
-
-        <div class="form-header">
-          <h1>{% trans %}Merge Announcements{% endtrans %}</h1>
-        </div>
-
-        {% if message %}
-        <div class="messages-list">
-          {{ macros.draw_message(message) }}
-        </div>
-        {% endif %}
-
-        <form action="{% url 'announcements' %}" method="post">
-          <input type="hidden" name="origin" value="merge_form">
-          <input type="hidden" name="list_action" value="merge">
-          {% for thread in threads -%}
-          <input type="hidden" name="list_items" value="{{ thread.pk }}">
-          {% endfor %}
-          <div class="form-fields">
-            {{ form_theme.form_widget(form, width=6) }}
-          </div>
-          <div class="form-actions">
-            <button type="submit" class="btn btn-primary">{% trans %}Merge Threads{% endtrans %}</button>
-            <a href="{% url 'announcements' %}" class="btn">{% trans %}Cancel{% endtrans %}</a>
-          </div>
-        </form>
-
-      </div>
-    </div>
-  </div>
-</div>
-{% endblock %}

+ 0 - 124
templates/cranefly/announcements/posting.html

@@ -1,124 +0,0 @@
-{% extends "cranefly/layout.html" %}
-{% import "_forms.html" as form_theme with context %}
-{% import "cranefly/editor.html" as editor with context %}
-{% import "cranefly/macros.html" as macros with context %}
-
-{% block title %}{% if thread -%}
-{{ macros.page_title(title=_(get_title()), parent=thread.name) }}
-{%- else -%}
-{{ macros.page_title(title=_(get_title()), parent=_('Global Announcements')) }}
-{%- endif %}{% endblock %}
-
-{% block breadcrumb %}{{ super() }} <span class="divider"><i class="icon-chevron-right"></i></span></li>
-<li><a href="{% url 'announcements' %}">{% trans %}Global Announcements{% endtrans %}</a> <span class="divider"><i class="icon-chevron-right"></i></span></li>
-{% if thread %}<li><a href="{% url 'announcement' thread=thread.pk, slug=thread.slug %}">{{ thread.name }}</a> <span class="divider"><i class="icon-chevron-right"></i></span></li>{% endif %}
-<li class="active">{{ get_title() }}
-{%- endblock %}
-
-{% block container %}
-<div class="page-header header-primary">
-  <div class="container">
-    {{ messages_list(messages) }}
-    <ul class="breadcrumb">
-      {{ self.breadcrumb() }}</li>
-    </ul>
-    <h1>{{ get_title() }} <small>{% if thread %}{{ thread.name }}{% else %}{% trans %}Global Announcements{% endtrans %}{% endif %}</small></h1>
-  </div>
-</div>
-<div class="container container-primary">
-  <div class="row">
-    <div class="span8 offset2">
-      <div class="posting">
-        <div class="form-container">
-
-          <div class="form-header">
-            <h1>{{ get_title() }}</h1>
-          </div>
-
-          {% if message %}
-          <div class="messages-list">
-            {{ macros.draw_message(message) }}
-          </div>
-          {% endif %}
-
-          {% if preview %}
-          <div class="form-preview">
-            <div class="markdown js-extra">
-              {{ preview|markdown_final|safe }}
-            </div>
-          </div>
-          {% endif %}
-
-          <form action="{{ get_action() }}" method="post">
-            <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
-            {% if 'thread_name' in form.fields %}
-            {{ form_theme.row_widget(form.fields.thread_name, width=8) }}
-            <hr>
-            <h4>Message Body</h4>
-            {% endif %}
-            {{ editor.editor(form.fields.post, get_button(), rows=8, extra=get_extra()) }}
-            {% if intersect(form.fields, ('edit_reason', 'thread_weight', 'close_thread')) %}
-            <hr>
-            {% if 'edit_reason' in form.fields %}
-            {{ form_theme.row_widget(form.fields.edit_reason, width=8) }}
-            {% endif %}
-
-            <div class="form-actions">
-              <button type="submit" class="btn btn-primary">{{ get_button() }}</button>
-              <button id="editor-preview" name="preview" type="submit" class="btn">{% trans %}Preview{% endtrans %}</button>
-            </div>
-            {% endif %}
-          </form>
-
-        </div>
-      </div>
-    </div>
-  </div>
-</div>
-{% endblock %}
-
-{% block stylesheets %}{{ super() }}
-<link href="{{ STATIC_URL }}cranefly/highlight/styles/monokai.css" rel="stylesheet">
-{% endblock %}
-
-{% block javascripts %}{{ super() }}
-  <script src="{{ STATIC_URL }}cranefly/highlight/highlight.pack.js"></script>
-  <script type="text/javascript">
-    hljs.tabReplace = '    ';
-    hljs.initHighlightingOnLoad();
-    EnhancePostsMD();
-  </script>
-  {{ editor.js() }}
-{% endblock %}
-
-
-{% macro get_action() -%}
-{% if action == 'new_thread' -%}
-{% url 'announcement_start' %}
-{%- elif action == 'edit_thread' -%}
-{% url 'announcement_edit' thread=thread.pk, slug=thread.slug %}
-{%- endif %}
-{%- endmacro %}
-
-
-{% macro get_title() -%}
-{% if action == 'new_thread' -%}
-{% trans %}Post New Announcement{% endtrans %}
-{%- elif action == 'edit_thread' -%}
-{% trans %}Edit Announcement{% endtrans %}
-{%- endif %}
-{%- endmacro %}
-
-
-{% macro get_button() -%}
-{% if action == 'new_thread' -%}
-{% trans %}Post Announcement{% endtrans %}
-{%- else -%}
-{% trans %}Save Changes{% endtrans %}
-{%- endif %}
-{%- endmacro %}
-
-
-{% macro get_extra() %}
-  <button id="editor-preview" name="preview" type="submit" class="btn pull-right">{% trans %}Preview{% endtrans %}</button>
-{% endmacro %}

+ 1 - 4
templates/cranefly/layout.html

@@ -12,13 +12,10 @@
           <li><a href="#">Frontlines</a></li>
           <li><a href="#">Reports <span class="label label-important">5</span></a></li>
           <li><a href="#">Warnings</a></li>
-          {% if acl.forums.can_browse(announcements) %}
-          <li{% if forum and forum.special == 'announcements' %} class="active"{% endif %}><a href="{% url 'announcements' %}">{% trans %}Manage Announcements{% endtrans %}</a></li>
-          {% endif %}
         </ul>
         <form class="navbar-form pull-right">
           <div class="navbar-search-form">
-            <input type="text" class="span2" placeholder="{% trans %}Search IP Address...{% endtrans %}">
+            <input type="text" class="span2" placeholder="{% trans %}Enter IP Address or Username...{% endtrans %}">
             <button type="submit" class="btn btn-link"><i class="icon-search"></i></button>
           </div>
         </form>