Skip to content

Commit

Permalink
1. remove welcome msg, use agenda instead
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fuji246 committed Mar 9, 2013
1 parent e93062f commit 06fbdba
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 16 deletions.
Binary file modified bbb_django/bbb/locale/zh_CN/LC_MESSAGES/django.mo
Binary file not shown.
3 changes: 3 additions & 0 deletions bbb_django/bbb/locale/zh_CN/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions bbb_django/bbb/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down Expand Up @@ -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),
))
Expand Down Expand Up @@ -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())
Expand Down
7 changes: 5 additions & 2 deletions bbb_django/bbb/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -234,6 +234,9 @@ <h1>BBB Django</h1>
{% else %}
<li><a href="{% url login %}">{% trans "Log in" %}</a></li>
{% endif %}
{% if user.is_superuser %}
<li><a href="{% url admin:index %}">{% trans "Administration" %}</a></li>
{% endif %}
</ul>
</nav>
</header>
Expand Down
4 changes: 4 additions & 0 deletions bbb_django/bbb/templates/calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ <h2>{% trans "Calendar" %}</h2>
<td width="20%" align="left">
&lt;&lt; <a href="/calendar/{{PreviousYear}}/{{PreviousMonth}}/">{{PreviousYear}}/{{PreviousMonth}}</a>
</td>
<!--
<td width="20%" align="left">
&lt;&lt; <a href="/calendar/{{YearBeforeThis}}/{{Month}}/">{{YearBeforeThis}}/{{Month}}</a>
</td>
-->
<td width="20%" align="center"><a href="/calendar/">{% trans "Today" %}</a></td>
<!--
<td width="20%" align="right">
<a href="/calendar/{{YearAfterThis}}/{{Month}}/">{{YearAfterThis}}/{{Month}}</a> &gt;&gt;
</td>
-->
<td width="20%" align="right">
<a href="/calendar/{{NextYear}}/{{NextMonth}}/">{{NextYear}}/{{NextMonth}}</a> &gt;&gt;
</td>
Expand Down
2 changes: 1 addition & 1 deletion bbb_django/bbb/templates/meetings.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<h2>{% trans "Meetings" %}</h2>
{% if meetings %}
<ul class="large">
{% autopaginate meetings 2 %}
{% autopaginate meetings 10 %}
{% for meeting in meetings %}
<li>
<span class="right">
Expand Down
22 changes: 13 additions & 9 deletions bbb_django/bbb/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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),
Expand All @@ -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)
Expand All @@ -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()

Expand Down
2 changes: 2 additions & 0 deletions bbb_django/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down

0 comments on commit 06fbdba

Please sign in to comment.