Thread: [Isocial-svn] SF.net SVN: isocial: [112] public/stylesheets/groupapp
Status: Pre-Alpha
Brought to you by:
aguidrevitch
From: <di...@us...> - 2008-03-26 17:55:44
|
Revision: 112 http://isocial.svn.sourceforge.net/isocial/?rev=112&view=rev Author: dim0s77 Date: 2008-03-26 10:55:46 -0700 (Wed, 26 Mar 2008) Log Message: ----------- form for group creation added Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/controllers/user_controller.php app/installers/groupapp/group_installer.php app/locales/groupapp/group/ru.php app/models/groupapp_group.php app/views/groupapp/group/_menu.tpl app/views/groupapp/group/create.tpl app/views/layouts/application.tpl app/views/message/send.tpl public/stylesheets/Application.css public/stylesheets/groupapp/Group.css Added Paths: ----------- app/views/groupapp/group/_bar.tpl app/views/groupapp/group/_group_customize.tpl app/views/groupapp/group/_group_info.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-03-21 19:59:00 UTC (rev 111) +++ app/controllers/groupapp/group_controller.php 2008-03-26 17:55:46 UTC (rev 112) @@ -9,6 +9,15 @@ } function create () { + $this->step = 'group_info'; + if (!empty($this->params['group'])){ + $this->GroupappGroup->setAttributes($this->params['group']); + if ($this->Request->isPost() && $this->GroupappGroup->save()){ + $this->step = 'group_customize'; + } else { + $this->importErrors( $this->GroupappGroup->getErrors() ); + } + } } function browse () { Modified: app/controllers/user_controller.php =================================================================== --- app/controllers/user_controller.php 2008-03-21 19:59:00 UTC (rev 111) +++ app/controllers/user_controller.php 2008-03-26 17:55:46 UTC (rev 112) @@ -32,10 +32,10 @@ if (!$this->_loginUser($this->params['email'], $this->params['password'], @$this->params['remember_me'])) { $this->addError( '_common', - 'Incorrect e-mail/password combination', + 'Incorrect email/password combination', 'Passwords are case sensitive. Please check your CAPS lock key' ); - } + } } function _loginUser ($email, $password, $remember_me = false) @@ -43,12 +43,12 @@ $user = $this->User->login($email, $password); if ($user && $user->active) { $this->_login($user->id); - if ($remember_me) { - setcookie(session_name(), session_id(), time() + 60 * 60 * 24 * 365 * 3, '/'); - } + if ($remember_me) { + setcookie(session_name(), session_id(), time() + 60 * 60 * 24 * 365 * 3, '/'); + } $this->redirectToAction( 'home' ); } - return false; + return false; } function logout () { Modified: app/installers/groupapp/group_installer.php =================================================================== --- app/installers/groupapp/group_installer.php 2008-03-21 19:59:00 UTC (rev 111) +++ app/installers/groupapp/group_installer.php 2008-03-26 17:55:46 UTC (rev 112) @@ -27,11 +27,16 @@ $this->execute( "CREATE TABLE `groupapp_groups` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `group_id` int(11) NOT NULL DEFAULT '0', - `en_name` char(100) NOT NULL DEFAULT '', - `en_desc` char(255) NOT NULL DEFAULT '', - FOREIGN KEY (group_id) REFERENCES groupapp_group_types(id), - INDEX group_idx (group_id) + `type_id` int(11) NOT NULL DEFAULT '0', + `name` char(100) NOT NULL DEFAULT '', + `description` char(255) NOT NULL DEFAULT '', + `recent_news` char(255) NOT NULL DEFAULT '', + `office` char(100) NOT NULL DEFAULT '', + `email` char(100) NOT NULL DEFAULT '', + `street` char(100) NOT NULL DEFAULT '', + `city` char(100) NOT NULL DEFAULT '', + FOREIGN KEY (type_id) REFERENCES groupapp_group_types(id), + INDEX type_idx (type_id) ) ENGINE=InnoDB"); } Modified: app/locales/groupapp/group/ru.php =================================================================== --- app/locales/groupapp/group/ru.php 2008-03-21 19:59:00 UTC (rev 111) +++ app/locales/groupapp/group/ru.php 2008-03-26 17:55:46 UTC (rev 112) @@ -15,6 +15,32 @@ $dictionary['Start a New Group'] = 'Начать новую группу'; $dictionary['Find a Group'] = 'Найти группу'; $dictionary['Search Groups'] = 'Поиск групп'; -$dictionary['Can\'t find the Group you\'re looking for? Start your own...'] = 'Не можете найти группу, которая вам нужна? Начните свою собственную...'; +$dictionary['Step'] = 'Шаг'; +$dictionary['Group Info'] = 'Информация о группе'; +$dictionary['Customize'] = 'Дополнительно'; +$dictionary['Members'] = 'Участники'; + +$dictionary['Group Name'] = 'Название группы'; +$dictionary['Description'] = 'Описание'; +$dictionary['Group Type'] = 'Тип группы'; +$dictionary['Select Category:'] = 'Выберите категорию:'; +$dictionary['Select'] = 'Выберите'; +$dictionary['Recent News'] = 'Последние новости'; +$dictionary['Office'] = 'Офис'; +$dictionary['Street'] = 'Улица'; +$dictionary['City/Town'] = 'Город'; +$dictionary['required'] = 'требуется'; +$dictionary['Can\'t find the Group you\'re looking for? Start your own...'] = + 'Не можете найти группу, которая вам нужна? Начните свою собственную...'; +$dictionary['Note: groups that attack a specific person or group of people (e.g. racist, sexist, or other hate groups) will not be tolerated. Creating such a group will result in immediate termination of your PROJECT_NAME account.'] = + 'Примечание: группы, которые могут совершить нападение на конкретного человека или группу людей (например, расистские, сексистские или другие группы ненависти), не будут допускаться. Создание такой группы приведет к немедленному удалению Вашего аккаунта из PROJECT_NAME.'; + +$dictionary['Name is missing'] = 'Название отсутствует'; +$dictionary['please enter the name'] = 'введите, пожалуйста, название группы'; +$dictionary['Description is missing'] = 'Описание отсутствует'; +$dictionary['please enter the description'] = 'введите, пожалуйста, описание группы'; +$dictionary['Group type is missing'] = 'Тип группы отсутствует'; +$dictionary['please enter the group category'] = 'выберите, пожалуйста, категорию группы'; + ?> Modified: app/models/groupapp_group.php =================================================================== --- app/models/groupapp_group.php 2008-03-21 19:59:00 UTC (rev 111) +++ app/models/groupapp_group.php 2008-03-26 17:55:46 UTC (rev 112) @@ -2,6 +2,13 @@ class GroupappGroup extends ActiveRecord { + function validateOnCreate () + { + $this->validatesPresenceOf('name', 'Name is missing|please enter the name'); + $this->validatesPresenceOf('description', 'Description is missing|please enter the description'); + $this->validatesPresenceOf('type_id', 'Group type is missing|please select the group category'); +# $this->validatesFormatOf('email', AK_EMAIL_REGULAR_EXPRESSION, 'Incorrect email|please enter the correct email'); + } } ?> Added: app/views/groupapp/group/_bar.tpl =================================================================== --- app/views/groupapp/group/_bar.tpl (rev 0) +++ app/views/groupapp/group/_bar.tpl 2008-03-26 17:55:46 UTC (rev 112) @@ -0,0 +1,10 @@ +<div class="minitabs"> + <div class="left"> + <ul class="toggle_minitabs"> + <li class="first"><a href="/groupapp/group/create" class="<?= $step == 'group_info' ? 'selected' : '' ?>">_{Step} 1: _{Group Info}</a></li><? + ?><li><a class="disabled">_{Step} 2: _{Customize}</a></li><? + ?><li><a class="disabled">_{Step} 3: _{Members}</a></li> + </ul> + </div> +</div> +<div class="clearfix"> </div> Added: app/views/groupapp/group/_group_customize.tpl =================================================================== --- app/views/groupapp/group/_group_customize.tpl (rev 0) +++ app/views/groupapp/group/_group_customize.tpl 2008-03-26 17:55:46 UTC (rev 112) @@ -0,0 +1 @@ +customize \ No newline at end of file Added: app/views/groupapp/group/_group_info.tpl =================================================================== --- app/views/groupapp/group/_group_info.tpl (rev 0) +++ app/views/groupapp/group/_group_info.tpl 2008-03-26 17:55:46 UTC (rev 112) @@ -0,0 +1,55 @@ +<tr> + <td class="tlabel">_{Group Name}:<br><small>(_{required})</small></td> + <td><?= $form_helper->text_field('group', 'name', array('class' => 'textinput')) ?></td> +</tr> +<tr> + <td class="tlabel">_{Description}:<br><small>(_{required})</small></td> + <td><?= $form_helper->text_area('group', 'description', array('rows' => '5')) ?></td> +</tr> +<tr> + <td class="tlabel">_{Group Type}:<br><small>(_{required})</small></td> + <td> + <?= $form_options_helper->select('group', + 'type_id', + $GroupappGroupType->collect( + $GroupappGroupType->find('all', array('conditions' => array("parent_id = 0"))), + 'name', + 'id'), + array(), + array('prompt' => $controller->t('Select')) + ) ?> + </td> +</tr> +<tr> + <td class="tlabel">_{Recent News}:</td> + <td><?= $form_helper->text_area('group', 'recent_news', array('rows' => '5')) ?></td> +</tr> +<tr> + <td class="tlabel">_{Office}:</td> + <td><?= $form_helper->text_field('group', 'office', array('class' => 'textinput')) ?></td> +</tr> +<tr> + <td class="tlabel">_{Email}:</td> + <td><?= $form_helper->text_field('group', 'email', array('class' => 'textinput')) ?></td> +</tr> +<tr> + <td class="tlabel">_{Street}:</td> + <td><?= $form_helper->text_field('group', 'street', array('class' => 'textinput')) ?></td> +</tr> +<tr> + <td class="tlabel">_{City/Town}:</td> + <td><?= $form_helper->text_field('group', 'city', array('class' => 'textinput') )?></td> +</tr> +<tr> + <td class="tlabel"> </td> + <td class="tsubmit"> + <input class="submitinput" type="submit" value="_{Create Group}"> + <input class="cancelinput" type="button" value="_{Cancel}"> + </td> +</tr> +<tr> + <td class="tlabel"> </td> + <td class="tnote"> + _{Note: groups that attack a specific person or group of people (e.g. racist, sexist, or other hate groups) will not be tolerated. Creating such a group will result in immediate termination of your PROJECT_NAME account.} + </td> +</tr> Modified: app/views/groupapp/group/_menu.tpl =================================================================== --- app/views/groupapp/group/_menu.tpl 2008-03-21 19:59:00 UTC (rev 111) +++ app/views/groupapp/group/_menu.tpl 2008-03-26 17:55:46 UTC (rev 112) @@ -3,7 +3,8 @@ <ul class="toggle_tabs"> <li class="first"><a href="/groupapp" class="<?= $controller->getActionName() == 'index' ? 'selected' : '' ?>">_{My Groups}</a></li><? ?><li><a href="/groupapp/group/browse" class="last <?= $controller->getActionName() == 'browse' ? 'selected' : '' ?>">_{Browse Groups}</a></li><? - ?><li><a href="/groupapp/group/popular" class="last <?= $controller->getActionName() == 'popular' ? 'selected' : '' ?>">_{Popular Groups}</a></li> + ?><li><a href="/groupapp/group/popular" class="<?= $controller->getActionName() == 'popular' ? 'selected' : '' ?>">_{Popular Groups}</a></li><? + ?><li><a href="/groupapp/group/create" class="last <?= $controller->getActionName() == 'create' ? 'selected' : '' ?>">_{Create Group}</a></li> </ul> </div> <div class="right"> Modified: app/views/groupapp/group/create.tpl =================================================================== --- app/views/groupapp/group/create.tpl 2008-03-21 19:59:00 UTC (rev 111) +++ app/views/groupapp/group/create.tpl 2008-03-26 17:55:46 UTC (rev 112) @@ -1 +1,23 @@ -create \ No newline at end of file +<?= $controller->renderPartial("menu") ?> + +<div class="title_bar"> + <div class="head"> + <div class="name groupapp">_{Create Group}</div> + </div> +</div> +<div class="clearfix"></div> + +<?= $controller->renderPartial("bar") ?> + +<div class="form_editor"> + <?= $controller->renderErrors() ?> + <form action="/groupapp/group/create" method="post"> + <table class="editor"> + <tbody> + <?= $controller->renderPartial($step) ?> + </tbody> + </table> + </form> +</div> +<div class="clearfix"></div> + Modified: app/views/layouts/application.tpl =================================================================== --- app/views/layouts/application.tpl 2008-03-21 19:59:00 UTC (rev 111) +++ app/views/layouts/application.tpl 2008-03-26 17:55:46 UTC (rev 112) @@ -29,36 +29,36 @@ <body id="application"> <div id="main"> <div id="sidebar"> - <a class="logo" href="/"></a> - <div id="sidebar_content"> - <?= $controller->renderSidebar() ?> - </div> + <a class="logo" href="/"></a> + <div id="sidebar_content"> + <?= $controller->renderSidebar() ?> + </div> </div> <div id="widebar"> - <div id="pageheader"> - <?= $controller->renderPageHeader() ?> - </div> - <div id="pagecontent"> - <div id="contentshadow"> - <div id="content"> - <?= $content_for_layout ?> - </div> - </div> - </div> - <div id="pagefooter"> - <div class="copyright"> - <a href="http://isocial.sourceforge.net/">_{PROJECT_NAME} © 2008</a>; + <div id="pageheader"> + <?= $controller->renderPageHeader() ?> + </div> + <div id="pagecontent"> + <div id="contentshadow"> + <div id="content"> + <?= $content_for_layout ?> </div> - <div class="linksarea"> - <ul> - <li><a href="/">_{About PROJECT_NAME}</a></li> - <li><a href="/">_{Terms}</a></li> - <li><a href="/">_{Help}</a></li> - </ul> - </div> - </div> + </div> + </div> + <div id="pagefooter"> + <div class="copyright"> + <a href="http://isocial.sourceforge.net/">_{PROJECT_NAME} © 2008</a>; + </div> + <div class="linksarea"> + <ul> + <li><a href="/">_{About PROJECT_NAME}</a></li> + <li><a href="/">_{Terms}</a></li> + <li><a href="/">_{Help}</a></li> + </ul> + </div> + </div> </div> </div> -<?= $controller->renderShared('dialog') ?> + <?= $controller->renderShared('dialog') ?> </body> </html> Modified: app/views/message/send.tpl =================================================================== --- app/views/message/send.tpl 2008-03-21 19:59:00 UTC (rev 111) +++ app/views/message/send.tpl 2008-03-26 17:55:46 UTC (rev 112) @@ -2,7 +2,7 @@ <?= $controller->renderErrors() ?> -<form action="/message/send" method="post"> +<form action="/message/send" method="get"> <div class="editform"> <div class="formrow"> <label>_{To}:</label> Modified: public/stylesheets/Application.css =================================================================== --- public/stylesheets/Application.css 2008-03-21 19:59:00 UTC (rev 111) +++ public/stylesheets/Application.css 2008-03-26 17:55:46 UTC (rev 112) @@ -323,7 +323,7 @@ border: 1px solid #bdc7d8; font-family: verdana, arial, sans-serif; font-size: 11px; - width: 200px; + width: 300px; margin: 0px 0px 5px 0px; padding: 3px; font-size: 11px; @@ -335,7 +335,6 @@ border: 1px solid #bdc7d8; font-family: verdana, arial, sans-serif; font-size: 11px; - width: 200px; margin: 0px 0px 5px 0px; padding: 3px; font-size: 11px; @@ -414,11 +413,6 @@ background: #f1f1f1; } -.toggle_tabs li a small { - font-size: 11px; - font-weight:normal; -} - .toggle_tabs li a:focus { outline: 0px; } @@ -433,7 +427,7 @@ border: 1px solid #3b5998; border-left: 1px solid #5973a9; border-right: 1px solid #5973a9; - color:#fff; + color: #ffffff; } .toggle_tabs li.last a.selected { @@ -457,7 +451,7 @@ } .toggle_tabs li a.disabled { - color: #999; + color: #999999; cursor: default; } @@ -513,7 +507,6 @@ #content .editform { margin: 20px auto 20px auto; - width: 600px; } .editform .formrow { @@ -580,3 +573,85 @@ background: #f7f7f7; width: 622px; } + +#content .minitabs { + display:block; + padding: 5px 0px 0px 0px; + border-bottom: 1px solid #3b5998; + float: left; + width: 647px; +} + +.minitabs .left { + float: left; + padding-left: 10px; + margin-bottom: -1px; +} + +.minitabs .right { + float: right; + padding-right: 10px; + margin-bottom: -1px; +} + +.toggle_minitabs { + display: block; + list-style: none; + padding: 4px 8px 6px 9px; + text-align: center; +} + +.toggle_minitabs li { + display: block; + float: left; + margin: 0px; +} + +.toggle_minitabs li a { + display: block; + color: #3b5998; + padding: 5px 4px 5px 4px; + margin: 0px 4px 0px 4px; + background: #ffffff; +} + +.toggle_minitabs li a:focus { + outline: 0px; +} + +.toggle_minitabs li a.selected { + background: #3b5998; + color: #ffffff; +} + +.toggle_minitabs li a.disabled { + background: #ffffff; + color: #999999; + cursor: default; + border-bottom: 1px solid #3b5998; +} + +.toggle_minitabs li a.disabled:hover { + text-decoration:none; +} + +.toggle_minitabs li.last a.selected { + margin-left: -1px; + border-left: 1px solid #5973a9; + border-right: 1px solid #36538f; +} + +.toggle_minitabs li.first a.selected { + margin: 0px; + border-left: 1px solid #36538f; + border-right: 1px solid #5973a9; +} + +.toggle_minitabs li.first.last a.selected { + border: 1px solid #36538f; +} + +.toggle_minitabs li a.selected:hover { + text-decoration: none; +} + Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-03-21 19:59:00 UTC (rev 111) +++ public/stylesheets/groupapp/Group.css 2008-03-26 17:55:46 UTC (rev 112) @@ -31,7 +31,7 @@ padding: 10px 0px 0px 80px; } -.title_bar .info .header .name { +.name { font-weight: bold; font-size: 14px; padding: 7px 0px 7px 22px; @@ -40,6 +40,11 @@ .title_bar .info .subheader { } +.title_bar .head { + padding: 10px 0px 10px 30px; + border-bottom: solid 1px #cccccc; +} + .nogroups { font-size: 12px; text-align: center; @@ -92,4 +97,39 @@ .query_button { margin: 4px 0px 0px 5px; float: left; -} \ No newline at end of file +} + +.form_editor { + background: #f7f7f7; + padding: 10px 10px 10px 10px; +} + +.editor { + margin: 5px auto 7px auto; +} + +.editor td { + padding: 0px 3px 0px 3px; + vertical-align: top; +} + +.editor td.tlabel { + padding: 0px 10px 0px 0px; + font-weight: bold; + color: #666666; +} + +.editor td.tlabel small { + color: #999999; + font-size: smaller; +} + +.editor td.tsubmit { + padding: 5px 10px 5px 20px; + border-bottom: solid 1px #cccccc; +} + +.editor td.tnote { + padding: 10px 0px 0px 0px; + width: 300px; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-03-28 16:54:20
|
Revision: 116 http://isocial.svn.sourceforge.net/isocial/?rev=116&view=rev Author: dim0s77 Date: 2008-03-28 09:54:26 -0700 (Fri, 28 Mar 2008) Log Message: ----------- Added tabs customize and members to the groups Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/locales/groupapp/group/ru.php app/views/groupapp/group/_bar.tpl app/views/groupapp/group/create.tpl public/stylesheets/Application.css public/stylesheets/groupapp/Group.css Added Paths: ----------- app/views/groupapp/group/customize.tpl app/views/groupapp/group/members.tpl Removed Paths: ------------- app/views/groupapp/group/_group_customize.tpl app/views/groupapp/group/_group_info.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-03-27 08:23:02 UTC (rev 115) +++ app/controllers/groupapp/group_controller.php 2008-03-28 16:54:26 UTC (rev 116) @@ -14,12 +14,37 @@ $this->GroupappGroup->setAttributes($this->params['group']); if ($this->Request->isPost() && $this->GroupappGroup->save()){ $this->step = 'group_customize'; + $this->redirectToAction('customize'); } else { $this->importErrors( $this->GroupappGroup->getErrors() ); } } } + function customize () { + $this->step = 'group_customize'; + if (!empty($this->params['group'])){ + $this->GroupappGroup->setAttributes($this->params['group']); + if ($this->Request->isPost() && $this->GroupappGroup->save()){ + $this->step = 'group_members'; + $this->redirectToAction('members'); + } else { + $this->importErrors( $this->GroupappGroup->getErrors() ); + } + } + } + + function members () { + $this->step = 'group_members'; + if (!empty($this->params['member'])){ + $this->GroupappGroup->setAttributes($this->params['member']); + if ($this->Request->isPost() && $this->GroupappGroup->save()){ + } else { + $this->importErrors( $this->GroupappGroup->getErrors() ); + } + } + } + function browse () { } Modified: app/locales/groupapp/group/ru.php =================================================================== --- app/locales/groupapp/group/ru.php 2008-03-27 08:23:02 UTC (rev 115) +++ app/locales/groupapp/group/ru.php 2008-03-28 16:54:26 UTC (rev 116) @@ -25,7 +25,6 @@ $dictionary['Description'] = 'Описание'; $dictionary['Group Type'] = 'Тип группы'; $dictionary['Select Category:'] = 'Выберите категорию:'; -$dictionary['Select'] = 'Выберите'; $dictionary['Recent News'] = 'Последние новости'; $dictionary['Office'] = 'Офис'; $dictionary['Street'] = 'Улица'; @@ -43,4 +42,35 @@ $dictionary['Group type is missing'] = 'Тип группы отсутствует'; $dictionary['please enter the group category'] = 'выберите, пожалуйста, категорию группы'; +$dictionary['Edit'] = 'Редактирование'; +$dictionary['Website'] = 'Адрес сайта'; +$dictionary['Options'] = 'Настройки'; +$dictionary['Show related groups'] = 'Показывать похожие группы'; +$dictionary['Enable discussion board'] = 'Включить форум'; +$dictionary['Enable the Wall'] = 'Включить доску объявлений'; +$dictionary['Enable photos'] = 'Включить фотографии'; +$dictionary['Allow all members to upload photos'] = 'Разрешить всем участникам загружать фото'; +$dictionary['Only allow admins to upload photos'] = 'Только администраторы могут загружать фото'; +$dictionary['Enable videos'] = 'Включить видео'; +$dictionary['Allow all members to upload videos'] = 'Разрешить всем участникам загружать видео'; +$dictionary['Only allow admins to upload videos'] = 'Только администраторы могут загружать видео'; +$dictionary['Access'] = 'Доступ'; +$dictionary['This group is open'] = 'Это открытая группа'; +$dictionary['This group is closed'] = 'Это закрытая группа'; +$dictionary['This group is secret'] = 'Это засекреченная группа'; +$dictionary['Anyone can join and invite others to join. Anyone can see the group information. Anyone can see the following: the discussion board, the wall, videos and photos.'] = + 'Каждый может присоединиться и пригласить других. Информацию о группе может увидеть каждый. Любой может увидеть форум, доску объявлений, видео и фото.'; +$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['Publicize'] = 'Опубликовать'; +$dictionary['Show this group in search results'] = 'Показывать эту группу в результатах поиска'; + +$dictionary['Invite people to'] = 'Пригласить людей в'; +$dictionary['Show'] = 'Показать'; +$dictionary['out of'] = 'из'; +$dictionary['Invite Friends'] = 'Пригласить друзей'; +$dictionary['Invite Friends on PROJECT_NAME'] = 'Пригласить друзей по PROJECT_NAME'; + ?> Modified: app/views/groupapp/group/_bar.tpl =================================================================== --- app/views/groupapp/group/_bar.tpl 2008-03-27 08:23:02 UTC (rev 115) +++ app/views/groupapp/group/_bar.tpl 2008-03-28 16:54:26 UTC (rev 116) @@ -2,8 +2,11 @@ <div class="left"> <ul class="toggle_minitabs"> <li class="first"><a href="/groupapp/group/create" class="<?= $step == 'group_info' ? 'selected' : '' ?>">_{Step} 1: _{Group Info}</a></li><? - ?><li><a class="disabled">_{Step} 2: _{Customize}</a></li><? - ?><li><a class="disabled">_{Step} 3: _{Members}</a></li> + ?><li><a href="/groupapp/group/customize/{group_id?}" class="<? if ($step == 'group_customize') { echo 'selected'; } + else if ($step == 'group_members') { echo ''; } + else echo 'disabled' ?>">_{Step} 2: _{Customize}</a></li><? + ?><li><a href="/groupapp/group/members/{group_id?}" class="<? if ($step == 'group_members') { echo 'selected'; } + else echo 'disabled' ?>">_{Step} 3: _{Members}</a></li> </ul> </div> </div> Deleted: app/views/groupapp/group/_group_customize.tpl =================================================================== --- app/views/groupapp/group/_group_customize.tpl 2008-03-27 08:23:02 UTC (rev 115) +++ app/views/groupapp/group/_group_customize.tpl 2008-03-28 16:54:26 UTC (rev 116) @@ -1 +0,0 @@ -customize \ No newline at end of file Deleted: app/views/groupapp/group/_group_info.tpl =================================================================== --- app/views/groupapp/group/_group_info.tpl 2008-03-27 08:23:02 UTC (rev 115) +++ app/views/groupapp/group/_group_info.tpl 2008-03-28 16:54:26 UTC (rev 116) @@ -1,55 +0,0 @@ -<tr> - <td class="tlabel">_{Group Name}:<br><small>(_{required})</small></td> - <td><?= $form_helper->text_field('group', 'name', array('class' => 'textinput')) ?></td> -</tr> -<tr> - <td class="tlabel">_{Description}:<br><small>(_{required})</small></td> - <td><?= $form_helper->text_area('group', 'description', array('rows' => '5')) ?></td> -</tr> -<tr> - <td class="tlabel">_{Group Type}:<br><small>(_{required})</small></td> - <td> - <?= $form_options_helper->select('group', - 'type_id', - $GroupappGroupType->collect( - $GroupappGroupType->find('all', array('conditions' => array("parent_id = 0"))), - 'name', - 'id'), - array(), - array('prompt' => $controller->t('Select')) - ) ?> - </td> -</tr> -<tr> - <td class="tlabel">_{Recent News}:</td> - <td><?= $form_helper->text_area('group', 'recent_news', array('rows' => '5')) ?></td> -</tr> -<tr> - <td class="tlabel">_{Office}:</td> - <td><?= $form_helper->text_field('group', 'office', array('class' => 'textinput')) ?></td> -</tr> -<tr> - <td class="tlabel">_{Email}:</td> - <td><?= $form_helper->text_field('group', 'email', array('class' => 'textinput')) ?></td> -</tr> -<tr> - <td class="tlabel">_{Street}:</td> - <td><?= $form_helper->text_field('group', 'street', array('class' => 'textinput')) ?></td> -</tr> -<tr> - <td class="tlabel">_{City/Town}:</td> - <td><?= $form_helper->text_field('group', 'city', array('class' => 'textinput') )?></td> -</tr> -<tr> - <td class="tlabel"> </td> - <td class="tsubmit"> - <input class="submitinput" type="submit" value="_{Create Group}"> - <input class="cancelinput" type="button" value="_{Cancel}"> - </td> -</tr> -<tr> - <td class="tlabel"> </td> - <td class="tnote"> - _{Note: groups that attack a specific person or group of people (e.g. racist, sexist, or other hate groups) will not be tolerated. Creating such a group will result in immediate termination of your PROJECT_NAME account.} - </td> -</tr> Modified: app/views/groupapp/group/create.tpl =================================================================== --- app/views/groupapp/group/create.tpl 2008-03-27 08:23:02 UTC (rev 115) +++ app/views/groupapp/group/create.tpl 2008-03-28 16:54:26 UTC (rev 116) @@ -14,7 +14,61 @@ <form action="/groupapp/group/create" method="post"> <table class="editor"> <tbody> - <?= $controller->renderPartial($step) ?> + <tr> + <td class="tlabel">_{Group Name}:<br><small>(_{required})</small></td> + <td><?= $form_helper->text_field('group', 'name', array('class' => 'textinput')) ?></td> + </tr> + <tr> + <td class="tlabel">_{Description}:<br><small>(_{required})</small></td> + <td><?= $form_helper->text_area('group', 'description', array('rows' => '5')) ?></td> + </tr> + <tr> + <td class="tlabel">_{Group Type}:<br><small>(_{required})</small></td> + <td> + <?= $form_options_helper->select('group', + 'type_id', + $GroupappGroupType->collect( + $GroupappGroupType->find('all', array('conditions' => array("parent_id = 0"))), + 'name', + 'id'), + array(), + array('prompt' => $controller->t('Select Category:')) + ) ?> + </td> + </tr> + <tr> + <td class="tlabel">_{Recent News}:</td> + <td><?= $form_helper->text_area('group', 'recent_news', array('rows' => '5')) ?></td> + </tr> + <tr> + <td class="tlabel">_{Office}:</td> + <td><?= $form_helper->text_field('group', 'office', array('class' => 'textinput')) ?></td> + </tr> + <tr> + <td class="tlabel">_{Email}:</td> + <td><?= $form_helper->text_field('group', 'email', array('class' => 'textinput')) ?></td> + </tr> + <tr> + <td class="tlabel">_{Street}:</td> + <td><?= $form_helper->text_field('group', 'street', array('class' => 'textinput')) ?></td> + </tr> + <tr> + <td class="tlabel">_{City/Town}:</td> + <td><?= $form_helper->text_field('group', 'city', array('class' => 'textinput') )?></td> + </tr> + <tr> + <td class="tlabel"> </td> + <td class="tsubmit"> + <input class="submitinput" type="submit" value="_{Create Group}"> + <input class="cancelinput" type="button" value="_{Cancel}"> + </td> + </tr> + <tr> + <td class="tlabel"> </td> + <td class="tnote"> + _{Note: groups that attack a specific person or group of people (e.g. racist, sexist, or other hate groups) will not be tolerated. Creating such a group will result in immediate termination of your PROJECT_NAME account.} + </td> + </tr> </tbody> </table> </form> Added: app/views/groupapp/group/customize.tpl =================================================================== --- app/views/groupapp/group/customize.tpl (rev 0) +++ app/views/groupapp/group/customize.tpl 2008-03-28 16:54:26 UTC (rev 116) @@ -0,0 +1,161 @@ +<?= $controller->renderPartial("menu") ?> + +<div class="title_bar"> + <div class="head"> + <div class="name groupapp">_{Edit} {group_name?}</div> + </div> +</div> +<div class="clearfix"></div> + +<?= $controller->renderPartial("bar") ?> + +<div class="editform"> + <form action="/groupapp/group/customize/{group_id?}" method="post"> + <div class="picture"></div> + + <div class="formrow"> + <?= $controller->renderErrors() ?> + </div> + + <div class="formrow"> + <label>_{Website}:</label> + <div class="formcol"> + <?= $form_helper->text_field('group', 'website', array('class' => 'textinput')) ?> + </div> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label>_{Options}:</label> + <div class="formcol"> + <label class="checkbox"><?= $form_helper->check_box('group', 'show_related_groups', array('class' => 'checkboxinput', 'checked' => 'checked')) ?> _{Show related groups}.</label> + </div> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label> </label> + <div class="formcol"> + <label class="checkbox"><?= $form_helper->check_box('group', 'enable_discussion_board', array('class' => 'checkboxinput', 'checked' => 'checked')) ?> _{Enable discussion board}.</label> + </div> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label> </label> + <div class="formcol"> + <label class="checkbox"><?= $form_helper->check_box('group', 'enable_the_wall', array('class' => 'checkboxinput', 'checked' => 'checked')) ?> _{Enable the Wall}.</label> + </div> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label> </label> + <div class="formcol"> + <label class="checkbox"><?= $form_helper->check_box('group', 'enable_photos', array('class' => 'checkboxinput', 'checked' => 'checked')) ?> _{Enable photos}.</label> + </div> + <div class="clearfix"></div> + </div> + <div class="formrow"> + <label> </label> + <div class="formcol"> + <div class="formblock border"> + <label class="radiobutton"><?= $form_helper->radio_button('group', 'photo_member', 'members', array('checked' => 'checked')) ?> _{Allow all members to upload photos}.</label> + <label class="radiobutton"><?= $form_helper->radio_button('group', 'photo_member', 'admins') ?> _{Only allow admins to upload photos}.</label> + <div class="clearfix"></div> + </div> + </div> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label> </label> + <div class="formcol"> + <label class="checkbox"><?= $form_helper->check_box('group', 'enable_videos', array('class' => 'checkboxinput', 'checked' => 'checked')) ?> _{Enable videos}.</label> + </div> + <div class="clearfix"></div> + </div> + <div class="formrow"> + <label> </label> + <div class="formcol"> + <div class="formblock border"> + <label class="radiobutton"><?= $form_helper->radio_button('group', 'video_member', 'members', array('checked' => 'checked')) ?> _{Allow all members to upload videos}.</label> + <label class="radiobutton"><?= $form_helper->radio_button('group', 'video_member', 'admins') ?> _{Only allow admins to upload videos}.</label> + <div class="clearfix"></div> + </div> + </div> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label>_{Access}:</label> + <div class="formcol"> + <label class="radiobutton"><?= $form_helper->radio_button('group', 'access', 'open', array('checked' => 'checked')) ?> _{This group is open}.</label> + </div> + <div class="clearfix"></div> + </div> + <div class="formrow"> + <label> </label> + <div class="formcol"> + <div class="formblock gray"> + _{Anyone can join and invite others to join. Anyone can see the group information. Anyone can see the following: the discussion board, the wall, videos and photos.} + </div> + </div> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label> </label> + <div class="formcol"> + <label class="radiobutton"><?= $form_helper->radio_button('group', 'access', 'closed') ?> _{This group is closed}.</label> + </div> + <div class="clearfix"></div> + </div> + <div class="formrow"> + <label> </label> + <div class="formcol"> + <div class="formblock gray"> + _{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.} + </div> + </div> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label> </label> + <div class="formcol"> + <label class="radiobutton"><?= $form_helper->radio_button('group', 'access', 'secret') ?> _{This group is secret}.</label> + </div> + <div class="clearfix"></div> + </div> + <div class="formrow"> + <label> </label> + <div class="formcol"> + <div class="formblock gray"> + _{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.} + </div> + </div> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label>_{Publicize}:</label> + <div class="formcol"> + <label class="checkbox"><?= $form_helper->check_box('group', 'is_show_in_search', array('class' => 'checkboxinput', 'checked' => 'checked')) ?> _{Show this group in search results}.</label> + </div> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label> </label> + <div class="formcol"> + <input class="submitinput" type="submit" value="_{Create Group}"> + <input class="cancelinput" type="button" value="_{Cancel}"> + </div> + <div class="clearfix"></div> + </div> + <div class="clearfix"></div> + + </form> +</div> + Added: app/views/groupapp/group/members.tpl =================================================================== --- app/views/groupapp/group/members.tpl (rev 0) +++ app/views/groupapp/group/members.tpl 2008-03-28 16:54:26 UTC (rev 116) @@ -0,0 +1,46 @@ +<?= $controller->renderPartial("menu") ?> + +<div class="title_bar"> + <div class="head"> + <div class="name groupapp">_{Invite people to} {group_name?}</div> + </div> +</div> +<div class="clearfix"></div> + +<?= $controller->renderPartial("bar") ?> + +<div class="formwrapper"> +<form action="/groupapp/group/edit_members/{group_id?}" method="post"> + <div class="invite_column"> + <div class="header_text">_{Invite Friends on PROJECT_NAME}:</div> + <div class="friends_list"></div> + <div class="submit"> + <input class="submitinput" type="submit" value="_{Invite Friends}"> + </div> + </div> + + <div class="members"> + <div class="submenushort"> + <div class="menu_block selector"> + <label for="action_select">_{Show}: + <select onchange="doselect(this)" id="action_select" name="action_select"> + <option selected="selected" value="members">_{Members}</option> + <option value="not_replied">_{Not Yet Replied}</option> + <option value="blocked">_{Blocked}</option> + </select> + </label> + </div> + </div> + <div class="list_header"> + _{Members}: 0 _{out of} 0 + </div> + <div class="members_list"> + </div> + </div> + + + <div class="clearfix"></div> + +</form> +</div> + Modified: public/stylesheets/Application.css =================================================================== --- public/stylesheets/Application.css 2008-03-27 08:23:02 UTC (rev 115) +++ public/stylesheets/Application.css 2008-03-28 16:54:26 UTC (rev 116) @@ -461,12 +461,18 @@ #content .submenu { background: #f7f7f7; - border-bottom: 1px solid #ccc; + border-bottom: 1px solid #cccccc; padding: 8px 20px 8px 20px; float: left; width: 605px; } +#content .submenushort { + background: #f7f7f7; + border-bottom: 1px solid #cccccc; + padding: 5px 0px 5px 15px; +} + .submenu .menu_block { float: left; } @@ -506,9 +512,14 @@ } #content .editform { - margin: 20px auto 20px auto; + padding: 20px 0px 20px 0px; + background: #f7f7f7; } +#content .formwrapper { + background: #f7f7f7; +} + .editform .formrow { clear: both; vertical-align: top; @@ -521,7 +532,7 @@ width: 150px; float: left; text-align: right; - padding: 3px 10px 3px; + padding: 3px 10px 3px 0px; } .formrow label.shortlabel { @@ -533,15 +544,24 @@ .formrow label.checkbox { font-weight: normal; - color: #000; + color: #000000; text-align: left; - padding: 3px 0px 3px; + padding: 3px 0px 3px 0px; + width: 400px; } +.formrow label.radiobutton { + font-weight: normal; + color: #000000; + text-align: left; + padding: 3px 0px 3px 0px; + width: 300px; +} + .formrow .formcol { float: left; width: 360px; - padding: 3px 0px 3px 0px; + padding: 0px 0px 5px 0px; margin: 0px; } @@ -556,6 +576,21 @@ background: url('/images/lock.png') no-repeat 0px; } +.formrow .formblock { + width: 235px; + margin: 3px 0px 3px 10px; +} + +.formrow .formblock.border { + border-top: 1px solid #aaaaaa; + border-bottom: 1px solid #aaaaaa; +} + +.formrow .formblock.gray { + color: #777777; + margin: 0px 0px 0px 25px; +} + .formrow textarea { width: 200px; height: 100px; @@ -618,8 +653,7 @@ display: block; color: #3b5998; padding: 5px 4px 5px 4px; - margin: 0px 4px 0px 4px; - background: #ffffff; + margin: 0px 4px 1px 4px; } .toggle_minitabs li a:focus { @@ -631,34 +665,17 @@ color: #ffffff; } +.toggle_minitabs li a.selected:hover { + text-decoration: none; +} + .toggle_minitabs li a.disabled { background: #ffffff; color: #999999; cursor: default; - border-bottom: 1px solid #3b5998; } .toggle_minitabs li a.disabled:hover { - text-decoration:none; -} - -.toggle_minitabs li.last a.selected { - margin-left: -1px; - border-left: 1px solid #5973a9; - border-right: 1px solid #36538f; -} - -.toggle_minitabs li.first a.selected { - margin: 0px; - border-left: 1px solid #36538f; - border-right: 1px solid #5973a9; -} - -.toggle_minitabs li.first.last a.selected { - border: 1px solid #36538f; -} - -.toggle_minitabs li a.selected:hover { text-decoration: none; } Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-03-27 08:23:02 UTC (rev 115) +++ public/stylesheets/groupapp/Group.css 2008-03-28 16:54:26 UTC (rev 116) @@ -133,3 +133,46 @@ padding: 10px 0px 0px 0px; width: 300px; } + +.formwrapper .invite_column { + float: right; + width: 230px; + height: 300px; + border-left: 1px solid #cccccc; +} + +.invite_column .header_text { + font-weight: bold; + font-size: 12px; + text-align: center; + padding: 10px 0px 3px 0px; + color: #777777; +} + +.invite_column .friends_list { + margin: 0px 10px 5px 10px; + background: #ffffff; + border: 1px solid #cccccc; + height: 230px; +} + +.invite_column .submit { + text-align: center; +} + +.formwrapper .members { + background: #ffffff; + margin-right: 231px; +} + +.members .list_header { + background: #ffffff; + border-bottom: 1px solid #dddddd; + padding: 8px 0px 5px 15px; + font-weight: bold; +} + +.members .members_list { + background: #ffffff; + height: 240px; +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-04-14 16:59:35
|
Revision: 121 http://isocial.svn.sourceforge.net/isocial/?rev=121&view=rev Author: dim0s77 Date: 2008-04-14 09:59:39 -0700 (Mon, 14 Apr 2008) Log Message: ----------- now group is created and custom edited in three steps. refactoring Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/controllers/profile_controller.php app/installers/groupapp/group_installer.php app/installers/groupapp/russian_installer.php app/models/groupapp_group.php app/views/groupapp/group/_bar.tpl app/views/groupapp/group/create.tpl app/views/groupapp/group/customize.tpl app/views/groupapp/group/members.tpl app/views/profile/show.tpl public/stylesheets/Application.css public/stylesheets/groupapp/Group.css Added Paths: ----------- app/models/groupapp_member.php app/models/groupapp_member_role.php app/views/groupapp/group/edit_members.tpl Removed Paths: ------------- app/controllers/group_controller.php Deleted: app/controllers/group_controller.php =================================================================== --- app/controllers/group_controller.php 2008-04-13 13:26:14 UTC (rev 120) +++ app/controllers/group_controller.php 2008-04-14 16:59:39 UTC (rev 121) @@ -1,13 +0,0 @@ -<?php - -class GroupController extends ApplicationController -{ - function index () { - $this->redirectTo(array('action' => 'show')); - } - - function show () { - } -} - -?> Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-04-13 13:26:14 UTC (rev 120) +++ app/controllers/groupapp/group_controller.php 2008-04-14 16:59:39 UTC (rev 121) @@ -2,7 +2,7 @@ class Groupapp_GroupController extends ApplicationController { - var $models = array('GroupappGroup', 'GroupappGroupType'); + var $models = array('GroupappGroup', 'GroupappGroupType', 'GroupappMember', 'GroupappMemberRole'); function index () { $this->group_types = $this->GroupappGroupType->find('all', array('conditions' => array("parent_id = 0"))); @@ -13,8 +13,14 @@ if (!empty($this->params['group'])){ $this->GroupappGroup->setAttributes($this->params['group']); if ($this->Request->isPost() && $this->GroupappGroup->save()){ - $this->step = 'group_customize'; - $this->redirectToAction('customize'); + $owner = $this->GroupappMemberRole->find(1); + $group_member = $this->GroupappGroup->group_member->build(); + $group_member->user->assign($this->current_user); + $group_member->role->assign($owner); + if ($group_member->save()) { + $this->step = 'group_customize'; + $this->redirectTo(array('action' => 'customize', 'id' => $this->GroupappGroup->getId())); + } } else { $this->importErrors( $this->GroupappGroup->getErrors() ); } @@ -23,26 +29,33 @@ function customize () { $this->step = 'group_customize'; - if (!empty($this->params['group'])){ - $this->GroupappGroup->setAttributes($this->params['group']); - if ($this->Request->isPost() && $this->GroupappGroup->save()){ + if (!empty($this->params['group']) && !empty($this->params['id'])){ + $group = $this->GroupappGroup->findFirst(array( 'id' => $this->params['id'] )); + $group->setAttributes($this->params['group']); + if ($this->Request->isPost() && $group->save()) { $this->step = 'group_members'; - $this->redirectToAction('members'); - } else { - $this->importErrors( $this->GroupappGroup->getErrors() ); + $this->redirectTo(array('action' => 'edit_members', 'id' => $group->getId())); + return; } + } else if (!empty($this->params['id']) && $this->GroupappGroup->find($this->params['id'])) { + $this->group = $this->GroupappGroup->find($this->params['id']); } + $this->importErrors( $this->GroupappGroup->getErrors() ); } - function members () { + function edit_members () { $this->step = 'group_members'; if (!empty($this->params['member'])){ $this->GroupappGroup->setAttributes($this->params['member']); if ($this->Request->isPost() && $this->GroupappGroup->save()){ - } else { - $this->importErrors( $this->GroupappGroup->getErrors() ); + return; } + } else if (!empty($this->params['id']) && $this->GroupappGroup->find($this->params['id'])) { + $this->group = $this->GroupappGroup->find($this->params['id']); + $this->members = $this->GroupappMember->find('all', array('conditions' => array("group_id = ?", $this->group->getId()), + 'include' => 'user')); } + $this->importErrors( $this->GroupappGroup->getErrors() ); } function browse () { Modified: app/controllers/profile_controller.php =================================================================== --- app/controllers/profile_controller.php 2008-04-13 13:26:14 UTC (rev 120) +++ app/controllers/profile_controller.php 2008-04-14 16:59:39 UTC (rev 121) @@ -10,7 +10,9 @@ function show () { $id = !empty($this->params['id']) ? $this->params['id'] : $this->current_user->getId(); - $this->user = $this->User->find($id); + if ($id) { + $this->user = $this->User->find($id); + } } function basic () { Modified: app/installers/groupapp/group_installer.php =================================================================== --- app/installers/groupapp/group_installer.php 2008-04-13 13:26:14 UTC (rev 120) +++ app/installers/groupapp/group_installer.php 2008-04-14 16:59:39 UTC (rev 121) @@ -36,12 +36,14 @@ `street` char(100) NOT NULL DEFAULT '', `city` char(100) NOT NULL DEFAULT '', `website` char(100) NOT NULL DEFAULT '', - `show_related_group` tinyint(1) NOT NULL DEFAULT '1', + `show_related_groups` tinyint(1) NOT NULL DEFAULT '1', `show_discussion_board` tinyint(1) NOT NULL DEFAULT '1', `show_wall` tinyint(1) NOT NULL DEFAULT '1', `show_photos` tinyint(1) NOT NULL DEFAULT '1', + `photo_member` tinyint(1) NOT NULL DEFAULT '0', `show_videos` tinyint(1) NOT NULL DEFAULT '1', - `access` tinyint(1) NOT NULL DEFAULT '1', + `video_member` tinyint(1) NOT NULL DEFAULT '0', + `access` int(1) UNSIGNED NOT NULL DEFAULT '0', `show_in_search` tinyint(1) NOT NULL DEFAULT '1', FOREIGN KEY (type_id) REFERENCES groupapp_group_types(id), @@ -49,32 +51,31 @@ ) ENGINE=InnoDB"); $this->execute( - "CREATE TABLE `groupapp_group_user_roles` ( - `id` tinyint(1) NOT NULL PRIMARY KEY AUTO_INCREMENT, + "CREATE TABLE `groupapp_member_roles` ( + `id` int(1) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, `en_name` char(15) NOT NULL DEFAULT '' ) ENGINE=InnoDB"); - $this->execute("INSERT INTO `groupapp_group_user_roles` (id, en_name) VALUES (1, 'Administrator')"); - $this->execute("INSERT INTO `groupapp_group_user_roles` (id, en_name) VALUES (2, 'Moderator')"); - $this->execute("INSERT INTO `groupapp_group_user_roles` (id, en_name) VALUES (3, 'Member')"); + $this->execute("INSERT INTO `groupapp_member_roles` (id, en_name) VALUES (1, 'Owner')"); + $this->execute("INSERT INTO `groupapp_member_roles` (id, en_name) VALUES (2, 'Administrator')"); + $this->execute("INSERT INTO `groupapp_member_roles` (id, en_name) VALUES (3, 'Moderator')"); + $this->execute("INSERT INTO `groupapp_member_roles` (id, en_name) VALUES (4, 'Member')"); $this->execute( - "CREATE TABLE `groupapp_group_users` ( - `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `group_id` int(11) NOT NULL DEFAULT '0', - `user_id` int(11) NOT NULL DEFAULT '0', - `role_id` tinyint(1) NOT NULL DEFAULT '3', - `is_owner` tinyint(1) NOT NULL DEFAULT '0', + "CREATE TABLE `groupapp_members` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `group_id` int(11) NOT NULL DEFAULT '0', + `user_id` int(11) NOT NULL DEFAULT '0', + `role_id` int(1) UNSIGNED NOT NULL DEFAULT '4', FOREIGN KEY (group_id) REFERENCES groupapp_groups(id), - FOREIGN KEY (role_id) REFERENCES groupapp_group_user_roles(id) + FOREIGN KEY (role_id) REFERENCES groupapp_member_roles(id) ) ENGINE=InnoDB"); - } function down_1() { - $this->dropTable('groupapp_group_users'); - $this->dropTable('groupapp_group_user_roles'); + $this->dropTable('groupapp_members'); + $this->dropTable('groupapp_member_roles'); $this->dropTable('groupapp_groups'); $this->dropTable('groupapp_group_types'); } Modified: app/installers/groupapp/russian_installer.php =================================================================== --- app/installers/groupapp/russian_installer.php 2008-04-13 13:26:14 UTC (rev 120) +++ app/installers/groupapp/russian_installer.php 2008-04-14 16:59:39 UTC (rev 121) @@ -18,10 +18,11 @@ $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Отдых и Спорт' WHERE id = 10"); $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Студенческие группы' WHERE id = 11"); - $this->execute("ALTER TABLE groupapp_group_user_roles ADD COLUMN {$locale}_name char(100) NOT NULL AFTER en_name"); - $this->execute("UPDATE groupapp_group_user_roles set {$locale}_name ='Администратор' WHERE id = 1"); - $this->execute("UPDATE groupapp_group_user_roles set {$locale}_name ='Модератор' WHERE id = 2"); - $this->execute("UPDATE groupapp_group_user_roles set {$locale}_name ='Участник' WHERE id = 3"); + $this->execute("ALTER TABLE groupapp_member_roles ADD COLUMN {$locale}_name char(100) NOT NULL AFTER en_name"); + $this->execute("UPDATE groupapp_member_roles set {$locale}_name ='Владелец' WHERE id = 1"); + $this->execute("UPDATE groupapp_member_roles set {$locale}_name ='Администратор' WHERE id = 2"); + $this->execute("UPDATE groupapp_member_roles set {$locale}_name ='Модератор' WHERE id = 3"); + $this->execute("UPDATE groupapp_member_roles set {$locale}_name ='Участник' WHERE id = 4"); } function down_1() Modified: app/models/groupapp_group.php =================================================================== --- app/models/groupapp_group.php 2008-04-13 13:26:14 UTC (rev 120) +++ app/models/groupapp_group.php 2008-04-14 16:59:39 UTC (rev 121) @@ -2,6 +2,10 @@ class GroupappGroup extends ActiveRecord { + var $has_one = array('group_member' => array('class_name' => 'GroupappMember', + 'foreign_key' => 'group_id'), + ); + function validateOnCreate () { $this->validatesPresenceOf('name', 'Name is missing|please enter the name'); Added: app/models/groupapp_member.php =================================================================== --- app/models/groupapp_member.php (rev 0) +++ app/models/groupapp_member.php 2008-04-14 16:59:39 UTC (rev 121) @@ -0,0 +1,10 @@ +<?php + +class GroupappMember extends ActiveRecord +{ + var $belongs_to = array('user' => array('class_name' => 'User', 'primary_key_name' => 'user_id'), + 'role' => array('class_name' => 'GroupMemberRole', 'primary_key_name' => 'role_id') + ); +} + +?> Added: app/models/groupapp_member_role.php =================================================================== --- app/models/groupapp_member_role.php (rev 0) +++ app/models/groupapp_member_role.php 2008-04-14 16:59:39 UTC (rev 121) @@ -0,0 +1,7 @@ +<?php + +class GroupappMemberRole extends ActiveRecord +{ +} + +?> Modified: app/views/groupapp/group/_bar.tpl =================================================================== --- app/views/groupapp/group/_bar.tpl 2008-04-13 13:26:14 UTC (rev 120) +++ app/views/groupapp/group/_bar.tpl 2008-04-14 16:59:39 UTC (rev 121) @@ -2,10 +2,10 @@ <div class="left"> <ul class="toggle_minitabs"> <li class="first"><a href="/groupapp/group/create" class="<?= $step == 'group_info' ? 'selected' : '' ?>">_{Step} 1: _{Group Info}</a></li><? - ?><li><a href="/groupapp/group/customize/{group_id?}" class="<? if ($step == 'group_customize') { echo 'selected'; } + ?><li><a href="/groupapp/group/customize/{group.id?}" class="<? if ($step == 'group_customize') { echo 'selected'; } else if ($step == 'group_members') { echo ''; } else echo 'disabled' ?>">_{Step} 2: _{Customize}</a></li><? - ?><li><a href="/groupapp/group/members/{group_id?}" class="<? if ($step == 'group_members') { echo 'selected'; } + ?><li><a href="/groupapp/group/edit_members/{group.id?}" class="<? if ($step == 'group_members') { echo 'selected'; } else echo 'disabled' ?>">_{Step} 3: _{Members}</a></li> </ul> </div> Modified: app/views/groupapp/group/create.tpl =================================================================== --- app/views/groupapp/group/create.tpl 2008-04-13 13:26:14 UTC (rev 120) +++ app/views/groupapp/group/create.tpl 2008-04-14 16:59:39 UTC (rev 121) @@ -11,7 +11,7 @@ <div class="form_editor"> <?= $controller->renderErrors() ?> - <form action="/groupapp/group/create" method="post"> + <form action="/groupapp/group/create/{id}" method="post"> <table class="editor"> <tbody> <tr> Modified: app/views/groupapp/group/customize.tpl =================================================================== --- app/views/groupapp/group/customize.tpl 2008-04-13 13:26:14 UTC (rev 120) +++ app/views/groupapp/group/customize.tpl 2008-04-14 16:59:39 UTC (rev 121) @@ -10,7 +10,7 @@ <?= $controller->renderPartial("bar") ?> <div class="editform"> - <form action="/groupapp/group/customize/{group_id?}" method="post"> + <form action="/groupapp/group/customize/{group.id?}" method="post"> <div class="picture"></div> <div class="formrow"> @@ -28,7 +28,7 @@ <div class="formrow"> <label>_{Options}:</label> <div class="formcol"> - <label class="checkbox"><?= $form_helper->check_box('group', 'show_related_groups', array('class' => 'checkboxinput', 'checked' => 'checked')) ?> _{Show related groups}.</label> + <label class="checkbox"><?= $form_helper->check_box('group', 'show_related_groups', array('class' => 'checkboxinput')) ?> _{Show related groups}.</label> </div> <div class="clearfix"></div> </div> @@ -36,7 +36,7 @@ <div class="formrow"> <label> </label> <div class="formcol"> - <label class="checkbox"><?= $form_helper->check_box('group', 'enable_discussion_board', array('class' => 'checkboxinput', 'checked' => 'checked')) ?> _{Enable discussion board}.</label> + <label class="checkbox"><?= $form_helper->check_box('group', 'show_discussion_board', array('class' => 'checkboxinput')) ?> _{Enable discussion board}.</label> </div> <div class="clearfix"></div> </div> @@ -44,7 +44,7 @@ <div class="formrow"> <label> </label> <div class="formcol"> - <label class="checkbox"><?= $form_helper->check_box('group', 'enable_the_wall', array('class' => 'checkboxinput', 'checked' => 'checked')) ?> _{Enable the Wall}.</label> + <label class="checkbox"><?= $form_helper->check_box('group', 'show_wall', array('class' => 'checkboxinput')) ?> _{Enable the Wall}.</label> </div> <div class="clearfix"></div> </div> @@ -52,7 +52,7 @@ <div class="formrow"> <label> </label> <div class="formcol"> - <label class="checkbox"><?= $form_helper->check_box('group', 'enable_photos', array('class' => 'checkboxinput', 'checked' => 'checked')) ?> _{Enable photos}.</label> + <label class="checkbox"><?= $form_helper->check_box('group', 'show_photos', array('class' => 'checkboxinput')) ?> _{Enable photos}.</label> </div> <div class="clearfix"></div> </div> @@ -60,8 +60,8 @@ <label> </label> <div class="formcol"> <div class="formblock border"> - <label class="radiobutton"><?= $form_helper->radio_button('group', 'photo_member', 'members', array('checked' => 'checked')) ?> _{Allow all members to upload photos}.</label> - <label class="radiobutton"><?= $form_helper->radio_button('group', 'photo_member', 'admins') ?> _{Only allow admins to upload photos}.</label> + <label class="radiobutton"><?= $form_helper->radio_button('group', 'photo_member', '0', array('checked' => 'checked')) ?> _{Allow all members to upload photos}.</label> + <label class="radiobutton"><?= $form_helper->radio_button('group', 'photo_member', '1') ?> _{Only allow admins to upload photos}.</label> <div class="clearfix"></div> </div> </div> @@ -71,7 +71,7 @@ <div class="formrow"> <label> </label> <div class="formcol"> - <label class="checkbox"><?= $form_helper->check_box('group', 'enable_videos', array('class' => 'checkboxinput', 'checked' => 'checked')) ?> _{Enable videos}.</label> + <label class="checkbox"><?= $form_helper->check_box('group', 'show_videos', array('class' => 'checkboxinput')) ?> _{Enable videos}.</label> </div> <div class="clearfix"></div> </div> @@ -79,8 +79,8 @@ <label> </label> <div class="formcol"> <div class="formblock border"> - <label class="radiobutton"><?= $form_helper->radio_button('group', 'video_member', 'members', array('checked' => 'checked')) ?> _{Allow all members to upload videos}.</label> - <label class="radiobutton"><?= $form_helper->radio_button('group', 'video_member', 'admins') ?> _{Only allow admins to upload videos}.</label> + <label class="radiobutton"><?= $form_helper->radio_button('group', 'video_member', '0', array('checked' => 'checked')) ?> _{Allow all members to upload videos}.</label> + <label class="radiobutton"><?= $form_helper->radio_button('group', 'video_member', '1') ?> _{Only allow admins to upload videos}.</label> <div class="clearfix"></div> </div> </div> @@ -90,7 +90,7 @@ <div class="formrow"> <label>_{Access}:</label> <div class="formcol"> - <label class="radiobutton"><?= $form_helper->radio_button('group', 'access', 'open', array('checked' => 'checked')) ?> _{This group is open}.</label> + <label class="radiobutton"><?= $form_helper->radio_button('group', 'access', '0', array('checked' => 'checked')) ?> _{This group is open}.</label> </div> <div class="clearfix"></div> </div> @@ -107,7 +107,7 @@ <div class="formrow"> <label> </label> <div class="formcol"> - <label class="radiobutton"><?= $form_helper->radio_button('group', 'access', 'closed') ?> _{This group is closed}.</label> + <label class="radiobutton"><?= $form_helper->radio_button('group', 'access', '1') ?> _{This group is closed}.</label> </div> <div class="clearfix"></div> </div> @@ -124,7 +124,7 @@ <div class="formrow"> <label> </label> <div class="formcol"> - <label class="radiobutton"><?= $form_helper->radio_button('group', 'access', 'secret') ?> _{This group is secret}.</label> + <label class="radiobutton"><?= $form_helper->radio_button('group', 'access', '2') ?> _{This group is secret}.</label> </div> <div class="clearfix"></div> </div> @@ -141,7 +141,7 @@ <div class="formrow"> <label>_{Publicize}:</label> <div class="formcol"> - <label class="checkbox"><?= $form_helper->check_box('group', 'is_show_in_search', array('class' => 'checkboxinput', 'checked' => 'checked')) ?> _{Show this group in search results}.</label> + <label class="checkbox"><?= $form_helper->check_box('group', 'show_in_search', array('class' => 'checkboxinput', 'checked' => 'checked')) ?> _{Show this group in search results}.</label> </div> <div class="clearfix"></div> </div> @@ -149,7 +149,7 @@ <div class="formrow"> <label> </label> <div class="formcol"> - <input class="submitinput" type="submit" value="_{Create Group}"> + <input class="submitinput" type="submit" value="_{Save Changes}"> <input class="cancelinput" type="button" value="_{Cancel}"> </div> <div class="clearfix"></div> Added: app/views/groupapp/group/edit_members.tpl =================================================================== --- app/views/groupapp/group/edit_members.tpl (rev 0) +++ app/views/groupapp/group/edit_members.tpl 2008-04-14 16:59:39 UTC (rev 121) @@ -0,0 +1,50 @@ +<?= $controller->renderPartial("menu") ?> + +<div class="title_bar"> + <div class="head"> + <div class="name groupapp">_{Invite people to} {group_name?}</div> + </div> +</div> +<div class="clearfix"></div> + +<?= $controller->renderPartial("bar") ?> + +<div class="formwrapper"> +<form action="/groupapp/group/edit_members/{group.id?}" method="post"> + <div class="invite_column"> + <div class="header_text">_{Invite Friends on PROJECT_NAME}:</div> + <div class="friends_list"></div> + <div class="submit"> + <input class="submitinput" type="submit" value="_{Invite Friends}"> + </div> + </div> + + <div class="members"> + <div class="submenushort"> + <div class="menu_block selector"> + <label for="action_select">_{Show}: + <select onchange="doselect(this)" id="action_select" name="action_select"> + <option selected="selected" value="members">_{Members}</option> + <option value="not_replied">_{Not Yet Replied}</option> + <option value="blocked">_{Blocked}</option> + </select> + </label> + </div> + </div> + <div class="list_header"> + _{Members}: <? if (isset($members)) { echo count($members); } else { echo '0'; } ?> _{out of} <? if (isset($members)) { echo count($members); } else { echo '0'; } ?> + </div> + <div class="members_list"> + {?members}{loop members} + <div class="row"> + <div class="member_name"><a href="/profile/show/{member.id}">{member.user.name}</a></div> + <div class="action"><a href="#" onclick="return false;">_{remove}</a></div> + </div> + {end}{end} + </div> + </div> + + <div class="clearfix"></div> + +</form> +</div> Modified: app/views/groupapp/group/members.tpl =================================================================== --- app/views/groupapp/group/members.tpl 2008-04-13 13:26:14 UTC (rev 120) +++ app/views/groupapp/group/members.tpl 2008-04-14 16:59:39 UTC (rev 121) @@ -1,46 +0,0 @@ -<?= $controller->renderPartial("menu") ?> - -<div class="title_bar"> - <div class="head"> - <div class="name groupapp">_{Invite people to} {group_name?}</div> - </div> -</div> -<div class="clearfix"></div> - -<?= $controller->renderPartial("bar") ?> - -<div class="formwrapper"> -<form action="/groupapp/group/edit_members/{group_id?}" method="post"> - <div class="invite_column"> - <div class="header_text">_{Invite Friends on PROJECT_NAME}:</div> - <div class="friends_list"></div> - <div class="submit"> - <input class="submitinput" type="submit" value="_{Invite Friends}"> - </div> - </div> - - <div class="members"> - <div class="submenushort"> - <div class="menu_block selector"> - <label for="action_select">_{Show}: - <select onchange="doselect(this)" id="action_select" name="action_select"> - <option selected="selected" value="members">_{Members}</option> - <option value="not_replied">_{Not Yet Replied}</option> - <option value="blocked">_{Blocked}</option> - </select> - </label> - </div> - </div> - <div class="list_header"> - _{Members}: 0 _{out of} 0 - </div> - <div class="members_list"> - </div> - </div> - - - <div class="clearfix"></div> - -</form> -</div> - Modified: app/views/profile/show.tpl =================================================================== --- app/views/profile/show.tpl 2008-04-13 13:26:14 UTC (rev 120) +++ app/views/profile/show.tpl 2008-04-14 16:59:39 UTC (rev 121) @@ -1 +1 @@ -<?= $user->email ?> \ No newline at end of file +{user.email?} \ No newline at end of file Modified: public/stylesheets/Application.css =================================================================== --- public/stylesheets/Application.css 2008-04-13 13:26:14 UTC (rev 120) +++ public/stylesheets/Application.css 2008-04-14 16:59:39 UTC (rev 121) @@ -555,7 +555,7 @@ color: #000000; text-align: left; padding: 3px 0px 3px 0px; - width: 300px; + width: 400px; } .formrow .formcol { Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-04-13 13:26:14 UTC (rev 120) +++ public/stylesheets/groupapp/Group.css 2008-04-14 16:59:39 UTC (rev 121) @@ -175,4 +175,20 @@ .members .members_list { background: #ffffff; height: 240px; + overflow: auto; +} + +.members_list .row { + border-bottom: 1px solid #dddddd; + float: left; +} + +.members_list .row .member_name { + margin: 5px 0px 5px 15px; + float: left; +} + +.members_list .row .action { + float: right; + margin: 5px 12px 5px 0px; } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-05-01 11:51:46
|
Revision: 144 http://isocial.svn.sourceforge.net/isocial/?rev=144&view=rev Author: dim0s77 Date: 2008-05-01 04:51:50 -0700 (Thu, 01 May 2008) Log Message: ----------- Added groupapp discussion board basis. Localizate Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/installers/groupapp/group_installer.php app/locales/groupapp/group/ru.php app/views/groupapp/group/show_group.tpl public/stylesheets/Application.css public/stylesheets/groupapp/Group.css Added Paths: ----------- app/locales/groupapp/board/ app/locales/groupapp/board/en.php app/locales/groupapp/board/ru.php app/views/groupapp/board/ app/views/groupapp/board/_head.tpl app/views/groupapp/board/_menu.tpl app/views/groupapp/board/index.tpl app/views/groupapp/board/show_topic.tpl app/views/groupapp/board/start_topic.tpl public/stylesheets/groupapp/Board.css public/stylesheets/groupapp/Groupapp.css Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-05-01 10:41:47 UTC (rev 143) +++ app/controllers/groupapp/group_controller.php 2008-05-01 11:51:50 UTC (rev 144) @@ -2,7 +2,9 @@ class Groupapp_GroupController extends ApplicationController { - var $models = array('GroupappGroup', 'GroupappGroupType', 'GroupappMember', 'GroupappMemberRole'); + var $models = array('GroupappGroup', 'GroupappGroupType', + 'GroupappMember', 'GroupappMemberRole', + 'GroupappMessage'); function index () { $this->group_types = $this->GroupappGroupType->find('all', array('conditions' => array("parent_id = 0"))); @@ -153,6 +155,12 @@ function popular () { } + function show_board () { + } + + function show_topic () { + } + function help () { } Modified: app/installers/groupapp/group_installer.php =================================================================== --- app/installers/groupapp/group_installer.php 2008-05-01 10:41:47 UTC (rev 143) +++ app/installers/groupapp/group_installer.php 2008-05-01 11:51:50 UTC (rev 144) @@ -70,10 +70,27 @@ FOREIGN KEY (group_id) REFERENCES groupapp_groups(id), FOREIGN KEY (role_id) REFERENCES groupapp_member_roles(id) ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `groupapp_messages` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `group_id` int(11) NOT NULL DEFAULT '0', + `topic_id` int(11) NOT NULL DEFAULT '0', + `reply_message_id` int(11) NOT NULL DEFAULT '0', + `user_id` int(11) NOT NULL DEFAULT '0', + `subject` char(255) NOT NULL DEFAULT '', + `body` text NOT NULL DEFAULT '', + `created_at` datetime NOT NULL, + FOREIGN KEY (group_id) REFERENCES groupapp_groups(id), + INDEX group_idx (group_id), + INDEX topic_idx (topic_id) + ) ENGINE=InnoDB"); + } function down_1() { + $this->dropTable('groupapp_messages'); $this->dropTable('groupapp_members'); $this->dropTable('groupapp_member_roles'); $this->dropTable('groupapp_groups'); Added: app/locales/groupapp/board/en.php =================================================================== --- app/locales/groupapp/board/en.php (rev 0) +++ app/locales/groupapp/board/en.php 2008-05-01 11:51:50 UTC (rev 144) @@ -0,0 +1,7 @@ +<?php + +// File created on: 2008-03-20 10:58:51 + +$dictionary = array(); + +?> Added: app/locales/groupapp/board/ru.php =================================================================== --- app/locales/groupapp/board/ru.php (rev 0) +++ app/locales/groupapp/board/ru.php 2008-05-01 11:51:50 UTC (rev 144) @@ -0,0 +1,14 @@ +<?php + +// File created on: 2008-03-20 10:58:51 + +$dictionary = array(); +$dictionary['Discussions'] = 'Обсуждения'; +$dictionary['Back to'] = 'Обратно в'; +$dictionary['Discussion Board'] = 'Доска обсуждений'; +$dictionary['Topic View'] = 'Просмотр темы'; +$dictionary['Start New Topic'] = 'Начать новую тему'; + + + +?> Modified: app/locales/groupapp/group/ru.php =================================================================== --- app/locales/groupapp/group/ru.php 2008-05-01 10:41:47 UTC (rev 143) +++ app/locales/groupapp/group/ru.php 2008-05-01 11:51:50 UTC (rev 144) @@ -98,4 +98,28 @@ $dictionary['Changing the status of the member'] = 'Изменение статуса участника'; $dictionary['Change'] = 'Изменить'; +$dictionary['Group'] = 'Группа'; +$dictionary['Information'] = 'Информация'; +$dictionary['Group Info'] = 'Информация о группе'; +$dictionary['Photos'] = 'Фотографии'; +$dictionary['No one has uploaded any photos'] = 'Никто не загружал фото'; +$dictionary['Add Photos'] = 'Добавить фотографии'; +$dictionary['Videos'] = 'Видео'; +$dictionary['No one has uploaded any videos'] = 'Никто не загружал видео'; +$dictionary['Add Videos'] = 'Добавить видео'; +$dictionary['Discussion board'] = 'Доска обсуждений'; +$dictionary['There are no discussions'] = 'Обсуждения отсутствуют'; +$dictionary['Start the first topic'] = 'Начать первую тему'; +$dictionary['Members count'] = 'Количество участников'; +$dictionary['The Wall'] = 'Доска объявлений'; +$dictionary['See all'] = 'Смотреть все'; +$dictionary['No one has said anything...yet'] = 'Все пока молчат'; +$dictionary['Write something'] = 'Объявить что-нибудь'; + +$dictionary['Message All Members'] = 'Сообщение всем участникам'; +$dictionary['Edit Group'] = 'Редактировать параметры группы'; +$dictionary['Edit Members'] = 'Редактировать список пользователей'; +$dictionary['Invite People to Join'] = 'Пригласить людей присоединиться'; +$dictionary['Leave Group'] = 'Покинуть группу'; + ?> Added: app/views/groupapp/board/_head.tpl =================================================================== --- app/views/groupapp/board/_head.tpl (rev 0) +++ app/views/groupapp/board/_head.tpl 2008-05-01 11:51:50 UTC (rev 144) @@ -0,0 +1,17 @@ +<div class="title_bar"> + <div class="avatar"> + <a href="/profile/show/"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> + </div> + <div class="info"> + <div class="header"> + <div class="name groupapp">{group.name?} _{Discussions}</div> + </div> + <div class="clearfix"></div> + <div class="subheader"><a href="/groupapp/group/show_group/{group.id?}">_{Back to} {group.name?}</a></div> + </div> +</div> +<div class="clearfix"></div> + +<?= $controller->renderErrors() ?> + +<?= $controller->renderPartial("menu") ?> Added: app/views/groupapp/board/_menu.tpl =================================================================== --- app/views/groupapp/board/_menu.tpl (rev 0) +++ app/views/groupapp/board/_menu.tpl 2008-05-01 11:51:50 UTC (rev 144) @@ -0,0 +1,15 @@ +<div class="tabs"> + <div class="left"> + <ul class="toggle_tabs"> + <li class="first"><a href="/groupapp/board" class="<?= $controller->getActionName() == 'index' ? 'selected' : '' ?>">_{Discussion Board}</a></li><? + if ($controller->getActionName() == 'show_topic') { ?><li><a href="/groupapp/board/show_topic/{topic.id?}" class="last selected">_{Topic View}</a></li><? } ?> + </ul> + </div> + <div class="right"> + <ul class="toggle_tabs"> + <li class="first last"><a href="/groupapp/board/start_topic" class="<?= $controller->getActionName() == 'start_topic' ? 'selected' : '' ?>">_{Start New Topic}</a></li> + </ul> + </div> +</div> +<div class="clearfix"> </div> + Added: app/views/groupapp/board/index.tpl =================================================================== --- app/views/groupapp/board/index.tpl (rev 0) +++ app/views/groupapp/board/index.tpl 2008-05-01 11:51:50 UTC (rev 144) @@ -0,0 +1 @@ +<?= $controller->renderPartial("head") ?> Added: app/views/groupapp/board/show_topic.tpl =================================================================== --- app/views/groupapp/board/show_topic.tpl (rev 0) +++ app/views/groupapp/board/show_topic.tpl 2008-05-01 11:51:50 UTC (rev 144) @@ -0,0 +1 @@ +<?= $controller->renderPartial("head") ?> \ No newline at end of file Added: app/views/groupapp/board/start_topic.tpl =================================================================== --- app/views/groupapp/board/start_topic.tpl (rev 0) +++ app/views/groupapp/board/start_topic.tpl 2008-05-01 11:51:50 UTC (rev 144) @@ -0,0 +1 @@ +<?= $controller->renderPartial("head") ?> Modified: app/views/groupapp/group/show_group.tpl =================================================================== --- app/views/groupapp/group/show_group.tpl 2008-05-01 10:41:47 UTC (rev 143) +++ app/views/groupapp/group/show_group.tpl 2008-05-01 11:51:50 UTC (rev 144) @@ -1,6 +1,6 @@ <div class="title_bar"> <div class="head"> - <div class="name groupapp">{group.name?}</div> + <div class="name groupapp">_{Group} {group.name?}</div> </div> </div> <div class="clearfix"></div> @@ -11,9 +11,9 @@ <ul class="actions_list"> <li><a href="/groupapp/">_{Message All Members}</a></li> - <li><a href="/groupapp/group/edit_info/{group.id}">_{Edit Group}</a></li> - <li><a href="/groupapp/group/edit_members/{group.id}">_{Edit Members}</a></li> - <li><a href="/groupapp/group/edit_members/{group.id}">_{Invite People to Join}</a></li> + <li><a href="/groupapp/group/edit_info/{group.id?}">_{Edit Group}</a></li> + <li><a href="/groupapp/group/edit_members/{group.id?}">_{Edit Members}</a></li> + <li><a href="/groupapp/group/edit_members/{group.id?}">_{Invite People to Join}</a></li> <li><a href="#">_{Leave Group}</a></li> </ul> @@ -27,7 +27,7 @@ <div class="box"> <div class="header"> - <div class="box_title">_{Admins}</div> + <div class="box_title">_{Administrators}</div> </div> <div class="clearfix"></div> </div> @@ -83,9 +83,13 @@ <div class="edit"><a href="#">_{edit}</a></div> <div class="box_title">_{Members}</div> </div> + <div class="menu"> + <div class="action"><a href="#">_{See all}</a></div> + <div class="info">_{Members count}: 1</div> + </div> <div class="clearfix"></div> - <div class="emptyblock"> - _{No one has uploaded any videos}. <a href="#">_{Add Videos}</a>. + <div class="body"> + Members list </div> </div> Modified: public/stylesheets/Application.css =================================================================== --- public/stylesheets/Application.css 2008-05-01 10:41:47 UTC (rev 143) +++ public/stylesheets/Application.css 2008-05-01 11:51:50 UTC (rev 144) @@ -361,7 +361,6 @@ line-height: 14px; } - #content .title { font-weight: bold; font-size: 13px; @@ -573,6 +572,22 @@ margin-right: 10px; } +.box .menu { + background: #eeeeee; + border-top: 1px solid #aaaaaa; + color: #000000; + padding: 3px 0px 3px 0px; +} + +.box .menu .info { + margin-left: 10px; +} + +.box .menu .action { + float: right; + margin-right: 10px; +} + .box .body { padding: 10px; } Added: public/stylesheets/groupapp/Board.css =================================================================== --- public/stylesheets/groupapp/Board.css (rev 0) +++ public/stylesheets/groupapp/Board.css 2008-05-01 11:51:50 UTC (rev 144) @@ -0,0 +1 @@ + \ No newline at end of file Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-05-01 10:41:47 UTC (rev 143) +++ public/stylesheets/groupapp/Group.css 2008-05-01 11:51:50 UTC (rev 144) @@ -1,50 +1,3 @@ -.title_bar { - background-color: #ffffff; -} - -.title_bar .avatar { - margin: 10px 10px 0px 20px; - overflow: hidden; - height: 50px; - width: 50px; - z-index: 1; - position: relative; -} - -.title_bar .avatar img{ - display: block; -} - -.title_bar .info { - position: relative; - top: -50px; - left: 0px; - margin: 0px 0px -50px 0px; - padding: 0px 0px 0px 80px; -} - -.title_bar .info .header { - background: #f7f7f7; - z-index: 0; - border-bottom: solid 1px #cccccc; - margin: -10px 0px 7px -80px; - padding: 10px 0px 0px 80px; -} - -.name { - font-weight: bold; - font-size: 14px; - padding: 7px 0px 7px 22px; -} - -.title_bar .info .subheader { -} - -.title_bar .head { - padding: 10px 0px 10px 30px; - border-bottom: solid 1px #cccccc; -} - .nogroups { font-size: 12px; text-align: center; Added: public/stylesheets/groupapp/Groupapp.css =================================================================== --- public/stylesheets/groupapp/Groupapp.css (rev 0) +++ public/stylesheets/groupapp/Groupapp.css 2008-05-01 11:51:50 UTC (rev 144) @@ -0,0 +1,47 @@ +.title_bar { + background-color: #ffffff; +} + +.title_bar .avatar { + margin: 10px 10px 0px 20px; + overflow: hidden; + height: 50px; + width: 50px; + z-index: 1; + position: relative; +} + +.title_bar .avatar img{ + display: block; +} + +.title_bar .info { + position: relative; + top: -50px; + left: 0px; + margin: 0px 0px -50px 0px; + padding: 0px 0px 0px 80px; +} + +.title_bar .info .header { + background: #f7f7f7; + z-index: 0; + border-bottom: solid 1px #cccccc; + margin: -10px 0px 7px -80px; + padding: 10px 0px 0px 80px; +} + +.name { + font-weight: bold; + font-size: 14px; + padding: 7px 0px 7px 22px; +} + +.title_bar .info .subheader { +} + +.title_bar .head { + padding: 10px 0px 10px 30px; + border-bottom: solid 1px #cccccc; +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-05-25 13:33:14
|
Revision: 224 http://isocial.svn.sourceforge.net/isocial/?rev=224&view=rev Author: dim0s77 Date: 2008-05-25 06:33:19 -0700 (Sun, 25 May 2008) Log Message: ----------- show user groups on home groupapp page Modified Paths: -------------- app/controllers/groupapp/board_controller.php app/controllers/groupapp/group_controller.php app/controllers/user_controller.php app/installers/groupapp/group_installer.php app/models/groupapp_group.php app/models/groupapp_member.php app/models/groupapp_message.php app/models/user.php app/views/groupapp/board/_menu.tpl app/views/groupapp/board/reply_to_post.tpl app/views/groupapp/board/reply_to_topic.tpl app/views/groupapp/board/start_topic.tpl app/views/groupapp/group/_members_list.tpl app/views/groupapp/group/edit_members.tpl app/views/groupapp/group/index.tpl public/stylesheets/common/Submenu.css public/stylesheets/groupapp/Board.css public/stylesheets/groupapp/Group.css Modified: app/controllers/groupapp/board_controller.php =================================================================== --- app/controllers/groupapp/board_controller.php 2008-05-25 13:15:10 UTC (rev 223) +++ app/controllers/groupapp/board_controller.php 2008-05-25 13:33:19 UTC (rev 224) @@ -8,7 +8,7 @@ if (!empty($this->params['id'])) { $messages = $this->GroupappMessage->find('all', array( - 'conditions' => array("group_id = ?", $this->params['id']), + 'conditions' => array("groupapp_group_id = ?", $this->params['id']), 'include' => 'user' ) ); @@ -33,7 +33,7 @@ $topics[$message->topic_id]['last'] = $message; } } - $this->group_id = $group->getId(); + $this->groupapp_group_id = $group->getId(); $this->group_name = $group->name; $this->topics = $topics; } @@ -48,13 +48,13 @@ ) ); if ($messages) { - $member = $this->GroupappMember->findFirst(array( 'group_id' => $messages[0]->group_id, + $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $messages[0]->groupapp_group_id, 'user_id' => $this->current_user->getId() )); - $group = $this->GroupappGroup->find( $messages[0]->group_id ); + $group = $this->GroupappGroup->find( $messages[0]->groupapp_group_id ); if (($group && $group->access == 1) || $member) { $this->messages = $messages; - $this->group_id = $group->getId(); + $this->groupapp_group_id = $group->getId(); $this->group_name = $group->name; $this->topic_id = $messages[0]->topic_id; } else { @@ -68,10 +68,10 @@ function start_topic () { if (!empty($this->params['topic']) && - !empty($this->params['topic']['group_id']) && + !empty($this->params['topic']['groupapp_group_id']) && !empty($this->params['topic']['body'])) { - if ( $this->group = $this->GroupappGroup->find( $this->params['topic']['group_id'] ) ) { - $member = $this->GroupappMember->findFirst(array( 'group_id' => $this->group->getId(), + if ( $this->group = $this->GroupappGroup->find( $this->params['topic']['groupapp_group_id'] ) ) { + $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $this->group->getId(), 'user_id' => $this->current_user->getId() )); if ($member) { @@ -95,7 +95,7 @@ } else if (!empty($this->params['id'])) { if ( $group = $this->GroupappGroup->find( $this->params['id'] ) ) { $this->topic = $group->message->build(); - $this->group_id = $group->getId(); + $this->groupapp_group_id = $group->getId(); $this->group_name = $group->name; $this->topic_id = $this->topic->getId(); } @@ -107,11 +107,11 @@ function reply_to_topic () { if (!empty($this->params['topic']) && - !empty($this->params['topic']['group_id']) && + !empty($this->params['topic']['groupapp_group_id']) && !empty($this->params['topic']['topic_id']) && !empty($this->params['topic']['body'])) { - if ( $this->group = $this->GroupappGroup->find( $this->params['topic']['group_id'] ) ) { - $member = $this->GroupappMember->findFirst(array( 'group_id' => $this->group->getId(), + if ( $this->group = $this->GroupappGroup->find( $this->params['topic']['groupapp_group_id'] ) ) { + $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $this->group->getId(), 'user_id' => $this->current_user->getId() )); if ($member) { @@ -130,13 +130,13 @@ ) ); if ($messages) { - $member = $this->GroupappMember->findFirst(array( 'group_id' => $messages[0]->group_id, + $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $messages[0]->groupapp_group_id, 'user_id' => $this->current_user->getId() )); - $group = $this->GroupappGroup->find( $messages[0]->group_id ); + $group = $this->GroupappGroup->find( $messages[0]->groupapp_group_id ); if (($group && $group->access == 1) || $member) { $this->messages = $messages; - $this->group_id = $group->getId(); + $this->groupapp_group_id = $group->getId(); $this->group_name = $group->name; $this->topic_id = $messages[0]->topic_id; } else { @@ -150,8 +150,8 @@ function reply_to_post () { if (!empty($this->params['topic'])) { - if ( $this->group = $this->GroupappGroup->find( $this->params['topic']['group_id'] ) ) { - $member = $this->GroupappMember->findFirst(array( 'group_id' => $this->group->getId(), + if ( $this->group = $this->GroupappGroup->find( $this->params['topic']['groupapp_group_id'] ) ) { + $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $this->group->getId(), 'user_id' => $this->current_user->getId() )); if ($member) { @@ -172,13 +172,13 @@ ) ); if ($message) { - $member = $this->GroupappMember->findFirst(array( 'group_id' => $message->group_id, + $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $message->groupapp_group_id, 'user_id' => $this->current_user->getId() )); - $group = $this->GroupappGroup->find( $message->group_id ); + $group = $this->GroupappGroup->find( $message->groupapp_group_id ); if (($group && $group->access == 1) || $member) { $this->message_to_reply = $message; - $this->group_id = $group->getId(); + $this->groupapp_group_id = $group->getId(); $this->group_name = $group->name; $this->topic_id = $message->topic_id; } else { Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-05-25 13:15:10 UTC (rev 223) +++ app/controllers/groupapp/group_controller.php 2008-05-25 13:33:19 UTC (rev 224) @@ -4,10 +4,18 @@ { var $models = array('GroupappGroup', 'GroupappGroupType', 'GroupappMember', 'GroupappMemberRole', - 'GroupappMessage'); + 'GroupappMessage', 'User'); function index () { $this->group_types = $this->GroupappGroupType->find('all', array('conditions' => array("parent_id = 0"))); + $this->user_groups = $this->current_user->groupapp_group->load(); + $gt = array(); + for ($i = 0; $i < count($this->group_types); $i++) { + $id = $this->group_types[$i]->id; + $name = $this->group_types[$i]->get('name'); + $gt[$id] = $name; + } + $this->gt = $gt; } function create () { @@ -84,25 +92,25 @@ $this->moderators_count = 0; $this->members_count = 0; foreach ($this->members as $member) { - if ($member->role_id == 1) $this->owners_count++; - elseif ($member->role_id == 2) $this->admins_count++; - elseif ($member->role_id == 3) $this->moderators_count++; - elseif ($member->role_id == 4) $this->members_count++; + if ($member->groupapp_member_role_id == 1) $this->owners_count++; + elseif ($member->groupapp_member_role_id == 2) $this->admins_count++; + elseif ($member->groupapp_member_role_id == 3) $this->moderators_count++; + elseif ($member->groupapp_member_role_id == 4) $this->members_count++; } } $this->importErrors( $this->GroupappGroup->getErrors() ); } function remove_member () { - if (!empty($this->params['group_id']) && !empty($this->params['member_id']) && - !empty($this->params['role_id']) && !empty($this->params['list_id'])) + if (!empty($this->params['groupapp_group_id']) && !empty($this->params['member_id']) && + !empty($this->params['groupapp_member_role_id']) && !empty($this->params['list_id'])) { - $this->group = $this->GroupappGroup->find($this->params['group_id']); + $this->group = $this->GroupappGroup->find($this->params['groupapp_group_id']); $this->GroupappMember->destroyAll("id = " . $this->params['member_id']); $members = $this->_getGroupMembers(); $members_count = 0; foreach ($members as $member) { - if ($member->role_id == $this->params['role_id']) { $members_count++; } + if ($member->groupapp_member_role_id == $this->params['groupapp_member_role_id']) { $members_count++; } } $members_group_name = ''; $empty_message = ''; @@ -117,22 +125,22 @@ 'members_count' => $members_count, 'members_group_name' => $members_group_name, 'empty_message' => $empty_message, - 'role' => $this->params['role_id'], + 'role' => $this->params['groupapp_member_role_id'], 'list_id' => $this->params['list_id'] ))); } } function change_member_status () { - if (!empty($this->params['group_id']) && !empty($this->params['member_id']) && - !empty($this->params['role_id']) && !empty($this->params['list_id'])) + if (!empty($this->params['groupapp_group_id']) && !empty($this->params['member_id']) && + !empty($this->params['groupapp_member_role_id']) && !empty($this->params['list_id'])) { - $this->group = $this->GroupappGroup->find($this->params['group_id']); + $this->group = $this->GroupappGroup->find($this->params['groupapp_group_id']); } } function _getGroupMembers () { - return $this->GroupappMember->find('all', array('conditions' => array("group_id = ?", + return $this->GroupappMember->find('all', array('conditions' => array("groupapp_group_id = ?", $this->group->getId()), 'include' => 'user')); } Modified: app/controllers/user_controller.php =================================================================== --- app/controllers/user_controller.php 2008-05-25 13:15:10 UTC (rev 223) +++ app/controllers/user_controller.php 2008-05-25 13:33:19 UTC (rev 224) @@ -2,9 +2,8 @@ class UserController extends ApplicationController { + var $models = array('User', 'Confirmation', 'GroupappGroup'); - var $models = array('User', 'Confirmation'); - function beforeAction ( $method = '' ) { $user = $this->_getUserFromSession(); Modified: app/installers/groupapp/group_installer.php =================================================================== --- app/installers/groupapp/group_installer.php 2008-05-25 13:15:10 UTC (rev 223) +++ app/installers/groupapp/group_installer.php 2008-05-25 13:33:19 UTC (rev 224) @@ -30,6 +30,7 @@ `type_id` int(11) NOT NULL DEFAULT '0', `name` char(100) NOT NULL DEFAULT '', `description` char(255) NOT NULL DEFAULT '', + `members_count` int(11) NOT NULL DEFAULT 0, `recent_news` char(255) NOT NULL DEFAULT '', `office` char(100) NOT NULL DEFAULT '', `email` char(100) NOT NULL DEFAULT '', @@ -63,26 +64,40 @@ $this->execute( "CREATE TABLE `groupapp_members` ( - `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `group_id` int(11) NOT NULL DEFAULT '0', - `user_id` int(11) NOT NULL DEFAULT '0', - `role_id` int(1) UNSIGNED NOT NULL DEFAULT '4', - FOREIGN KEY (group_id) REFERENCES groupapp_groups(id), - FOREIGN KEY (role_id) REFERENCES groupapp_member_roles(id) + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `groupapp_group_id` int(11) NOT NULL DEFAULT '0', + `user_id` int(11) NOT NULL DEFAULT '0', + `groupapp_member_role_id` int(1) UNSIGNED NOT NULL DEFAULT '4', + FOREIGN KEY (groupapp_group_id) REFERENCES groupapp_groups(id), + FOREIGN KEY (groupapp_member_role_id) REFERENCES groupapp_member_roles(id) ) ENGINE=InnoDB"); $this->execute( + "CREATE TRIGGER gapp_group_insert AFTER INSERT ON groupapp_members + FOR EACH ROW BEGIN + UPDATE `groupapp_groups` SET members_count = members_count + 1 WHERE id = NEW.groupapp_group_id; + END; + "); + + $this->execute( + "CREATE TRIGGER gapp_group_delete AFTER DELETE ON groupapp_members + FOR EACH ROW BEGIN + UPDATE `groupapp_groups` SET members_count = members_count - 1 WHERE id = OLD.groupapp_group_id; + END; + "); + + $this->execute( "CREATE TABLE `groupapp_messages` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `group_id` int(11) NOT NULL DEFAULT '0', + `groupapp_group_id` int(11) NOT NULL DEFAULT '0', `topic_id` int(11) NOT NULL DEFAULT '0', `reply_message_id` int(11) NOT NULL DEFAULT '0', `user_id` int(11) NOT NULL DEFAULT '0', `subject` char(255) NOT NULL DEFAULT '', `body` text NOT NULL DEFAULT '', `created_at` datetime NOT NULL, - FOREIGN KEY (group_id) REFERENCES groupapp_groups(id), - INDEX group_idx (group_id), + FOREIGN KEY (groupapp_group_id) REFERENCES groupapp_groups(id), + INDEX groupapp_group_idx (groupapp_group_id), INDEX topic_idx (topic_id) ) ENGINE=InnoDB"); @@ -90,12 +105,26 @@ function down_1() { + $this->transactionComplete(); $this->dropTable('groupapp_messages'); $this->dropTable('groupapp_members'); $this->dropTable('groupapp_member_roles'); $this->dropTable('groupapp_groups'); $this->dropTable('groupapp_group_types'); } + + function dropTable($table_name, $options = array()) + { + if($this->tableExists($table_name)){ + $result = $this->db->execute('DROP TABLE '.$table_name); + if ($result) { + unset($this->available_tables[array_search($table_name, $this->available_tables)]); + if(!empty($options['sequence'])){ + $this->dropSequence($table_name); + } + } + } + } } ?> Modified: app/models/groupapp_group.php =================================================================== --- app/models/groupapp_group.php 2008-05-25 13:15:10 UTC (rev 223) +++ app/models/groupapp_group.php 2008-05-25 13:33:19 UTC (rev 224) @@ -3,11 +3,18 @@ class GroupappGroup extends ActiveRecord { var $has_one = array('group_member' => array('class_name' => 'GroupappMember', - 'foreign_key' => 'group_id'), + 'foreign_key' => 'groupapp_group_id') ); var $has_many = array( 'messages' => array('class_name' => 'GroupappMessage', - 'foreign_key' => 'group_id') ); + 'foreign_key' => 'groupapp_group_id') ); + var $belongs_to = array('group_type' => array('class_name' => 'GroupappGroupType', + 'primary_key_name' => 'type_id') + ); + + +# var $has_and_belongs_to_many = array('users' => array('join_table' => 'groupapp_members')); + function validateOnCreate () { $this->validatesPresenceOf('name', 'Name is missing|please enter the name'); Modified: app/models/groupapp_member.php =================================================================== --- app/models/groupapp_member.php 2008-05-25 13:15:10 UTC (rev 223) +++ app/models/groupapp_member.php 2008-05-25 13:33:19 UTC (rev 224) @@ -5,11 +5,13 @@ var $belongs_to = array('user' => array('class_name' => 'User', 'primary_key_name' => 'user_id'), 'role' => array('class_name' => 'GroupMemberRole', - 'primary_key_name' => 'role_id') + 'primary_key_name' => 'groupapp_member_role_id'), + 'group' => array('class_name' => 'GroupappGroup', + 'primary_key_name' => 'groupapp_group_id') ); var $has_many = array( 'messages' => array('class_name' => 'GroupappMessage', - 'foreign_key' => 'user_id') ); - + 'foreign_key' => 'user_id') + ); } ?> Modified: app/models/groupapp_message.php =================================================================== --- app/models/groupapp_message.php 2008-05-25 13:15:10 UTC (rev 223) +++ app/models/groupapp_message.php 2008-05-25 13:33:19 UTC (rev 224) @@ -5,7 +5,7 @@ var $belongs_to = array('user' => array('class_name' => 'User', 'foreign_key' => 'user_id'), 'group' => array('class_name' => 'GroupappGroup', - 'foreign_key' => 'group_id') + 'foreign_key' => 'groupapp_group_id') ); /* function validateOnCreate () */ Modified: app/models/user.php =================================================================== --- app/models/user.php 2008-05-25 13:15:10 UTC (rev 223) +++ app/models/user.php 2008-05-25 13:33:19 UTC (rev 224) @@ -12,7 +12,11 @@ 'conditions' => 'is_recipient_del = 0'), 'im_profiles' => array('class_name' => 'ImProfile', 'foreign_key' => 'user_id'), + /* 'groupapp_groups' => array('class_name' => 'GroupappMember', */ + /* 'foreign_key' => 'user_id'), */ ); + + var $has_and_belongs_to_many = array('groupapp_groups' => array('join_table' => 'groupapp_members')); var $has_one = array('BasicProfile', 'ContactProfile', 'RelationshipProfile', 'PersonalProfile'); Modified: app/views/groupapp/board/_menu.tpl =================================================================== --- app/views/groupapp/board/_menu.tpl 2008-05-25 13:15:10 UTC (rev 223) +++ app/views/groupapp/board/_menu.tpl 2008-05-25 13:33:19 UTC (rev 224) @@ -1,7 +1,7 @@ <div class="tabs"> <div class="left"> <ul class="toggle_tabs"> - <li class="first"><a href="/groupapp/board/{group_id?}" class="<?= $controller->getActionName() == 'index' ? 'selected' : '' ?>">_{Discussion Board}</a></li><? + <li class="first"><a href="/groupapp/board/{groupapp_group_id?}" class="<?= $controller->getActionName() == 'index' ? 'selected' : '' ?>">_{Discussion Board}</a></li><? if ($controller->getActionName() == 'show_topic' || $controller->getActionName() == 'reply_to_topic' || $controller->getActionName() == 'reply_to_post' @@ -16,7 +16,7 @@ <div class="right"> <ul class="toggle_tabs"> <? if ($controller->getActionName() != 'reply_to_topic' && $controller->getActionName() != 'reply_to_post') { ?> - <li class="first last"><a href="/groupapp/board/start_topic/{group_id?}" class="<?= $controller->getActionName() == 'start_topic' ? 'selected' : '' ?>">_{Start New Topic}</a></li> + <li class="first last"><a href="/groupapp/board/start_topic/{groupapp_group_id?}" class="<?= $controller->getActionName() == 'start_topic' ? 'selected' : '' ?>">_{Start New Topic}</a></li> <? } ?> </ul> </div> Modified: app/views/groupapp/board/reply_to_post.tpl =================================================================== --- app/views/groupapp/board/reply_to_post.tpl 2008-05-25 13:15:10 UTC (rev 223) +++ app/views/groupapp/board/reply_to_post.tpl 2008-05-25 13:33:19 UTC (rev 224) @@ -46,7 +46,7 @@ </div> <div class="formrow"> <label> - <?= $form_helper->hidden_field('topic', 'group_id', array('value' => $message_to_reply->group_id))?> + <?= $form_helper->hidden_field('topic', 'groupapp_group_id', array('value' => $message_to_reply->groupapp_group_id))?> <?= $form_helper->hidden_field('topic', 'topic_id', array('value' => $message_to_reply->topic_id))?> <?= $form_helper->hidden_field('topic', 'subject', array('value' => $message_to_reply->subject))?> <?= $form_helper->hidden_field('topic', 'reply_message_id', array('value' => $message_to_reply->getId()))?> Modified: app/views/groupapp/board/reply_to_topic.tpl =================================================================== --- app/views/groupapp/board/reply_to_topic.tpl 2008-05-25 13:15:10 UTC (rev 223) +++ app/views/groupapp/board/reply_to_topic.tpl 2008-05-25 13:33:19 UTC (rev 224) @@ -20,7 +20,7 @@ </div> <div class="formrow"> <label> - <?= $form_helper->hidden_field('topic', 'group_id', array('value' => $messages[0]->group_id))?> + <?= $form_helper->hidden_field('topic', 'groupapp_group_id', array('value' => $messages[0]->groupapp_group_id))?> <?= $form_helper->hidden_field('topic', 'topic_id', array('value' => $messages[0]->topic_id))?> <?= $form_helper->hidden_field('topic', 'subject', array('value' => $messages[0]->subject))?> </label> Modified: app/views/groupapp/board/start_topic.tpl =================================================================== --- app/views/groupapp/board/start_topic.tpl 2008-05-25 13:15:10 UTC (rev 223) +++ app/views/groupapp/board/start_topic.tpl 2008-05-25 13:33:19 UTC (rev 224) @@ -3,7 +3,7 @@ <?= $controller->renderErrors() ?> <div class="board_from_background"> -<form action="/groupapp/board/start_topic/{group_id?}" method="post"> +<form action="/groupapp/board/start_topic/{groupapp_group_id?}" method="post"> <div class="editform"> <div class="formrow"> <label>_{Topic}:</label> @@ -15,7 +15,7 @@ </div> <div class="formrow"> <label> - <?= $form_helper->hidden_field('topic', 'group_id', array('value' => $group_id))?> + <?= $form_helper->hidden_field('topic', 'groupapp_group_id', array('value' => $groupapp_group_id))?> </label> <input class="submitinput" type="submit" value="_{Create new Topic}"> <input class="cancelinput" type="button" value="_{Cancel}"> Modified: app/views/groupapp/group/_members_list.tpl =================================================================== --- app/views/groupapp/group/_members_list.tpl 2008-05-25 13:15:10 UTC (rev 223) +++ app/views/groupapp/group/_members_list.tpl 2008-05-25 13:33:19 UTC (rev 224) @@ -6,7 +6,7 @@ <div class="members_list"> <ul> {?members}{loop members} - <? if ($member->role_id == $role) { ?> + <? if ($member->groupapp_member_role_id == $role) { ?> <li> <span class="member_name"><a href="/profile/show/{member.id}">{member.user.name}</a></span> <span class="change_status"><a href="#" onclick="change_member_status(this); return false;" name="{member.id}">_{change status}</a></span> Modified: app/views/groupapp/group/edit_members.tpl =================================================================== --- app/views/groupapp/group/edit_members.tpl 2008-05-25 13:15:10 UTC (rev 223) +++ app/views/groupapp/group/edit_members.tpl 2008-05-25 13:33:19 UTC (rev 224) @@ -36,7 +36,7 @@ <div class="members_list"> <ul> {?members}{loop members} - <? if ($member->role_id == 1) { ?> + <? if ($member->groupapp_member_role_id == 1) { ?> <li> <span class="member_name"><a href="/profile/show/{member.id}">{member.user.name}</a></span> <span class="change_status"> @@ -59,7 +59,7 @@ <div class="members_list"> <ul> {?members}{loop members} - <? if ($member->role_id == 2) { ?> + <? if ($member->groupapp_member_role_id == 2) { ?> <li> <span class="member_name"><a href="/profile/show/{member.id}">{member.user.name}</a></span> <span class="change_status"> @@ -82,7 +82,7 @@ <div class="members_list"> <ul> {?members}{loop members} - <? if ($member->role_id == 3) { ?> + <? if ($member->groupapp_member_role_id == 3) { ?> <li> <span class="member_name"><a href="/profile/show/{member.id}">{member.user.name}</a></span> <span class="change_status"> @@ -106,7 +106,7 @@ <div class="members_list"> <ul> {?members}{loop members} - <? if ($member->role_id == 4) { ?> + <? if ($member->groupapp_member_role_id == 4) { ?> <li> <span class="member_name"><a href="/profile/show/{member.id}">{member.user.name}</a></span> <span class="change_status"> @@ -130,7 +130,7 @@ </div> <script> -function remove_member (element, group_id, list_id, role) { +function remove_member (element, groupapp_group_id, list_id, role) { new Dialog.Box('dlg', { reference: element, title: '_{Remove member}?', @@ -143,10 +143,10 @@ { method:'post', asynchronous:true, parameters: - 'group_id=' + group_id + + 'groupapp_group_id=' + groupapp_group_id + '&list_id=' + list_id + '&member_id=' + element.name + - '&role_id=' + role + '&groupapp_member_role_id=' + role }); } }); @@ -154,7 +154,7 @@ return false; } -function change_member_status (element, group_id, list_id, role) { +function change_member_status (element, groupapp_group_id, list_id, role) { var body_content = '<?= $form_helper->radio_button('member', 'status', '1', array('checked' => 'checked')) ?>_{Owner}' + '<?= $form_helper->radio_button('member', 'status', '2') ?>_{Administrator}' + '<?= $form_helper->radio_button('member', 'status', '3') ?>_{Moderator}' + @@ -171,10 +171,10 @@ { method:'post', asynchronous:true, parameters: - 'group_id=' + group_id + + 'groupapp_group_id=' + groupapp_group_id + '&list_id=' + list_id + '&member_id=' + element.name + - '&role_id=' + role + '&groupapp_member_role_id=' + role }); } }); Modified: app/views/groupapp/group/index.tpl =================================================================== --- app/views/groupapp/group/index.tpl 2008-05-25 13:15:10 UTC (rev 223) +++ app/views/groupapp/group/index.tpl 2008-05-25 13:33:19 UTC (rev 224) @@ -13,12 +13,64 @@ <div class="clearfix"></div> <div class="subheader"><a href="/groupapp/group/create">_{Create a New Group}</a></div> </div> +<div class="clearfix"></div> </div> + +{?user_groups} +<div class="submenu_separator"> </div> +<div class="submenu"> + <div class="menu_block selector"> + <label for="action_select">_{Show}: + <select onchange="doselect(this)" id="action_select" name="action_select"> + <option selected="selected" value="none">_{All groups}</option> + <option value="read">_{Recently Updated}</option> + <option value="unread">_{By Group Member Size}</option> + <option value="all">_{Groups You Admin}</option> + </select> + </label> + </div> +</div> <div class="clearfix"></div> +<div class="groups_list"> + <div class="info">_{You are in groups}: <?= count($user_groups); ?></div> + + <div class="container"> + {loop user_groups} + <div class="row"> + + <div class="actions"> + <ul class="actions_list"> + <li><a href="/groupapp/group/edit_info/{user_group.id?}">_{Edit Group}</a></li> + <li><a href="#">_{Leave Group}</a></li> + </ul> + </div> + + <div class="avatar"> + <a href="/groupapp/group/show_group/{user_group.id?}"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> + </div> + + <div class="info"> + <div class="name"><a href="/groupapp/group/show_group/{user_group.id?}">{user_group.name}</a></div> + <div class="other param">_{Members count}:</div> + <div class="other value">{user_group.members_count}</div> + <div class="clearfix"></div> + <div class="other param">_{Type}:</div> + <div class="other value"><? $id = $user_group->type_id; echo $gt[$id]; ?></div> + <div class="clearfix"></div> + </div> + + <div class="clearfix"></div> + </div> + {end} + </div> + +</div> +{else} <div class="nogroups"> _{You have not joined any groups}. </div> +{end} <div class="clearfix"></div> <div class="actions"> Modified: public/stylesheets/common/Submenu.css =================================================================== --- public/stylesheets/common/Submenu.css 2008-05-25 13:15:10 UTC (rev 223) +++ public/stylesheets/common/Submenu.css 2008-05-25 13:33:19 UTC (rev 224) @@ -55,3 +55,9 @@ cursor: default; text-decoration: none; } + +.submenu_separator { + display: block; + margin-top: 5px; + border-bottom: 1px solid #cccccc; +} \ No newline at end of file Modified: public/stylesheets/groupapp/Board.css =================================================================== --- public/stylesheets/groupapp/Board.css 2008-05-25 13:15:10 UTC (rev 223) +++ public/stylesheets/groupapp/Board.css 2008-05-25 13:33:19 UTC (rev 224) @@ -109,3 +109,10 @@ .message .head .sender .other_user { font-weight: bold; } + +.group_list { + float: left; + background: #ffffff; + width: 100%; + margin: 10px; +} Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-05-25 13:15:10 UTC (rev 223) +++ public/stylesheets/groupapp/Group.css 2008-05-25 13:33:19 UTC (rev 224) @@ -136,3 +136,59 @@ text-align: center; padding: 20px 0px 20px 0px; } + +.groups_list { + float: left; + background: #ffffff; + width: 100%; +} + +.groups_list .info { + padding: 10px 10px 5px 20px; +} + +.groups_list .container { + background: #f7f7f7; + padding: 5px; + border-top: solid 1px #dddddd; + border-bottom: solid 1px #dddddd; +} + +.groups_list .container .row { + background: #ffffff; + border: 1px solid #cccccc; + display: block; + margin: 3px; + padding: 10px 20px 10px 20px; +} + +.groups_list .container .row .avatar { + float: left; + width: 100px; +} + +.groups_list .container .row .info { + float: left; + width: 300px; + padding: 0px 5px 0px 5px; +} + +.groups_list .container .row .info .name { + padding: 0px; + margin-bottom: 10px; +} + +.groups_list .container .row .info .other { + float: left; + margin-bottom: 3px; +} + +.groups_list .container .row .info .other.param { + color: #999999; + margin-right: 5px; +} + +.groups_list .container .row .actions { + float: right; + width: 125px; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-06-24 14:27:12
|
Revision: 245 http://isocial.svn.sourceforge.net/isocial/?rev=245&view=rev Author: dim0s77 Date: 2008-06-24 07:27:06 -0700 (Tue, 24 Jun 2008) Log Message: ----------- cosmetic changes. fixed minor bugZ Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/locales/groupapp/board/ru.php app/locales/groupapp/group/ru.php app/views/groupapp/board/_head.tpl app/views/groupapp/board/index.tpl app/views/groupapp/group/_editbar.tpl app/views/groupapp/group/edit_members.tpl app/views/groupapp/group/index.tpl app/views/groupapp/group/show_group.tpl public/stylesheets/common/Application.css public/stylesheets/groupapp/Board.css Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-06-20 15:13:32 UTC (rev 244) +++ app/controllers/groupapp/group_controller.php 2008-06-24 14:27:06 UTC (rev 245) @@ -14,18 +14,18 @@ $this->is_guest = true; if (!empty($this->params['id']) && $this->GroupappGroup->find($this->params['id'])) { - $this->group = $this->GroupappGroup->findFirst(array( 'id = ?' => $this->params['id'] )); - // $this->group = $this->GroupappGroup->find($this->params['id']); - $members = $this->_getGroupMembers($this->group); - $current_user_id = $this->current_user->getId(); - foreach ($members as $member) { - if ($member->groupapp_member_role_id < 3 && $current_user_id == $member->getId()) { - $this->is_admin = true; + if ($this->group = $this->GroupappGroup->findFirst(array( 'id = ?' => $this->params['id'] ))) { + $members = $this->_getGroupMembers($this->group); + $current_user_id = $this->current_user->getId(); + foreach ($members as $member) { + if ($member->groupapp_member_role_id < 3 && $current_user_id == $member->getId()) { + $this->is_admin = true; + } + if ($current_user_id == $member->getId()) { + $this->is_member = true; + $this->is_guest = false; + } } - if ($current_user_id == $member->getId()) { - $this->is_member = true; - $this->is_guest = false; - } } } } @@ -62,26 +62,34 @@ } function customize () { - $this->step = 'group_customize'; - if (!empty($this->params['group']) && $this->group){ - $this->group->setAttributes($this->params['group']); - if ($this->Request->isPost() && $this->group->save()) { - $this->step = 'group_members'; - $this->redirectTo(array('action' => 'edit_members', 'id' => $this->group->getId())); - return; + if (isset($this->group)) { + $this->step = 'group_customize'; + if (!empty($this->params['group'])){ + $this->group->setAttributes($this->params['group']); + if ($this->Request->isPost() && $this->group->save()) { + $this->step = 'group_members'; + $this->redirectTo(array('action' => 'edit_members', 'id' => $this->group->getId())); + return; + } } + $this->importErrors( $this->GroupappGroup->getErrors() ); + } else { + $this->redirectTo(array('action' => 'index')); } - $this->importErrors( $this->GroupappGroup->getErrors() ); } function edit_group () { - if (!empty($this->params['group']) && $this->group){ - $this->group->setAttributes($this->params['group']); - if ($this->Request->isPost() && $this->group->save()) { - return; + if (isset($this->group)) { + if (!empty($this->params['group'])){ + $this->group->setAttributes($this->params['group']); + if ($this->Request->isPost() && $this->group->save()) { + return; + } } + $this->importErrors( $this->GroupappGroup->getErrors() ); + } else { + $this->redirectTo(array('action' => 'index')); } - $this->importErrors( $this->GroupappGroup->getErrors() ); } function edit_info () { @@ -162,7 +170,7 @@ } function show_group () { - if ($this->group) { + if (isset($this->group)) { $this->members = $this->_getGroupMembers($this->group); $this->members_count = count($this->members); $this->admins = array(); @@ -196,12 +204,12 @@ if (!isset($topics[$message->topic_id])) { $topics[$message->topic_id]['first'] = $message; } - isset($topics[$message->topic_id]['posts']) ? + isset($topics[$message->topic_id]['posts']) ? $topics[$message->topic_id]['posts']++ : $topics[$message->topic_id]['posts'] = 1; if (!isset($persons[$message->topic_id][$message->user_id])) { $persons[$message->topic_id][$message->user_id] = 1; - isset($topics[$message->topic_id]['persons']) ? + isset($topics[$message->topic_id]['persons']) ? $topics[$message->topic_id]['persons']++ : $topics[$message->topic_id]['persons'] = 1; } @@ -211,6 +219,8 @@ } $this->topics = $topics; $this->topics_count = count($this->topics); + } else { + $this->redirectTo(array('action' => 'index')); } } Modified: app/locales/groupapp/board/ru.php =================================================================== --- app/locales/groupapp/board/ru.php 2008-06-20 15:13:32 UTC (rev 244) +++ app/locales/groupapp/board/ru.php 2008-06-24 14:27:06 UTC (rev 245) @@ -3,6 +3,7 @@ // File created on: 2008-03-20 10:58:51 $dictionary = array(); +$dictionary['Group'] = 'Группа'; $dictionary['Discussions'] = 'Обсуждения'; $dictionary['Back to group'] = 'Обратно в группу'; $dictionary['Discussion Board'] = 'Список обсуждений'; Modified: app/locales/groupapp/group/ru.php =================================================================== --- app/locales/groupapp/group/ru.php 2008-06-20 15:13:32 UTC (rev 244) +++ app/locales/groupapp/group/ru.php 2008-06-24 14:27:06 UTC (rev 245) @@ -4,6 +4,7 @@ $dictionary = array(); $dictionary['Groups'] = 'Группы'; +$dictionary['Group'] = 'Группа'; $dictionary['My Groups'] = 'Мои группы'; $dictionary['Browse Groups'] = 'Поиск групп'; $dictionary['Popular Groups'] = 'Популярные группы'; @@ -21,6 +22,11 @@ $dictionary['persons'] = 'участников'; $dictionary['Start New Topic'] = 'Начать новую тему'; $dictionary['Topics count'] = 'Обсуждаемых тем'; +$dictionary['All groups'] = 'Все Ваши группы'; +$dictionary['Recently Updated'] = 'Обновленные последними'; +$dictionary['By Group Member Size'] = 'По количеству пользователей'; +$dictionary['Groups You Admin'] = 'Администрируемые Вами'; +$dictionary['You are in groups'] = 'Число групп, в которых Вы состоите'; $dictionary['Step'] = 'Шаг'; $dictionary['Group Info'] = 'Инфо о группе'; @@ -88,7 +94,7 @@ $dictionary['Publicize'] = 'Опубликовать'; $dictionary['Show this group in search results'] = 'Показывать эту группу в результатах поиска'; -$dictionary['Invite people to'] = 'Пригласить людей в'; +$dictionary['Invite people to group'] = 'Пригласить людей в группу'; $dictionary['Show'] = 'Показать'; $dictionary['Invite Friends'] = 'Пригласить друзей'; $dictionary['Invite Friends on PROJECT_NAME'] = 'Пригласить друзей по PROJECT_NAME'; @@ -96,7 +102,7 @@ $dictionary['Group has no owner'] = 'У группы нет владельца'; $dictionary['Group has no administrators'] = 'В группе нет администраторов'; $dictionary['Group has no moderators'] = 'В группе нет модераторов'; -$dictionary['Could not find any members. Invite some more people.'] = +$dictionary['Could not find any members. Invite some more people.'] = 'Не удалось найти ни одного участника. Пригласите больше людей.'; $dictionary['change status'] = 'изменить статус'; $dictionary['remove'] = 'удалить'; Modified: app/views/groupapp/board/_head.tpl =================================================================== --- app/views/groupapp/board/_head.tpl 2008-06-20 15:13:32 UTC (rev 244) +++ app/views/groupapp/board/_head.tpl 2008-06-24 14:27:06 UTC (rev 245) @@ -4,10 +4,10 @@ </div> <div class="info"> <div class="header"> - <div class="name groupapp">{group_name?}: _{Discussions}</div> + <div class="name groupapp">_{Group} '{group_name?}': _{Discussions}</div> </div> <div class="clearfix"></div> - <div class="subheader"><a href="/groupapp/group/show_group/{group.id?}">_{Back to group} {group_name?}</a></div> + <div class="subheader"><a href="/groupapp/group/show_group/{group.id?}">_{Back to group} '{group_name?}'</a></div> </div> </div> <div class="clearfix"></div> Modified: app/views/groupapp/board/index.tpl =================================================================== --- app/views/groupapp/board/index.tpl 2008-06-20 15:13:32 UTC (rev 244) +++ app/views/groupapp/board/index.tpl 2008-06-24 14:27:06 UTC (rev 245) @@ -36,7 +36,7 @@ <div class="container"> {loop topics} - <div class="row<? if ($topic_loop_counter == 1) echo ' first'; ?>"> + <div class="row<? if ($topic_loop_counter != 1) echo ' notfirst'; ?>"> <div class="topic_info"> <div class="subject"><a href="/groupapp/board/show_topic/{topic-first.topic_id?}">{topic-first.subject?}</a></div> Modified: app/views/groupapp/group/_editbar.tpl =================================================================== --- app/views/groupapp/group/_editbar.tpl 2008-06-20 15:13:32 UTC (rev 244) +++ app/views/groupapp/group/_editbar.tpl 2008-06-24 14:27:06 UTC (rev 245) @@ -8,7 +8,7 @@ </div> <div class="right"> <ul class="toggle_minitabs"> - <li><a href="/groupapp/group/show_group/{group.id?}">_{Back to} {group.name?}</a></li> + <li><a href="/groupapp/group/show_group/{group.id?}">_{Back to} '{group.name?}'</a></li> </ul> </div> </div> Modified: app/views/groupapp/group/edit_members.tpl =================================================================== --- app/views/groupapp/group/edit_members.tpl 2008-06-20 15:13:32 UTC (rev 244) +++ app/views/groupapp/group/edit_members.tpl 2008-06-24 14:27:06 UTC (rev 245) @@ -1,6 +1,6 @@ <div class="title_bar"> <div class="head"> - <div class="name groupapp">_{Invite people to} {group.name?}</div> + <div class="name groupapp">_{Invite people to group} '{group.name?}'</div> </div> </div> <div class="clearfix"></div> @@ -42,7 +42,7 @@ <span class="change_status"> <a href="#" onclick="change_member_status(this, {group.id}, 'moderators_list', 1); return false;" name="{member.id}">_{change status}</a> </span> - <a href="#" onclick="remove_member(this, {group.id}, 'owners_list', 1); return false;" name="{member.id}">_{remove}</a> + <a href="#" onclick="remove_member(this, {group.id?}, 'owners_list', 1); return false;" name="{member.id?}">_{remove}</a> </li> <? } ?> {end}{end} @@ -131,23 +131,24 @@ <script> function remove_member (element, groupapp_group_id, list_id, role) { - new Dialog.Box('dlg', { - reference: element, - title: '_{Remove member}?', - body: '_{Are you sure you want to remove this member from group}?', - yes: '_{Remove}', - cancel: '_{Cancel}', - onYes : function () { - new Ajax.Updater(list_id, - '/groupapp/group/remove_member', - { method:'post', - asynchronous:true, - parameters: - 'groupapp_group_id=' + groupapp_group_id + - '&list_id=' + list_id + - '&member_id=' + element.name + - '&groupapp_member_role_id=' + role - }); + new Dialog.Box(element, { + classname: 'delete_dialog', + title: '_{Remove member}?', + body: '_{Are you sure you want to remove this member from group}?', + yes: '_{Remove}', + cancel: '_{Cancel}', + hfloat: 'right', + onYes : function () { + new Ajax.Updater(list_id, + '/groupapp/group/remove_member', + { method:'post', + asynchronous:true, + parameters: + 'groupapp_group_id=' + groupapp_group_id + + '&list_id=' + list_id + + '&member_id=' + element.name + + '&groupapp_member_role_id=' + role + }); } }); Modified: app/views/groupapp/group/index.tpl =================================================================== --- app/views/groupapp/group/index.tpl 2008-06-20 15:13:32 UTC (rev 244) +++ app/views/groupapp/group/index.tpl 2008-06-24 14:27:06 UTC (rev 245) @@ -85,11 +85,11 @@ <tbody> <? $counter = 0; ?> {loop group_types} - <? if ($group_type_loop_counter % 3 == 1) { ?><tr><td><a href=""><?= $group_type->get('name') ?></a></td> + <? if ($group_type_loop_counter % 3 == 1) { ?><tr><td><a href=""><?= $group_type->get('name') ?></a></td> <? } ?> - <? if ($group_type_loop_counter % 3 == 2) { ?><td><a href=""><?= $group_type->get('name') ?></a></td> + <? if ($group_type_loop_counter % 3 == 2) { ?><td><a href=""><?= $group_type->get('name') ?></a></td> <? } ?> - <? if ($group_type_loop_counter % 3 == 0) { ?><td><a href=""><?= $group_type->get('name') ?></a></td></tr> + <? if ($group_type_loop_counter % 3 == 0) { ?><td><a href=""><?= $group_type->get('name') ?></a></td></tr> <? } ?> <? $counter++; ?> {end} @@ -101,7 +101,7 @@ ?> </tbody> </table> - <form action="/groupapp/group/search" method="post"> + <form action="/groupapp/group/browse" method="post"> <span class="query_field"><?= $form_helper->text_field('group', 'type', array('class' => 'textinput'))?></span> <span class="query_button"><input class="submitinput" type="submit" value="_{Search Groups}"></span> </form> Modified: app/views/groupapp/group/show_group.tpl =================================================================== --- app/views/groupapp/group/show_group.tpl 2008-06-20 15:13:32 UTC (rev 244) +++ app/views/groupapp/group/show_group.tpl 2008-06-24 14:27:06 UTC (rev 245) @@ -1,6 +1,6 @@ <div class="title_bar"> <div class="head"> - <div class="name groupapp">_{Group} {group.name?}</div> + <div class="name groupapp">_{Group} '{group.name?}'</div> </div> </div> <div class="clearfix"></div> @@ -35,13 +35,13 @@ <div class="box_title">_{Group Type}</div> </div> <div class="body"> - <? if ($group->access == 0) { ?> + <? if (isset($group)) { if ($group->access == 0) { ?> _{This is an open group. Anyone can join and invite others to join.} <? } else if ($group->access == 1) { ?> _{This is a closed group. Members must be invited or approved by an admin.} <? } else if ($group->access == 2) { ?> _{This is a secret group. It will not show up in your profile, and only admins can invite members.} - <? } ?> + <? } } ?> </div> <div class="clearfix"></div> </div> @@ -76,7 +76,7 @@ <div class="other value">{group_type?}</div> <div class="clearfix"></div> <div class="other param">_{Description}:</div> - <div class="other value">{group.description}</div> + <div class="other value">{group.description?}</div> <div class="clearfix"></div> </div> </div> Modified: public/stylesheets/common/Application.css =================================================================== --- public/stylesheets/common/Application.css 2008-06-20 15:13:32 UTC (rev 244) +++ public/stylesheets/common/Application.css 2008-06-24 14:27:06 UTC (rev 245) @@ -235,9 +235,9 @@ .clearfix { clear: both; - height: 0px; - width: 0px; - line-height: 0px; + height: 0px; + width: 0px; + line-height: 0px; overflow: hidden; } Modified: public/stylesheets/groupapp/Board.css =================================================================== --- public/stylesheets/groupapp/Board.css 2008-06-20 15:13:32 UTC (rev 244) +++ public/stylesheets/groupapp/Board.css 2008-06-24 14:27:06 UTC (rev 245) @@ -41,8 +41,8 @@ padding: 10px 20px 10px 20px; } -.messages_list .container .row.first { - border-bottom: 0px; +.messages_list .container .row.notfirst { + border-top: 0px; } .messages_list .container .row .topic_info { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-06-25 19:06:41
|
Revision: 252 http://isocial.svn.sourceforge.net/isocial/?rev=252&view=rev Author: dim0s77 Date: 2008-06-25 12:06:47 -0700 (Wed, 25 Jun 2008) Log Message: ----------- minor changes Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/locales/groupapp/group/ru.php app/views/groupapp/group/browse.tpl public/stylesheets/common/Layout.css public/stylesheets/groupapp/Group.css Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-06-25 18:33:10 UTC (rev 251) +++ app/controllers/groupapp/group_controller.php 2008-06-25 19:06:47 UTC (rev 252) @@ -254,6 +254,8 @@ if (!($this->all_groups_count = count($all_groups))) { return; } $all_group_types = $this->GroupappGroupType->find('all'); if ($all_group_types) { + $this->group_id = 2; + $this->subgroup_id = 0; foreach($all_group_types as $group_type) { $gt = array("id" => $group_type->id, "parent_id" => $group_type->parent_id, "name" => $group_type->get('name')); if ($group_type->parent_id == 0) { @@ -262,10 +264,10 @@ if (is_numeric($this->params['g']) && $group_type->parent_id == $this->params['g']) { $this->subgroup_types[] = $gt; if (isset($this->params['sg']) && is_numeric($this->params['sg'])) { - $this->subgroup = $this->params['sg']; + $this->subgroup_id = $this->params['sg']; } } - } else if ($group_type->parent_id == 1) { + } else if ($group_type->parent_id == 2) { $this->subgroup_types[] = $gt; } } Modified: app/locales/groupapp/group/ru.php =================================================================== --- app/locales/groupapp/group/ru.php 2008-06-25 18:33:10 UTC (rev 251) +++ app/locales/groupapp/group/ru.php 2008-06-25 19:06:47 UTC (rev 252) @@ -142,5 +142,6 @@ $dictionary['Groups are not found'] = 'Ни одной группы не найдено'; $dictionary['Create first group'] = 'Создать первую группу'; +$dictionary['All'] = 'Все'; ?> Modified: app/views/groupapp/group/browse.tpl =================================================================== --- app/views/groupapp/group/browse.tpl 2008-06-25 18:33:10 UTC (rev 251) +++ app/views/groupapp/group/browse.tpl 2008-06-25 19:06:47 UTC (rev 252) @@ -3,6 +3,9 @@ {?all_groups_count} <div class="info">_{You are in groups}: <? if (isset($user_groups)) echo count($user_groups); else echo 0; ?></div> +<div class="groups_list"> +<div class="container"> + <div class="two_column"> <div class="right_small"> <div class="right_content"> @@ -11,10 +14,15 @@ <li><a href="/groupapp/group/browse?g={group_type-id?}">{group_type-name}</a></li> {end} </ul> - <ul> + <ul class="groups_list"> + <? if ($subgroup_id == 0) { ?> + <li><strong>_{All}</strong></li> + <? } else { ?> + <li><a href="/groupapp/group/browse?g={group_id?}">_{All}</a></li> + <? } ?> {loop subgroup_types} - <? if (isset($subgroup) && $subgroup == $subgroup_type["id"]) { ?> - <li><b>{subgroup_type-name?}</b></li> + <? if ($subgroup_id == $subgroup_type["id"]) { ?> + <li><strong>{subgroup_type-name?}</strong></li> <? } else { ?> <li><a href="/groupapp/group/browse?g={subgroup_type-parent_id?}&sg={subgroup_type-id?}">{subgroup_type-name?}</a></li> <? } ?> @@ -24,9 +32,6 @@ </div> <div class="left_big"> - <div class="groups_list"> - - <div class="container"> {loop user_groups} <div class="row"> @@ -54,12 +59,13 @@ <div class="clearfix"></div> </div> {end} - </div> - - </div> </div> - + <div class="clearfix"></div> </div> + +</div> +</div> + {else} <div class="nogroups"> _{Groups are not found}. <a href="/groupapp/group/create">_{Create first group}!</a> Modified: public/stylesheets/common/Layout.css =================================================================== --- public/stylesheets/common/Layout.css 2008-06-25 18:33:10 UTC (rev 251) +++ public/stylesheets/common/Layout.css 2008-06-25 19:06:47 UTC (rev 252) @@ -1,5 +1,4 @@ #content .two_column { - background: #ffffff; } #content .two_column .left_small { Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-06-25 18:33:10 UTC (rev 251) +++ public/stylesheets/groupapp/Group.css 2008-06-25 19:06:47 UTC (rev 252) @@ -139,7 +139,6 @@ .groups_list { float: left; - background: #ffffff; width: 100%; } @@ -178,6 +177,17 @@ margin-bottom: 10px; } +.groups_list ul { + list-style: none; + padding-left: 0px; + margin: 0px; +} + +.groups_list li { + display: block; + padding: 5px 10px 5px 10px; +} + .other { float: left; margin-bottom: 3px; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-06-26 10:43:00
|
Revision: 253 http://isocial.svn.sourceforge.net/isocial/?rev=253&view=rev Author: dim0s77 Date: 2008-06-26 03:43:07 -0700 (Thu, 26 Jun 2008) Log Message: ----------- minor fixes Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/views/groupapp/group/browse.tpl public/stylesheets/common/Layout.css public/stylesheets/groupapp/Group.css Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-06-25 19:06:47 UTC (rev 252) +++ app/controllers/groupapp/group_controller.php 2008-06-26 10:43:07 UTC (rev 253) @@ -262,6 +262,7 @@ $this->group_types[] = $gt; } else if (!empty($this->params['g'])) { if (is_numeric($this->params['g']) && $group_type->parent_id == $this->params['g']) { + $this->group_id = $this->params['g']; $this->subgroup_types[] = $gt; if (isset($this->params['sg']) && is_numeric($this->params['sg'])) { $this->subgroup_id = $this->params['sg']; Modified: app/views/groupapp/group/browse.tpl =================================================================== --- app/views/groupapp/group/browse.tpl 2008-06-25 19:06:47 UTC (rev 252) +++ app/views/groupapp/group/browse.tpl 2008-06-26 10:43:07 UTC (rev 253) @@ -9,12 +9,16 @@ <div class="two_column"> <div class="right_small"> <div class="right_content"> + <div class="filter_text">_{Filter groups by}:</div> + <div class="filter_name">_{Type}</div> + <?= $form_options_helper->select('browse_groups', 'g', $PoliticalView->collect($PoliticalView->find(), 'name', 'id'), array(), array('prompt' => $controller->t('Select Political Views:')) )?> <ul class="actions_list"> {loop group_types} <li><a href="/groupapp/group/browse?g={group_type-id?}">{group_type-name}</a></li> {end} </ul> - <ul class="groups_list"> + <div class="filter_name">_{Subtype}</div> + <ul class="subgroups_list"> <? if ($subgroup_id == 0) { ?> <li><strong>_{All}</strong></li> <? } else { ?> Modified: public/stylesheets/common/Layout.css =================================================================== --- public/stylesheets/common/Layout.css 2008-06-25 19:06:47 UTC (rev 252) +++ public/stylesheets/common/Layout.css 2008-06-26 10:43:07 UTC (rev 253) @@ -24,5 +24,5 @@ } .right_content { - padding: 10px 20px 10px 5px; + padding: 10px 10px 10px 5px; } Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-06-25 19:06:47 UTC (rev 252) +++ public/stylesheets/groupapp/Group.css 2008-06-26 10:43:07 UTC (rev 253) @@ -177,15 +177,14 @@ margin-bottom: 10px; } -.groups_list ul { +.subgroups_list { list-style: none; - padding-left: 0px; - margin: 0px; + margin: 0px 0px 10px 0px; + padding: 0px; } -.groups_list li { - display: block; - padding: 5px 10px 5px 10px; +.subgroups_list li { + padding: 5px 0px 5px 0px; } .other { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-06-26 17:36:42
|
Revision: 254 http://isocial.svn.sourceforge.net/isocial/?rev=254&view=rev Author: dim0s77 Date: 2008-06-26 10:36:48 -0700 (Thu, 26 Jun 2008) Log Message: ----------- Upgraded group's browse Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/installers/groupapp/russian_installer.php app/locales/groupapp/group/ru.php app/views/groupapp/board/index.tpl app/views/groupapp/group/browse.tpl app/views/groupapp/group/index.tpl public/stylesheets/common/Layout.css public/stylesheets/groupapp/Group.css Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-06-26 10:43:07 UTC (rev 253) +++ app/controllers/groupapp/group_controller.php 2008-06-26 17:36:48 UTC (rev 254) @@ -254,24 +254,32 @@ if (!($this->all_groups_count = count($all_groups))) { return; } $all_group_types = $this->GroupappGroupType->find('all'); if ($all_group_types) { - $this->group_id = 2; - $this->subgroup_id = 0; + $this->group_type_id = 2; + $this->subgroup_type_id = 0; foreach($all_group_types as $group_type) { $gt = array("id" => $group_type->id, "parent_id" => $group_type->parent_id, "name" => $group_type->get('name')); - if ($group_type->parent_id == 0) { + if ($group_type->parent_id == 0) { // groups $this->group_types[] = $gt; - } else if (!empty($this->params['g'])) { + } else if (!empty($this->params['g'])) { // group selected if (is_numeric($this->params['g']) && $group_type->parent_id == $this->params['g']) { - $this->group_id = $this->params['g']; + $this->group_type_id = $this->params['g']; $this->subgroup_types[] = $gt; - if (isset($this->params['sg']) && is_numeric($this->params['sg'])) { - $this->subgroup_id = $this->params['sg']; + if (isset($this->params['sg']) && is_numeric($this->params['sg'])) { // subgroup selected + $this->subgroup_type_id = $this->params['sg']; } } - } else if ($group_type->parent_id == 2) { + } else if ($group_type->parent_id == 2) { // no group selected $this->subgroup_types[] = $gt; } } + $type_id = $this->subgroup_type_id > 0 ? $this->subgroup_type_id : $this->group_type_id; + + $_filter_pagination = array('items_per_page' => 10, 'count_conditions' => "type_id =" . $type_id ); + $this->group_pages = $this->pagination_helper->getPaginator($this->GroupappGroup, $_filter_pagination);// paginator + + $_filter = array('conditions' => "type_id =" . $type_id); + $options = array_merge($_filter, $this->pagination_helper->getFindOptions($this->GroupappGroup)); + $this->groups = $this->GroupappGroup->find('all', $options); } } Modified: app/installers/groupapp/russian_installer.php =================================================================== --- app/installers/groupapp/russian_installer.php 2008-06-26 10:43:07 UTC (rev 253) +++ app/installers/groupapp/russian_installer.php 2008-06-26 17:36:48 UTC (rev 254) @@ -130,7 +130,7 @@ $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Религиозные организации' WHERE id = 810"); $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Волонтерские организации' WHERE id = 811"); - $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Рекламное' WHERE id = 901"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Спонсорство' WHERE id = 901"); $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Автомобили и Рэйсинг' WHERE id = 1001"); $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Группы поддержки' WHERE id = 1002"); Modified: app/locales/groupapp/group/ru.php =================================================================== --- app/locales/groupapp/group/ru.php 2008-06-26 10:43:07 UTC (rev 253) +++ app/locales/groupapp/group/ru.php 2008-06-26 17:36:48 UTC (rev 254) @@ -144,4 +144,10 @@ $dictionary['Create first group'] = 'Создать первую группу'; $dictionary['All'] = 'Все'; +$dictionary['Search groups'] = 'Поиск групп'; +$dictionary['Search by name'] = 'Поиск по имени'; +$dictionary['Filter groups by'] = 'Фильтровать группы по'; +$dictionary['subtype'] = 'подтипу'; +$dictionary['type'] = 'типу'; + ?> Modified: app/views/groupapp/board/index.tpl =================================================================== --- app/views/groupapp/board/index.tpl 2008-06-26 10:43:07 UTC (rev 253) +++ app/views/groupapp/board/index.tpl 2008-06-26 17:36:48 UTC (rev 254) @@ -1,3 +1,17 @@ +<script> +function on_search_topic_click(element) { + if (element.value == '_{Search all topics}') { + element.value = ''; + } +} + +function on_search_topic_blur(element) { + if (element.value == '') { + element.value = '_{Search all topics}'; + } +} +</script> + <?= $controller->renderPartial("head") ?> <div class="submenu"> @@ -63,17 +77,3 @@ </div> {end} <div class="clearfix"></div> - -<script> -function on_search_topic_click(element) { - if (element.value == '_{Search all topics}') { - element.value = ''; - } -} - -function on_search_topic_blur(element) { - if (element.value == '') { - element.value = '_{Search all topics}'; - } -} -</script> Modified: app/views/groupapp/group/browse.tpl =================================================================== --- app/views/groupapp/group/browse.tpl 2008-06-26 10:43:07 UTC (rev 253) +++ app/views/groupapp/group/browse.tpl 2008-06-26 17:36:48 UTC (rev 254) @@ -1,76 +1,97 @@ +<script> +function on_search_group_click(element) { + if (element.value == '_{Search by name}') { + element.value = ''; + } +} + +function on_search_group_blur(element) { + if (element.value == '') { + element.value = '_{Search by name}'; + } +} +</script> + <?= $controller->renderPartial("menu") ?> {?all_groups_count} -<div class="info">_{You are in groups}: <? if (isset($user_groups)) echo count($user_groups); else echo 0; ?></div> - <div class="groups_list"> -<div class="container"> + <div class="head">_{Groups paginator description}: </div> -<div class="two_column"> - <div class="right_small"> - <div class="right_content"> - <div class="filter_text">_{Filter groups by}:</div> - <div class="filter_name">_{Type}</div> - <?= $form_options_helper->select('browse_groups', 'g', $PoliticalView->collect($PoliticalView->find(), 'name', 'id'), array(), array('prompt' => $controller->t('Select Political Views:')) )?> - <ul class="actions_list"> - {loop group_types} - <li><a href="/groupapp/group/browse?g={group_type-id?}">{group_type-name}</a></li> - {end} - </ul> - <div class="filter_name">_{Subtype}</div> - <ul class="subgroups_list"> - <? if ($subgroup_id == 0) { ?> - <li><strong>_{All}</strong></li> - <? } else { ?> - <li><a href="/groupapp/group/browse?g={group_id?}">_{All}</a></li> - <? } ?> - {loop subgroup_types} - <? if ($subgroup_id == $subgroup_type["id"]) { ?> - <li><strong>{subgroup_type-name?}</strong></li> - <? } else { ?> - <li><a href="/groupapp/group/browse?g={subgroup_type-parent_id?}&sg={subgroup_type-id?}">{subgroup_type-name?}</a></li> - <? } ?> - {end} - </ul> + <div class="two_column"> + <div class="right_small"> + <div class="right_content"> + + <div class="title_text">_{Search groups}:</div> + <form> + <input class="mediumtextinput search" id="searchfield" name="" type="text" value="_{Search by name}" onclick="on_search_group_click(this)" onblur="on_search_group_blur(this)" /> + </form> + + <div class="or_text">_{or}</div> + + <div class="title_text">_{Filter groups by}:</div> + <div class="filter_name">_{type}</div> + <select id="group_type_id" onchange="javascript: window.location.href='?g=' + this.options[this.selectedIndex].value"> + {loop group_types} + <option <? if($group_type['id'] == $group_type_id): ?>selected="selected" <? endif ?>value="{group_type-id?}">{group_type-name?}</option> + {end} + </select> + + <div class="filter_name">_{subtype}</div> + <ul class="subgroups_list"> + <? if ($subgroup_type_id == 0): ?> + <li><strong>_{All}</strong></li> + <? else: ?> + <li><a href="/groupapp/group/browse?g={group_type_id?}">_{All}</a></li> + <? endif ?> + {loop subgroup_types} + <? if ($subgroup_type_id == $subgroup_type["id"]): ?> + <li><strong>{subgroup_type-name?}</strong></li> + <? else: ?> + <li><a href="/groupapp/group/browse?g={subgroup_type-parent_id?}&sg={subgroup_type-id?}">{subgroup_type-name?}</a></li> + <? endif ?> + {end} + </ul> + </div> </div> - </div> - <div class="left_big"> - {loop user_groups} - <div class="row"> + <div class="left_big"> + <div class="left_content"> + {loop groups} + <div class="group_row"> + <div class="actions"> <ul class="actions_list"> - <li><a href="/groupapp/group/edit_info/{user_group.id?}">_{Edit Group}</a></li> - <li><a href="#">_{Leave Group}</a></li> + <li><a href="#">_{Join Group}</a></li> </ul> </div> <div class="avatar"> - <a href="/groupapp/group/show_group/{user_group.id?}"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> + <a href="/groupapp/group/show_group/{group.id?}"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> </div> <div class="info"> - <div class="name"><a href="/groupapp/group/show_group/{user_group.id?}">{user_group.name}</a></div> - <div class="other param">_{Members count}:</div> - <div class="other value">{user_group.members_count}</div> - <div class="clearfix"></div> - <div class="other param">_{Type}:</div> - <div class="other value"><? $id = $user_group->type_id; echo $gt[$id]; ?></div> - <div class="clearfix"></div> + <div class="name"><a href="/groupapp/group/show_group/{group.id?}">{group.name}</a></div> + <div class="other"><span class="param">_{Members count}:</span> {group.members_count}</div> + <div class="other"><span class="param">_{Type}:</span> </div> </div> - <div class="clearfix"></div> </div> + {end} + + </div> + </div> + </div> + <div class="clearfix"></div> + <div class="foot"> </div> </div> -</div> -</div> +{else} -{else} <div class="nogroups"> _{Groups are not found}. <a href="/groupapp/group/create">_{Create first group}!</a> </div> Modified: app/views/groupapp/group/index.tpl =================================================================== --- app/views/groupapp/group/index.tpl 2008-06-26 10:43:07 UTC (rev 253) +++ app/views/groupapp/group/index.tpl 2008-06-26 17:36:48 UTC (rev 254) @@ -33,38 +33,35 @@ <div class="clearfix"></div> <div class="groups_list"> - <div class="info">_{You are in groups}: <?= count($user_groups); ?></div> + <div class="head">_{You are in groups}: <?= count($user_groups); ?></div> <div class="container"> - {loop user_groups} - <div class="row"> + {loop user_groups} + <div class="group_row"> <div class="actions"> <ul class="actions_list"> <li><a href="/groupapp/group/edit_info/{user_group.id?}">_{Edit Group}</a></li> <li><a href="#">_{Leave Group}</a></li> - </ul> + </ul> </div> - + <div class="avatar"> <a href="/groupapp/group/show_group/{user_group.id?}"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> </div> <div class="info"> <div class="name"><a href="/groupapp/group/show_group/{user_group.id?}">{user_group.name}</a></div> - <div class="other param">_{Members count}:</div> - <div class="other value">{user_group.members_count}</div> - <div class="clearfix"></div> - <div class="other param">_{Type}:</div> - <div class="other value"><? $id = $user_group->type_id; echo $gt[$id]; ?></div> - <div class="clearfix"></div> + <div class="other"><span class="param">_{Members count}:</span> {user_group.members_count}</div> + <div class="other"><span class="param">_{Type}:</span> <? $id = $user_group->type_id; echo $gt[$id]; ?></div> </div> <div class="clearfix"></div> </div> - {end} + {end} </div> - + <div class="clearfix"></div> + <div class="foot"> </div> </div> {else} <div class="nogroups"> Modified: public/stylesheets/common/Layout.css =================================================================== --- public/stylesheets/common/Layout.css 2008-06-26 10:43:07 UTC (rev 253) +++ public/stylesheets/common/Layout.css 2008-06-26 17:36:48 UTC (rev 254) @@ -20,7 +20,7 @@ } .left_content { - padding: 10px 5px 10px 20px; + padding: 10px 5px 10px 10px; } .right_content { Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-06-26 10:43:07 UTC (rev 253) +++ public/stylesheets/groupapp/Group.css 2008-06-26 17:36:48 UTC (rev 254) @@ -138,45 +138,57 @@ } .groups_list { - float: left; width: 100%; + background: #f7f7f7; } -.groups_list .info { +.groups_list .head { padding: 10px 10px 5px 20px; + border-bottom: solid 1px #dddddd; + background: #ffffff; } -.groups_list .container { +.groups_list .foot { background: #f7f7f7; - padding: 5px; - border-top: solid 1px #dddddd; border-bottom: solid 1px #dddddd; } -.groups_list .container .row { +.groups_list .container { + padding: 5px 10px 5px 10px; +} + +.group_row { + float: left; + width: 100%; background: #ffffff; border: 1px solid #cccccc; - display: block; - margin: 3px; - padding: 10px 20px 10px 20px; + margin: 5px 0px 5px 0px; } -.groups_list .container .row .avatar { - float: left; +.group_row .avatar { + position: absolute; width: 100px; + padding: 10px 5px 10px 5px; + text-align: center; } -.groups_list .container .row .info { - float: left; - width: 300px; - padding: 0px 5px 0px 5px; +.group_row .info { + padding: 10px 5px 10px 5px; + margin-left: 110px; + position: relative; } -.groups_list .container .row .info .name { +.group_row .info .name { padding: 0px; margin-bottom: 10px; } +.group_row .actions { + float: right; + width: 125px; + padding: 10px 5px 10px 0px; +} + .subgroups_list { list-style: none; margin: 0px 0px 10px 0px; @@ -188,20 +200,14 @@ } .other { - float: left; - margin-bottom: 3px; + margin: 5px 0px 5px 0px; } -.other.param { +.other .param { color: #999999; - margin-right: 5px; + margin: 0px 5px 0px 0px; } -.groups_list .container .row .actions { - float: right; - width: 125px; -} - .subtext { padding: 2px 5px 0px 0px; font-size: 9px; @@ -212,3 +218,22 @@ color: #000000; float: left; } + +.title_text { + color: #333333; + font-weight: bold; + font-size: 12px; + padding: 5px 0px 0px 0px; +} + +.or_text { + color: #777777; + padding: 5px 0px 5px 0px; +} + +.filter_name { + color: #777777; + font-weight: bold; + font-size: 12px; + padding: 10px 0px 3px 0px; +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-07-03 13:52:56
|
Revision: 260 http://isocial.svn.sourceforge.net/isocial/?rev=260&view=rev Author: dim0s77 Date: 2008-07-03 06:53:04 -0700 (Thu, 03 Jul 2008) Log Message: ----------- added form for uploading group avatar Modified Paths: -------------- app/controllers/blogapp/post_controller.php app/controllers/groupapp/group_controller.php app/models/groupapp_group.php app/views/groupapp/group/_customize.tpl public/stylesheets/common/Form.css public/stylesheets/groupapp/Group.css Modified: app/controllers/blogapp/post_controller.php =================================================================== --- app/controllers/blogapp/post_controller.php 2008-07-02 17:31:31 UTC (rev 259) +++ app/controllers/blogapp/post_controller.php 2008-07-03 13:53:04 UTC (rev 260) @@ -8,7 +8,7 @@ $this->posts = $this->BlogappPost->find('all', array('conditions' => array('user_id = ' . $this->current_user->getId()))); //$this->debug($this->posts); for ($i = 0 ; $i < count($this->posts) ; $i++) { - $this->posts[$i]->media_item->load(); + // $this->posts[$i]->media_item->load(); /* $this->posts[$i]->attachments = $this->posts[$i]->attachment->load(); foreach ($this->posts[$i]->attachments as $k => $attach) { Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-07-02 17:31:31 UTC (rev 259) +++ app/controllers/groupapp/group_controller.php 2008-07-03 13:53:04 UTC (rev 260) @@ -42,6 +42,10 @@ function create () { $this->step = 'group_info'; if (!empty($this->params['group'])){ + if (empty($this->params['group']['type_id']) || $this->params['group']['type_id'] == 0) { + $this->addError('_common', 'Group type is missing', 'please select the group type'); + return; + } $this->GroupappGroup->setAttributes($this->params['group']); $this->GroupappGroup->members_count = 1; if ($this->Request->isPost() && $this->GroupappGroup->save()){ @@ -255,7 +259,7 @@ $type_id = $this->subgroup_type_id > 0 ? " = " . $this->subgroup_type_id : " BETWEEN " . $this->group_type_id * 100 . " and " . ($this->group_type_id + 1) * 100; - $_filter_pagination = array('items_per_page' => 10, 'count_conditions' => "type_id" . $type_id ); + $_filter_pagination = array('items_per_page' => 2, 'count_conditions' => "type_id" . $type_id ); $group_pages = $this->pagination_helper->getPaginator($this->GroupappGroup, $_filter_pagination);// paginator $this->first_group = ($group_pages->getCurrentPage() - 1) * $group_pages->getItemsPerPage() + 1; $this->last_group = ($group_pages->getCurrentPage() * $group_pages->getItemsPerPage() < $group_pages->getItemCount()) ? Modified: app/models/groupapp_group.php =================================================================== --- app/models/groupapp_group.php 2008-07-02 17:31:31 UTC (rev 259) +++ app/models/groupapp_group.php 2008-07-03 13:53:04 UTC (rev 260) @@ -20,6 +20,9 @@ $this->validatesPresenceOf('name', 'Name is missing|please enter the name'); $this->validatesPresenceOf('description', 'Description is missing|please enter the description'); $this->validatesPresenceOf('type_id', 'Group type is missing|please select the group type'); + if (!$this->getErrors()) { + $this->validatesNumericalityOf('type_id', "Type: hack attempt detected|type does not exist"); + } # $this->validatesFormatOf('email', AK_EMAIL_REGULAR_EXPRESSION, 'Incorrect email|please enter the correct email'); } } Modified: app/views/groupapp/group/_customize.tpl =================================================================== --- app/views/groupapp/group/_customize.tpl 2008-07-02 17:31:31 UTC (rev 259) +++ app/views/groupapp/group/_customize.tpl 2008-07-03 13:53:04 UTC (rev 260) @@ -2,8 +2,56 @@ <?= $controller->renderErrors() ?> </div> - <div class="picture"></div> + <div class="picture"> + <div class="two_column"> + <div class="left_small"> + <div class="left_content"> + + <div class="imghead">_{Current picture}:<br><br> + <img src="/images/nophoto_men_sm.gif" alt="" class=""> + </div> + + </div> + </div> + + <div class="right_big"> + <div class="left_content"> + + <form action="/groupapp/group/customize/{group.id?}" method="post"> + + <div class="upload_picture"> + <div class="upload_title"> + _{Upload Picture} + </div> + + <div class="upload_text"> + _{You can upload a JPG, GIF or PNG file}. + </div> + + <div class="upload_field"> + <?= $form_helper->file_field('upload', 'photo', array('class' => 'textinput small')) ?> + </div> + + <div class="filter_name certify"> + <?= $form_helper->check_box('upload', 'certify', array()) ?> + <label for="group_certify">_{I certify that I have the right to distribute this picture and that it does not violate the} <a href="#">_{Terms of Use}</a>.</label> + </div> + + <div class="upload_submit"> + <input class="submitinput" type="submit" value="_{Upload Picture}"/> + </div> + </div> + + </form> + + </div> + </div> + + </div> + <div class="clearfix"></div> + </div> + <div class="formrow"> <label>_{Website}:</label> <div class="formcol"> Modified: public/stylesheets/common/Form.css =================================================================== --- public/stylesheets/common/Form.css 2008-07-02 17:31:31 UTC (rev 259) +++ public/stylesheets/common/Form.css 2008-07-03 13:53:04 UTC (rev 260) @@ -1,5 +1,5 @@ #content .editform { - padding: 20px 0px 20px 10px; + padding: 10px 0px 10px 0px; margin: auto; } Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-07-02 17:31:31 UTC (rev 259) +++ public/stylesheets/groupapp/Group.css 2008-07-03 13:53:04 UTC (rev 260) @@ -241,4 +241,32 @@ font-weight: bold; font-size: 12px; padding: 10px 0px 3px 0px; -} \ No newline at end of file +} + +.imghead { + color: #333333; + font-weight: bold; + font-size: 12px; + text-align: center; + padding: 0px 10px 20px 10px; +} + +.upload_picture { + padding: 0px 10px 20px 10px; +} + +.upload_picture .upload_title { + color: #333333; + font-weight: bold; + font-size: 13px; + border-bottom: solid 1px #d8dfea; + padding: 0px 0px 5px 0px; +} + +.upload_picture .upload_text { + padding: 10px 0px 10px 0px; +} + +.filter_name.certify { + padding: 10px 0px 10px 0px; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-07-06 15:40:58
|
Revision: 270 http://isocial.svn.sourceforge.net/isocial/?rev=270&view=rev Author: dim0s77 Date: 2008-07-06 08:41:05 -0700 (Sun, 06 Jul 2008) Log Message: ----------- more pagination for groups Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/helpers/array_pagination_helper.php app/views/groupapp/group/browse.tpl app/views/groupapp/group/index.tpl public/stylesheets/common/Pagination.css public/stylesheets/groupapp/Group.css public/stylesheets/groupapp/Groupapp.css Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-07-06 14:10:04 UTC (rev 269) +++ app/controllers/groupapp/group_controller.php 2008-07-06 15:41:05 UTC (rev 270) @@ -36,7 +36,17 @@ } function index () { - $this->user_groups = $this->current_user->groupapp_group->load(); + $user_groups = $this->current_user->groupapp_group->load(); + + $this->user_groups_count = count($user_groups); + + $_filter_pagination = array('items_per_page' => 10); + $group_pages = $this->array_pagination_helper->getPaginator("user_group_pages", $user_groups, $_filter_pagination);// paginator + + $links = $group_pages->paginator->getLinks(); + $this->pages_links = $links['first'] . ' ' . $links['back'] . ' ' . $links['pages'] . ' ' . $links['next'] . ' ' . $links['last']; + $this->user_groups = $this->array_pagination_helper->getPageItems("user_group_pages", $user_groups); + $this->_extract_group_types(); } @@ -253,8 +263,10 @@ $this->last_group = ($group_pages->getCurrentPage() * $group_pages->getItemsPerPage() < $group_pages->getItemCount()) ? $group_pages->getCurrentPage() * $group_pages->getItemsPerPage() : $group_pages->getItemCount(); $this->all_groups = $group_pages->getItemCount(); - $this->pages_links = $group_pages->links(); + $links = $group_pages->paginator->getLinks(); + $this->pages_links = $links['first'] . ' ' . $links['back'] . ' ' . $links['pages'] . ' ' . $links['next'] . ' ' . $links['last']; + $_filter = array('conditions' => "type_id" . $type_id); $options = array_merge($_filter, $this->pagination_helper->getFindOptions($this->GroupappGroup)); $this->groups = $this->GroupappGroup->find('all', $options); @@ -299,7 +311,8 @@ $_filter_pagination = array('items_per_page' => 10); $member_pages = $this->array_pagination_helper->getPaginator("groupapp_member_pages", $members, $_filter_pagination);// paginator $links = $member_pages->paginator->getLinks(); - $this->pages_links = $links['first'] . ' ' . $links['back'] . ' ' . $links['pages'] . ' ' . $links['next'] . ' ' . $links['last']; + $this->pages_links = $links['first'] . ' ' . $links['back'] . ' ' . $links['pages'] . ' ' . $links['next'] . ' ' . $links['last']; + $this->members = $this->array_pagination_helper->getPageItems("groupapp_member_pages", $members); $this->renderAction('members.tpl'); Modified: app/helpers/array_pagination_helper.php =================================================================== --- app/helpers/array_pagination_helper.php 2008-07-06 14:10:04 UTC (rev 269) +++ app/helpers/array_pagination_helper.php 2008-07-06 15:41:05 UTC (rev 270) @@ -31,12 +31,10 @@ $offset = $this->$paginator_name->getOffset(); $page_items = array(); - for ($i = 0; $i < count($items); $i++) { - if (($offset == 0 && $i < $items_per_page) || - ($i < $items_per_page * $offset && $i >= $items_per_page * ($offset - 1))) - { - $page_items[] = $items[$i]; - } + for ($i = $offset; $i < $offset + $items_per_page; $i++) { + if ($i < count($items)) { + $page_items[] = $items[$i]; + } } return $page_items; Modified: app/views/groupapp/group/browse.tpl =================================================================== --- app/views/groupapp/group/browse.tpl 2008-07-06 14:10:04 UTC (rev 269) +++ app/views/groupapp/group/browse.tpl 2008-07-06 15:41:05 UTC (rev 270) @@ -19,11 +19,13 @@ {?all_groups_count} <div class="groups_list"> <div class="head"> - <div class="paginator"> - <div class="items">{?all_groups}_{Displaying groups} {first_group?} - {last_group?} _{out of} {all_groups?}{end}</div> - <div class="pages">{pages_links?}</div> - <div class="clearfix"></div> + <div class="left"> + {?all_groups}_{Displaying groups} {first_group?} - {last_group?} _{out of} {all_groups?}{end} </div> + <div class="paginationAbove1"> + {pages_links?} + </div> + <div class="clearfix"></div> </div> <div class="two_column"> @@ -108,14 +110,9 @@ <div class="foot"> </div> </div> -{?pages_links} -<div class="actions"> - <div class="paginator"> - <div class="pages">{pages_links?}</div> - <div class="clearfix"></div> - </div> +<div class="paginationUnder1"> + {pages_links?} </div> -{end} {else} Modified: app/views/groupapp/group/index.tpl =================================================================== --- app/views/groupapp/group/index.tpl 2008-07-06 14:10:04 UTC (rev 269) +++ app/views/groupapp/group/index.tpl 2008-07-06 15:41:05 UTC (rev 270) @@ -16,7 +16,7 @@ <div class="clearfix"></div> </div> -{?user_groups} +{?user_groups_count} <div class="submenu_separator"> </div> <div class="submenu"> <div class="menu_block selector"> @@ -33,7 +33,10 @@ <div class="clearfix"></div> <div class="groups_list"> - <div class="head">_{You are in groups}: <?= count($user_groups); ?></div> + <div class="head">_{You are in groups}: {user_groups_count}</div> + <div class="paginationUnder2"> + {pages_links?} + </div> <div class="container"> {loop user_groups} @@ -63,11 +66,15 @@ <div class="clearfix"></div> </div> {end} + </div> + <div class="paginationAbove2"> + {pages_links?} + </div> <div class="clearfix"></div> - <div class="foot"> </div> </div> {else} + <div class="nogroups"> _{You have not joined any groups}. </div> Modified: public/stylesheets/common/Pagination.css =================================================================== --- public/stylesheets/common/Pagination.css 2008-07-06 14:10:04 UTC (rev 269) +++ public/stylesheets/common/Pagination.css 2008-07-06 15:41:05 UTC (rev 270) @@ -17,7 +17,7 @@ /* pagination above the line. non-white background */ .paginationAbove2 { float: right; - padding: 0px 8px 7px 5px; + padding: 4px 8px 7px 5px; } .paginationAbove2 .paginationCurrent { @@ -41,7 +41,7 @@ /* pagination under line. white background */ .paginationUnder1 { float: right; - padding: 7px 5px 2px 5px; + padding: 6px 5px 7px 5px; } .paginationUnder1 .paginationCurrent { Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-07-06 14:10:04 UTC (rev 269) +++ public/stylesheets/groupapp/Group.css 2008-07-06 15:41:05 UTC (rev 270) @@ -145,17 +145,18 @@ .groups_list { width: 100%; background: #f7f7f7; + border-bottom: solid 1px #dddddd; } .groups_list .head { - padding: 10px 10px 5px 20px; + padding: 10px 10px 8px 20px; border-bottom: solid 1px #dddddd; background: #ffffff; } -.groups_list .foot { - background: #f7f7f7; - border-bottom: solid 1px #dddddd; +.groups_list .head .left { + padding: 6px 0px 0px 0px; + float: left; } .groups_list .container { Modified: public/stylesheets/groupapp/Groupapp.css =================================================================== --- public/stylesheets/groupapp/Groupapp.css 2008-07-06 14:10:04 UTC (rev 269) +++ public/stylesheets/groupapp/Groupapp.css 2008-07-06 15:41:05 UTC (rev 270) @@ -54,11 +54,3 @@ text-align: center; margin-bottom: 5px; } - -.paginator .items { - float: left; -} - -.paginator .pages { - float: right; -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-07-08 17:25:44
|
Revision: 275 http://isocial.svn.sourceforge.net/isocial/?rev=275&view=rev Author: dim0s77 Date: 2008-07-08 10:25:53 -0700 (Tue, 08 Jul 2008) Log Message: ----------- added more logic to page groupapp->group->edit_customize and picture_upload Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/locales/groupapp/group/ru.php app/views/groupapp/group/_customize.tpl app/views/groupapp/group/_editbar.tpl app/views/groupapp/group/_picture_upload.tpl public/stylesheets/common/MiniTab.css public/stylesheets/groupapp/Group.css Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-07-08 15:05:14 UTC (rev 274) +++ app/controllers/groupapp/group_controller.php 2008-07-08 17:25:53 UTC (rev 275) @@ -19,11 +19,8 @@ if (!empty($this->params['id']) && $this->GroupappGroup->find($this->params['id'])) { $group = $this->GroupappGroup->find( $this->params['id'] ); if (isset($group) && $group) { - $this->group_picture = GROUPAPP_DEFAULT_PICTURE_URL; - if ($group->stored_file_id) { - $group->picture->load(); - $this->group_picture = $group->picture->url(); - } + $this->group_picture = $group->stored_file_id ? + $group->picture->load()->url() : GROUPAPP_DEFAULT_PICTURE_URL; $this->group = $group; $members = $this->_getGroupMembers($this->group->getId()); $current_user_id = $this->current_user->getId(); @@ -106,14 +103,19 @@ $this->group->category_id = floor($this->group->type_id / 100); if (!empty($this->params['group'])){ if (isset($this->params['group']['stored_file_id']) && + !empty($this->params['group']['stored_file_id']) && $this->params['group']['stored_file_id'] != $this->group->stored_file_id ) { $stored_file = $this->StoredFile->findFirst(array( 'id' => $this->params['group']['stored_file_id'] )); $this->group->picture->assign($stored_file); + } else { + $this->group->stored_file_id = NULL; + $this->group->picture->build(); } $this->group->setAttributes($this->params['group']); if ($this->Request->isPost() && $this->group->save()) { - $this->group_picture = $this->group->picture->url(); + $this->group_picture = $this->group->stored_file_id ? + $this->group->picture->load()->url() : GROUPAPP_DEFAULT_PICTURE_URL; return; } } Modified: app/locales/groupapp/group/ru.php =================================================================== --- app/locales/groupapp/group/ru.php 2008-07-08 15:05:14 UTC (rev 274) +++ app/locales/groupapp/group/ru.php 2008-07-08 17:25:53 UTC (rev 275) @@ -93,6 +93,15 @@ 'Это засекреченная группа. Эта группа не будет отображаться в результатах поиска или в профилях своих участников.'; $dictionary['Publicize'] = 'Опубликовать'; $dictionary['Show this group in search results'] = 'Показывать эту группу в результатах поиска'; +$dictionary['Current picture'] = 'Текущее изображение'; +$dictionary['Upload Picture'] = 'Загрузить изображение'; +$dictionary['You can upload a JPG, GIF or PNG file'] = 'Вы можете загрузить изображение в формате JPG, GIF или PNG'; +$dictionary['I certify that I have the right to distribute this picture and that it does not violate the'] = 'Подтверждаю то, что я обладаю правами на распространение этого изображения и оно не нарушает'; +$dictionary['Terms of Use'] = 'Условия пользования'; +$dictionary['Remove Picture'] = 'Удалить изображение'; +$dictionary['You can remove this picture, but be sure to upload another or we will display a question mark in its place'] = 'Вы можете удалить текущее изображение, но не забудьте загрузить другое или на этом месте появится картинка, используемая по-умолчанию для групп'; +$dictionary['Note'] = 'Примечание'; +$dictionary['to preserve the new images do not forget to save the parameters group'] = 'для сохранения нового изображения не забудьте сохранить параметры группы'; $dictionary['Invite people to group'] = 'Пригласить людей в группу'; $dictionary['Show'] = 'Показать'; Modified: app/views/groupapp/group/_customize.tpl =================================================================== --- app/views/groupapp/group/_customize.tpl 2008-07-08 15:05:14 UTC (rev 274) +++ app/views/groupapp/group/_customize.tpl 2008-07-08 17:25:53 UTC (rev 275) @@ -22,13 +22,13 @@ <div class="clearfix"></div> </div> - <div class="formrow"> - <label> </label> - <div class="formcol"> - <label class="checkbox"><?= $form_helper->check_box('group', 'show_wall', array('class' => 'checkboxinput')) ?>_{Enable the Wall}.</label> - </div> - <div class="clearfix"></div> - </div> + <!-- <div class="formrow"> --> + <!-- <label> </label> --> + <!-- <div class="formcol"> --> + <!-- <label class="checkbox"><?= $form_helper->check_box('group', 'show_wall', array('class' => 'checkboxinput')) ?>_{Enable the Wall}.</label> --> + <!-- </div> --> + <!-- <div class="clearfix"></div> --> + <!-- </div> --> <!-- <div class="formrow"> --> <!-- <label> </label> --> Modified: app/views/groupapp/group/_editbar.tpl =================================================================== --- app/views/groupapp/group/_editbar.tpl 2008-07-08 15:05:14 UTC (rev 274) +++ app/views/groupapp/group/_editbar.tpl 2008-07-08 17:25:53 UTC (rev 275) @@ -1,8 +1,8 @@ <div class="minitabs"> <div class="left"> <ul class="toggle_minitabs"> - <li><a href="/groupapp/group/edit_info/{group.id?}" class="<?= !empty($step) && $step == 'edit_info' ? 'selected' : '' ?>">_{Group Info}</a> - </li><li><a href="/groupapp/group/edit_customize/{group.id?}" class="<?= !empty($step) && $step == 'edit_customize' ? 'selected' : '' ?>">_{Customize}</a> + <li><a href="/groupapp/group/edit_info/{group.id?}" class="<?= !empty($step) && $step == 'edit_info' ? 'selected' : '' ?> right_space">_{Group Info}</a> + </li><li><a href="/groupapp/group/edit_customize/{group.id?}" class="<?= !empty($step) && $step == 'edit_customize' ? 'selected' : '' ?> right_space">_{Customize}</a> </li><li><a href="/groupapp/group/edit_members/{group.id?}" class="<?= !empty($step) && $step == 'edit_members' ? 'selected' : '' ?>">_{Members}</a></li> </ul> </div> Modified: app/views/groupapp/group/_picture_upload.tpl =================================================================== --- app/views/groupapp/group/_picture_upload.tpl 2008-07-08 15:05:14 UTC (rev 274) +++ app/views/groupapp/group/_picture_upload.tpl 2008-07-08 17:25:53 UTC (rev 275) @@ -9,6 +9,7 @@ if (uploaded.length) { $('current_picture').innerHTML = '<img src="/preview/200x200/' + uploaded[0].url + '">'; $('group_stored_file_id').value = uploaded[0].id; + $('picture_note').show(); } } @@ -21,6 +22,14 @@ $('upload_submit_btn').writeAttribute('class', 'cancelinput'); } } + + function removePicture() { + <? $default_picture = GROUPAPP_DEFAULT_PICTURE_URL; ?> + $('current_picture').innerHTML = '<img src="/preview/200x200/{default_picture}">'; + $('group_stored_file_id').value = ''; + $('picture_note').show(); + } + </script> <form enctype="multipart/form-data" method="post" id="picture_upload_form" action="/upload" onsubmit="return AIM.submit(this, {'onStart' : startCallback, 'onComplete' : completeCallback})"> @@ -37,6 +46,10 @@ </div> </div> + <div class="note" id="picture_note" style="display: none"> + <strong>_{Note}</strong>: _{to preserve the new images do not forget to save the parameters group}! + </div> + </div> </div> @@ -44,6 +57,7 @@ <div class="left_content"> <div class="upload_picture"> + <div class="upload_title"> _{Upload Picture} </div> @@ -64,6 +78,23 @@ <div class="upload_submit"> <input class="cancelinput" type="submit" value="_{Upload Picture}" disabled="disabled" id="upload_submit_btn" name="upload_submit_btn" /> </div> + + {?group.stored_file_id} + <div class="spacer"> </div> + + <div class="upload_title"> + _{Remove Picture} + </div> + + <div class="upload_text"> + _{You can remove this picture, but be sure to upload another or we will display a question mark in its place}. + </div> + + <div class="upload_submit"> + <input class="submitinput" type="button" value="_{Remove Picture}" id="remove_submit_btn" name="remove_submit_btn" onclick="removePicture()" /> + </div> + {end} + </div> </div> Modified: public/stylesheets/common/MiniTab.css =================================================================== --- public/stylesheets/common/MiniTab.css 2008-07-08 15:05:14 UTC (rev 274) +++ public/stylesheets/common/MiniTab.css 2008-07-08 17:25:53 UTC (rev 275) @@ -43,6 +43,10 @@ border-right: 1px solid #cccccc; } +.toggle_minitabs li.empty.right_space { + margin-right: 3px; +} + .toggle_minitabs li a { display: block; color: #3b5998; @@ -54,6 +58,10 @@ border-right: 1px solid #cccccc; } +.toggle_minitabs li a.right_space { + margin-right: 3px; +} + .toggle_minitabs li a:focus { outline: 0px; } Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-07-08 15:05:14 UTC (rev 274) +++ public/stylesheets/groupapp/Group.css 2008-07-08 17:25:53 UTC (rev 275) @@ -264,7 +264,7 @@ color: #333333; font-weight: bold; font-size: 13px; - border-bottom: solid 1px #d8dfea; + border-bottom: solid 1px #6d84b4; padding: 0px 0px 5px 0px; } @@ -272,7 +272,17 @@ padding: 10px 0px 10px 0px; } +.note { + font-size: 11px; + color: #ff5f5f; + margin: 0px 5px 10px 10px; +} + .filter_name.certify { padding: 10px 0px 10px 0px; } +.spacer { + dislay: block; + height: 20px; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-07-14 18:35:30
|
Revision: 287 http://isocial.svn.sourceforge.net/isocial/?rev=287&view=rev Author: dim0s77 Date: 2008-07-14 11:35:39 -0700 (Mon, 14 Jul 2008) Log Message: ----------- created basis of friends selector Modified Paths: -------------- app/application_controller.php app/views/groupapp/group/edit_members.tpl app/views/layouts/application.tpl public/stylesheets/groupapp/Group.css Added Paths: ----------- public/stylesheets/friend_selector.css Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-07-14 18:27:43 UTC (rev 286) +++ app/application_controller.php 2008-07-14 18:35:39 UTC (rev 287) @@ -21,7 +21,7 @@ var $_errors = array(); var $app_models = array('User', 'Message', 'BaseFile', 'StoredFile'); - var $app_helpers = array('AutoComplete', 'City', 'Dialog', 'AccessField', 'ArrayPagination'); + var $app_helpers = array('AutoComplete', 'City', 'Dialog', 'AccessField', 'ArrayPagination', 'FriendSelector'); var $uploaded_files = array(); var $current_user; Modified: app/views/groupapp/group/edit_members.tpl =================================================================== --- app/views/groupapp/group/edit_members.tpl 2008-07-14 18:27:43 UTC (rev 286) +++ app/views/groupapp/group/edit_members.tpl 2008-07-14 18:35:39 UTC (rev 287) @@ -10,15 +10,17 @@ <?= $controller->renderErrors() ?> <div class="formwrapper"> -<form action="/groupapp/group/edit_members/{group.id?}" method="post"> - <div class="invite_column"> - <div class="header_text">_{Invite Friends on PROJECT_NAME}:</div> - <div class="friends_list"></div> - <div class="submit"> - <input class="submitinput" type="submit" value="_{Invite Friends}"> - </div> + <div class="invite_column"> + <div class="header_text">_{Invite Friends on PROJECT_NAME}:</div> + <div class="friends_list"> + <?= $friend_selector_helper->row_selector('current_user', 'email_access', array('show_groups' => true)); ?> </div> + <div class="submit"> + <input class="submitinput" type="submit" value="_{Invite Friends}"> + </div> + </div> + <form action="/groupapp/group/edit_members/{group.id?}" method="post"> <div class="members"> <div class="submenushort"> @@ -130,7 +132,7 @@ </div> <div class="clearfix"></div> -</form> + </form> </div> <script> Modified: app/views/layouts/application.tpl =================================================================== --- app/views/layouts/application.tpl 2008-07-14 18:27:43 UTC (rev 286) +++ app/views/layouts/application.tpl 2008-07-14 18:35:39 UTC (rev 287) @@ -6,6 +6,7 @@ <link href="/stylesheets/autocomplete.css" rel="stylesheet" type="text/css"> <link href="/stylesheets/dialog.css" rel="stylesheet" type="text/css"> <link href="/stylesheets/Application.css" rel="stylesheet" type="text/css"> +<link href="/stylesheets/friend_selector.css" rel="stylesheet" type="text/css"> <? if ($controller->getModuleName()) : ?> <link href="/stylesheets/<?= $controller->getModuleName() . '/' . ucfirst($controller->getModuleName()) ?>.css" rel="stylesheet" type="text/css"> <? endif ?> Added: public/stylesheets/friend_selector.css =================================================================== --- public/stylesheets/friend_selector.css (rev 0) +++ public/stylesheets/friend_selector.css 2008-07-14 18:35:39 UTC (rev 287) @@ -0,0 +1,48 @@ +.friend_selector { + margin: 0px; + background: #ffffff; + border: 1px solid #cccccc; +} + +.friend_selector .content { + background: #ffffff; + border: 1px solid #6d84b4; + margin: 15px 2px 10px 2px; + padding: 10px 1px 2px 1px; +} + +.friend_selector .content .content_title { + margin: -19px 0px 0px 5px; + padding: 3px; + background: #ffffff; + border-left: 1px solid #6d84b4; + border-right: 1px solid #6d84b4; + float: left; + font-weight: bold; +} + +.friend_selector .content .friend_row { + background: #ffffff; + border-bottom: 1px solid #cccccc; + padding: 3px 2px 3px 2px; +} + +.friend_selector .content .friend_row.first { + border-top: 1px solid #cccccc; + +} + +.friend_selector .content .friend_row .friend_check { + padding: 6px 2px 0px 0px; + float: left; +} + +.friend_selector .content .friend_row .friend_photo { + float: left; +} + +.friend_selector .content .friend_row .friend_name { + padding: 9px 0px 0px 4px; + float: left; +} + Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-07-14 18:27:43 UTC (rev 286) +++ public/stylesheets/groupapp/Group.css 2008-07-14 18:35:39 UTC (rev 287) @@ -73,10 +73,7 @@ } .invite_column .friends_list { - margin: 0px 10px 5px 10px; - background: #ffffff; - border: 1px solid #cccccc; - height: 230px; + padding: 0px 10px 5px 10px; } .invite_column .submit { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-07-15 18:39:02
|
Revision: 288 http://isocial.svn.sourceforge.net/isocial/?rev=288&view=rev Author: dim0s77 Date: 2008-07-15 11:39:12 -0700 (Tue, 15 Jul 2008) Log Message: ----------- added user photo to profile and groupapp. refactoring Modified Paths: -------------- app/application_controller.php app/controllers/groupapp/board_controller.php app/controllers/groupapp/group_controller.php app/controllers/profile_controller.php app/installers/user_installer.php app/locales/groupapp/group/ru.php app/locales/layout/ru.php app/models/basic_profile.php app/models/groupapp_message.php app/models/user.php app/views/groupapp/board/_head.tpl app/views/groupapp/board/_menu.tpl app/views/groupapp/board/reply_to_post.tpl app/views/groupapp/board/reply_to_topic.tpl app/views/groupapp/board/show_topic.tpl app/views/groupapp/group/_picture_upload.tpl app/views/groupapp/group/edit_members.tpl app/views/groupapp/group/index.tpl app/views/groupapp/group/show_group.tpl app/views/layouts/application.tpl app/views/profile/picture.tpl public/stylesheets/friend_selector.css public/stylesheets/groupapp/Group.css Added Paths: ----------- public/stylesheets/upload_picture.css Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-07-14 18:35:39 UTC (rev 287) +++ app/application_controller.php 2008-07-15 18:39:12 UTC (rev 288) @@ -4,6 +4,8 @@ require_once(AK_VENDOR_DIR.DS.'phputf8'.DS.'ucfirst.php'); require_once(AK_APP_DIR.DS.'vendor'.DS.'utf8_to_ascii'.DS.'utf8_to_ascii.php'); +define('USER_DEFAULT_PICTURE_URL', "/images/nophoto_men_sm.gif"); + /** * This file is application-wide controller file. You can put all * application-wide controller-related methods here. Modified: app/controllers/groupapp/board_controller.php =================================================================== --- app/controllers/groupapp/board_controller.php 2008-07-14 18:35:39 UTC (rev 287) +++ app/controllers/groupapp/board_controller.php 2008-07-15 18:39:12 UTC (rev 288) @@ -4,15 +4,28 @@ { var $models = array('GroupappMessage', 'GroupappGroup', 'GroupappMember', 'User'); + function beforeAction ( $method = '' ) { + parent::beforeAction($method); + + if (!empty($this->params['id'])) { + $group = $this->GroupappGroup->find( $this->params['id'] ); + if (isset($group)) { + $this->group = $group; + $this->groupapp_group_id = $group->getId(); + $this->group_name = $group->name; + $this->group_picture = $this->_group_picture($group); + } + } + } + function index () { - if (!empty($this->params['id'])) { + if (isset($this->group)) { $messages = $this->GroupappMessage->find('all', array( - 'conditions' => array("groupapp_group_id = ?", $this->params['id']), - 'include' => 'user' + 'conditions' => array("groupapp_group_id" => $this->group->getId()), + 'include' => 'user' ) ); - $group = $this->GroupappGroup->find( $this->params['id'] ); $topics = array(); $persons = array(); if(!empty($messages)) { @@ -33,30 +46,28 @@ $topics[$message->topic_id]['last'] = $message; } } - $this->groupapp_group_id = $group->getId(); - $this->group_name = $group->name; $this->topics = $topics; } } function show_topic () { - if (!empty($this->params['id'])) { + if (isset($this->group) && !empty($this->params['t'])) { $messages = $this->GroupappMessage->find('all', - array( - 'conditions' => array("topic_id = ?", $this->params['id']), - 'include' => 'user' - ) - ); + array( + 'conditions' => array( + "groupapp_group_id" => $this->group->getId(), + "topic_id" => $this->params['t']), + 'include' => 'user' + ) + ); if ($messages) { - $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $messages[0]->groupapp_group_id, - 'user_id' => $this->current_user->getId() - )); - $group = $this->GroupappGroup->find( $messages[0]->groupapp_group_id ); - if (($group && $group->access == 1) || $member) { + $member = $this->GroupappMember->findFirst(array( + 'groupapp_group_id' => $this->group->getId(), + 'user_id' => $this->current_user->getId() + )); + if ($this->group->access == 1 || $member) { $this->messages = $messages; - $this->groupapp_group_id = $group->getId(); - $this->group_name = $group->name; - $this->topic_id = $messages[0]->topic_id; + $this->topic_id = $this->params['t']; } else { $this->addError('_common', 'Access denied', 'Group id closed. You can\'t to see this topic'); } @@ -65,131 +76,142 @@ } $this->addError('_common', 'Topic not found', 'This topic is not founded'); } - + function start_topic () { - if (!empty($this->params['topic']) && - !empty($this->params['topic']['groupapp_group_id']) && - !empty($this->params['topic']['body'])) { - if ( $this->group = $this->GroupappGroup->find( $this->params['topic']['groupapp_group_id'] ) ) { - $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $this->group->getId(), - 'user_id' => $this->current_user->getId() - )); - if ($member) { - $message = $member->message->build(); - $message->setAttributes($this->params['topic']); - if (empty($message->subject)) { - $message->subject = $this->t('(no topic)'); - } - if ($message->save()) { - if (!$message->topic_id) { - $message->topic_id = $message->getId(); - if ($message->save()) { - $this->redirectTo(array('action' => 'show_topic', 'id' => $message->getId())); - return; - } - } - } - } + if (!isset($this->group)) { + $this->addError('_common', 'Start topic error', 'please, specify group'); + return; + } + if (empty($this->params['topic']) && empty($this->params['topic']['body'])) { + $this->topic = $this->group->message->build(); + $this->topic_id = $this->topic->getId(); + } else { + $member = $this->GroupappMember->findFirst(array( + 'groupapp_group_id' => $this->group->getId(), + 'user_id' => $this->current_user->getId() + )); + if (empty($member)) { + $this->addError('_common', 'Sending message error', 'please, try again'); + return; } - $this->addError('_common', 'Sending message error', 'please, try again'); - } else if (!empty($this->params['id'])) { - if ( $group = $this->GroupappGroup->find( $this->params['id'] ) ) { - $this->topic = $group->message->build(); - $this->groupapp_group_id = $group->getId(); - $this->group_name = $group->name; - $this->topic_id = $this->topic->getId(); + + $message = $this->current_user->groupapp_message->build(); + $message->setAttributes($this->params['topic']); + $message->assign($this->group); + + if (empty($message->subject)) { $message->subject = $this->t('(no topic)'); } + + if ($message->save()) { + $message->topic_id = $message->getId(); + $message->save(); + $this->redirectToAction('show_topic', array('id' => $this->group->getId(), + 't' => $message->topic_id)); } - } else { - $this->addError('_common', 'Start topic error', 'please, specify group'); } } + function reply_to_topic () { + if (!isset($this->group) || empty($this->params['t'])) { + $this->addError('_common', 'Reply to topic error', 'please, specify topic'); + return; + } - function reply_to_topic () { - if (!empty($this->params['topic']) && - !empty($this->params['topic']['groupapp_group_id']) && - !empty($this->params['topic']['topic_id']) && - !empty($this->params['topic']['body'])) { - if ( $this->group = $this->GroupappGroup->find( $this->params['topic']['groupapp_group_id'] ) ) { - $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $this->group->getId(), - 'user_id' => $this->current_user->getId() - )); - if ($member) { - $message = $member->message->build(); - $message->setAttributes($this->params['topic']); - if ($message->save()) { - $this->redirectTo(array('action' => 'show_topic', 'id' => $message->topic_id)); - return; - } + $topic = $this->GroupappMessage->find('all', + array( + 'conditions' => array( + "groupapp_group_id" => $this->group->getId(), + "topic_id" => $this->params['t']) + ) + ); + if (empty($topic)) { + $this->addError('_common', 'Reply to topic error', 'topic not found'); + return; + } + + $member = $this->GroupappMember->findFirst(array( + 'groupapp_group_id' => $this->group->getId(), + 'user_id' => $this->current_user->getId() + ) + ); + $this->topic_id = $this->params['t']; + + if ($this->Request->isPost() && + !empty($this->params['topic']) && + !empty($this->params['topic']['body']) + ) { + if ($member) { + $message = $this->current_user->groupapp_message->build(); + $message->setAttributes($this->params['topic']); + $message->group->assign($this->group); + if ($message->save()) { + $this->redirectToAction('show_topic', array('id' => $this->group->getId(), + 't' => $message->topic_id)); } } $this->addError('_common', 'Sending message error', 'please, try again'); - } else if (!empty($this->params['id'])) { - $messages = $this->GroupappMessage->find('all', array( - 'conditions' => array("topic_id = ?", $this->params['id']) - ) - ); - if ($messages) { - $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $messages[0]->groupapp_group_id, - 'user_id' => $this->current_user->getId() - )); - $group = $this->GroupappGroup->find( $messages[0]->groupapp_group_id ); - if (($group && $group->access == 1) || $member) { - $this->messages = $messages; - $this->groupapp_group_id = $group->getId(); - $this->group_name = $group->name; - $this->topic_id = $messages[0]->topic_id; - } else { - $this->addError('_common', 'Access denied', 'Group id closed. You can\'t reply to this topic'); - } - return; + } else { + if ($this->group->access == 1 || $member) { + $this->messages = $topic; + } else { + $this->addError('_common', 'Access denied', 'Group id closed. You can\'t reply to this topic'); } } - $this->addError('_common', 'Topic not found', 'This topic is not founded'); } function reply_to_post () { - if (!empty($this->params['topic'])) { - if ( $this->group = $this->GroupappGroup->find( $this->params['topic']['groupapp_group_id'] ) ) { - $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $this->group->getId(), - 'user_id' => $this->current_user->getId() - )); - if ($member) { - $message = $member->message->build(); - $message->setAttributes($this->params['topic']); - if ($message->save()) { - $this->redirectTo(array('action' => 'show_topic', 'id' => $message->topic_id)); - return; - } + if (!isset($this->group) || empty($this->params['p'])) { + $this->addError('_common', 'Reply to post error', 'please, specify post'); + return; + } + + $message = $this->GroupappMessage->find('all', + array( + 'conditions' => array( + "groupapp_group_id" => $this->group->getId(), + "id" => $this->params['p']), + 'include' => 'user' + ) + ); + if (empty($message)) { + $this->addError('_common', 'Reply to post error', 'post not found'); + return; + } + + $member = $this->GroupappMember->findFirst(array( + 'groupapp_group_id' => $this->group->getId(), + 'user_id' => $this->current_user->getId() + ) + ); + $this->topic_id = $message[0]->topic_id; + + if ($this->Request->isPost() && + !empty($this->params['topic']) && + !empty($this->params['topic']['body']) + ) { + if ($member) { + $message = $this->current_user->groupapp_message->build(); + $message->setAttributes($this->params['topic']); + $message->group->assign($this->group); + if ($message->save()) { + $this->redirectToAction('show_topic', array('id' => $this->group->getId(), + 't' => $message->topic_id)); } + $this->addError('_common', 'Sending message error', 'please, try again'); } - $this->addError('_common', 'Sending message error', 'please, try again'); - } else if (!empty($this->params['id'])) { - $message = $this->GroupappMessage->findFirst( - array( - 'conditions' => array("id = ?", $this->params['id']), - 'include' => 'user' - ) - ); - if ($message) { - $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $message->groupapp_group_id, - 'user_id' => $this->current_user->getId() - )); - $group = $this->GroupappGroup->find( $message->groupapp_group_id ); - if (($group && $group->access == 1) || $member) { - $this->message_to_reply = $message; - $this->groupapp_group_id = $group->getId(); - $this->group_name = $group->name; - $this->topic_id = $message->topic_id; - } else { - $this->addError('_common', 'Access denied', 'Group id closed. You can\'t reply to this message'); - } - return; + } else { + if ($this->group->access == 1 || $member) { + $this->message_to_reply = $message[0]; + } else { + $this->addError('_common', 'Access denied', 'Group id closed. You can\'t reply to this message'); } } - $this->addError('_common', 'Topic not found', 'This topic is not founded'); } + function _group_picture ($group) { + return $group->stored_file_id ? + $group->picture->load()->url() : GROUPAPP_DEFAULT_PICTURE_URL; + } + } ?> Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-07-14 18:35:39 UTC (rev 287) +++ app/controllers/groupapp/group_controller.php 2008-07-15 18:39:12 UTC (rev 288) @@ -19,8 +19,7 @@ if (!empty($this->params['id']) && $this->GroupappGroup->find($this->params['id'])) { $group = $this->GroupappGroup->find( $this->params['id'] ); if (isset($group) && $group) { - $this->group_picture = $group->stored_file_id ? - $group->picture->load()->url() : GROUPAPP_DEFAULT_PICTURE_URL; + $this->group_picture = $this->_group_picture($group); $this->group = $group; $members = $this->_getGroupMembers($this->group->getId()); @@ -56,6 +55,8 @@ $this->pages_links = $links['first'] . ' ' . $links['back'] . ' ' . $links['pages'] . ' ' . $links['next'] . ' ' . $links['last']; $this->user_groups = $this->array_pagination_helper->getPageItems("user_group_pages", $user_groups); + $this->user_picture = $this->_current_user_picture(); + $this->_extract_group_types(); } @@ -88,9 +89,9 @@ function customize () { if (isset($this->group)) { $this->step = 'group_customize'; - if (!empty($this->params['group'])){ + if ($this->Request->isPost() && !empty($this->params['group'])){ $this->group->setAttributes($this->params['group']); - if ($this->Request->isPost() && $this->group->save()) { + if ($this->group->save()) { $this->step = 'group_members'; $this->redirectTo(array('action' => 'edit_members', 'id' => $this->group->getId())); return; @@ -105,7 +106,7 @@ function edit_group () { if (isset($this->group)) { $this->group->category_id = floor($this->group->type_id / 100); - if (!empty($this->params['group'])){ + if ($this->Request->isPost() && !empty($this->params['group'])){ if (isset($this->params['group']['stored_file_id']) && !empty($this->params['group']['stored_file_id']) && $this->params['group']['stored_file_id'] != $this->group->stored_file_id @@ -117,9 +118,8 @@ $this->group->picture->build(); } $this->group->setAttributes($this->params['group']); - if ($this->Request->isPost() && $this->group->save()) { - $this->group_picture = $this->group->stored_file_id ? - $this->group->picture->load()->url() : GROUPAPP_DEFAULT_PICTURE_URL; + if ($this->group->save()) { + $this->group_picture = $this->_group_picture($this->group); return; } } @@ -148,9 +148,9 @@ if (!$this->is_admin) { $this->redirectTo(array('action' => 'index')); } $this->step = 'edit_members'; - if (!empty($this->params['member'])){ + if ($this->Request->isPost() && !empty($this->params['member'])){ $this->GroupappGroup->setAttributes($this->params['member']); - if ($this->Request->isPost() && $this->GroupappGroup->save()){ + if ($this->GroupappGroup->save()){ return; } } else if (isset($this->group)) { @@ -412,6 +412,16 @@ } $this->gt = $gt; } + + function _group_picture ($group) { + return $group->stored_file_id ? + $group->picture->load()->url() : GROUPAPP_DEFAULT_PICTURE_URL; + } + + function _current_user_picture () { + return $this->current_user->basic_profile->load()->stored_file_id ? + $this->current_user->basic_profile->picture->load()->url() : USER_DEFAULT_PICTURE_URL; + } } ?> Modified: app/controllers/profile_controller.php =================================================================== --- app/controllers/profile_controller.php 2008-07-14 18:35:39 UTC (rev 287) +++ app/controllers/profile_controller.php 2008-07-15 18:39:12 UTC (rev 288) @@ -120,8 +120,27 @@ } function picture () { + $this->basic_profile = $this->current_user->basic_profile->load(); + if ($this->Request->isPost() && !empty($this->params['basic_profile'])) { + if (isset($this->params['basic_profile']['stored_file_id']) && + !empty($this->params['basic_profile']['stored_file_id']) && + $this->params['basic_profile']['stored_file_id'] != $this->basic_profile->stored_file_id + ) { + $stored_file = $this->StoredFile->findFirst(array( 'id' => $this->params['basic_profile']['stored_file_id'] )); + $this->basic_profile->picture->assign($stored_file); + } else { + $this->basic_profile->stored_file_id = NULL; + $this->basic_profile->picture->build(); + } + $this->basic_profile->setAttributes($this->params['basic_profile']); + if (!$this->basic_profile->save()) { + $this->importErrors( $this->Profile->getErrors() ); + return; + } + } + $this->user_picture = $this->basic_profile->stored_file_id ? + $this->basic_profile->picture->load()->url() : USER_DEFAULT_PICTURE_URL; } - } ?> \ No newline at end of file Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-07-14 18:35:39 UTC (rev 287) +++ app/installers/user_installer.php 2008-07-15 18:39:12 UTC (rev 288) @@ -197,6 +197,7 @@ `city_other` char(100), `country_id` int(11), `birthdate` date DEFAULT NULL, + `stored_file_id` int(11) DEFAULT NULL, `political_view_id` int(11), `religious_view_id` int(11), `created_at` datetime NOT NULL, @@ -207,6 +208,7 @@ FOREIGN KEY (country_id) REFERENCES countries(id), FOREIGN KEY (political_view_id) REFERENCES political_views(id), FOREIGN KEY (religious_view_id) REFERENCES religious_views(id), + FOREIGN KEY (stored_file_id) REFERENCES base_files(id), INDEX user_idx (user_id) ) ENGINE=InnoDB"); Modified: app/locales/groupapp/group/ru.php =================================================================== --- app/locales/groupapp/group/ru.php 2008-07-14 18:35:39 UTC (rev 287) +++ app/locales/groupapp/group/ru.php 2008-07-15 18:39:12 UTC (rev 288) @@ -93,15 +93,6 @@ 'Это засекреченная группа. Эта группа не будет отображаться в результатах поиска или в профилях своих участников.'; $dictionary['Publicize'] = 'Опубликовать'; $dictionary['Show this group in search results'] = 'Показывать эту группу в результатах поиска'; -$dictionary['Current picture'] = 'Текущее изображение'; -$dictionary['Upload Picture'] = 'Загрузить изображение'; -$dictionary['You can upload a JPG, GIF or PNG file'] = 'Вы можете загрузить изображение в формате JPG, GIF или PNG'; -$dictionary['I certify that I have the right to distribute this picture and that it does not violate the'] = 'Подтверждаю то, что я обладаю правами на распространение этого изображения и оно не нарушает'; -$dictionary['Terms of Use'] = 'Условия пользования'; -$dictionary['Remove Picture'] = 'Удалить изображение'; -$dictionary['You can remove this picture, but be sure to upload another or we will display a question mark in its place'] = 'Вы можете удалить текущее изображение, но не забудьте загрузить другое или на этом месте появится картинка, используемая по-умолчанию для групп'; -$dictionary['Note'] = 'Примечание'; -$dictionary['to preserve the new images do not forget to save the parameters group'] = 'для сохранения нового изображения не забудьте сохранить параметры группы'; $dictionary['Invite people to group'] = 'Пригласить людей в группу'; $dictionary['Show'] = 'Показать'; Modified: app/locales/layout/ru.php =================================================================== --- app/locales/layout/ru.php 2008-07-14 18:35:39 UTC (rev 287) +++ app/locales/layout/ru.php 2008-07-15 18:39:12 UTC (rev 288) @@ -20,6 +20,9 @@ $dictionary['edit'] = 'настроить'; $dictionary['Friends'] = 'Друзья'; $dictionary['Messages'] = 'Сообщения'; +$dictionary['friends'] = 'друзья'; +$dictionary['groups'] = 'группы'; +$dictionary['All'] = 'Все'; $dictionary['Save Changes'] = 'Сохранить'; $dictionary['Save'] = 'Сохранить'; @@ -49,4 +52,14 @@ $dictionary['Address field'] = 'Домашний адрес'; $dictionary['Website field'] = 'URL веб сайта'; +$dictionary['Current picture'] = 'Текущее изображение'; +$dictionary['Upload Picture'] = 'Загрузить изображение'; +$dictionary['You can upload a JPG, GIF or PNG file'] = 'Вы можете загрузить изображение в формате JPG, GIF или PNG'; +$dictionary['I certify that I have the right to distribute this picture and that it does not violate the'] = 'Подтверждаю то, что я обладаю правами на распространение этого изображения и оно не нарушает'; +$dictionary['Terms of Use'] = 'Условия пользования'; +$dictionary['Remove Picture'] = 'Удалить изображение'; +$dictionary['You can remove this picture, but be sure to upload another or we will display a question mark in its place'] = 'Вы можете удалить текущее изображение, но не забудьте загрузить другое или на этом месте появится картинка, используемая по-умолчанию'; +$dictionary['Note'] = 'Примечание'; +$dictionary['to preserve the new images do not forget to save the parameters group'] = 'для сохранения нового изображения не забудьте сохранить параметры группы'; +$dictionary['to preserve the new images do not forget to save the user profile'] = 'для сохранения нового изображения не забудьте сохранить профиль пользователя'; ?> Modified: app/models/basic_profile.php =================================================================== --- app/models/basic_profile.php 2008-07-14 18:35:39 UTC (rev 287) +++ app/models/basic_profile.php 2008-07-15 18:39:12 UTC (rev 288) @@ -2,7 +2,9 @@ class BasicProfile extends ActiveRecord { - var $belongs_to = array('User', 'City', 'PoliticalView', 'ReligiousView', 'Sex'); + var $belongs_to = array('User', 'City', 'PoliticalView', 'ReligiousView', 'Sex', + 'picture' => array('class_name' => 'StoredFile', + 'primary_key_name' => 'stored_file_id')); } ?> Modified: app/models/groupapp_message.php =================================================================== --- app/models/groupapp_message.php 2008-07-14 18:35:39 UTC (rev 287) +++ app/models/groupapp_message.php 2008-07-15 18:39:12 UTC (rev 288) @@ -8,6 +8,7 @@ 'foreign_key' => 'groupapp_group_id') ); + /* function validateOnCreate () */ /* { */ /* $this->validatesPresenceOf('name', 'Name is missing|please enter the name'); */ Modified: app/models/user.php =================================================================== --- app/models/user.php 2008-07-14 18:35:39 UTC (rev 287) +++ app/models/user.php 2008-07-15 18:39:12 UTC (rev 288) @@ -18,6 +18,8 @@ 'foreign_key' => 'user_id'), 'work_profiles' => array('class_name' => 'WorkProfile', 'foreign_key' => 'user_id'), + 'groupapp_messages' => array('class_name' => 'GroupappMessage', + 'foreign_key' => 'user_id'), ); var $has_and_belongs_to_many = array('groupapp_groups' => array('join_table' => 'groupapp_members')); Modified: app/views/groupapp/board/_head.tpl =================================================================== --- app/views/groupapp/board/_head.tpl 2008-07-14 18:35:39 UTC (rev 287) +++ app/views/groupapp/board/_head.tpl 2008-07-15 18:39:12 UTC (rev 288) @@ -1,6 +1,6 @@ <div class="title_bar"> <div class="avatar"> - <a href="/profile/show/"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> + <a href="/profile/show/"><img src="/preview/50x50/{group_picture}"></a> </div> <div class="info"> <div class="header"> Modified: app/views/groupapp/board/_menu.tpl =================================================================== --- app/views/groupapp/board/_menu.tpl 2008-07-14 18:35:39 UTC (rev 287) +++ app/views/groupapp/board/_menu.tpl 2008-07-15 18:39:12 UTC (rev 288) @@ -5,11 +5,11 @@ if ($controller->getActionName() == 'show_topic' || $controller->getActionName() == 'reply_to_topic' || $controller->getActionName() == 'reply_to_post' - ) { ?><li><a href="/groupapp/board/show_topic/{topic_id?}" class="<?= $controller->getActionName() == 'show_topic' ? 'last selected' : '' ?>" >_{Topic View}</a></li><? } ?><? + ) { ?><li><a href="/groupapp/board/show_topic/{group.id}/?t={topic_id?}" class="<?= $controller->getActionName() == 'show_topic' ? 'last selected' : '' ?>" >_{Topic View}</a></li><? } ?><? if ($controller->getActionName() == 'reply_to_topic') { ?> - <li><a href="/groupapp/board/reply_to_topic/{topic_id?}" class="last selected">_{Post Reply}</a></li> <? } + <li><a href="/groupapp/board/reply_to_topic/{group.id}/?t={topic_id?}" class="last selected">_{Post Reply}</a></li> <? } else if ($controller->getActionName() == 'reply_to_post') { ?> - <li><a href="/groupapp/board/reply_to_post/{message_to_reply.id?}" class="last selected">_{Post Reply}</a></li> + <li><a href="/groupapp/board/reply_to_post/{group.id}/?p={message_to_reply.id?}" class="last selected">_{Post Reply}</a></li> <? } ?> </ul> </div> Modified: app/views/groupapp/board/reply_to_post.tpl =================================================================== --- app/views/groupapp/board/reply_to_post.tpl 2008-07-14 18:35:39 UTC (rev 287) +++ app/views/groupapp/board/reply_to_post.tpl 2008-07-15 18:39:12 UTC (rev 288) @@ -6,7 +6,7 @@ <div class="submenu"> <div class="menu_block"> - <div class="header">_{Topic}: <a href="/groupapp/board/show_topic/{message_to_reply.topic_id}">{message_to_reply.subject?}</a></div> + <div class="header">_{Topic}: <a href="/groupapp/board/show_topic/{group.id}/?t={message_to_reply.topic_id}">{message_to_reply.subject?}</a></div> </div> </div> <div class="clearfix"></div> @@ -17,14 +17,15 @@ </div> <div class="avatar"> - <a href="/profile/show/{message_to_reply.user_id?}"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> + <? $user_picture = $message_to_reply->user->basic_profile->load()->stored_file_id ? $message_to_reply->user->basic_profile->picture->load()->url() : USER_DEFAULT_PICTURE_URL; ?> + <a href="/profile/show/{message_to_reply.user_id}"><img src="/preview/50x50/{user_picture}"></a> </div> <div class="message"> <div class="head"> <span class="sender"> - <? if ($current_user->getId() == $message_to_reply->user_id) { ?><span class="current_user">_{You}</span> - <? } else { ?><a href="/profile/show/{message_to_reply.user_id?}"><span class="other_user">{message_to_reply.user.name?}</span></a><? } ?> + <? if ($current_user->getId() == $message_to_reply->user_id): ?><span class="current_user">_{You}</span> + <? else: ?><a href="/profile/show/{message_to_reply.user_id?}"><span class="other_user">{message_to_reply.user.name?}</span></a><? endif ?> </span> _{wrote} <div class="subtext">{message_to_reply.created_at?}</div> @@ -38,7 +39,7 @@ <div class="clearfix"></div> <div class="board_from_background"> -<form action="/groupapp/board/reply_to_topic/{message_to_reply.topic_id?}" method="post"> +<form action="/groupapp/board/reply_to_topic/{group.id}/?t={message_to_reply.topic_id?}" method="post"> <div class="editform"> <div class="formrow"> <label> </label><span class="label">_{Your reply}</span><br> @@ -46,10 +47,9 @@ </div> <div class="formrow"> <label> - <?= $form_helper->hidden_field('topic', 'groupapp_group_id', array('value' => $message_to_reply->groupapp_group_id))?> - <?= $form_helper->hidden_field('topic', 'topic_id', array('value' => $message_to_reply->topic_id))?> - <?= $form_helper->hidden_field('topic', 'subject', array('value' => $message_to_reply->subject))?> - <?= $form_helper->hidden_field('topic', 'reply_message_id', array('value' => $message_to_reply->getId()))?> + <?= $form_helper->hidden_field('topic', 'topic_id', array('value' => $message_to_reply->topic_id)) ?> + <?= $form_helper->hidden_field('topic', 'subject', array('value' => $message_to_reply->subject)) ?> + <?= $form_helper->hidden_field('topic', 'reply_message_id', array('value' => $message_to_reply->getId())) ?> </label> <input class="submitinput" type="submit" value="_{Post reply}"> <input class="cancelinput" type="button" value="_{Cancel}"> Modified: app/views/groupapp/board/reply_to_topic.tpl =================================================================== --- app/views/groupapp/board/reply_to_topic.tpl 2008-07-14 18:35:39 UTC (rev 287) +++ app/views/groupapp/board/reply_to_topic.tpl 2008-07-15 18:39:12 UTC (rev 288) @@ -6,13 +6,13 @@ <div class="submenu"> <div class="menu_block"> - <div class="header">_{Topic}: <a href="/groupapp/board/show_topic/{messages-0.topic_id}">{messages-0.subject?}</a></div> + <div class="header">_{Topic}: <a href="/groupapp/board/show_topic/{group.id}/?t={messages-0.topic_id}">{messages-0.subject?}</a></div> </div> </div> <div class="clearfix"></div> <div class="board_from_background"> -<form action="/groupapp/board/reply_to_topic/{messages-0.topic_id?}" method="post"> +<form action="/groupapp/board/reply_to_topic/{group.id}/?t={messages-0.topic_id?}" method="post"> <div class="editform"> <div class="formrow"> <label> </label><span class="label">_{Your reply}</span><br> @@ -20,7 +20,6 @@ </div> <div class="formrow"> <label> - <?= $form_helper->hidden_field('topic', 'groupapp_group_id', array('value' => $messages[0]->groupapp_group_id))?> <?= $form_helper->hidden_field('topic', 'topic_id', array('value' => $messages[0]->topic_id))?> <?= $form_helper->hidden_field('topic', 'subject', array('value' => $messages[0]->subject))?> </label> Modified: app/views/groupapp/board/show_topic.tpl =================================================================== --- app/views/groupapp/board/show_topic.tpl 2008-07-14 18:35:39 UTC (rev 287) +++ app/views/groupapp/board/show_topic.tpl 2008-07-15 18:39:12 UTC (rev 288) @@ -4,11 +4,11 @@ <div class="submenu"> <div class="menu_block"> - <div class="header">_{Topic}: <a href="/groupapp/board/show_topic/{messages-0.topic_id}">{messages-0.subject?}</a></div> + <div class="header">_{Topic}: <a href="/groupapp/board/show_topic/{group.id}/?t={messages-0.topic_id}">{messages-0.subject?}</a></div> </div> <div class="menu_block right"> - <a href="/groupapp/board/reply_to_topic/{messages-0.topic_id?}">_{Reply to Topic}</a> + <a href="/groupapp/board/reply_to_topic/{group.id}/?t={messages-0.topic_id?}">_{Reply to Topic}</a> </div> </div> @@ -22,7 +22,7 @@ <div class="actions"> <ul class="actions_list"> - <li><a href="/groupapp/board/reply_to_post/{message.id?}">_{Reply} <? if ($current_user->getId() == $message->user_id) echo $text_helper->translate('to Your Post'); ?></a></li> + <li><a href="/groupapp/board/reply_to_post/{group.id}/?p={message.id?}">_{Reply} <? if ($current_user->getId() == $message->user_id) echo $text_helper->translate('to Your Post'); ?></a></li> <? if ($current_user->getId() != $message->user_id) { ?> <li><a href="#">_{Mark as Irrelevant}</a></li> <li><a href="#">_{Report}</a></li> @@ -32,7 +32,8 @@ </div> <div class="avatar"> - <a href="/profile/show/{message.user_id?}"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> + <? $user_picture = $message->user->basic_profile->load()->stored_file_id ? $message->user->basic_profile->picture->load()->url() : USER_DEFAULT_PICTURE_URL; ?> + <a href="/profile/show/{message.user.id}"><img src="/preview/50x50/{user_picture}"></a> <div class="subtext">#{message_loop_counter}</div> <?= $form_helper->hidden_field('message_id', $message->id, array('value' => $message_loop_counter))?> </div> Modified: app/views/groupapp/group/_picture_upload.tpl =================================================================== --- app/views/groupapp/group/_picture_upload.tpl 2008-07-14 18:35:39 UTC (rev 287) +++ app/views/groupapp/group/_picture_upload.tpl 2008-07-15 18:39:12 UTC (rev 288) @@ -54,7 +54,7 @@ </div> <div class="right_big"> - <div class="left_content"> + <div class="right_content"> <div class="upload_picture"> @@ -70,9 +70,9 @@ <?= $form_helper->file_field('upload', 'photo', array('class' => 'textinput small')) ?> </div> - <div class="filter_name certify"> - <?= $form_helper->check_box('upload', 'certify', array('onclick' => "onCertifyClick(this)")) ?> - <label for="group_certify">_{I certify that I have the right to distribute this picture and that it does not violate the} <a href="#">_{Terms of Use}</a>.</label> + <div class="certify"> + <?= $form_helper->check_box('picture', 'certify', array('onclick' => "onCertifyClick(this)")) ?> + <label for="picture_certify">_{I certify that I have the right to distribute this picture and that it does not violate the} <a href="#">_{Terms of Use}</a>.</label> </div> <div class="upload_submit"> Modified: app/views/groupapp/group/edit_members.tpl =================================================================== --- app/views/groupapp/group/edit_members.tpl 2008-07-14 18:35:39 UTC (rev 287) +++ app/views/groupapp/group/edit_members.tpl 2008-07-15 18:39:12 UTC (rev 288) @@ -43,7 +43,7 @@ {?group_members}{loop group_members} <? if ($group_member->groupapp_member_role_id == 1): ?> <li> - <span class="member_name"><a href="/profile/show/{group_member.id}">{group_member.user.name}</a></span> + <span class="member_name"><a href="/profile/show/{group_member.user_id}">{group_member.user.name}</a></span> <span class="change_status"> <a href="#" onclick="change_member_status(this, {group.id}, 'moderators_list', {group_member.groupapp_member_role_id}); return false;" name="{group_member.id}">_{change status}</a> </span> @@ -66,7 +66,7 @@ {?group_members}{loop group_members} <? if ($group_member->groupapp_member_role_id == 2): ?> <li> - <span class="member_name"><a href="/profile/show/{group_member.id}">{group_member.user.name}</a></span> + <span class="member_name"><a href="/profile/show/{group_member.user_id}">{group_member.user.name}</a></span> <span class="change_status"> <a href="#" onclick="change_member_status(this, {group.id}, 'moderators_list', {group_member.groupapp_member_role_id}); return false;" name="{group_member.id}">_{change status}</a> </span> @@ -89,7 +89,7 @@ {?group_members}{loop group_members} <? if ($group_member->groupapp_member_role_id == 3): ?> <li> - <span class="member_name"><a href="/profile/show/{group_member.id}">{group_member.user.name}</a></span> + <span class="member_name"><a href="/profile/show/{group_member.user_id}">{group_member.user.name}</a></span> <span class="change_status"> <a href="#" onclick="change_member_status(this, {group.id}, 'moderators_list', {group_member.groupapp_member_role_id}); return false;" name="{group_member.id}">_{change status}</a> </span> @@ -113,7 +113,7 @@ <? if ($group_member->groupapp_member_role_id == 4): ?> <li> <span class="member_name"> - <a href="/profile/show/{group_member.id}">{group_member.user.name}</a> + <a href="/profile/show/{group_member.user_id}">{group_member.user.name}</a> </span> <span class="change_status"> <a href="#" onclick="change_member_status(this, {group.id}, 'moderators_list', {group_member.groupapp_member_role_id}); return false;" name="{group_member.id}">_{change status}</a> Modified: app/views/groupapp/group/index.tpl =================================================================== --- app/views/groupapp/group/index.tpl 2008-07-14 18:35:39 UTC (rev 287) +++ app/views/groupapp/group/index.tpl 2008-07-15 18:39:12 UTC (rev 288) @@ -4,7 +4,7 @@ <div class="title_bar"> <div class="avatar"> - <a href="/profile/show/"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> + <a href="/profile/show/"><img src="/preview/50x50/{user_picture}" alt="" class=""></a> </div> <div class="info"> <div class="header"> Modified: app/views/groupapp/group/show_group.tpl =================================================================== --- app/views/groupapp/group/show_group.tpl 2008-07-14 18:35:39 UTC (rev 287) +++ app/views/groupapp/group/show_group.tpl 2008-07-15 18:39:12 UTC (rev 288) @@ -153,9 +153,10 @@ <div class="body"> {?group_members} {loop group_members} + <? $user_picture = $group_member->user->basic_profile->load()->stored_file_id ? $group_member->user->basic_profile->picture->load()->url() : USER_DEFAULT_PICTURE_URL; ?> <span class="member_ceil"> - <a href="/profile/show/{group_member.user.id?}"> - <img src="/preview/70x70//images/nophoto_men_sm.gif"><br>{group_member.user.name?} + <a href="/profile/show/{group_member.user.id}"> + <img src="/preview/70x70/{user_picture}"><br>{group_member.user.name?} </a> </span> <? if ($group_member_loop_counter >= 5) break; ?> Modified: app/views/layouts/application.tpl =================================================================== --- app/views/layouts/application.tpl 2008-07-14 18:35:39 UTC (rev 287) +++ app/views/layouts/application.tpl 2008-07-15 18:39:12 UTC (rev 288) @@ -7,6 +7,7 @@ <link href="/stylesheets/dialog.css" rel="stylesheet" type="text/css"> <link href="/stylesheets/Application.css" rel="stylesheet" type="text/css"> <link href="/stylesheets/friend_selector.css" rel="stylesheet" type="text/css"> +<link href="/stylesheets/upload_picture.css" rel="stylesheet" type="text/css"> <? if ($controller->getModuleName()) : ?> <link href="/stylesheets/<?= $controller->getModuleName() . '/' . ucfirst($controller->getModuleName()) ?>.css" rel="stylesheet" type="text/css"> <? endif ?> Modified: app/views/profile/picture.tpl =================================================================== --- app/views/profile/picture.tpl 2008-07-14 18:35:39 UTC (rev 287) +++ app/views/profile/picture.tpl 2008-07-15 18:39:12 UTC (rev 288) @@ -2,4 +2,133 @@ <?= $controller->renderErrors() ?> -<p class="indent">Coming soon</p> \ No newline at end of file +<script type="text/javascript"> + function startCallback() { + return true; + } + + function completeCallback(response) { + $('upload_photo').value = ''; + var uploaded = response.evalJSON(true); + if (uploaded.length) { + $('current_picture').innerHTML = '<img src="/preview/200x200/' + uploaded[0].url + '">'; + $('basic_profile_stored_file_id').value = uploaded[0].id; + $('picture_note').show(); + } + } + + function onCertifyClick (el) { + if (el.checked) { + $('upload_submit_btn').enable(); + $('upload_submit_btn').writeAttribute('class', 'submitinput'); + } else { + $('upload_submit_btn').disable(); + $('upload_submit_btn').writeAttribute('class', 'cancelinput'); + } + } + + function removePicture() { + <? $default_picture = USER_DEFAULT_PICTURE_URL; ?> + $('current_picture').innerHTML = '<img src="/preview/200x200/{default_picture}">'; + $('basic_profile_stored_file_id').value = ''; + $('picture_note').show(); + } + +</script> + +<form enctype="multipart/form-data" method="post" id="picture_upload_form" action="/upload" onsubmit="return AIM.submit(this, {'onStart' : startCallback, 'onComplete' : completeCallback})"> + +<div class="picture"> + <div class="two_column"> + + <div class="left_small"> + <div class="left_content"> + + <div class="imghead">_{Current picture}:<br><br> + <div id="current_picture"> + <img src="/preview/200x200/{user_picture}"> + </div> + </div> + + <div class="note" id="picture_note" style="display: none"> + <strong>_{Note}</strong>: _{to preserve the new images do not forget to save the user profile}! + </div> + + </div> + </div> + + <div class="right_big"> + <div class="right_content"> + + <div class="upload_picture"> + + <div class="upload_title"> + _{Upload Picture} + </div> + + <div class="upload_text"> + _{You can upload a JPG, GIF or PNG file}. + </div> + + <div class="upload_field"> + <?= $form_helper->file_field('upload', 'photo', array('class' => 'textinput small')) ?> + </div> + + <div class="certify"> + <?= $form_helper->check_box('picture', 'certify', array('onclick' => "onCertifyClick(this)")) ?> + <label for="picture_certify">_{I certify that I have the right to distribute this picture and that it does not violate the} <a href="#">_{Terms of Use}</a>.</label> + </div> + + <div class="upload_submit"> + <input class="cancelinput" type="submit" value="_{Upload Picture}" disabled="disabled" id="upload_submit_btn" name="upload_submit_btn" /> + </div> + + {?basic_profile.stored_file_id} + <div class="spacer"> </div> + <div class="upload_title"> + _{Remove Picture} + </div> + + <div class="upload_text"> + _{You can remove this picture, but be sure to upload another or we will display a question mark in its place}. + </div> + + <div class="upload_submit"> + <input class="submitinput" type="button" value="_{Remove Picture}" id="remove_submit_btn" name="remove_submit_btn" onclick="removePicture()" /> + </div> + {end} + + </div> + + </div> + </div> + + </div> + <div class="clearfix"></div> +</div> +</form> + +<form id="profile_picture_form" action="/profile/picture" method="post"> + <div class="two_column"> + <div class="left_small"> + <div class="left_content"> + + </div> + </div> + + <div class="right_big"> + <div class="right_content"> + + <div class="upload_picture"> + <?= $form_helper->hidden_field('basic_profile', 'stored_file_id') ?> + <div class="upload_submit"> + <input class="submitinput" type="submit" value="_{Save Changes}"> + </div> + </div> + + </div> + </div> + + <div class="clearfix"></div> + </div> +</form> Modified: public/stylesheets/friend_selector.css =================================================================== --- public/stylesheets/friend_selector.css 2008-07-14 18:35:39 UTC (rev 287) +++ public/stylesheets/friend_selector.css 2008-07-15 18:39:12 UTC (rev 288) @@ -25,11 +25,11 @@ background: #ffffff; border-bottom: 1px solid #cccccc; padding: 3px 2px 3px 2px; + height: 30px; } .friend_selector .content .friend_row.first { border-top: 1px solid #cccccc; - } .friend_selector .content .friend_row .friend_check { Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-07-14 18:35:39 UTC (rev 287) +++ public/stylesheets/groupapp/Group.css 2008-07-15 18:39:12 UTC (rev 288) @@ -245,45 +245,6 @@ padding: 10px 0px 3px 0px; } -.imghead { - color: #333333; - font-weight: bold; - font-size: 12px; - text-align: center; - padding: 0px 10px 20px 10px; -} - -.upload_picture { - padding: 0px 10px 20px 10px; -} - -.upload_picture .upload_title { - color: #333333; - font-weight: bold; - font-size: 13px; - border-bottom: solid 1px #6d84b4; - padding: 0px 0px 5px 0px; -} - -.upload_picture .upload_text { - padding: 10px 0px 10px 0px; -} - -.note { - font-size: 11px; - color: #ff5f5f; - margin: 0px 5px 10px 10px; -} - -.filter_name.certify { - padding: 10px 0px 10px 0px; -} - -.spacer { - dislay: block; - height: 20px; -} - .member_ceil { width: 80px; padding: 5px; Added: public/stylesheets/upload_picture.css =================================================================== --- public/stylesheets/upload_picture.css (rev 0) +++ public/stylesheets/upload_picture.css 2008-07-15 18:39:12 UTC (rev 288) @@ -0,0 +1,42 @@ +.imghead { + color: #333333; + font-weight: bold; + font-size: 12px; + text-align: center; + padding: 0px 10px 20px 10px; +} + +.upload_picture { + padding: 0px 10px 20px 10px; +} + +.upload_picture .upload_title { + color: #333333; + font-weight: bold; + font-size: 13px; + border-bottom: solid 1px #6d84b4; + padding: 0px 0px 5px 0px; +} + +.upload_picture .upload_text { + padding: 10px 0px 10px 0px; +} + +.certify { + color: #777777; + font-weight: bold; + font-size: 12px; + padding: 10px 0px 10px 0px; +} + +.note { + font-size: 11px; + color: #ff5f5f; + margin: 0px 5px 10px 10px; +} + +.spacer { + dislay: block; + height: 20px; +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |