From 06fbdbaf5c0878bfdf8b51dd6bb56ed19c2ee77d Mon Sep 17 00:00:00 2001 From: Jeromy Date: Sat, 9 Mar 2013 22:24:37 +0800 Subject: [PATCH] 1. remove welcome msg, use agenda instead 2. remove last year and next year link in calendar 3. add admin link for admin user 4. add setting for isolation mode 5. sort meeting by start time in calendar --- .../bbb/locale/zh_CN/LC_MESSAGES/django.mo | Bin 3659 -> 3703 bytes .../bbb/locale/zh_CN/LC_MESSAGES/django.po | 3 +++ bbb_django/bbb/models.py | 8 +++---- bbb_django/bbb/templates/base.html | 7 ++++-- bbb_django/bbb/templates/calendar.html | 4 ++++ bbb_django/bbb/templates/meetings.html | 2 +- bbb_django/bbb/views/core.py | 22 +++++++++++------- bbb_django/settings.py | 2 ++ 8 files changed, 32 insertions(+), 16 deletions(-) diff --git a/bbb_django/bbb/locale/zh_CN/LC_MESSAGES/django.mo b/bbb_django/bbb/locale/zh_CN/LC_MESSAGES/django.mo index feea84aaa215e54a7de9e62e37e942827fafacf4..e5812f287d86c23882959be5c4293a741a0b1a57 100644 GIT binary patch delta 1336 zcmYk+OGs2v9LMp$kMYr%l~!g>HJX)Hrj?eNi$XC(dTuma83{8zG-~Xz$N|G3h?JzD zph$|OpfF}pndwcf%C8#>5tn% zPUh1P!9qNTi*N{a;{#+YdxYtjaGzlg`E%s3x9&J*l7B+=PoO5A#vuOmJe7;0%x^(X zbVCo7COVJH@B)_LFqYzLY{GB21gjWT12?+|Fq^y`nZr790UkrWNUyi|A%|U}%4B}K z%88!zrgw~B9{DKhjbC~D8{9=c?s*}zX`&LGgXPGxSv7K4J(ccnLXF>oTKYDu;WI}t z-cG}9?$(XJk+Ch6by6O5^HJ?Zs1+zh4S3W&i+YfL&o8?--1}|<^zt9p6DwL4LIW+ zwR2|&-0ila9-src#3F8w+voiQ?sfN;_uq4$pgzG1?|&cnlaJU)$7j!r*&CX$3^idT z>J97NChy;edVyBdbw`j-oBUk0sNaRkRzlhj?mwog-e>dPDf*% z;qF+ZGm#M}NXgxK_;|D{dMb9ZBNpxMN`x}10y&d|S0)EWrydVa4PLz45={FG1K@52 delta 1303 zcmYk+OGs2v9LMqhIF6cQHd;QinHp`(nz5|RN*US|#y}5fAz4s@NhxGRQ%FGrK@FolA!FDLWNw>u?_v$*d&tioyE9lx`8le67B%rZ4C4nc&*3QL0#-7= z4bV#y9l;nL!#2Ex34Db8_y(J?j!`vm((T4Yl+(zV){k|#7qyV1UO$ZdY>W#-*%_>1 ze!JieSFxV*P1K4Xdi^x+raa^2U#N+K%vz1rr~w;L4-(^|{vD{D=tOOOFZS?yGkBPC zj?OuC{78l|Z4Ol~xbt4WfZBl&`=|l;pdMh*%R}x-_q=-rwV+8aPa$*LQ&j(#VfJ4G zzVaL1d&6h0bT*zWaNufK@PsK4&sM?KIp+=;KX|GJ@OacRI- zH-&n_9^_t2yBT-D+lSpT_q4Z9xR+5|f6Ln+xYM|c`X@QB_~tI4CJb^$w8Dtnf_k6? zY6U6OeLIj>T6}%mP<@oP61x9yVpv;6lo9H$*Q|8AsyvcQk?AQGOGnVN)@)P0TWq$wxP+kN8 diff --git a/bbb_django/bbb/locale/zh_CN/LC_MESSAGES/django.po b/bbb_django/bbb/locale/zh_CN/LC_MESSAGES/django.po index 5b7be78..8fc43f2 100644 --- a/bbb_django/bbb/locale/zh_CN/LC_MESSAGES/django.po +++ b/bbb_django/bbb/locale/zh_CN/LC_MESSAGES/django.po @@ -228,6 +228,9 @@ msgstr "会议管理站点" msgid "Django bbb administration" msgstr "会议管理" +msgid "Administration" +msgstr "后台管理" + #: templates/admin/change_list.html:64 #, python-format msgid "Add %(name)s" diff --git a/bbb_django/bbb/models.py b/bbb_django/bbb/models.py index 0bfd1e6..46e47c6 100755 --- a/bbb_django/bbb/models.py +++ b/bbb_django/bbb/models.py @@ -41,7 +41,7 @@ class Meeting(models.Model): name = models.CharField(max_length=100, verbose_name=_('meeting name')) attendee_password = models.CharField(max_length=50, verbose_name=_('attendee password')) moderator_password = models.CharField(max_length=50, verbose_name=_('moderator password')) - welcome = models.CharField(max_length=100, blank=True, verbose_name=_('welcome message')) + #welcome = models.CharField(max_length=100, blank=True, verbose_name=_('welcome message')) record = models.BooleanField(default=False, verbose_name=_('record')) duration = models.IntegerField(default=0, choices=MEETING_DURATION, verbose_name=_('duration')) start_time = models.DateTimeField(verbose_name=_('start time')) @@ -231,8 +231,8 @@ def start(self): ('attendeePW', self.attendee_password), ('moderatorPW', self.moderator_password), ('voiceBridge', voicebridge), - #('welcome', _("Welcome!").encode('utf8')), - ('welcome', self.welcome.encode('utf8')), + #('welcome', self.welcome.encode('utf8')), + ('welcome', self.agenda.encode('utf8')), ('record', self.record), #('duration', self.duration), )) @@ -263,7 +263,7 @@ class CreateForm(forms.Form): widget=forms.PasswordInput(render_value=False)) moderator_password = forms.CharField(label=_('moderator password'), widget=forms.PasswordInput(render_value=False)) - welcome = forms.CharField(label=_('welcome message'), initial=_('Welcome!')) + #welcome = forms.CharField(label=_('welcome message'), initial=_('Welcome!')) record = forms.BooleanField(label=_('record'), initial=False, required=False) duration = forms.ChoiceField(label=_('duration'), choices=MEETING_DURATION) start_time = forms.DateTimeField(label=_('start time'), widget=widgets.AdminSplitDateTime()) diff --git a/bbb_django/bbb/templates/base.html b/bbb_django/bbb/templates/base.html index 83fc81d..c4766f1 100644 --- a/bbb_django/bbb/templates/base.html +++ b/bbb_django/bbb/templates/base.html @@ -83,8 +83,8 @@ text-indent: -9999px; display: block; background: url(/static/img/logo.png) no-repeat top left; - height: 48px; - width: 194px; + height: 50px; + width: 340px; margin: 0 auto; margin-bottom: 10px; } @@ -234,6 +234,9 @@

BBB Django

{% else %}
  • {% trans "Log in" %}
  • {% endif %} + {% if user.is_superuser %} +
  • {% trans "Administration" %}
  • + {% endif %} diff --git a/bbb_django/bbb/templates/calendar.html b/bbb_django/bbb/templates/calendar.html index 6d043a4..4f1d23c 100644 --- a/bbb_django/bbb/templates/calendar.html +++ b/bbb_django/bbb/templates/calendar.html @@ -15,13 +15,17 @@

    {% trans "Calendar" %}

    << {{PreviousYear}}/{{PreviousMonth}} + {% trans "Today" %} + {{NextYear}}/{{NextMonth}} >> diff --git a/bbb_django/bbb/templates/meetings.html b/bbb_django/bbb/templates/meetings.html index 142a6b6..90746b6 100644 --- a/bbb_django/bbb/templates/meetings.html +++ b/bbb_django/bbb/templates/meetings.html @@ -10,7 +10,7 @@

    {% trans "Meetings" %}

    {% if meetings %}
      - {% autopaginate meetings 2 %} + {% autopaginate meetings 10 %} {% for meeting in meetings %}
    • diff --git a/bbb_django/bbb/views/core.py b/bbb_django/bbb/views/core.py index 207dd9b..5f09ae3 100644 --- a/bbb_django/bbb/views/core.py +++ b/bbb_django/bbb/views/core.py @@ -59,8 +59,10 @@ def calendar(request, year, month): m = int(month) from_date = date(y, m, 1) to_date = date(y, m, monthrange(y,m)[1]) - meetings = Meeting.objects.filter(user=request.user).filter(start_time__gte=from_date, start_time__lte=to_date) - #meetings = Meeting.objects.filter(start_time__gte=from_date, start_time__lte=to_date) + if settings.ISOLATION_MODE: + meetings = Meeting.objects.filter(user=request.user).filter(start_time__gte=from_date, start_time__lte=to_date).order_by('start_time') + else: + meetings = Meeting.objects.filter(start_time__gte=from_date, start_time__lte=to_date) prev_year = y prev_month = m - 1 if prev_month == 0: @@ -71,15 +73,15 @@ def calendar(request, year, month): if next_month == 13: next_month = 1 next_year += 1 - year_after = y + 1 - year_before = y - 1 + #year_after = y + 1 + #year_before = y - 1 items = request.LANGUAGE_CODE.split('-') locale_name = 'en_US.UTF-8' if len(items) == 2: locale_name = items[0] + '_' + items[1].upper() + '.UTF-8' - print m,y,prev_month,prev_year,next_month,next_year,year_before,year_after + #print m,y,prev_month,prev_year,next_month,next_year,year_before,year_after html_calendar = MeetingCalendar(meetings, locale=locale_name).formatmonth(y, m) context = RequestContext(request, { 'Calendar': mark_safe(html_calendar), @@ -89,8 +91,8 @@ def calendar(request, year, month): 'PreviousYear': prev_year, 'NextMonth': next_month, 'NextYear': next_year, - 'YearBeforeThis': year_before, - 'YearAfterThis': year_after, + #'YearBeforeThis': year_before, + #'YearAfterThis': year_after, }) return render_to_response('calendar.html', context) @@ -110,8 +112,10 @@ def begin_meeting(request): @login_required def meetings(request): - #existing = Meeting.objects.all() - existing = Meeting.objects.filter(user=request.user) + if settings.ISOLATION_MODE: + existing = Meeting.objects.filter(user=request.user) + else: + existing = Meeting.objects.all() #meetings = Meeting.get_meetings() started = Meeting.get_meetings() diff --git a/bbb_django/settings.py b/bbb_django/settings.py index 658973d..933ac53 100644 --- a/bbb_django/settings.py +++ b/bbb_django/settings.py @@ -133,6 +133,8 @@ LOCALE_PATHS = os.path.join(PROJECT_ROOT, 'bbb', 'locale') +ISOLATION_MODE = True + ## Load our local_settings try: from bbb.local_settings import *