Skip to content

Commit

Permalink
1. add calenda support, can export ics file
Browse files Browse the repository at this point in the history
2. add duration and record params
3. only call crate api when the creater joined the meeting.
4. only show meetings for the creater
  • Loading branch information
fuji246 committed Dec 1, 2012
1 parent 0633572 commit 258d9a4
Show file tree
Hide file tree
Showing 21 changed files with 2,165 additions and 90 deletions.
4 changes: 2 additions & 2 deletions bbb_django/bbb/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class MeetingAdmin(admin.ModelAdmin):
list_display = ('name','id')
list_filter = ['name']
search_fields = ['name']
list_filter = ['name', 'user']
search_fields = ['name','user' ]

admin.site.register(Meeting, MeetingAdmin)
Binary file modified bbb_django/bbb/locale/zh_CN/LC_MESSAGES/django.mo
Binary file not shown.
118 changes: 72 additions & 46 deletions bbb_django/bbb/locale/zh_CN/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,111 +8,124 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-11-21 21:47+0800\n"
"POT-Creation-Date: 2012-12-01 10:05+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: models.py:26
#: models.py:29
msgid "unlimited"
msgstr "无限制"

#: models.py:27
#: models.py:30
msgid "15 min"
msgstr "15分钟"

#: models.py:28
#: models.py:31
msgid "30 min"
msgstr "30分钟"

#: models.py:29
#: models.py:32
msgid "1 hour"
msgstr "1小时"

#: models.py:30
#: models.py:33
msgid "2 hour"
msgstr "2小时"

#: models.py:36 models.py:177
#: models.py:34
msgid "3 hour"
msgstr "3小时"

#: models.py:39
msgid "user"
msgstr "用户"

#: models.py:40 models.py:184
msgid "meeting name"
msgstr "会议名称"

#: models.py:37 models.py:178
#: models.py:41 models.py:185
msgid "attendee password"
msgstr "会议密码"

#: models.py:38 models.py:180
#: models.py:42 models.py:187
msgid "moderator password"
msgstr "管理员密码"

#: models.py:39 models.py:182
#: models.py:43 models.py:189
msgid "welcome message"
msgstr "欢迎信息"

#: models.py:48
msgid "meeting"
msgstr "会议"

#: models.py:49
msgid "meetings"
msgstr "会议列表"

#: models.py:182
msgid "Welcome!"
msgstr "欢迎!"

#: models.py:183
#: models.py:44 models.py:190
msgid "record"
msgstr "录制"

#: models.py:184
#: models.py:45 models.py:191
msgid "duration"
msgstr "时长"

#: models.py:185
#: models.py:46 models.py:192
msgid "start time"
msgstr "开始时间"

#: models.py:198
#: models.py:47
msgid "started"
msgstr "已开始"

#: models.py:53
msgid "meeting"
msgstr "会议"

#: models.py:54
msgid "meetings"
msgstr "会议列表"

#: models.py:189
msgid "Welcome!"
msgstr "欢迎!"

#: models.py:205
msgid "Your name"
msgstr "姓名"

#: models.py:199
#: models.py:206
msgid "password"
msgstr "密码"

#: templates/base.html:218 templates/home.html:4
#: templates/base.html:230 templates/home.html:4
msgid "Home"
msgstr "主页"

#: templates/base.html:220
#: templates/base.html:232
msgid "Logged in as"
msgstr "登陆帐号"

#: templates/base.html:220
#: templates/base.html:232
msgid "Log out"
msgstr "退出"

#: templates/base.html:222
#: templates/base.html:234
msgid "Log in"
msgstr "登陆"

#: templates/create.html:5
msgid "Create a meeting"
msgstr "创建会议"

#: templates/create.html:8 templates/home.html:9
#: templates/create.html:18 templates/home.html:9
msgid "Create Meeting"
msgstr "创建会议"

#: templates/create.html:15
#: templates/create.html:26
msgid "create"
msgstr "创建"

#: templates/home.html:10 templates/meetings.html:5
#: templates/home.html:10 templates/meeting_list.html:5
#: templates/meeting_list.html.py:8 templates/meetings.html:5
#: templates/meetings.html.py:8
msgid "Meetings"
msgstr "会议列表"
Expand All @@ -136,52 +149,65 @@ msgid ""
msgstr ""
"通过这里的<a href=\"/meeting/%(meeting_id)s/join\">链接</a>邀请其他人参加会议"

#: templates/join.html:17 templates/meetings.html:20
#: templates/join.html:17 templates/meeting_list.html:20
#: templates/meetings.html:17
msgid "Join"
msgstr "加入会议"

#: templates/login.html:5 templates/login.html.py:11 templates/login.html:16
msgid "Log In"
msgstr "登陆"

#: templates/meetings.html:12
#: templates/meeting_list.html:12 templates/meetings.html:12
msgid "view details"
msgstr "查看详细信息"

#: templates/meetings.html:16
#: templates/meeting_list.html:16 templates/meetings.html:16
msgid "Running"
msgstr "运行中"

#: templates/meetings.html:18
#: templates/meeting_list.html:18
msgid "Not running"
msgstr "未开始"

#: templates/meetings.html:20
#: templates/meeting_list.html:20 templates/meetings.html:17
msgid "End"
msgstr "结束会议"

#: templates/meetings.html:22
#: templates/meeting_list.html:22 templates/meetings.html:19
msgid "Ended"
msgstr "已结束"

#: templates/meetings.html:37
#: templates/meeting_list.html:37 templates/meetings.html:39
msgid "There are no meetings at the moment."
msgstr "当前没有会议"

#: views/core.py:77
#: templates/meetings.html:22
msgid "Not started"
msgstr "未开始"

#: templates/meetings.html:23
msgid "Calendar"
msgstr "日程"

#: templates/meetings.html:24
msgid "Start"
msgstr "开启会议"

#: views/core.py:134
#, python-format
msgid "Successfully ended meeting %s"
msgstr "成功结束会议%s"

#: views/core.py:81
#: views/core.py:138
#, python-format
msgid "Unable to end meeting %s"
msgstr "未能结束会议%s"

#: views/core.py:103
#: views/core.py:165
#, python-format
msgid "Successfully created meeting %s"
msgstr "成功创建会议%s"
msgid "Successfully schdulered meeting %s"
msgstr "成功预定会议%s"

#~ msgid "invite_url"
#~ msgstr "邀请链接"
Expand Down
26 changes: 16 additions & 10 deletions bbb_django/bbb/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from django.contrib.admin import widgets
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse

from urllib2 import urlopen
from urllib import urlencode
Expand All @@ -29,18 +31,20 @@ def parse(response):
(30, _('30 min')),
(60, _('1 hour')),
(120, _('2 hour')),
(180, _('3 hour')),
)

class Meeting(models.Model):


user = models.ForeignKey(User, verbose_name=_('user'))
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, verbose_name=_('welcome message'))
record = models.BooleanField(default=False)
duration = models.IntegerField(default=0, choices=MEETING_DURATION)
start_time = models.DateTimeField()
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'))
started = models.BooleanField(default=False, verbose_name=_('started'))

#def __unicode__(self):
# return self.name
Expand Down Expand Up @@ -120,22 +124,22 @@ def get_meetings(self):
result = parse(urlopen(url).read())
if result:
# Create dict of values for easy use in template
d = []
d = {}
r = result[1].findall('meeting')
for m in r:
meeting_name = m.find('meetingName').text
meeting_id = m.find('meetingID').text
password = m.find('moderatorPW').text
d.append({
d[meeting_id] = {
'name': meeting_name,
'meeting_id': meeting_id,
'running': m.find('running').text,
'moderator_pw': password,
'attendee_pw': m.find('attendeePW').text,
#'moderator_pw': password,
#'attendee_pw': m.find('attendeePW').text,
'info': Meeting.meeting_info(
meeting_id,
password)
})
}
print d
return d
else:
Expand All @@ -152,6 +156,8 @@ def start(self):
('voiceBridge', voicebridge),
#('welcome', _("Welcome!").encode('utf8')),
('welcome', self.welcome.encode('utf8')),
('record', self.record),
#('duration', self.duration),
))
hashed = self.api_call(query, call)
url = settings.BBB_API_URL + call + '?' + hashed
Expand Down Expand Up @@ -181,7 +187,7 @@ class CreateForm(forms.Form):
moderator_password = forms.CharField(label=_('moderator password'),
widget=forms.PasswordInput(render_value=False))
welcome = forms.CharField(label=_('welcome message'), initial=_('Welcome!'))
record = forms.BooleanField(label=_('record'))
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
Loading

0 comments on commit 258d9a4

Please sign in to comment.