[Isocial-svn] SF.net SVN: isocial: [282] app
Status: Pre-Alpha
Brought to you by:
aguidrevitch
From: <di...@us...> - 2008-07-09 15:00:54
|
Revision: 282 http://isocial.svn.sourceforge.net/isocial/?rev=282&view=rev Author: dim0s77 Date: 2008-07-09 08:01:01 -0700 (Wed, 09 Jul 2008) Log Message: ----------- added joining to group Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/locales/groupapp/group/ru.php app/views/groupapp/group/browse.tpl app/views/groupapp/group/show_group.tpl app/views/message/outbox.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-07-09 13:57:52 UTC (rev 281) +++ app/controllers/groupapp/group_controller.php 2008-07-09 15:01:01 UTC (rev 282) @@ -355,6 +355,23 @@ function show_topic () { } + function join () { + if ($this->group && !$this->is_member) { + $member = $this->GroupappMemberRole->find(4); + $group_member = $this->GroupappGroup->group_member->build(); + $group_member->group->assign($this->group); + $group_member->user->assign($this->current_user); + $group_member->role->assign($member); + if ($group_member->save()) { + $this->group->members_count += 1; + $this->group->save(); + $this->renderText('OK'); + return; + } + } + $this->renderText(''); + } + function help () { } Modified: app/locales/groupapp/group/ru.php =================================================================== --- app/locales/groupapp/group/ru.php 2008-07-09 13:57:52 UTC (rev 281) +++ app/locales/groupapp/group/ru.php 2008-07-09 15:01:01 UTC (rev 282) @@ -84,7 +84,7 @@ $dictionary['Administrative approval is required for new members to join. Anyone can see the group information. Only the members will be able to see the following: the discussion board, the wall, videos and photos.'] = 'Для вступления в группу необходимо разрешение администратора. Все могут смотреть описание группы, ее содержание доступно только участникам.'; $dictionary['The group will not appear in search results or in the profiles of its members. Membership is by invitation only, and only members can see the group information. Only the members will be able to see the following: the discussion board, the wall, videos and photos.'] = - 'Группа не будет отображаться в результатах поиска или в профилях ее участников. Вступить можно только по приглашениям, и только члены могут видеть информацию и содержание группы.'; + 'Группа не будет отображаться в результатах поиска или в профилях ее участников. Вступить можно только по приглашениям, и только участники группы могут видеть информацию и содержание группы.'; $dictionary['This is an open group. Anyone can join and invite others to join.'] = 'Это открытая группа. Каждый может присоединиться и пригласить других.'; $dictionary['This is a closed group. Members must be invited or approved by an admin.'] = @@ -133,7 +133,7 @@ $dictionary['Videos'] = 'Видео'; $dictionary['No one has uploaded any videos'] = 'Никто не загружал видео'; $dictionary['Add Videos'] = 'Добавить видео'; -$dictionary['Discussion board'] = 'Доска обсуждений'; +$dictionary['Discussion board'] = 'Форум'; $dictionary['There are no discussions'] = 'Обсуждения отсутствуют'; $dictionary['Start the first topic'] = 'Начать первую тему'; $dictionary['Members count'] = 'Количество участников'; @@ -152,6 +152,11 @@ $dictionary['Create first group'] = 'Создать первую группу'; $dictionary['All'] = 'Все'; $dictionary['Join Group'] = 'Присоединиться'; +$dictionary['Join this Group'] = 'Присоединиться к группе'; +$dictionary['View Discussion Board'] = 'Просмотреть форум'; +$dictionary['Add group membership'] = 'Присоединиться к группе'; +$dictionary['Do you want to join'] = 'Вы хотите присоединиться к'; +$dictionary['Join'] = 'Присоединиться'; $dictionary['Search groups'] = 'Поиск групп'; $dictionary['Search by name'] = 'Поиск по имени'; Modified: app/views/groupapp/group/browse.tpl =================================================================== --- app/views/groupapp/group/browse.tpl 2008-07-09 13:57:52 UTC (rev 281) +++ app/views/groupapp/group/browse.tpl 2008-07-09 15:01:01 UTC (rev 282) @@ -87,7 +87,7 @@ <ul class="actions_list"> {?user_groups} <? if (!isset($user_groups[$group->id])): ?> - <li><a href="#">_{Join Group}</a></li> + <li><a href="#" onclick="join_this_group(this); return false;" id="{group.id?}" name="{group.name?}">_{Join Group}</a></li> <? endif ?> {end} </ul> @@ -133,3 +133,23 @@ </div> {end} <div class="clearfix"></div> + +<script type="text/javascript"> +function join_this_group (element) { + new Dialog.Box(element, { + classname: 'delete_dialog', + title: '_{Add group membership}?', + body: '_{Do you want to join} "' + element.name + '"?', + yes: '_{Join}', + cancel: '_{Cancel}', + onYes : function () { + new Ajax.Request('/groupapp/group/join/' + element.id, { + onComplete: function () { + window.location = "/groupapp/group/show_group/" + element.id; + } + }); + } + }); + return false; +} +</script> Modified: app/views/groupapp/group/show_group.tpl =================================================================== --- app/views/groupapp/group/show_group.tpl 2008-07-09 13:57:52 UTC (rev 281) +++ app/views/groupapp/group/show_group.tpl 2008-07-09 15:01:01 UTC (rev 282) @@ -12,7 +12,7 @@ <div class="right_content"> <div class="group_avatar"> - <img src="/preview/100x100/{group_picture}"> + <img src="/preview/200x200/{group_picture}"> </div> <ul class="actions_list"> @@ -27,7 +27,7 @@ {end} {?is_guest} <li><a href="#">_{View Discussion Board}</a></li> - <li><a href="#">_{Join this Group}</a></li> + <li><a href="#" onclick="join_this_group(this); return false;" name="{group.id?}">_{Join this Group}</a></li> {end} </ul> @@ -178,3 +178,22 @@ </div> <div class="clearfix"></div> +<script type="text/javascript"> +function join_this_group (element) { + new Dialog.Box(element, { + classname: 'delete_dialog', + title: '_{Add group membership}?', + body: '_{Do you want to join} "{group.name?}"?', + yes: '_{Join}', + cancel: '_{Cancel}', + onYes : function () { + new Ajax.Request('/groupapp/group/join/{group.id?}', { + onComplete: function () { + window.location = "/groupapp/group/show_group/{group.id?}"; + } + }); + } + }); + return false; +} +</script> Modified: app/views/message/outbox.tpl =================================================================== --- app/views/message/outbox.tpl 2008-07-09 13:57:52 UTC (rev 281) +++ app/views/message/outbox.tpl 2008-07-09 15:01:01 UTC (rev 282) @@ -26,7 +26,7 @@ </div> </form> -<script> +<script type="text/javascript"> var checkids = new Array(); function oncheck (element, is_read) { checked = $$('input[type=checkbox]:checked'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |