Thread: [Isocial-svn] SF.net SVN: isocial: [124] (Page 2)
Status: Pre-Alpha
Brought to you by:
aguidrevitch
From: <di...@us...> - 2008-04-17 09:44:43
|
Revision: 124 http://isocial.svn.sourceforge.net/isocial/?rev=124&view=rev Author: dim0s77 Date: 2008-04-17 02:36:18 -0700 (Thu, 17 Apr 2008) Log Message: ----------- Use the same templates for common operations Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/locales/groupapp/group/ru.php app/views/groupapp/group/_editbar.tpl app/views/groupapp/group/create.tpl app/views/groupapp/group/customize.tpl app/views/groupapp/group/edit_customize.tpl app/views/groupapp/group/edit_info.tpl app/views/groupapp/group/edit_members.tpl app/views/groupapp/group/edit_moderators.tpl public/stylesheets/groupapp/Group.css Added Paths: ----------- app/views/groupapp/group/_customize.tpl app/views/groupapp/group/_info.tpl app/views/groupapp/group/group_info.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-04-17 09:01:04 UTC (rev 123) +++ app/controllers/groupapp/group_controller.php 2008-04-17 09:36:18 UTC (rev 124) @@ -70,6 +70,12 @@ $this->importErrors( $this->GroupappGroup->getErrors() ); } + function group_info () { + if (!empty($this->params['id']) && $this->GroupappGroup->find($this->params['id'])) { + $this->group = $this->GroupappGroup->find($this->params['id']); + } + } + function browse () { } Modified: app/locales/groupapp/group/ru.php =================================================================== --- app/locales/groupapp/group/ru.php 2008-04-17 09:01:04 UTC (rev 123) +++ app/locales/groupapp/group/ru.php 2008-04-17 09:36:18 UTC (rev 124) @@ -17,10 +17,11 @@ $dictionary['Search Groups'] = 'Поиск групп'; $dictionary['Step'] = 'Шаг'; -$dictionary['Group Info'] = 'Информация о группе'; +$dictionary['Group Info'] = 'Инфо о группе'; $dictionary['Customize'] = 'Дополнительно'; $dictionary['Members'] = 'Участники'; $dictionary['Moderators'] = 'Модераторы'; +$dictionary['Back to'] = 'Обратно в'; $dictionary['Group Name'] = 'Название группы'; $dictionary['Description'] = 'Описание'; Added: app/views/groupapp/group/_customize.tpl =================================================================== --- app/views/groupapp/group/_customize.tpl (rev 0) +++ app/views/groupapp/group/_customize.tpl 2008-04-17 09:36:18 UTC (rev 124) @@ -0,0 +1,145 @@ + <div class="formrow"> + <?= $controller->renderErrors() ?> + </div> + + <div class="picture"></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')) ?> _{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', 'show_discussion_board', array('class' => 'checkboxinput')) ?> _{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', '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_photos', array('class' => 'checkboxinput')) ?> _{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', '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> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label> </label> + <div class="formcol"> + <label class="checkbox"><?= $form_helper->check_box('group', 'show_videos', array('class' => 'checkboxinput')) ?> _{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', '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> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label>_{Access}:</label> + <div class="formcol"> + <label class="radiobutton"><?= $form_helper->radio_button('group', 'access', '0', 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', '1') ?> _{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', '2') ?> _{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', '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="_{Save Changes}"> + <input class="cancelinput" type="button" value="_{Cancel}"> + </div> + <div class="clearfix"></div> + </div> + <div class="clearfix"></div> + Modified: app/views/groupapp/group/_editbar.tpl =================================================================== --- app/views/groupapp/group/_editbar.tpl 2008-04-17 09:01:04 UTC (rev 123) +++ app/views/groupapp/group/_editbar.tpl 2008-04-17 09:36:18 UTC (rev 124) @@ -1,11 +1,16 @@ <div class="minitabs"> <div class="left"> <ul class="toggle_minitabs"> - <li class="first"><a href="/groupapp/group/edit_info/{group.id?}" class="<?= $step == 'edit_info' ? 'selected' : '' ?>">_{Group Info}</a> + <li><a href="/groupapp/group/edit_info/{group.id?}" class="<?= $step == 'edit_info' ? 'selected' : '' ?>">_{Group Info}</a> </li><li><a href="/groupapp/group/edit_customize/{group.id?}" class="<?= $step == 'edit_customize' ? 'selected' : '' ?>">_{Customize}</a> </li><li><a href="/groupapp/group/edit_moderators/{group.id?}" class="<?= $step == 'edit_moderators' ? 'selected' : '' ?>">_{Moderators}</a> </li><li><a href="/groupapp/group/edit_members/{group.id?}" class="<?= $step == 'edit_members' ? 'selected' : '' ?>">_{Members}</a></li> </ul> </div> + <div class="right"> + <ul class="toggle_minitabs"> + <li><a href="/groupapp/group/group_info/{group.id?}">_{Back to} {group.name?}</a></li> + </ul> + </div> </div> <div class="clearfix"> </div> Added: app/views/groupapp/group/_info.tpl =================================================================== --- app/views/groupapp/group/_info.tpl (rev 0) +++ app/views/groupapp/group/_info.tpl 2008-04-17 09:36:18 UTC (rev 124) @@ -0,0 +1,42 @@ + <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> Modified: app/views/groupapp/group/create.tpl =================================================================== --- app/views/groupapp/group/create.tpl 2008-04-17 09:01:04 UTC (rev 123) +++ app/views/groupapp/group/create.tpl 2008-04-17 09:36:18 UTC (rev 124) @@ -14,49 +14,8 @@ <form action="/groupapp/group/create/{id}" method="post"> <table class="editor"> <tbody> + <?= $controller->renderPartial("info") ?> <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}"> Modified: app/views/groupapp/group/customize.tpl =================================================================== --- app/views/groupapp/group/customize.tpl 2008-04-17 09:01:04 UTC (rev 123) +++ app/views/groupapp/group/customize.tpl 2008-04-17 09:36:18 UTC (rev 124) @@ -2,7 +2,7 @@ <div class="title_bar"> <div class="head"> - <div class="name groupapp">_{Edit} {group_name?}</div> + <div class="name groupapp">_{Edit} {group.name?}</div> </div> </div> <div class="clearfix"></div> @@ -11,151 +11,7 @@ <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')) ?> _{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', 'show_discussion_board', array('class' => 'checkboxinput')) ?> _{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', '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_photos', array('class' => 'checkboxinput')) ?> _{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', '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> - <div class="clearfix"></div> - </div> - - <div class="formrow"> - <label> </label> - <div class="formcol"> - <label class="checkbox"><?= $form_helper->check_box('group', 'show_videos', array('class' => 'checkboxinput')) ?> _{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', '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> - <div class="clearfix"></div> - </div> - - <div class="formrow"> - <label>_{Access}:</label> - <div class="formcol"> - <label class="radiobutton"><?= $form_helper->radio_button('group', 'access', '0', 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', '1') ?> _{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', '2') ?> _{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', '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="_{Save Changes}"> - <input class="cancelinput" type="button" value="_{Cancel}"> - </div> - <div class="clearfix"></div> - </div> - <div class="clearfix"></div> - + <?= $controller->renderPartial("customize") ?> </form> </div> Modified: app/views/groupapp/group/edit_customize.tpl =================================================================== --- app/views/groupapp/group/edit_customize.tpl 2008-04-17 09:01:04 UTC (rev 123) +++ app/views/groupapp/group/edit_customize.tpl 2008-04-17 09:36:18 UTC (rev 124) @@ -1,5 +1,3 @@ -<?= $controller->renderPartial("menu") ?> - <div class="title_bar"> <div class="head"> <div class="name groupapp">_{Edit} {group_name?}</div> @@ -8,3 +6,9 @@ <div class="clearfix"></div> <?= $controller->renderPartial("editbar") ?> + +<div class="editform"> + <form action="/groupapp/group/edit_customize/{group.id?}" method="post"> + <?= $controller->renderPartial("customize") ?> + </form> +</div> Modified: app/views/groupapp/group/edit_info.tpl =================================================================== --- app/views/groupapp/group/edit_info.tpl 2008-04-17 09:01:04 UTC (rev 123) +++ app/views/groupapp/group/edit_info.tpl 2008-04-17 09:36:18 UTC (rev 124) @@ -1,5 +1,3 @@ -<?= $controller->renderPartial("menu") ?> - <div class="title_bar"> <div class="head"> <div class="name groupapp">_{Edit} {group_name?}</div> @@ -8,3 +6,22 @@ <div class="clearfix"></div> <?= $controller->renderPartial("editbar") ?> + +<div class="form_editor"> + <?= $controller->renderErrors() ?> + <form action="/groupapp/group/edit_info/{id}" method="post"> + <table class="editor"> + <tbody> + <?= $controller->renderPartial("info") ?> + <tr> + <td class="tlabel"> </td> + <td class="tsubmit"> + <input class="submitinput" type="submit" value="_{Save Changes}"> + <input class="cancelinput" type="button" value="_{Cancel}"> + </td> + </tr> + </tbody> + </table> + </form> +</div> +<div class="clearfix"></div> Modified: app/views/groupapp/group/edit_members.tpl =================================================================== --- app/views/groupapp/group/edit_members.tpl 2008-04-17 09:01:04 UTC (rev 123) +++ app/views/groupapp/group/edit_members.tpl 2008-04-17 09:36:18 UTC (rev 124) @@ -1,5 +1,3 @@ -<?= $controller->renderPartial("menu") ?> - <div class="title_bar"> <div class="head"> <div class="name groupapp">_{Invite people to} {group_name?}</div> Modified: app/views/groupapp/group/edit_moderators.tpl =================================================================== --- app/views/groupapp/group/edit_moderators.tpl 2008-04-17 09:01:04 UTC (rev 123) +++ app/views/groupapp/group/edit_moderators.tpl 2008-04-17 09:36:18 UTC (rev 124) @@ -1,5 +1,3 @@ -<?= $controller->renderPartial("menu") ?> - <div class="title_bar"> <div class="head"> <div class="name groupapp">_{Invite people to} {group_name?}</div> 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-04-17 09:36:18 UTC (rev 124) @@ -0,0 +1 @@ +<?= $controller->renderPartial("menu") ?> \ No newline at end of file Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-04-17 09:01:04 UTC (rev 123) +++ public/stylesheets/groupapp/Group.css 2008-04-17 09:36:18 UTC (rev 124) @@ -126,10 +126,10 @@ .editor td.tsubmit { padding: 5px 10px 5px 20px; - border-bottom: solid 1px #cccccc; } .editor td.tnote { + border-top: solid 1px #cccccc; 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-04-19 13:19:31
|
Revision: 125 http://isocial.svn.sourceforge.net/isocial/?rev=125&view=rev Author: dim0s77 Date: 2008-04-19 06:19:36 -0700 (Sat, 19 Apr 2008) Log Message: ----------- Added template 'edit moderators'. Refactoring Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/locales/groupapp/group/ru.php app/views/groupapp/group/edit_members.tpl app/views/groupapp/group/edit_moderators.tpl public/stylesheets/groupapp/Group.css Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-04-17 09:36:18 UTC (rev 124) +++ app/controllers/groupapp/group_controller.php 2008-04-19 13:19:36 UTC (rev 125) @@ -45,14 +45,26 @@ function edit_info () { $this->step = 'edit_info'; + if (!empty($this->params['id']) && $this->GroupappGroup->find($this->params['id'])) { + $this->group = $this->GroupappGroup->find($this->params['id']); + } } function edit_customize () { $this->step = 'edit_customize'; + if (!empty($this->params['id']) && $this->GroupappGroup->find($this->params['id'])) { + $this->group = $this->GroupappGroup->find($this->params['id']); + } } function edit_moderators () { $this->step = 'edit_moderators'; + 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')); + } } function edit_members () { @@ -64,7 +76,8 @@ } } 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()), + $this->members = $this->GroupappMember->find('all', array('conditions' => array("group_id = ?", + $this->group->getId()), 'include' => 'user')); } $this->importErrors( $this->GroupappGroup->getErrors() ); Modified: app/locales/groupapp/group/ru.php =================================================================== --- app/locales/groupapp/group/ru.php 2008-04-17 09:36:18 UTC (rev 124) +++ app/locales/groupapp/group/ru.php 2008-04-19 13:19:36 UTC (rev 125) @@ -21,6 +21,7 @@ $dictionary['Customize'] = 'Дополнительно'; $dictionary['Members'] = 'Участники'; $dictionary['Moderators'] = 'Модераторы'; +$dictionary['Non-Moderators'] = 'Немодераторы'; $dictionary['Back to'] = 'Обратно в'; $dictionary['Group Name'] = 'Название группы'; @@ -75,4 +76,14 @@ $dictionary['Invite Friends'] = 'Пригласить друзей'; $dictionary['Invite Friends on PROJECT_NAME'] = 'Пригласить друзей по PROJECT_NAME'; +$dictionary['make moderator'] = 'сделать модератором'; +$dictionary['remove moderator'] = 'удалить модератора'; + +$dictionary['Choose from the list below to make members into moderators'] = + 'Выберите из списка ниже участников, которых хотите сделать модераторами'; +$dictionary['Could not find any members'] = + 'Не удалось найти ни одного участника'; +$dictionary['Invite some more people'] = + 'Пригласите больше людей'; + ?> Modified: app/views/groupapp/group/edit_members.tpl =================================================================== --- app/views/groupapp/group/edit_members.tpl 2008-04-17 09:36:18 UTC (rev 124) +++ app/views/groupapp/group/edit_members.tpl 2008-04-19 13:19:36 UTC (rev 125) @@ -32,15 +32,18 @@ <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 class="members_list_container"> + <div class="members_list"> + <ul> + {?members}{loop members} + <li> + <span class="member_name"><a href="/profile/show/{member.id}">{member.user.name}</a></span> + <a href="#" onclick="return false;">_{remove}</a> + </li> + {end}{end} + </ul> </div> - {end}{end} </div> - </div> <div class="clearfix"></div> Modified: app/views/groupapp/group/edit_moderators.tpl =================================================================== --- app/views/groupapp/group/edit_moderators.tpl 2008-04-17 09:36:18 UTC (rev 124) +++ app/views/groupapp/group/edit_moderators.tpl 2008-04-19 13:19:36 UTC (rev 125) @@ -1,8 +1,59 @@ <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.name?}</div> </div> </div> <div class="clearfix"></div> <?= $controller->renderPartial("editbar") ?> + +<div class="formwrapper"> + <form action="/groupapp/group/edit_moderators/{group.id?}" method="post"> + <div class="formrow"> + <?= $controller->renderErrors() ?> + </div> + + <div class="members_list"> + <div class="list_name">_{Moderators}</div> + <ul> + <? $moderators_count = 1; ?> + {?members}{loop members} + <? if ($member->role_id == 3) { ?> + <li> + <span class="member_name">{moderators_count}. <a href="/profile/show/{member.id}">{member.user.name}</a></span> + <a href="#" onclick="return false;">_{remove moderator}</a> + </li> + <? $moderators_count++; ?> + <? } ?> + {end}{end} + </ul> + </div> + <? if ($moderators_count == 1) { ?> + <div class="empty_list"> + _{Choose from the list below to make members into moderators}. + </div> + <? } ?> + + <div class="members_list"> + <div class="list_name">_{Non-Moderators}</div> + <ul> + <? $members_count = 0; ?> + {?members}{loop members} + <? if ($member->role_id != 3) { ?> + <li> + <span class="member_name"><a href="/profile/show/{member.id}">{member.user.name}</a></span> + <a href="#" onclick="return false;">_{make moderator}</a> + </li> + <? $members_count++; ?> + <? } ?> + {end}{end} + </ul> + </div> + <? if (!$members_count) { ?> + <div class="empty_list"> + _{Could not find any members}. <a href="/groupapp/group/edit_members/{group.id}">_{Invite some more people}</a>. + </div> + <? } ?> + + </form> +</div> Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-04-17 09:36:18 UTC (rev 124) +++ public/stylesheets/groupapp/Group.css 2008-04-19 13:19:36 UTC (rev 125) @@ -160,35 +160,57 @@ text-align: center; } +.members_list { + margin-bottom:5px; +} + +.members_list .list_name { + border-bottom: 1px solid #dddddd; + color: #3b5998; + font-size: 14px; + font-weight: bold; + padding: 10px 0px 4px 10px; +} + +.members_list ul { + list-style: none; + padding-left: 0px; + margin: 0px; +} + +.members_list li { + display: block; + padding: 5px 10px 5px 10px; + border-bottom: 1px solid #e2e7ef; + background: #ffffff; + text-align: right; +} + +.members_list .member_name { + padding-left: 10px; + float: left; +} + .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; +.members .members_list_container { 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; +.formwrapper .empty_list { + color: #777777; + background: #ffffff; + font-size: 12px; + text-align: center; + padding: 20px 0px 20px 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-04-22 16:21:00
|
Revision: 127 http://isocial.svn.sourceforge.net/isocial/?rev=127&view=rev Author: dim0s77 Date: 2008-04-22 09:21:01 -0700 (Tue, 22 Apr 2008) Log Message: ----------- Added members removing. Refactoring Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/locales/groupapp/group/ru.php app/views/groupapp/group/_editbar.tpl app/views/groupapp/group/edit_members.tpl public/stylesheets/groupapp/Group.css Added Paths: ----------- app/views/groupapp/group/_members_list.tpl Removed Paths: ------------- app/views/groupapp/group/edit_moderators.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-04-21 18:03:39 UTC (rev 126) +++ app/controllers/groupapp/group_controller.php 2008-04-22 16:21:01 UTC (rev 127) @@ -67,16 +67,6 @@ $this->edit_group(); } - function edit_moderators () { - $this->step = 'edit_moderators'; - 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')); - } - } - function edit_members () { $this->step = 'edit_members'; if (!empty($this->params['member'])){ @@ -86,13 +76,57 @@ } } 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->members = $this->_getGroupMembers($this->group); + $this->owners_count = 0; + $this->admins_count = 0; + $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++; + } } $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'])) + { + $this->group = $this->GroupappGroup->find($this->params['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++; } + } + $members_group_name = ''; + $empty_message = ''; + switch ($this->params['list_id']) { + case 'owners_list' : $members_group_name = 'Owners'; $empty_message = 'Group has no owner'; break; + case 'admins_list' : $members_group_name = 'Admins'; $empty_message = 'Group has no administrators'; break; + case 'moderators_list': $members_group_name = 'Moderators'; $empty_message = 'Group has no moderators'; break; + case 'members_list' : $members_group_name = 'Members'; $empty_message = 'Could not find any members. Invite some more people.'; break; + } + return $this->render(array('partial' => 'members_list', + 'locals' => array('members' => $members, + 'members_count' => $members_count, + 'members_group_name' => $members_group_name, + 'empty_message' => $empty_message, + 'role' => $this->params['role_id'], + 'list_id' => $this->params['list_id'] + ))); + } + } + + function _getGroupMembers () { + return $this->GroupappMember->find('all', array('conditions' => array("group_id = ?", + $this->group->getId()), + 'include' => 'user')); + } + function group_info () { if (!empty($this->params['id']) && $this->GroupappGroup->find($this->params['id'])) { $this->group = $this->GroupappGroup->find($this->params['id']); Modified: app/locales/groupapp/group/ru.php =================================================================== --- app/locales/groupapp/group/ru.php 2008-04-21 18:03:39 UTC (rev 126) +++ app/locales/groupapp/group/ru.php 2008-04-22 16:21:01 UTC (rev 127) @@ -19,9 +19,10 @@ $dictionary['Step'] = 'Шаг'; $dictionary['Group Info'] = 'Инфо о группе'; $dictionary['Customize'] = 'Дополнительно'; +$dictionary['Owners'] = 'Владельцы'; +$dictionary['Admins'] = 'Администраторы'; +$dictionary['Moderators'] = 'Модераторы'; $dictionary['Members'] = 'Участники'; -$dictionary['Moderators'] = 'Модераторы'; -$dictionary['Non-Moderators'] = 'Немодераторы'; $dictionary['Back to'] = 'Обратно в'; $dictionary['Group Name'] = 'Название группы'; @@ -72,18 +73,21 @@ $dictionary['Invite people to'] = 'Пригласить людей в'; $dictionary['Show'] = 'Показать'; -$dictionary['out of'] = 'из'; $dictionary['Invite Friends'] = 'Пригласить друзей'; $dictionary['Invite Friends on PROJECT_NAME'] = 'Пригласить друзей по PROJECT_NAME'; -$dictionary['make moderator'] = 'сделать модератором'; -$dictionary['remove moderator'] = 'удалить модератора'; +$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['change status'] = 'изменить статус'; +$dictionary['remove'] = 'удалить'; +$dictionary['Remove'] = 'Удалить'; -$dictionary['Choose from the list below to make members into moderators'] = - 'Выберите из списка ниже участников, которых хотите сделать модераторами'; -$dictionary['Could not find any members'] = - 'Не удалось найти ни одного участника'; -$dictionary['Invite some more people'] = - 'Пригласите больше людей'; +$dictionary['Remove member'] = 'Удалить пользователя'; +$dictionary['Are you sure you want to remove this member from group'] = + 'Вы уверены, что хотите удалить этого пользователя из группы'; +$dictionary['Changing status'] = 'Изменение статуса пользователя'; ?> Modified: app/views/groupapp/group/_editbar.tpl =================================================================== --- app/views/groupapp/group/_editbar.tpl 2008-04-21 18:03:39 UTC (rev 126) +++ app/views/groupapp/group/_editbar.tpl 2008-04-22 16:21:01 UTC (rev 127) @@ -3,7 +3,6 @@ <ul class="toggle_minitabs"> <li><a href="/groupapp/group/edit_info/{group.id?}" class="<?= $step == 'edit_info' ? 'selected' : '' ?>">_{Group Info}</a> </li><li><a href="/groupapp/group/edit_customize/{group.id?}" class="<?= $step == 'edit_customize' ? 'selected' : '' ?>">_{Customize}</a> - </li><li><a href="/groupapp/group/edit_moderators/{group.id?}" class="<?= $step == 'edit_moderators' ? 'selected' : '' ?>">_{Moderators}</a> </li><li><a href="/groupapp/group/edit_members/{group.id?}" class="<?= $step == 'edit_members' ? 'selected' : '' ?>">_{Members}</a></li> </ul> </div> Added: app/views/groupapp/group/_members_list.tpl =================================================================== --- app/views/groupapp/group/_members_list.tpl (rev 0) +++ app/views/groupapp/group/_members_list.tpl 2008-04-22 16:21:01 UTC (rev 127) @@ -0,0 +1,20 @@ +<div class="list_header"><?= $text_helper->translate($members_group_name, array()); ?>: {members_count}</div> +<? if (!$members_count) { ?> +<div class="empty_list"><?= $text_helper->translate($empty_message, array()); ?></div> +<? } else { ?> +<? if ($list_id == 'members_list') { ?><div class="members_list_container"><? } ?> + <div class="members_list"> + <ul> + {?members}{loop members} + <? if ($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> + <a href="#" onclick="remove_member(this, {group.id}, '{list_id}', {role}); return false;" name="{member.id}">_{remove}</a> + </li> + <? } ?> + {end}{end} + </ul> + </div> +<? if ($list_id == 'members_list') { ?></div><? } ?> +<? } ?> Modified: app/views/groupapp/group/edit_members.tpl =================================================================== --- app/views/groupapp/group/edit_members.tpl 2008-04-21 18:03:39 UTC (rev 126) +++ app/views/groupapp/group/edit_members.tpl 2008-04-22 16:21:01 UTC (rev 127) @@ -29,23 +29,121 @@ </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 id="owners_list"> + <div class="list_header">_{Owners}: {owners_count}</div> + <? if (!$owners_count) { ?> + <div class="empty_list">_{Group has no owner}</div> + <? } else { ?> + <div class="members_list"> + <ul> + {?members}{loop members} + <? if ($member->role_id == 1) { ?> + <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> + <a href="#" onclick="remove_member(this, {group.id}, 'owners_list', 1); return false;" name="{member.id}">_{remove}</a> + </li> + <? } ?> + {end}{end} + </ul> + </div> + <? } ?> </div> - <div class="members_list_container"> + + <div id="admins_list"> + <div class="list_header">_{Admins}: {admins_count}</div> + <? if (!$admins_count) { ?> + <div class="empty_list">_{Group has no administrators}</div> + <? } else { ?> <div class="members_list"> <ul> {?members}{loop members} + <? if ($member->role_id == 2) { ?> <li> <span class="member_name"><a href="/profile/show/{member.id}">{member.user.name}</a></span> - <a href="#" onclick="return false;">_{remove}</a> + <span class="change_status"><a href="#" onclick="change_member_status(this); return false;" name="{member.id}">_{change status}</a></span> + <a href="#" onclick="remove_member(this, {group.id}, 'admins_list', 2); return false;" name="{member.id}">_{remove}</a> </li> + <? } ?> {end}{end} </ul> </div> + <? } ?> </div> - + + <div id="moderators_list"> + <div class="list_header">_{Moderators}: {moderators_count}</div> + <? if (!$moderators_count) { ?> + <div class="empty_list">_{Group has no moderators}</div> + <? } else { ?> + <div class="members_list"> + <ul> + {?members}{loop members} + <? if ($member->role_id == 3) { ?> + <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> + <a href="#" onclick="remove_member(this, {group.id}, 'moderators_list', 3); return false;" name="{member.id}">_{remove}</a> + </li> + <? } ?> + {end}{end} + </ul> + </div> + <? } ?> + </div> + + <div id="members_list"> + <div class="list_header">_{Members}: {members_count}</div> + <? if (!$members_count) { ?> + <div class="empty_list">_{Could not find any members. Invite some more people.}</div> + <? } else { ?> + <div class="members_list_container"> + <div class="members_list"> + <ul> + {?members}{loop members} + <? if ($member->role_id == 4) { ?> + <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> + <a href="#" onclick="remove_member(this, {group.id}, 'members_list', 4); return false;" name="{member.id}">_{remove}</a> + </li> + <? } ?> + {end}{end} + </ul> + </div> + </div> + <? } ?> + </div> + <div class="clearfix"></div> </form> </div> + +<script> +function remove_member (element, 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: + 'group_id=' + group_id + + '&list_id=' + list_id + + '&member_id=' + element.name + + '&role_id=' + role + }); + } + }); + + return false; +} + +</script> Deleted: app/views/groupapp/group/edit_moderators.tpl =================================================================== --- app/views/groupapp/group/edit_moderators.tpl 2008-04-21 18:03:39 UTC (rev 126) +++ app/views/groupapp/group/edit_moderators.tpl 2008-04-22 16:21:01 UTC (rev 127) @@ -1,59 +0,0 @@ -<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("editbar") ?> - -<div class="formwrapper"> - <form action="/groupapp/group/edit_moderators/{group.id?}" method="post"> - <div class="formrow"> - <?= $controller->renderErrors() ?> - </div> - - <div class="members_list"> - <div class="list_name">_{Moderators}</div> - <ul> - <? $moderators_count = 1; ?> - {?members}{loop members} - <? if ($member->role_id == 3) { ?> - <li> - <span class="member_name">{moderators_count}. <a href="/profile/show/{member.id}">{member.user.name}</a></span> - <a href="#" onclick="return false;">_{remove moderator}</a> - </li> - <? $moderators_count++; ?> - <? } ?> - {end}{end} - </ul> - </div> - <? if ($moderators_count == 1) { ?> - <div class="empty_list"> - _{Choose from the list below to make members into moderators}. - </div> - <? } ?> - - <div class="members_list"> - <div class="list_name">_{Non-Moderators}</div> - <ul> - <? $members_count = 0; ?> - {?members}{loop members} - <? if ($member->role_id != 3) { ?> - <li> - <span class="member_name"><a href="/profile/show/{member.id}">{member.user.name}</a></span> - <a href="#" onclick="return false;">_{make moderator}</a> - </li> - <? $members_count++; ?> - <? } ?> - {end}{end} - </ul> - </div> - <? if (!$members_count) { ?> - <div class="empty_list"> - _{Could not find any members}. <a href="/groupapp/group/edit_members/{group.id}">_{Invite some more people}</a>. - </div> - <? } ?> - - </form> -</div> Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-04-21 18:03:39 UTC (rev 126) +++ public/stylesheets/groupapp/Group.css 2008-04-22 16:21:01 UTC (rev 127) @@ -191,6 +191,10 @@ float: left; } +.members_list .change_status { + padding-right: 15px; +} + .formwrapper .members { background: #ffffff; margin-right: 231px; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-04-26 08:50:38
|
Revision: 129 http://isocial.svn.sourceforge.net/isocial/?rev=129&view=rev Author: dim0s77 Date: 2008-04-26 01:50:42 -0700 (Sat, 26 Apr 2008) Log Message: ----------- Changed html structure of 'group create' page from table to div. Minor fixes Modified Paths: -------------- app/views/groupapp/group/_info.tpl app/views/groupapp/group/create.tpl app/views/groupapp/group/edit_info.tpl app/views/groupapp/group/edit_members.tpl public/stylesheets/Application.css public/stylesheets/groupapp/Group.css timesheet/dim0s77.txt Modified: app/views/groupapp/group/_info.tpl =================================================================== --- app/views/groupapp/group/_info.tpl 2008-04-24 09:53:49 UTC (rev 128) +++ app/views/groupapp/group/_info.tpl 2008-04-26 08:50:42 UTC (rev 129) @@ -1,42 +1,75 @@ - <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> + <div class="formrow"> + <?= $controller->renderErrors() ?> + </div> + + <div class="formrow"> + <label class="required">_{Group Name}:<br><small>(_{required})</small></label> + <div class="formcol"> + <?= $form_helper->text_field('group', 'name', array('class' => 'textinput')) ?> + </div> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label class="required">_{Description}:<br><small>(_{required})</small></label> + <div class="formcol"> + <?= $form_helper->text_area('group', 'description', array('rows' => '5')) ?> + </div> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label class="required">_{Group Type}:<br><small>(_{required})</small></label> + <div class="formcol"> + <?= $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:')) + ) ?> + </div> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label>_{Recent News}:</label> + <div class="formcol"> + <?= $form_helper->text_area('group', 'recent_news', array('rows' => '5')) ?> + </div> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label>_{Office}:</label> + <div class="formcol"> + <?= $form_helper->text_field('group', 'office', array('class' => 'textinput')) ?> + </div> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label>_{Email}:</label> + <div class="formcol"> + <?= $form_helper->text_field('group', 'email', array('class' => 'textinput')) ?> + </div> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label>_{Street}:</label> + <div class="formcol"> + <?= $form_helper->text_field('group', 'street', array('class' => 'textinput')) ?> + </div> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label>_{City/Town}:</label> + <div class="formcol"> + <?= $form_helper->text_field('group', 'city', array('class' => 'textinput') )?> + </div> + <div class="clearfix"></div> + </div> Modified: app/views/groupapp/group/create.tpl =================================================================== --- app/views/groupapp/group/create.tpl 2008-04-24 09:53:49 UTC (rev 128) +++ app/views/groupapp/group/create.tpl 2008-04-26 08:50:42 UTC (rev 129) @@ -9,28 +9,32 @@ <?= $controller->renderPartial("bar") ?> -<div class="form_editor"> - <?= $controller->renderErrors() ?> - <form action="/groupapp/group/create/{id}" method="post"> - <table class="editor"> - <tbody> - <?= $controller->renderPartial("info") ?> - <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> +<div class="editform"> + <form action="/groupapp/group/create" method="post"> + + <?= $controller->renderPartial("info") ?> + + <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="formrow"> + <label> </label> + <div class="formcol"> + <div 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.} + </div> + </div> + <div class="clearfix"></div> + </div> + </form> </div> + <div class="clearfix"></div> Modified: app/views/groupapp/group/edit_info.tpl =================================================================== --- app/views/groupapp/group/edit_info.tpl 2008-04-24 09:53:49 UTC (rev 128) +++ app/views/groupapp/group/edit_info.tpl 2008-04-26 08:50:42 UTC (rev 129) @@ -7,21 +7,20 @@ <?= $controller->renderPartial("editbar") ?> -<div class="form_editor"> - <?= $controller->renderErrors() ?> - <form action="/groupapp/group/edit_info/{id}" method="post"> - <table class="editor"> - <tbody> - <?= $controller->renderPartial("info") ?> - <tr> - <td class="tlabel"> </td> - <td class="tsubmit"> - <input class="submitinput" type="submit" value="_{Save Changes}"> - <input class="cancelinput" type="button" value="_{Cancel}"> - </td> - </tr> - </tbody> - </table> +<div class="editform"> + <form action="/groupapp/group/edit_info/{group.id?}" method="post"> + + <?= $controller->renderPartial("info") ?> + + <div class="formrow"> + <label> </label> + <div class="formcol"> + <input class="submitinput" type="submit" value="_{Save Changes}"> + <input class="cancelinput" type="button" value="_{Cancel}"> + </div> + <div class="clearfix"></div> + </div> + </form> </div> <div class="clearfix"></div> Modified: app/views/groupapp/group/edit_members.tpl =================================================================== --- app/views/groupapp/group/edit_members.tpl 2008-04-24 09:53:49 UTC (rev 128) +++ app/views/groupapp/group/edit_members.tpl 2008-04-26 08:50:42 UTC (rev 129) @@ -31,10 +31,8 @@ </div> <div id="owners_list"> - <div class="list_header">_{Owners}: {owners_count}</div> - <? if (!$owners_count) { ?> - <div class="empty_list">_{Group has no owner}</div> - <? } else { ?> + <div class="list_header">_{Owners}: {?owners_count}{owners_count}{else}0{end}</div> + <? if (isset($owners_count) && $owners_count > 0) { ?> <div class="members_list"> <ul> {?members}{loop members} @@ -48,14 +46,14 @@ {end}{end} </ul> </div> + <? } else { ?> + <div class="empty_list">_{Group has no owner}</div> <? } ?> </div> <div id="admins_list"> - <div class="list_header">_{Admins}: {admins_count}</div> - <? if (!$admins_count) { ?> - <div class="empty_list">_{Group has no administrators}</div> - <? } else { ?> + <div class="list_header">_{Admins}: {?admins_count}{admins_count}{else}0{end}</div> + <? if (isset($admins_count) && $admins_count > 0) { ?> <div class="members_list"> <ul> {?members}{loop members} @@ -69,14 +67,14 @@ {end}{end} </ul> </div> + <? } else { ?> + <div class="empty_list">_{Group has no administrators}</div> <? } ?> </div> <div id="moderators_list"> - <div class="list_header">_{Moderators}: {moderators_count}</div> - <? if (!$moderators_count) { ?> - <div class="empty_list">_{Group has no moderators}</div> - <? } else { ?> + <div class="list_header">_{Moderators}: {?moderators_count}{moderators_count}{else}0{end}</div> + <? if (isset($moderators_count) && $moderators_count > 0) { ?> <div class="members_list"> <ul> {?members}{loop members} @@ -90,14 +88,14 @@ {end}{end} </ul> </div> + <? } else { ?> + <div class="empty_list">_{Group has no moderators}</div> <? } ?> </div> <div id="members_list"> - <div class="list_header">_{Members}: {members_count}</div> - <? if (!$members_count) { ?> - <div class="empty_list">_{Could not find any members. Invite some more people.}</div> - <? } else { ?> + <div class="list_header">_{Members}: {?members_count}{members_count}{else}0{end}</div> + <? if (isset($members_count) && $members_count > 0) { ?> <div class="members_list_container"> <div class="members_list"> <ul> @@ -113,6 +111,8 @@ </ul> </div> </div> + <? } else { ?> + <div class="empty_list">_{Could not find any members. Invite some more people.}</div> <? } ?> </div> Modified: public/stylesheets/Application.css =================================================================== --- public/stylesheets/Application.css 2008-04-24 09:53:49 UTC (rev 128) +++ public/stylesheets/Application.css 2008-04-26 08:50:42 UTC (rev 129) @@ -557,6 +557,16 @@ width: 400px; } +.formrow label.required { + line-height: 10px; +} + +.formrow label.required small { + color: #999999; + font-size: smaller; + line-height: 10px; +} + .formrow .formcol { float: left; width: 360px; @@ -575,6 +585,13 @@ background: url('/images/lock.png') no-repeat 0px; } +.formrow .formcol .tnote { + border-top: solid 1px #cccccc; + padding: 10px 0px 0px 0px; + width: 300px; + color: #777777; +} + .formrow .formblock { width: 235px; margin: 3px 0px 3px 10px; Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-04-24 09:53:49 UTC (rev 128) +++ public/stylesheets/groupapp/Group.css 2008-04-26 08:50:42 UTC (rev 129) @@ -99,41 +99,6 @@ float: left; } -.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; -} - -.editor td.tnote { - border-top: solid 1px #cccccc; - padding: 10px 0px 0px 0px; - width: 300px; -} - .formwrapper .invite_column { float: right; width: 230px; Modified: timesheet/dim0s77.txt =================================================================== --- timesheet/dim0s77.txt 2008-04-24 09:53:49 UTC (rev 128) +++ timesheet/dim0s77.txt 2008-04-26 08:50:42 UTC (rev 129) @@ -0,0 +1 @@ +2008-04-26,10:45,11:45,groupapp,RT:1,"Change html structure of 'group create' page from table to div. Minor fixes" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-04-26 10:30:35
|
Revision: 130 http://isocial.svn.sourceforge.net/isocial/?rev=130&view=rev Author: dim0s77 Date: 2008-04-26 03:30:41 -0700 (Sat, 26 Apr 2008) Log Message: ----------- Added method 'change status' for members list Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/locales/groupapp/group/ru.php app/views/groupapp/group/edit_members.tpl timesheet/dim0s77.txt Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-04-26 08:50:42 UTC (rev 129) +++ app/controllers/groupapp/group_controller.php 2008-04-26 10:30:41 UTC (rev 130) @@ -121,6 +121,14 @@ } } + 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'])) + { + $this->group = $this->GroupappGroup->find($this->params['group_id']); + } + } + function _getGroupMembers () { return $this->GroupappMember->find('all', array('conditions' => array("group_id = ?", $this->group->getId()), Modified: app/locales/groupapp/group/ru.php =================================================================== --- app/locales/groupapp/group/ru.php 2008-04-26 08:50:42 UTC (rev 129) +++ app/locales/groupapp/group/ru.php 2008-04-26 10:30:41 UTC (rev 130) @@ -19,8 +19,13 @@ $dictionary['Step'] = 'Шаг'; $dictionary['Group Info'] = 'Инфо о группе'; $dictionary['Customize'] = 'Дополнительно'; +$dictionary['Owner'] = 'Владелец'; +$dictionary['Administrator'] = 'Администратор'; +$dictionary['Moderator'] = 'Модератор'; +$dictionary['Member'] = 'Участник'; +$dictionary['Customize'] = 'Дополнительно'; $dictionary['Owners'] = 'Владельцы'; -$dictionary['Admins'] = 'Администраторы'; +$dictionary['Administrators'] = 'Администраторы'; $dictionary['Moderators'] = 'Модераторы'; $dictionary['Members'] = 'Участники'; $dictionary['Back to'] = 'Обратно в'; @@ -90,4 +95,7 @@ 'Вы уверены, что хотите удалить этого пользователя из группы'; $dictionary['Changing status'] = 'Изменение статуса пользователя'; +$dictionary['Changing the status of the member'] = 'Изменение статуса участника'; +$dictionary['Change'] = 'Изменить'; + ?> Modified: app/views/groupapp/group/edit_members.tpl =================================================================== --- app/views/groupapp/group/edit_members.tpl 2008-04-26 08:50:42 UTC (rev 129) +++ app/views/groupapp/group/edit_members.tpl 2008-04-26 10:30:41 UTC (rev 130) @@ -39,7 +39,9 @@ <? if ($member->role_id == 1) { ?> <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> + <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> </li> <? } ?> @@ -52,7 +54,7 @@ </div> <div id="admins_list"> - <div class="list_header">_{Admins}: {?admins_count}{admins_count}{else}0{end}</div> + <div class="list_header">_{Administrators}: {?admins_count}{admins_count}{else}0{end}</div> <? if (isset($admins_count) && $admins_count > 0) { ?> <div class="members_list"> <ul> @@ -60,7 +62,9 @@ <? if ($member->role_id == 2) { ?> <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> + <span class="change_status"> + <a href="#" onclick="change_member_status(this, {group.id}, 'moderators_list', 2); return false;" name="{member.id}">_{change status}</a> + </span> <a href="#" onclick="remove_member(this, {group.id}, 'admins_list', 2); return false;" name="{member.id}">_{remove}</a> </li> <? } ?> @@ -81,7 +85,9 @@ <? if ($member->role_id == 3) { ?> <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> + <span class="change_status"> + <a href="#" onclick="change_member_status(this, {group.id}, 'moderators_list', 3); return false;" name="{member.id}">_{change status}</a> + </span> <a href="#" onclick="remove_member(this, {group.id}, 'moderators_list', 3); return false;" name="{member.id}">_{remove}</a> </li> <? } ?> @@ -103,7 +109,9 @@ <? if ($member->role_id == 4) { ?> <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> + <span class="change_status"> + <a href="#" onclick="change_member_status(this, {group.id}, 'moderators_list', 4); return false;" name="{member.id}">_{change status}</a> + </span> <a href="#" onclick="remove_member(this, {group.id}, 'members_list', 4); return false;" name="{member.id}">_{remove}</a> </li> <? } ?> @@ -129,7 +137,7 @@ body: '_{Are you sure you want to remove this member from group}?', yes: '_{Remove}', cancel: '_{Cancel}', - onYes : function () { + onYes : function () { new Ajax.Updater(list_id, '/groupapp/group/remove_member', { method:'post', @@ -146,4 +154,32 @@ return false; } +function change_member_status (element, 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}' + + '<?= $form_helper->radio_button('member', 'status', '4') ?>_{Member}'; + new Dialog.Box('dlg', { + reference: element, + title: '_{Changing the status of the member}', + body: body_content, + yes: '_{Change}', + cancel: '_{Cancel}', + onYes : function () { + new Ajax.Updater(list_id, + '/groupapp/group/change_member_status', + { method:'post', + asynchronous:true, + parameters: + 'group_id=' + group_id + + '&list_id=' + list_id + + '&member_id=' + element.name + + '&role_id=' + role + }); + } + }); + + return false; +} + </script> Modified: timesheet/dim0s77.txt =================================================================== --- timesheet/dim0s77.txt 2008-04-26 08:50:42 UTC (rev 129) +++ timesheet/dim0s77.txt 2008-04-26 10:30:41 UTC (rev 130) @@ -1 +1,2 @@ 2008-04-26,10:45,11:45,groupapp,RT:1,"Change html structure of 'group create' page from table to div. Minor fixes" +2008-04-26,11:45,13:30,groupapp,RT:2,"Create feature: change status of member" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-05-01 08:53:00
|
Revision: 140 http://isocial.svn.sourceforge.net/isocial/?rev=140&view=rev Author: dim0s77 Date: 2008-05-01 01:53:02 -0700 (Thu, 01 May 2008) Log Message: ----------- Added actions list Modified Paths: -------------- app/views/groupapp/group/show_group.tpl public/stylesheets/Application.css public/stylesheets/groupapp/Group.css timesheet/dim0s77.txt Modified: app/views/groupapp/group/show_group.tpl =================================================================== --- app/views/groupapp/group/show_group.tpl 2008-05-01 07:08:03 UTC (rev 139) +++ app/views/groupapp/group/show_group.tpl 2008-05-01 08:53:02 UTC (rev 140) @@ -9,6 +9,14 @@ <div class="right_small"> <div class="right_content"> + <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="#">_{Leave Group}</a></li> + </ul> + <div class="box"> <div class="header"> <div class="edit"><a href="#">_{edit}</a></div> @@ -60,6 +68,37 @@ </div> </div> + <div class="box"> + <div class="header"> + <div class="box_title">_{Discussion board}</div> + </div> + <div class="clearfix"></div> + <div class="emptyblock"> + _{There are no discussions}.<br><a href="#">_{Start the first topic}</a>. + </div> + </div> + + <div class="box"> + <div class="header"> + <div class="edit"><a href="#">_{edit}</a></div> + <div class="box_title">_{Members}</div> + </div> + <div class="clearfix"></div> + <div class="emptyblock"> + _{No one has uploaded any videos}. <a href="#">_{Add Videos}</a>. + </div> + </div> + + <div class="box"> + <div class="header"> + <div class="box_title">_{The Wall}</div> + </div> + <div class="clearfix"></div> + <div class="emptyblock"> + _{No one has said anything...yet}. <a href="#">_{Write something}</a>. + </div> + </div> + </div> </div> </div> Modified: public/stylesheets/Application.css =================================================================== --- public/stylesheets/Application.css 2008-05-01 07:08:03 UTC (rev 139) +++ public/stylesheets/Application.css 2008-05-01 08:53:02 UTC (rev 140) @@ -586,6 +586,35 @@ background: #f7f7f7; } +.actions_list { + list-style: none; + margin: 0px 0px 10px 0px; + padding: 0px; +} + +.actions_list li { + border-bottom: 1px solid #d8dfea; +} + +.actions_list a { + background: transparent; + display: block; + margin: 0px; + padding: 4px 3px 4px 3px; + text-decoration: none; +} + +.actions_list a:hover { + background: #3b5998; + color: white; + text-decoration: none; +} + +.actions_list .inactive { + padding: 2px 3px 2px 3px; + color: #777777; +} + .editform .formrow { clear: both; vertical-align: top; Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-05-01 07:08:03 UTC (rev 139) +++ public/stylesheets/groupapp/Group.css 2008-05-01 08:53:02 UTC (rev 140) @@ -182,4 +182,4 @@ font-size: 12px; text-align: center; padding: 20px 0px 20px 0px; -} \ No newline at end of file +} Modified: timesheet/dim0s77.txt =================================================================== --- timesheet/dim0s77.txt 2008-05-01 07:08:03 UTC (rev 139) +++ timesheet/dim0s77.txt 2008-05-01 08:53:02 UTC (rev 140) @@ -4,3 +4,6 @@ 2008-04-29,19:50,20:10,groupapp,RT:3,"Create page 'show group' for groupapp" 2008-04-30,18:00,19:25,groupapp,RT:3,"Create two column design" + +2008-05-01,09:50,11:50,groupapp,RT:3,"Modife template 'show_group' for groupapp" +2008-05-01,11:50,11:50,groupapp,RT:3,"Modife template 'show_group' for groupapp" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-01 12:43:27
|
Revision: 145 http://isocial.svn.sourceforge.net/isocial/?rev=145&view=rev Author: fsnobody Date: 2008-05-01 05:43:32 -0700 (Thu, 01 May 2008) Log Message: ----------- started edit albums Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/locales/photoapp/album/en.php app/locales/photoapp/album/ru.php app/views/photoapp/album/help.tpl app/views/photoapp/album/index.tpl app/views/photoapp/album/photos_of_you.tpl public/stylesheets/photoapp/Album.css Added Paths: ----------- app/views/photoapp/album/_edit_menu.tpl app/views/photoapp/album/add_photos.tpl app/views/photoapp/album/delete.tpl app/views/photoapp/album/edit_info.tpl Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-01 11:51:50 UTC (rev 144) +++ app/controllers/photoapp/album_controller.php 2008-05-01 12:43:32 UTC (rev 145) @@ -6,6 +6,8 @@ function index () { //$this->redirectTo(array('action' => 'show')); + $this->my_albums = $this->PhotoappAlbum->find('all', array('conditions' => array('owner = ' . $this->current_user->getId()))); + $this->count_albums = count($this->my_albums); } function show () { @@ -29,7 +31,7 @@ $this->PhotoappAlbum->owner = $this->current_user->getId(); if ($this->Request->isPost() && $this->PhotoappAlbum->save()){ // success - $this->redirectTo(array('action' => 'show')); + $this->redirectTo(array('action' => 'index')); } else { $this->importErrors( $this->PhotoappAlbum->getErrors() ); } @@ -37,8 +39,11 @@ } - function add () { + function add_photos () { } + + function edit_info () { + } function help () { } Modified: app/locales/photoapp/album/en.php =================================================================== --- app/locales/photoapp/album/en.php 2008-05-01 11:51:50 UTC (rev 144) +++ app/locales/photoapp/album/en.php 2008-05-01 12:43:32 UTC (rev 145) @@ -4,22 +4,8 @@ $dictionary = array(); -$dictionary['My Photos'] = 'My Photos'; -$dictionary['Photos'] = 'Photos'; -$dictionary['Photos of You'] = 'Photos of You'; -$dictionary['Create a Photo Album'] = 'Create a Photo Album'; -$dictionary['Welcome to PROJECT_NAME Photos'] = 'Welcome to PROJECT_NAME Photos'; -$dictionary['Name'] = 'Name'; -$dictionary['Location'] = 'Location'; -$dictionary['Description'] = 'Description'; -$dictionary['Privacy'] = 'Privacy'; -$dictionary['Create Album'] = 'Create Album'; -$dictionary['My Albums'] = 'My Albums'; -$dictionary['Create a New Album'] = 'Create a New Album'; -$dictionary['You have no any album'] = 'You have no any album'; - ?> Modified: app/locales/photoapp/album/ru.php =================================================================== --- app/locales/photoapp/album/ru.php 2008-05-01 11:51:50 UTC (rev 144) +++ app/locales/photoapp/album/ru.php 2008-05-01 12:43:32 UTC (rev 145) @@ -18,7 +18,18 @@ $dictionary['My Albums'] = 'Мои Альбомы'; $dictionary['Create a New Album'] = 'Создать новый альбом'; $dictionary['You have no any album'] = 'У вас нет альбомов'; +$dictionary['Photo Albums'] = 'Фото альбомов'; +$dictionary['Album Privacy'] = 'Доступ альбомов'; +$dictionary['Description'] = 'Описание'; +$dictionary['Created'] = 'Создан'; +$dictionary['Edit Album'] = 'Редактировать Альбом'; +$dictionary['View Album'] = 'Просмотр Альбома'; +$dictionary['Delete Album'] = 'Удаление Альбома'; +$dictionary['photos'] = 'фотографий'; + + + ?> Added: app/views/photoapp/album/_edit_menu.tpl =================================================================== --- app/views/photoapp/album/_edit_menu.tpl (rev 0) +++ app/views/photoapp/album/_edit_menu.tpl 2008-05-01 12:43:32 UTC (rev 145) @@ -0,0 +1,13 @@ +<div class="tabs"> + <div class="left"> + <ul class="toggle_tabs"> + <li class="first"><a href="/photoapp/album/add_photos" class="<?= $controller->getActionName() == 'add_photos' ? 'selected' : '' ?>">_{Add Photos}</a></li><? + ?><li><a href="/photoapp/album/edit_info" class="last <?= $controller->getActionName() == 'edit_info' ? 'selected' : '' ?>">_{Edit Info}</a></li><? + ?><li><a href="/photoapp/album/delete" class="last <?= $controller->getActionName() == 'delete' ? 'selected' : '' ?>">_{Delete}</a></li> + </ul> + </div> + <div class="right"> + <a href="/photoapp" class="<?= $controller->getActionName() == 'help' ? 'selected' : '' ?>">_{Back to Album}</a> + </div> +</div> +<div class="clearfix"> </div> Added: app/views/photoapp/album/add_photos.tpl =================================================================== --- app/views/photoapp/album/add_photos.tpl (rev 0) +++ app/views/photoapp/album/add_photos.tpl 2008-05-01 12:43:32 UTC (rev 145) @@ -0,0 +1,17 @@ + +<?= $controller->renderErrors() ?> + +<div class="title_bar"> + <div class="info"> + <div class="header"> + <div class="name">_{Edit Album}</div> + </div> + <div class="clearfix"></div> + </div> +</div> +<div class="clearfix"></div> + +<?= $controller->renderPartial("edit_menu") ?> + + + Added: app/views/photoapp/album/delete.tpl =================================================================== --- app/views/photoapp/album/delete.tpl (rev 0) +++ app/views/photoapp/album/delete.tpl 2008-05-01 12:43:32 UTC (rev 145) @@ -0,0 +1,21 @@ + +<?= $controller->renderErrors() ?> + +<div class="title_bar"> + <div class="info"> + <div class="header"> + <div class="name">_{Edit Album}</div> + </div> + <div class="clearfix"></div> + </div> +</div> +<div class="clearfix"></div> + +<?= $controller->renderPartial("edit_menu") ?> + +<div class="delete_album"> +</div> +<div class="clearfix"></div> + + + Added: app/views/photoapp/album/edit_info.tpl =================================================================== --- app/views/photoapp/album/edit_info.tpl (rev 0) +++ app/views/photoapp/album/edit_info.tpl 2008-05-01 12:43:32 UTC (rev 145) @@ -0,0 +1,17 @@ + +<?= $controller->renderErrors() ?> + +<div class="title_bar"> + <div class="info"> + <div class="header"> + <div class="name">_{Edit Album}</div> + </div> + <div class="clearfix"></div> + </div> +</div> +<div class="clearfix"></div> + +<?= $controller->renderPartial("edit_menu") ?> + + + Modified: app/views/photoapp/album/help.tpl =================================================================== --- app/views/photoapp/album/help.tpl 2008-05-01 11:51:50 UTC (rev 144) +++ app/views/photoapp/album/help.tpl 2008-05-01 12:43:32 UTC (rev 145) @@ -1 +1 @@ -Group Help \ No newline at end of file +Albums Help \ No newline at end of file Modified: app/views/photoapp/album/index.tpl =================================================================== --- app/views/photoapp/album/index.tpl 2008-05-01 11:51:50 UTC (rev 144) +++ app/views/photoapp/album/index.tpl 2008-05-01 12:43:32 UTC (rev 145) @@ -1,20 +1,7 @@ <?= $controller->renderPartial("menu") ?> <?= $controller->renderErrors() ?> -<!-- -<div class="title_bar"> - <div class="info"> - <div class="header"> - <div class="name">_{Photos}</div> - <div class="create"><a href="/photoapp/album/create">_{Create a Photo Album}</a></div> - </div> - <div class="clearfix"></div> - </div> -</div> -<div class="clearfix"></div> ---> - <div class="title_bar"> <div class="info"> <div class="header"> @@ -27,8 +14,35 @@ <div class="clearfix"></div> +<? if ($count_albums == 0) {?> <div class="noalbums"> _{You have no any album}. </div> +<? } else {?> + +<div class="album_list"> + <?= $count_albums?> _{Photo Albums} <span>|</span> <a href="#" >_{Album Privacy}</a> +</div> +<div class="container"> + {loop my_albums} + <div class="album"> + <div class="img">IMG</div> + <div class="info"> + <div class="name_album"><a href="/photoapp/album/view/<?= $my_album->get('id')?>"><?= $my_album->get('name') ?></a></div> + <div class="photos_count">0 _{photos}</div> + <div class="description">_{Description}: <?= $my_album->get('description')?></div> + <div class="photos_count">_{Created} April 25</div> + <div class="links"> + <a href="/photoapp/album/edit/<?= $my_album->get('id')?>">_{Edit Album}</a> | + <a href="/photoapp/album/view/<?= $my_album->get('id')?>">_{View Album}</a> | + <a href="/photoapp/album/delete/<?= $my_album->get('id')?>">_{Delete Album}</a> + </div> + </div> + </div> + {end} +</div> <div class="clearfix"></div> +<? }?> +<div class="clearfix"></div> + Modified: app/views/photoapp/album/photos_of_you.tpl =================================================================== --- app/views/photoapp/album/photos_of_you.tpl 2008-05-01 11:51:50 UTC (rev 144) +++ app/views/photoapp/album/photos_of_you.tpl 2008-05-01 12:43:32 UTC (rev 145) @@ -2,4 +2,4 @@ <?= $controller->renderErrors() ?> -Photos of You \ No newline at end of file +Photos of You... Coming soon \ No newline at end of file Modified: public/stylesheets/photoapp/Album.css =================================================================== --- public/stylesheets/photoapp/Album.css 2008-05-01 11:51:50 UTC (rev 144) +++ public/stylesheets/photoapp/Album.css 2008-05-01 12:43:32 UTC (rev 145) @@ -18,8 +18,6 @@ } .title_bar .info { - 1position: relative; - 1top: -50px; left: 0px; margin: 0px; padding: 0px 0px 0px 80px; @@ -137,4 +135,61 @@ padding: 20px; } +.album_list { + padding: 15px 5px 5px 20px; +} +.album_list span { + color: #888888; +} + +.container { + border-top: 1px solid #cccccc; + padding: 10px 10px 4px 10px; + background: #f7f7f7; + +} + +.album { + border: 1px solid #cccccc; + background: #ffffff; + height: 120px; + margin-bottom: 6px; + padding: 10px; +} + +.album .img { + width: 200px; + float: left; + height: 120px; +} + +.album .info { + width: 400px; + float: left; + height: 120px; +} + +.album .info .name_album { + padding: 5px 0px 0px 0px; + font-size: 12px; + font-weight: bold; +} + +.album .info .description { + padding: 3px 0px; + font-size: 10px; + line-height: 14px; +} + +.album .info .photos_count { + padding: 3px 0px; + font-size: 10px; + color: #888888; +} + +.album .info .links { + padding: 3px 0px; + font-size: 10px; +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-05-01 13:55:46
|
Revision: 147 http://isocial.svn.sourceforge.net/isocial/?rev=147&view=rev Author: dim0s77 Date: 2008-05-01 06:55:54 -0700 (Thu, 01 May 2008) Log Message: ----------- Created tab 'discussion board' with no topics for groupapp Modified Paths: -------------- app/locales/groupapp/board/ru.php app/views/groupapp/board/index.tpl public/stylesheets/Application.css public/stylesheets/groupapp/Board.css timesheet/dim0s77.txt Added Paths: ----------- app/controllers/groupapp/board_controller.php Added: app/controllers/groupapp/board_controller.php =================================================================== --- app/controllers/groupapp/board_controller.php (rev 0) +++ app/controllers/groupapp/board_controller.php 2008-05-01 13:55:54 UTC (rev 147) @@ -0,0 +1,18 @@ +<?php + +class Groupapp_BoardController extends ApplicationController +{ + var $models = array('GroupappMessage'); + + function index () { + } + + function show_topic () { + } + + function start_topic () { + } + +} + +?> Modified: app/locales/groupapp/board/ru.php =================================================================== --- app/locales/groupapp/board/ru.php 2008-05-01 12:46:03 UTC (rev 146) +++ app/locales/groupapp/board/ru.php 2008-05-01 13:55:54 UTC (rev 147) @@ -5,10 +5,22 @@ $dictionary = array(); $dictionary['Discussions'] = 'Обсуждения'; $dictionary['Back to'] = 'Обратно в'; -$dictionary['Discussion Board'] = 'Доска обсуждений'; +$dictionary['Discussion Board'] = 'Список обсуждений'; $dictionary['Topic View'] = 'Просмотр темы'; $dictionary['Start New Topic'] = 'Начать новую тему'; +$dictionary['Show'] = 'Показывать'; +$dictionary['All Topics'] = 'Все темы'; +$dictionary['My Topics'] = 'Мои темы'; +$dictionary['My Friends\' Topics'] = 'Темы друзей'; +$dictionary['Sort by'] = 'Сортировать по'; +$dictionary['Latest Replies'] = 'Последним ответам'; +$dictionary['Newest Topics'] = 'Новым темам'; +$dictionary['Most People'] = 'Макс. людей'; +$dictionary['Most Posts'] = 'Макс. сообщений'; +$dictionary['Search all topics'] = 'Искать все темы'; +$dictionary['There are no discussions'] ='Обсуждений пока нет'; + ?> Modified: app/views/groupapp/board/index.tpl =================================================================== --- app/views/groupapp/board/index.tpl 2008-05-01 12:46:03 UTC (rev 146) +++ app/views/groupapp/board/index.tpl 2008-05-01 13:55:54 UTC (rev 147) @@ -1 +1,48 @@ <?= $controller->renderPartial("head") ?> + +<div class="submenu"> + + <div class="menu_block selector"> + <label for="show_select">_{Show}: + <select onchange="doselect(this)" id="show_select" name="show_select"> + <option selected="selected" value="all_topics">_{All Topics}</option> + <option value="my_topics">_{My Topics}</option> + <option value="my_friends_topics">_{My Friends' Topics}</option> + </select> + </label> + </div> + + <div class="menu_block selector"> + <label for="sort_select">_{Sort by}: + <select onchange="doselect(this)" id="sort_select" name="sort_select"> + <option selected="selected" value="latest_replies">_{Latest Replies}</option> + <option value="newest_topics">_{Newest Topics}</option> + <option value="most_people">_{Most People}</option> + <option value="most_posts">_{Most Posts}</option> + </select> + </label> + </div> + + <input class="mediumtextinput search right" id="searchfield" name="" type="text" value="_{Search all topics}" onclick="on_search_topic_click(this)" onblur="on_search_topic_blur(this)" /> + +</div> +<div class="clearfix"></div> + +<div class="nodiscus"> + _{There are no discussions}. +</div> +<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: public/stylesheets/Application.css =================================================================== --- public/stylesheets/Application.css 2008-05-01 12:46:03 UTC (rev 146) +++ public/stylesheets/Application.css 2008-05-01 13:55:54 UTC (rev 147) @@ -325,8 +325,6 @@ font-size: 11px; width: 300px; margin: 0px 0px 5px 0px; - padding: 3px; - font-size: 11px; } .shorttextinput { @@ -336,10 +334,28 @@ font-family: verdana, arial, sans-serif; font-size: 11px; margin: 0px 0px 5px 0px; - padding: 3px; +} + +.mediumtextinput { + width: 130px; + padding: 4px 3px 4px 3px; + border: 1px solid #bdc7d8; + font-family: verdana, arial, sans-serif; font-size: 11px; + margin: 0px 0px 0px 10px; } +.mediumtextinput.search { + color: #777777; + padding: 4px 3px 4px 20px; + background: url('/images/magnifier.png') no-repeat 2px; + background-color: #ffffff; +} + +.mediumtextinput.search.right { + float: right; +} + .checkboxinput { border: 0px; margin: 4px 0px 0px 0px; @@ -460,9 +476,9 @@ #content .submenu { background: #f7f7f7; border-bottom: 1px solid #cccccc; - padding: 8px 20px 8px 20px; + padding: 8px 10px 8px 10px; float: left; - width: 605px; + width: 627px; } #content .submenushort { @@ -476,7 +492,7 @@ } .submenu .menu_block.selector { - padding-right: 5px; + padding-right: 10px; } .submenu .menu_block.selector select { Modified: public/stylesheets/groupapp/Board.css =================================================================== --- public/stylesheets/groupapp/Board.css 2008-05-01 12:46:03 UTC (rev 146) +++ public/stylesheets/groupapp/Board.css 2008-05-01 13:55:54 UTC (rev 147) @@ -1 +1,10 @@ - \ No newline at end of file +.nodiscus { + font-size: 12px; + text-align: center; + margin: 10px; + padding: 100px 10px 100px 10px; + color: gray; + background: #f7f7f7; + border: solid 1px #dddddd; +} + Modified: timesheet/dim0s77.txt =================================================================== --- timesheet/dim0s77.txt 2008-05-01 12:46:03 UTC (rev 146) +++ timesheet/dim0s77.txt 2008-05-01 13:55:54 UTC (rev 147) @@ -6,4 +6,5 @@ 2008-04-30,18:00,19:25,groupapp,RT:3,"Create two column design" 2008-05-01,09:50,11:50,groupapp,RT:3,"Modife template 'show_group' for groupapp" -2008-05-01,11:50,11:50,groupapp,RT:3,"Modife template 'show_group' for groupapp" +2008-05-01,11:50,15:00,groupapp,RT:3,"Adding groupapp discussion board basis. Localizate" +2008-05-01,15:00,16:55,groupapp,RT:3,"Creation tab 'discussion board' with no topics for groupapp" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-05 09:53:09
|
Revision: 162 http://isocial.svn.sourceforge.net/isocial/?rev=162&view=rev Author: fsnobody Date: 2008-05-05 02:53:02 -0700 (Mon, 05 May 2008) Log Message: ----------- updated Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/views/photoapp/album/delete.tpl app/views/photoapp/album/index.tpl public/stylesheets/photoapp/Album.css Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-03 14:19:44 UTC (rev 161) +++ app/controllers/photoapp/album_controller.php 2008-05-05 09:53:02 UTC (rev 162) @@ -42,13 +42,24 @@ function add_photos () { } - function edit_info () { + function edit () { } function help () { } function delete () { + if (!empty($this->params['album']) ){ + // delete + $album = $this->PhotoappAlbum->find($this->params['id']); + if ($album->get('owner') == $this->current_user->getId() && $this->Request->isPost() && $this->PhotoappAlbum->destroyAll("id = " . $this->params['id'])) { + $this->redirectTo(array('action' => 'index')); + return; + } + } else if (!empty($this->params['id']) && $this->PhotoappAlbum->find($this->params['id'])) { + // pre delete + $this->album = $this->PhotoappAlbum->find($this->params['id']); + } } } Modified: app/views/photoapp/album/delete.tpl =================================================================== --- app/views/photoapp/album/delete.tpl 2008-05-03 14:19:44 UTC (rev 161) +++ app/views/photoapp/album/delete.tpl 2008-05-05 09:53:02 UTC (rev 162) @@ -14,6 +14,23 @@ <?= $controller->renderPartial("edit_menu") ?> <div class="delete_album"> + <div class="delete_form"> + <form action="/photoapp/album/delete/{id}" method="post"> + <?= $form_helper->hidden_field('album', 'action_delete', array('value' => 'do_delete')) ?> + <div class="warning"> + <div class="form_title"> + _{Delete Photo Album}? + </div> + <div class="text"> + {album.name?} is empty. Delete it? + </div> + <div class="formbtns"> + <input class="submitinput" type="submit" value="_{Delete Album}"/> + <input class="cancelinput" type="button" value="_{Cancel}"/> + </div> + </div> + </form> + </div> </div> <div class="clearfix"></div> Modified: app/views/photoapp/album/index.tpl =================================================================== --- app/views/photoapp/album/index.tpl 2008-05-03 14:19:44 UTC (rev 161) +++ app/views/photoapp/album/index.tpl 2008-05-05 09:53:02 UTC (rev 162) @@ -32,12 +32,12 @@ <div class="photos_count">0 _{photos}</div> <div class="description">_{Description}: <?= $my_album->get('description')?></div> <div class="photos_count">_{Created} April 25</div> - <div class="links"> - <a href="/photoapp/album/edit/<?= $my_album->get('id')?>">_{Edit Album}</a> | - <a href="/photoapp/album/view/<?= $my_album->get('id')?>">_{View Album}</a> | - <a href="/photoapp/album/delete/<?= $my_album->get('id')?>">_{Delete Album}</a> - </div> </div> + <div class="links"> + <div><a href="/photoapp/album/edit/<?= $my_album->get('id')?>">_{Edit Album}</a></div> + <div><a href="/photoapp/album/view/<?= $my_album->get('id')?>">_{View Album}</a></div> + <div><a href="/photoapp/album/delete/<?= $my_album->get('id')?>">_{Delete Album}</a></div> + </div> </div> {end} </div> Modified: public/stylesheets/photoapp/Album.css =================================================================== --- public/stylesheets/photoapp/Album.css 2008-05-03 14:19:44 UTC (rev 161) +++ public/stylesheets/photoapp/Album.css 2008-05-05 09:53:02 UTC (rev 162) @@ -159,15 +159,16 @@ } .album .img { - width: 200px; + width: 130px; float: left; height: 120px; } .album .info { - width: 400px; + width: 345px; float: left; height: 120px; + padding: 0px 5px 0px 0px; } .album .info .name_album { @@ -188,8 +189,52 @@ color: #888888; } -.album .info .links { +.album .links { padding: 3px 0px; font-size: 10px; + width: 120px; + float: left; + height: 120px; } +.album .links div{ + height: 20px; + border-bottom: 1px solid #dedeee; + padding: 0px 0px 0px 5px; +} + +.album .links div a{ + height: 20px; + width: 120px; + line-height: 18px; +} + +.delete_album { + padding: 10px 150px; +} + +.delete_form { + background: #dedeee; + padding: 10px; +} + +.warning { + border: 1px solid #39599c; + padding: 10px; + background: #ffffff; +} + +.form_title { + font-size: 14px; + font-weight: bold; + border-bottom: 1px solid #dedeee; + padding: 3px 0px; +} + +.warning .text { + padding: 14px 0px; +} + +.formbtns { + text-align: right; +} \ 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: <fsn...@us...> - 2008-05-06 08:23:19
|
Revision: 166 http://isocial.svn.sourceforge.net/isocial/?rev=166&view=rev Author: fsnobody Date: 2008-05-06 01:23:26 -0700 (Tue, 06 May 2008) Log Message: ----------- minor fixes + added created_at and photos_count to installer Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/installers/photoapp/album_installer.php app/views/photoapp/album/index.tpl public/stylesheets/photoapp/Album.css Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-06 07:34:04 UTC (rev 165) +++ app/controllers/photoapp/album_controller.php 2008-05-06 08:23:26 UTC (rev 166) @@ -7,7 +7,10 @@ function index () { //$this->redirectTo(array('action' => 'show')); $this->my_albums = $this->PhotoappAlbum->find('all', array('conditions' => array('owner = ' . $this->current_user->getId()))); - $this->count_albums = count($this->my_albums); + if(is_array($this->my_albums)) + $this->count_albums = count($this->my_albums); + else + $this->count_albums = 0; } function show () { Modified: app/installers/photoapp/album_installer.php =================================================================== --- app/installers/photoapp/album_installer.php 2008-05-06 07:34:04 UTC (rev 165) +++ app/installers/photoapp/album_installer.php 2008-05-06 08:23:26 UTC (rev 166) @@ -10,9 +10,11 @@ "CREATE TABLE `photoapp_albums` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `owner` int(11) NOT NULL , + `photos_count` int(11) NOT NULL DEFAULT 0, `name` char(100) NOT NULL DEFAULT '', `privacy` char(100) NOT NULL DEFAULT '', `description` char(255) NOT NULL DEFAULT '', + `created_at` datetime NOT NULL , `img` char(255) NOT NULL DEFAULT '' ) ENGINE=InnoDB"); Modified: app/views/photoapp/album/index.tpl =================================================================== --- app/views/photoapp/album/index.tpl 2008-05-06 07:34:04 UTC (rev 165) +++ app/views/photoapp/album/index.tpl 2008-05-06 08:23:26 UTC (rev 166) @@ -8,7 +8,7 @@ <div class="name photoapp">_{My Albums}</div> </div> <div class="clearfix"></div> - <div class="subheader"><a href="/photoapp/album/create">_{Create a New Album}</a></div> + <div class="subheader"><a href="/photoapp/album/add">_{Create a New Album}</a></div> </div> </div> <div class="clearfix"></div> @@ -29,9 +29,9 @@ <div class="img">IMG</div> <div class="info"> <div class="name_album"><a href="/photoapp/album/view/<?= $my_album->get('id')?>"><?= $my_album->get('name') ?></a></div> - <div class="photos_count">0 _{photos}</div> + <div class="photos_count"><?= $my_album->get('photos_count')?> _{photos}</div> <div class="description">_{Description}: <?= $my_album->get('description')?></div> - <div class="photos_count">_{Created} April 25</div> + <div class="photos_count">_{Created} <?= strftime("%b %e", strtotime($my_album->get('created_at')))?></div> </div> <div class="links"> <div><a href="/photoapp/album/add_photo/<?= $my_album->get('id')?>">_{Edit Album}</a></div> Modified: public/stylesheets/photoapp/Album.css =================================================================== --- public/stylesheets/photoapp/Album.css 2008-05-06 07:34:04 UTC (rev 165) +++ public/stylesheets/photoapp/Album.css 2008-05-06 08:23:26 UTC (rev 166) @@ -165,7 +165,7 @@ } .album .info { - width: 345px; + width: 315px; float: left; height: 120px; padding: 0px 5px 0px 0px; @@ -192,7 +192,7 @@ .album .links { padding: 3px 0px; font-size: 10px; - width: 120px; + width: 150px; float: left; height: 120px; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-06 15:16:09
|
Revision: 167 http://isocial.svn.sourceforge.net/isocial/?rev=167&view=rev Author: fsnobody Date: 2008-05-06 08:16:02 -0700 (Tue, 06 May 2008) Log Message: ----------- design add photo to album form Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/locales/photoapp/album/ru.php app/views/photoapp/album/add_photo.tpl public/stylesheets/photoapp/Album.css Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-06 08:23:26 UTC (rev 166) +++ app/controllers/photoapp/album_controller.php 2008-05-06 15:16:02 UTC (rev 167) @@ -43,6 +43,13 @@ } function add_photo () { + + if (!empty($this->params['album'])){ + // + } else if ($this->params['id']) { + $this->album = $this->PhotoappAlbum->find($this->params['id']); + return; + } } function edit () { Modified: app/locales/photoapp/album/ru.php =================================================================== --- app/locales/photoapp/album/ru.php 2008-05-06 08:23:26 UTC (rev 166) +++ app/locales/photoapp/album/ru.php 2008-05-06 15:16:02 UTC (rev 167) @@ -26,10 +26,13 @@ $dictionary['View Album'] = 'Просмотр Альбома'; $dictionary['Delete Album'] = 'Удаление Альбома'; $dictionary['photos'] = 'фотографий'; +$dictionary['Upload'] = 'Загрузить'; +$dictionary['Choose'] = 'Обзор'; + ?> Modified: app/views/photoapp/album/add_photo.tpl =================================================================== --- app/views/photoapp/album/add_photo.tpl 2008-05-06 08:23:26 UTC (rev 166) +++ app/views/photoapp/album/add_photo.tpl 2008-05-06 15:16:02 UTC (rev 167) @@ -13,4 +13,73 @@ <?= $controller->renderPartial("edit_menu") ?> -Add Photo \ No newline at end of file +<div class="album_step"> + <?= $form_tag_helper->start_form_tag(array('action'=>'add_photo', 'id' => $album->getId())) ?> + <div class="form_create_clear red"> + + <div class="form_create_row"> + <label>_{Photos}:</label> + <div class="form_create_col"> + <?= $form_helper->file_field('album', 'photo1', array('class' => 'textinput small')) ?> + </div> + </div> + <div class="clearfix"></div> + + <div class="form_create_row"> + <label > </label> + <div class="form_create_col"> + <?= $form_helper->file_field('album', 'photo2', array('class' => 'textinput small')) ?> + </div> + </div> + <div class="clearfix"></div> + + <div class="form_create_row"> + <label > </label> + <div class="form_create_col"> + <?= $form_helper->file_field('album', 'photo3', array('class' => 'textinput small')) ?> + </div> + </div> + <div class="clearfix"></div> + + <div class="form_create_row"> + <label > </label> + <div class="form_create_col"> + <?= $form_helper->file_field('album', 'photo4', array('class' => 'textinput small')) ?> + </div> + </div> + <div class="clearfix"></div> + + <div class="form_create_row"> + <label > </label> + <div class="form_create_col"> + <?= $form_helper->file_field('album', 'photo5', array('class' => 'textinput small')) ?> + </div> + </div> + <div class="clearfix"></div> + + <div class="form_row"> + <small>You can upload JPG, GIF or PNG files.</small> + </div> + <div class="clearfix"></div> + + <div class="form_row"> + <?= $form_helper->check_box('album', 'check_box', array()) ?> + <label for="album_check_box">I certify that I have the right to distribute these photos and that they do not violate the Terms of Use.</label> + </div> + <div class="clearfix"></div> + + + + + <div class="form_create_row"> + <label > </label> + <div class="form_create_col"> + <input class="submitinput" type="submit" value="_{Upload}"/> + <input class="cancelinput" type="button" value="_{Cancel}"/> + </div> + </div> + <div class="clearfix"></div> + + </div> + </form> +</div> \ No newline at end of file Modified: public/stylesheets/photoapp/Album.css =================================================================== --- public/stylesheets/photoapp/Album.css 2008-05-06 08:23:26 UTC (rev 166) +++ public/stylesheets/photoapp/Album.css 2008-05-06 15:16:02 UTC (rev 167) @@ -97,6 +97,17 @@ padding-top: 2px; } +.form_row small { + font-size: 10px; + font-weight: bold; + color: #cccccc; + +} + +.form_row { + text-align: center; +} + .form_create_row label { font-size: 10px; display: block; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-07 05:02:13
|
Revision: 171 http://isocial.svn.sourceforge.net/isocial/?rev=171&view=rev Author: fsnobody Date: 2008-05-06 22:02:19 -0700 (Tue, 06 May 2008) Log Message: ----------- design links on index like groups Modified Paths: -------------- app/views/photoapp/album/index.tpl public/stylesheets/photoapp/Album.css Modified: app/views/photoapp/album/index.tpl =================================================================== --- app/views/photoapp/album/index.tpl 2008-05-06 17:54:37 UTC (rev 170) +++ app/views/photoapp/album/index.tpl 2008-05-07 05:02:19 UTC (rev 171) @@ -34,9 +34,16 @@ <div class="photos_count">_{Created} <?= strftime("%b %e", strtotime($my_album->get('created_at')))?></div> </div> <div class="links"> + <ul class="actions_list"> + <li><a href="/photoapp/album/add_photo/<?= $my_album->get('id')?>">_{Edit Album}</a></li> + <li><a href="/photoapp/album/view/<?= $my_album->get('id')?>">_{View Album}</a></li> + <li><a href="/photoapp/album/delete/<?= $my_album->get('id')?>">_{Delete Album}</a></li> + </ul> +<!-- <div><a href="/photoapp/album/add_photo/<?= $my_album->get('id')?>">_{Edit Album}</a></div> <div><a href="/photoapp/album/view/<?= $my_album->get('id')?>">_{View Album}</a></div> <div><a href="/photoapp/album/delete/<?= $my_album->get('id')?>">_{Delete Album}</a></div> +--> </div> </div> {end} Modified: public/stylesheets/photoapp/Album.css =================================================================== --- public/stylesheets/photoapp/Album.css 2008-05-06 17:54:37 UTC (rev 170) +++ public/stylesheets/photoapp/Album.css 2008-05-07 05:02:19 UTC (rev 171) @@ -176,7 +176,7 @@ } .album .info { - width: 315px; + width: 325px; float: left; height: 120px; padding: 0px 5px 0px 0px; @@ -203,7 +203,7 @@ .album .links { padding: 3px 0px; font-size: 10px; - width: 150px; + width: 140px; float: left; height: 120px; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-07 15:41:06
|
Revision: 176 http://isocial.svn.sourceforge.net/isocial/?rev=176&view=rev Author: fsnobody Date: 2008-05-07 08:41:03 -0700 (Wed, 07 May 2008) Log Message: ----------- photoapp.css added Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/installers/photoapp/photo_installer.php app/locales/photoapp/album/ru.php app/views/photoapp/album/_edit_menu.tpl app/views/photoapp/album/add_photo.tpl app/views/photoapp/album/edit.tpl Added Paths: ----------- app/views/photoapp/album/_edit_title.tpl app/views/photoapp/album/uploaded.tpl public/stylesheets/photoapp/Photoapp.css Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-07 07:55:15 UTC (rev 175) +++ app/controllers/photoapp/album_controller.php 2008-05-07 15:41:03 UTC (rev 176) @@ -28,6 +28,11 @@ function create () { } */ + function uploaded () { + $this->uploaded_albums = $this->PhotoappAlbum->find('all', array('conditions' => array('name IS NULL', 'caption IS NULL'))); + return; + } + function add () { if (!empty($this->params['album'])){ $this->PhotoappAlbum->setAttributes($this->params['album']); Modified: app/installers/photoapp/photo_installer.php =================================================================== --- app/installers/photoapp/photo_installer.php 2008-05-07 07:55:15 UTC (rev 175) +++ app/installers/photoapp/photo_installer.php 2008-05-07 15:41:03 UTC (rev 176) @@ -14,9 +14,7 @@ `name` char(100) NOT NULL DEFAULT '', `caption` char(255) NOT NULL DEFAULT '', `created_at` datetime NOT NULL , - `img` char(255) NOT NULL DEFAULT '', - `img_preview` char(255) NOT NULL DEFAULT '', - `img_small` char(255) NOT NULL DEFAULT '' + `img` char(255) NOT NULL DEFAULT '' ) ENGINE=InnoDB"); @@ -24,7 +22,7 @@ function down_1() { - $this->dropTable('photoapp_photo'); + $this->dropTable('photoapp_photos'); } } Modified: app/locales/photoapp/album/ru.php =================================================================== --- app/locales/photoapp/album/ru.php 2008-05-07 07:55:15 UTC (rev 175) +++ app/locales/photoapp/album/ru.php 2008-05-07 15:41:03 UTC (rev 176) @@ -6,7 +6,7 @@ $dictionary['My Photos'] = 'Мои Фото'; $dictionary['Photos'] = 'Фото'; -$dictionary['Photos of You'] = 'Фото с Вами'; +$dictionary['Photos of You'] = 'Мои личные фото'; $dictionary['Create a Photo Album'] = 'Создать фото альбом'; $dictionary['Welcome to PROJECT_NAME Photos'] = 'Добро пожаловать в PROJECT_NAME Фото'; $dictionary['Name'] = 'Название'; @@ -18,16 +18,17 @@ $dictionary['My Albums'] = 'Мои альбомы'; $dictionary['Create a New Album'] = 'Создать новый альбом'; $dictionary['You have no any album'] = 'У вас нет альбомов'; -$dictionary['Photo Albums'] = 'Фото альбомов'; -$dictionary['Album Privacy'] = 'Доступ альбомов'; +$dictionary['Photo Albums'] = 'Фотоальбомов'; +$dictionary['Album Privacy'] = 'Доступ к альбомам'; $dictionary['Description'] = 'Описание'; $dictionary['Created'] = 'Создан'; $dictionary['Edit Album'] = 'Редактировать альбом'; -$dictionary['View Album'] = 'Просмотр альбома'; -$dictionary['Delete Album'] = 'Удаление альбома'; +$dictionary['View Album'] = 'Просмотреть альбом'; +$dictionary['Delete Album'] = 'Удалить альбом'; $dictionary['photos'] = 'фотографий'; $dictionary['Upload'] = 'Загрузить'; $dictionary['Choose'] = 'Обзор'; +$dictionary['Uploaded'] = 'Загруженные'; Modified: app/views/photoapp/album/_edit_menu.tpl =================================================================== --- app/views/photoapp/album/_edit_menu.tpl 2008-05-07 07:55:15 UTC (rev 175) +++ app/views/photoapp/album/_edit_menu.tpl 2008-05-07 15:41:03 UTC (rev 176) @@ -2,6 +2,7 @@ <div class="left"> <ul class="toggle_tabs"> <li class="first"><a href="/photoapp/album/add_photo/{id}" class="<?= $controller->getActionName() == 'add_photo' ? 'selected' : '' ?>">_{Add Photos}</a></li><? + ?><li class="first"><a href="/photoapp/album/uploaded/{id}" class="<?= $controller->getActionName() == 'uploaded' ? 'selected' : '' ?>">_{Edit uploaded}</a></li><? ?><li><a href="/photoapp/album/edit/{id}" class="last <?= $controller->getActionName() == 'edit' ? 'selected' : '' ?>">_{Edit Info}</a></li><? ?><li><a href="/photoapp/album/delete/{id}" class="last <?= $controller->getActionName() == 'delete' ? 'selected' : '' ?>">_{Delete}</a></li> </ul> Added: app/views/photoapp/album/_edit_title.tpl =================================================================== --- app/views/photoapp/album/_edit_title.tpl (rev 0) +++ app/views/photoapp/album/_edit_title.tpl 2008-05-07 15:41:03 UTC (rev 176) @@ -0,0 +1,11 @@ +<div class="title_bar"> + <div class="info"> + <div class="header"> + <div class="name">_{Edit Album}</div> + </div> + <div class="clearfix"></div> + </div> +</div> +<div class="clearfix"></div> + +<?= $controller->renderErrors() ?> \ No newline at end of file Modified: app/views/photoapp/album/add_photo.tpl =================================================================== --- app/views/photoapp/album/add_photo.tpl 2008-05-07 07:55:15 UTC (rev 175) +++ app/views/photoapp/album/add_photo.tpl 2008-05-07 15:41:03 UTC (rev 176) @@ -14,7 +14,7 @@ <?= $controller->renderPartial("edit_menu") ?> <div class="album_step"> - <?= $form_tag_helper->start_form_tag(array('action'=>'add_photo', 'id' => $album->getId())) ?> + <?= $form_tag_helper->start_form_tag(array('action'=>'add_photo', 'id' => $album->getId(), 'enctype' => 'multipart/form-data')) ?> <div class="form_create_clear red"> Modified: app/views/photoapp/album/edit.tpl =================================================================== --- app/views/photoapp/album/edit.tpl 2008-05-07 07:55:15 UTC (rev 175) +++ app/views/photoapp/album/edit.tpl 2008-05-07 15:41:03 UTC (rev 176) @@ -1,6 +1,3 @@ - -<?= $controller->renderErrors() ?> - <div class="title_bar"> <div class="info"> <div class="header"> @@ -11,6 +8,8 @@ </div> <div class="clearfix"></div> +<?= $controller->renderErrors() ?> + <?= $controller->renderPartial("edit_menu") ?> Added: app/views/photoapp/album/uploaded.tpl =================================================================== --- app/views/photoapp/album/uploaded.tpl (rev 0) +++ app/views/photoapp/album/uploaded.tpl 2008-05-07 15:41:03 UTC (rev 176) @@ -0,0 +1,28 @@ +<?= $controller->renderPartial("edit_title") ?> + +<?= $controller->renderPartial("edit_menu") ?> + + +<div class="album_step"> + <?= $form_tag_helper->start_form_tag(array('action'=>'uploaded')) ?> + + <? if ($uploaded_albums == 0) {?> + <div class="noalbums"> + _{You have no any uploaded and not edited photos}. + </div> + <? } else {?> + + <div class="container"> + {loop uploaded_albums} + <div class="album"> + <div class="img">IMG: <?= $uploaded_album->get('img')?></div> + </div> + {end} + </div> + <div class="clearfix"></div> + <? }?> + + + </form> +</div> +<div class="clearfix"></div> Added: public/stylesheets/photoapp/Photoapp.css =================================================================== This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-05-07 17:40:21
|
Revision: 177 http://isocial.svn.sourceforge.net/isocial/?rev=177&view=rev Author: dim0s77 Date: 2008-05-07 10:40:27 -0700 (Wed, 07 May 2008) Log Message: ----------- create template for topic messages Modified Paths: -------------- app/controllers/groupapp/board_controller.php app/views/groupapp/board/show_topic.tpl public/stylesheets/groupapp/Board.css Modified: app/controllers/groupapp/board_controller.php =================================================================== --- app/controllers/groupapp/board_controller.php 2008-05-07 15:41:03 UTC (rev 176) +++ app/controllers/groupapp/board_controller.php 2008-05-07 17:40:27 UTC (rev 177) @@ -9,12 +9,15 @@ function show_topic () { if (!empty($this->params['id'])) { - $topic = $this->GroupappMessage->findFirst(array( 'id' => $this->params['id'] )); + $topic = $this->GroupappMessage->find('all', + array('conditions' => + array("topic_id = ?", $this->params['id'])) + ); if ($topic) { - $member = $this->GroupappMember->findFirst(array( 'group_id' => $topic->group_id, + $member = $this->GroupappMember->findFirst(array( 'group_id' => $topic[0]->group_id, 'user_id' => $this->current_user->getId() )); - $group = $this->GroupappGroup->findFirst(array( 'id' => $topic->group_id )); + $group = $this->GroupappGroup->findFirst(array( 'id' => $topic[0]->group_id )); if (($group && $group->access == 1) || $member) { $this->topic = $topic; } else { Modified: app/views/groupapp/board/show_topic.tpl =================================================================== --- app/views/groupapp/board/show_topic.tpl 2008-05-07 15:41:03 UTC (rev 176) +++ app/views/groupapp/board/show_topic.tpl 2008-05-07 17:40:27 UTC (rev 177) @@ -4,7 +4,7 @@ <div class="submenu"> <div class="menu_block"> - <div class="header">_{Topic}: {topic.subject?}</div> + <div class="header">_{Topic}: {topic-0.subject?}</div> </div> <div class="menu_block right"> @@ -15,3 +15,37 @@ <div class="clearfix"></div> {end} <?= $controller->renderErrors() ?> + +<div class="messages_list"> + <div class="info">Displaying all 3 posts by 2 people.</div> + <div class="row"> + + <div class="actions"> + <ul class="actions_list"> + <li><a href="/groupapp/">_{Reply to}</a></li> + <li><a href="/groupapp/group/edit_info/{group.id?}">_{Mark as Irrelevant}</a></li> + <li><a href="/groupapp/group/edit_members/{group.id?}">_{Report}</a></li> + <li><a href="/groupapp/group/edit_members/{group.id?}">_{Delete Post}</a></li> + </ul> + </div> + + <div class="avatar"> + <a href="/profile/show/{sender.id?}"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> + <div class="subtext">Post # </div> + <div class="subtext black">1 reply</div> + </div> + + <div class="message"> + <div class="head"> + <div class="sender">wrote</div> + <div class="subtext">datetime </div> + </div> + <div class="body"> + body + </div> + </div> + + </div> + <div class="clearfix"></div> +</div> +<div class="clearfix"></div> Modified: public/stylesheets/groupapp/Board.css =================================================================== --- public/stylesheets/groupapp/Board.css 2008-05-07 15:41:03 UTC (rev 176) +++ public/stylesheets/groupapp/Board.css 2008-05-07 17:40:27 UTC (rev 177) @@ -8,3 +8,58 @@ border: solid 1px #dddddd; } +.messages_list { + padding-top: 10px; + float: left; + background: #ffffff; + width: 100%; +} + +.messages_list .info { + padding: 0px 0px 5px 20px; +} + +.messages_list .row { + border-top: 1px solid #cccccc; + display: block; + padding: 10px; +} + +.messages_list .row .actions { + float: right; + width: 165px; +} + +.messages_list .row .avatar { + float: left; + width: 60px; +} + +.subtext { + display: block; + padding: 2px 0px 0px 0px; + font-size: 9px; + color: #777777; +} + +.subtext.black { + color: #000000; +} + +.messages_list .row .message { + float: left; + width: 370px; + padding-left: 5px; +} + +.messages_list .row .message .head { + padding: 3px; + border-top: 1px solid #3b5998; + border-bottom: 1px solid #e2e2e2; + background: #f7f7f7; +} + +.messages_list .row .message .body { + background: #ffffff; + padding: 10px 3px 10px 3px; +} \ 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: <fsn...@us...> - 2008-05-12 16:36:53
|
Revision: 183 http://isocial.svn.sourceforge.net/isocial/?rev=183&view=rev Author: fsnobody Date: 2008-05-12 09:35:27 -0700 (Mon, 12 May 2008) Log Message: ----------- comment uploaded Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/views/photoapp/album/index.tpl app/views/photoapp/album/uploaded.tpl public/stylesheets/photoapp/Album.css Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-12 09:43:21 UTC (rev 182) +++ app/controllers/photoapp/album_controller.php 2008-05-12 16:35:27 UTC (rev 183) @@ -29,8 +29,20 @@ } */ function uploaded () { - $this->uploaded_photos = $this->PhotoappPhoto->find('all', array('conditions' => array("name =''", "caption =''"))); - return; + if (!empty($this->params['photo']) && $this->Request->isPost() && $this->params['photo']['action_comment'] == 'do_comment'){ + unset($this->params['photo']['action_comment']); + foreach ($this->params['photo'] as $k => $v) { + $photo = $this->PhotoappPhoto->findFirst(array('id' => $k)); + $photo->setAttributes($v); + //$photo->name = $v['name']; + //$photo->caption = $v['description']; + $photo->save(); + } + $this->redirectTo(array('action' => 'index')); + } else { + $this->uploaded_photos = $this->PhotoappPhoto->find('all', array('conditions' => array("name =''", "caption =''"))); + return; + } } function add () { Modified: app/views/photoapp/album/index.tpl =================================================================== --- app/views/photoapp/album/index.tpl 2008-05-12 09:43:21 UTC (rev 182) +++ app/views/photoapp/album/index.tpl 2008-05-12 16:35:27 UTC (rev 183) @@ -26,7 +26,10 @@ <div class="container"> {loop my_albums} <div class="album"> - <div class="img"><img src="/preview/index/100x100/<?= $my_album->get('img')?>" /></div> + <div class="img"><? if ($my_album->get('img')) {?><img src="/preview/index/100x100/<?= $my_album->get('img')?>" /><? + } else {?>No Cover choosed<? + } + ?></div> <div class="info"> <div class="name_album"><a href="/photoapp/album/view/<?= $my_album->get('id')?>"><?= $my_album->get('name') ?></a></div> <div class="photos_count">_{photos}: <?= $my_album->get('photos_count')?> </div> Modified: app/views/photoapp/album/uploaded.tpl =================================================================== --- app/views/photoapp/album/uploaded.tpl 2008-05-12 09:43:21 UTC (rev 182) +++ app/views/photoapp/album/uploaded.tpl 2008-05-12 16:35:27 UTC (rev 183) @@ -3,23 +3,51 @@ <?= $controller->renderPartial("edit_menu") ?> -<div class="album_step"> +<div class="uploaded_container"> <?= $form_tag_helper->start_form_tag(array('action'=>'uploaded')) ?> - + <?= $form_helper->hidden_field('photo', 'action_comment', array('value' => 'do_comment'))?> <? if ($uploaded_photos == 0) {?> <div class="noalbums"> _{You have no any uploaded and not edited photos}. </div> <? } else {?> - <div class="container"> + <div class="edit_container"> {loop uploaded_photos} - <div class="album"> - <div class="img red"> + <div class="photo_comment"> + <div class="img"> <img src="/preview/index/100x100/<?= $uploaded_photo->get('img')?>" /> </div> + <div class="data"> + + <div class="form_create_row"> + <label >_{Name}:</label> + <div class="form_create_col"> + <?= $form_helper->text_field('photo[' . $uploaded_photo->get('id') . ']', 'name', array('class' => 'text_input small')) ?> + </div> + </div> + <div class="clearfix"></div> + + <div class="form_create_row"> + <label >_{Description}:</label> + <div class="form_create_col"> + <?= $form_helper->text_area('photo[' . $uploaded_photo->get('id') . ']', 'caption', array('rows' => '5', 'class' => 'small')) ?> + </div> + </div> + <div class="clearfix"></div> + + </div> </div> + <div class="clearfix"></div> {end} + + <div class="form_create_row"> + <label class="medium"> </label> + <div class="form_create_col"> + <input class="submitinput" type="submit" value="_{Update Info}"/> + </div> + </div> + <div class="clearfix"></div> </div> <div class="clearfix"></div> <? }?> Modified: public/stylesheets/photoapp/Album.css =================================================================== --- public/stylesheets/photoapp/Album.css 2008-05-12 09:43:21 UTC (rev 182) +++ public/stylesheets/photoapp/Album.css 2008-05-12 16:35:27 UTC (rev 183) @@ -119,6 +119,17 @@ } +.form_create_row .medium { + font-size: 10px; + display: block; + width: 200px; + float: left; + margin: 0px; + height: 30px; + line-height: 30px; + +} + .form_create_col { float: left; width: 200px; @@ -161,6 +172,25 @@ } +.uploaded_container { + padding: 10px 10px; + background: #ffffff; +} + +.photo_comment .img { + float: left; + width: 120px; + height: 170px; + text-align: center; + padding-top: 10px; +} + +.photo_comment .data { + float: left; + width: 500px; + height: 170px; +} + .album { border: 1px solid #cccccc; background: #ffffff; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-13 05:09:41
|
Revision: 185 http://isocial.svn.sourceforge.net/isocial/?rev=185&view=rev Author: fsnobody Date: 2008-05-12 22:09:48 -0700 (Mon, 12 May 2008) Log Message: ----------- minor changes in templates Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/views/photoapp/album/_edit_title.tpl app/views/photoapp/album/add_photo.tpl app/views/photoapp/album/delete.tpl app/views/photoapp/album/edit.tpl public/stylesheets/photoapp/Album.css Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-12 16:37:04 UTC (rev 184) +++ app/controllers/photoapp/album_controller.php 2008-05-13 05:09:48 UTC (rev 185) @@ -34,12 +34,14 @@ foreach ($this->params['photo'] as $k => $v) { $photo = $this->PhotoappPhoto->findFirst(array('id' => $k)); $photo->setAttributes($v); - //$photo->name = $v['name']; - //$photo->caption = $v['description']; $photo->save(); } $this->redirectTo(array('action' => 'index')); } else { + if (!empty($this->params['id']) && $this->PhotoappAlbum->find($this->params['id'])) { + // pre delete + $this->album = $this->PhotoappAlbum->find($this->params['id']); + } $this->uploaded_photos = $this->PhotoappPhoto->find('all', array('conditions' => array("name =''", "caption =''"))); return; } @@ -134,7 +136,7 @@ } } } // for - $this->redirectTo(array('action' => 'uploaded')); + $this->redirectTo(array('action' => 'uploaded', 'id' => $this->params['id'])); } Modified: app/views/photoapp/album/_edit_title.tpl =================================================================== --- app/views/photoapp/album/_edit_title.tpl 2008-05-12 16:37:04 UTC (rev 184) +++ app/views/photoapp/album/_edit_title.tpl 2008-05-13 05:09:48 UTC (rev 185) @@ -1,7 +1,7 @@ <div class="title_bar"> <div class="info"> <div class="header"> - <div class="name">_{Edit Album}</div> + <div class="name">_{Edit Album} - <span><?= $album->get('name'); ?></span></div> </div> <div class="clearfix"></div> </div> Modified: app/views/photoapp/album/add_photo.tpl =================================================================== --- app/views/photoapp/album/add_photo.tpl 2008-05-12 16:37:04 UTC (rev 184) +++ app/views/photoapp/album/add_photo.tpl 2008-05-13 05:09:48 UTC (rev 185) @@ -1,18 +1,10 @@ +<?= $controller->renderPartial("edit_title") ?> +<?= $controller->renderPartial("edit_menu") ?> + <?= $controller->renderErrors() ?> -<div class="title_bar"> - <div class="info"> - <div class="header"> - <div class="name">_{Edit Album}</div> - </div> - <div class="clearfix"></div> - </div> -</div> -<div class="clearfix"></div> -<?= $controller->renderPartial("edit_menu") ?> - <div class="album_step"> <?= $form_tag_helper->start_form_tag(array('action'=>'add_photo', 'id' => $album->getId()), array('multipart' => true)) ?> Modified: app/views/photoapp/album/delete.tpl =================================================================== --- app/views/photoapp/album/delete.tpl 2008-05-12 16:37:04 UTC (rev 184) +++ app/views/photoapp/album/delete.tpl 2008-05-13 05:09:48 UTC (rev 185) @@ -1,18 +1,10 @@ +<?= $controller->renderPartial("edit_title") ?> +<?= $controller->renderPartial("edit_menu") ?> + <?= $controller->renderErrors() ?> -<div class="title_bar"> - <div class="info"> - <div class="header"> - <div class="name">_{Edit Album}</div> - </div> - <div class="clearfix"></div> - </div> -</div> -<div class="clearfix"></div> -<?= $controller->renderPartial("edit_menu") ?> - <div class="delete_album"> <div class="delete_form"> <form action="/photoapp/album/delete/{id}" method="post"> Modified: app/views/photoapp/album/edit.tpl =================================================================== --- app/views/photoapp/album/edit.tpl 2008-05-12 16:37:04 UTC (rev 184) +++ app/views/photoapp/album/edit.tpl 2008-05-13 05:09:48 UTC (rev 185) @@ -1,18 +1,10 @@ -<div class="title_bar"> - <div class="info"> - <div class="header"> - <div class="name">_{Edit Album}</div> - </div> - <div class="clearfix"></div> - </div> -</div> -<div class="clearfix"></div> +<?= $controller->renderPartial("edit_title") ?> -<?= $controller->renderErrors() ?> - <?= $controller->renderPartial("edit_menu") ?> +<?= $controller->renderErrors() ?> + <div class="album_step"> <?= $form_tag_helper->start_form_tag(array('action'=>'edit', 'id' => $album->getId())) ?> <?= $controller->renderPartial("form") ?> Modified: public/stylesheets/photoapp/Album.css =================================================================== --- public/stylesheets/photoapp/Album.css 2008-05-12 16:37:04 UTC (rev 184) +++ public/stylesheets/photoapp/Album.css 2008-05-13 05:09:48 UTC (rev 185) @@ -37,6 +37,10 @@ padding: 7px 0px 7px 22px; } +.name span{ + font-weight: normal; +} + .title_bar .info .subheader { } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-13 05:48:38
|
Revision: 186 http://isocial.svn.sourceforge.net/isocial/?rev=186&view=rev Author: fsnobody Date: 2008-05-12 22:48:43 -0700 (Mon, 12 May 2008) Log Message: ----------- view album desifn v1 Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/views/photoapp/album/_edit_menu.tpl app/views/photoapp/album/uploaded.tpl public/stylesheets/photoapp/Album.css Added Paths: ----------- app/views/photoapp/album/view.tpl Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-13 05:09:48 UTC (rev 185) +++ app/controllers/photoapp/album_controller.php 2008-05-13 05:48:43 UTC (rev 186) @@ -13,7 +13,12 @@ $this->count_albums = 0; } - function show () { + function view () { + if (!empty($this->params['id']) && $this->PhotoappAlbum->find($this->params['id'])) { + $this->album = $this->PhotoappAlbum->find($this->params['id']); + } + $this->photos = $this->PhotoappPhoto->find('all', array('conditions' => array("album_id =" . $this->params['id']))); + return; } function search () { @@ -58,13 +63,10 @@ $this->importErrors( $this->PhotoappAlbum->getErrors() ); } } - } function add_photo () { - if (!empty($this->params['album']) && !empty($_FILES)){ - // $this->_upload($this->params); } else if ($this->params['id']) { $this->album = $this->PhotoappAlbum->find($this->params['id']); @@ -87,7 +89,6 @@ $this->album = $this->PhotoappAlbum->find($this->params['id']); return; } - } function help () { @@ -98,7 +99,6 @@ // delete $album = $this->PhotoappAlbum->find($this->params['id']); if ($album->get('owner') == $this->current_user->getId() && $this->Request->isPost()) { - if( $this->PhotoappPhoto->destroyAll("album_id = " . $this->params['id']) && $this->PhotoappAlbum->destroyAll("id = " . $this->params['id'])) { $this->redirectTo(array('action' => 'index')); return; @@ -131,7 +131,6 @@ } $photo->save(); $album->photos_count += 1; - $album->save(); } } Modified: app/views/photoapp/album/_edit_menu.tpl =================================================================== --- app/views/photoapp/album/_edit_menu.tpl 2008-05-13 05:09:48 UTC (rev 185) +++ app/views/photoapp/album/_edit_menu.tpl 2008-05-13 05:48:43 UTC (rev 186) @@ -2,6 +2,7 @@ <div class="left"> <ul class="toggle_tabs"> <li class="first"><a href="/photoapp/album/add_photo/{id}" class="<?= $controller->getActionName() == 'add_photo' ? 'selected' : '' ?>">_{Add Photos}</a></li><? + ?><li class="first"><a href="/photoapp/album/view/{id}" class="<?= $controller->getActionName() == 'view' ? 'selected' : '' ?>">_{View}</a></li><? ?><li class="first"><a href="/photoapp/album/uploaded/{id}" class="<?= $controller->getActionName() == 'uploaded' ? 'selected' : '' ?>">_{Edit uploaded}</a></li><? ?><li><a href="/photoapp/album/edit/{id}" class="last <?= $controller->getActionName() == 'edit' ? 'selected' : '' ?>">_{Edit Info}</a></li><? ?><li><a href="/photoapp/album/delete/{id}" class="last <?= $controller->getActionName() == 'delete' ? 'selected' : '' ?>">_{Delete}</a></li> Modified: app/views/photoapp/album/uploaded.tpl =================================================================== --- app/views/photoapp/album/uploaded.tpl 2008-05-13 05:09:48 UTC (rev 185) +++ app/views/photoapp/album/uploaded.tpl 2008-05-13 05:48:43 UTC (rev 186) @@ -2,6 +2,7 @@ <?= $controller->renderPartial("edit_menu") ?> +<?= $controller->renderErrors() ?> <div class="uploaded_container"> <?= $form_tag_helper->start_form_tag(array('action'=>'uploaded')) ?> Added: app/views/photoapp/album/view.tpl =================================================================== --- app/views/photoapp/album/view.tpl (rev 0) +++ app/views/photoapp/album/view.tpl 2008-05-13 05:48:43 UTC (rev 186) @@ -0,0 +1,33 @@ +<?= $controller->renderPartial("edit_title") ?> + +<?= $controller->renderPartial("edit_menu") ?> + +<?= $controller->renderErrors() ?> + +<div class="uploaded_container"> + <?= $form_tag_helper->start_form_tag(array('action'=>'view')) ?> + <?= $form_helper->hidden_field('photo', 'action_view', array('value' => 'do_view'))?> + <? if ($photos == 0) {?> + <div class="noalbums"> + _{You have no any uploaded photos to this album}. + </div> + <? } else {?> + + <div class="edit_container"> + {loop photos} + <div class="photo_view"> + <div class="img"> + <img src="/preview/index/100x100/<?= $photo->get('img')?>" /> + </div> + </div> + + {end} + + </div> + <div class="clearfix"></div> + <? }?> + + + </form> +</div> +<div class="clearfix"></div> Modified: public/stylesheets/photoapp/Album.css =================================================================== --- public/stylesheets/photoapp/Album.css 2008-05-13 05:09:48 UTC (rev 185) +++ public/stylesheets/photoapp/Album.css 2008-05-13 05:48:43 UTC (rev 186) @@ -282,4 +282,14 @@ .formbtns { text-align: right; +} + +.photo_view { + float: left; + border: 1px solid #dedeee; + width: 110px; + height: 120px; + padding: 3px; + margin: 2px 3px; + text-align: center; } \ 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: <agu...@us...> - 2008-05-13 10:08:42
|
Revision: 189 http://isocial.svn.sourceforge.net/isocial/?rev=189&view=rev Author: aguidrevitch Date: 2008-05-13 03:08:47 -0700 (Tue, 13 May 2008) Log Message: ----------- dialogs rewritten Modified Paths: -------------- app/helpers/access_field_helper.php app/helpers/city_helper.php app/helpers/dialog_helper.php app/models/city.php app/views/message/inbox.tpl app/views/message/outbox.tpl public/javascripts/dialog.js public/stylesheets/common/Error.css public/stylesheets/dialog.css timesheet/aguidrevitch.txt Removed Paths: ------------- app/controllers/dialog_controller.php app/views/dialog/ Deleted: app/controllers/dialog_controller.php =================================================================== --- app/controllers/dialog_controller.php 2008-05-13 09:16:01 UTC (rev 188) +++ app/controllers/dialog_controller.php 2008-05-13 10:08:47 UTC (rev 189) @@ -1,16 +0,0 @@ -<?php - -class DialogController extends ApplicationController -{ - var $models = array('Country', 'Region'); - - function access () { - return $this->renderPartial('access'); - } - - function new_city () { - return $this->renderPartial('new_city'); - } -} - -?> \ No newline at end of file Modified: app/helpers/access_field_helper.php =================================================================== --- app/helpers/access_field_helper.php 2008-05-13 09:16:01 UTC (rev 188) +++ app/helpers/access_field_helper.php 2008-05-13 10:08:47 UTC (rev 189) @@ -6,18 +6,40 @@ { function access_field ($object, $method, $options = array()) { - $this->object =& $this->_controller->{$object}; + $everyone = $this->t('Everyone'); + $friendsoffriends = $this->t('Friends of Friends'); + $onlyfriends = $this->t('Only Friends'); + $onlyme = $this->t('Only Me'); - if ($this->object) { - $value = $this->object->get($method); - } + $hidden = $this->_controller->form_helper->hidden_field($object, $method); + $dialog = $this->_controller->dialog_helper->dialog('access_dialog', 'hidden, title', array( + 'class' => 'access_dialog', + 'title' => $this->t('Who can see this?'), + 'yes' => $this->t('Save'), + 'cancel' => $this->t('Cancel'), + 'body' => TagHelper::content_tag('div', '', array('id' => 'access_title', 'class' => 'field')) . + "<select id='access_select'> + <option value='0'>$everyone</option> + <option value='1'>$friendsoffriends</option> + <option value='2'>$onlyfriends</option> + <option value='4'>$onlyme</option> + </select>", + 'onShow' => 'function (object) { + object._data = \'access_select_\' + Math.round(Math.random() * 1000000); + + $(\'access_title\').id += object._data; + $(\'access_select\').id += object._data; + + $(\'access_title\' + object._data).update(title); + $(\'access_select\' + object._data).setValue($F(hidden)); + }', + 'onYes' => 'function (object) { + $(hidden).setValue($F(\'access_select\' + object._data)); + }' + )); - $hidden = $this->_controller->form_helper->hidden_field($object, $method); - $id = $this->_controller->dialog_helper->generateid(); - $options = array_merge(array('reference_element' => $id, 'hidden' => "{$object}_{$method}"), $options); - $dialog = $this->_controller->dialog_helper->dialog('/dialog/access', $options); - $div = TagHelper::content_tag('div', '', array('id' => $id, 'class' => 'lock short', 'onclick' => $dialog)); - return $hidden . $div; + $div = TagHelper::content_tag('div', '', array('class' => 'lock short', 'onclick' => "access_dialog(this, '{$object}_{$method}', '" . addslashes($this->t(@$options['title'])) . "')")); + return $dialog . $hidden . $div; } } Modified: app/helpers/city_helper.php =================================================================== --- app/helpers/city_helper.php 2008-05-13 09:16:01 UTC (rev 188) +++ app/helpers/city_helper.php 2008-05-13 10:08:47 UTC (rev 189) @@ -52,18 +52,83 @@ $text_field = $this->_controller->form_helper->text_field(null, null, $tag_options); $div = TagHelper::content_tag('div', '', array('id' => "auto_{$object}_{$method}_auto_complete", 'class' => 'auto_complete')); $javascript = $this->auto_complete_field("auto_{$object}_{$method}", $completion_options); - $id = $this->_controller->dialog_helper->generateid(); - $dialog = $this->_controller->dialog_helper->dialog( - '/dialog/new_city', - array('reference_element' => $id, 'input' => $tag_options['id'], 'hidden' => "{$object}_{$method}")); + + $text_city_name = $this->t('City Name'); + $text_country = $this->t('Country'); + $Country = new Country (); + $dialog = $this->_controller->dialog_helper->dialog('city_dialog', 'input, hidden', array( + 'class' => 'city_dialog', + 'autohide' => false, + 'title' => $this->t('Add New City'), + 'yes' => $this->t('Save'), + 'cancel' => $this->t('Cancel'), + 'body' => " + <form id='city_addition_form'> + <div class='editform'> + <div id='ncdlg_errors'></div> + <div class='formrow'> + <label>{$text_city_name}</label>" . $this->_controller->form_helper->text_field('city', 'name', array('class' => 'mediumtextinput')) . + "</div> + <div class='formrow'> + <label>{$text_country}</label> " . + $this->_controller->form_options_helper->select('city', 'country_id', $Country->collect($Country->find(), 'name', 'id'), array(), array('prompt' => $this->t('Select Country:'))) . + "</div> + <div id='ncdlg_regions_list' class='formrow'> + </div> + </div> + </form>", + + 'onShow' => 'function (object) { + object._data = Math.round(Math.random() * 1000000); + + // updating ids + $(\'city_addition_form\').id += object._data; + $(\'ncdlg_errors\').id += object._data; + $(\'ncdlg_regions_list\').id += object._data; + $(\'city_country_id\').id += object._data; + $(\'city_name\').id += object._data; + + // preparing + $(\'city_name\' + object._data).setValue($F(input)); + $(\'city_country_id\' + object._data).onchange = function () { + if ($F(this)) { + new Ajax.Updater(\'ncdlg_regions_list\' + object._data, \'/city/get_regions\', { + postBody: $(\'city_addition_form\' + object._data).serialize() + }); + } + } + }', + + 'onYes' => 'function (object) { + new Ajax.Request(\'/city/add\', { + postBody: $(\'city_addition_form\' + object._data).serialize(), + onSuccess: function (response) { + if (response.responseText.isJSON()) { + var data = response.responseText.evalJSON(true); + if (data.id) { + $(hidden).setValue(data.id); + $(input).setValue(data.name); + object.hide(); + } + } else { + $(\'ncdlg_errors\' + object._data).update(response.responseText); + } + } + }); + }', + + 'onCancel' => 'function (object) { + object.hide(); + }', + )); + $new_city = TagHelper::tag('input', array( - 'id' => $id, 'class' => 'submitinput', 'type' => 'button', 'value' => $this->t('Not Listed') . "?", - 'onclick' => $dialog)); + 'onclick' => "city_dialog(this, 'auto_{$object}_{$method}', '{$object}_{$method}')")); - return $hidden . $hidden_prev . $text_field . $new_city . $div . $javascript; + return $hidden . $hidden_prev . $text_field . $dialog . $new_city . $div . $javascript; } } Modified: app/helpers/dialog_helper.php =================================================================== --- app/helpers/dialog_helper.php 2008-05-13 09:16:01 UTC (rev 188) +++ app/helpers/dialog_helper.php 2008-05-13 10:08:47 UTC (rev 189) @@ -1,24 +1,45 @@ <?php -require_once(AK_LIB_DIR.DS.'AkActionView'.DS.'helpers'.DS.'javascript_helper.php'); -require_once(AK_LIB_DIR.DS.'AkActionView'.DS.'helpers'.DS.'url_helper.php'); - class DialogHelper extends AkActionViewHelper { - var $current = 1; + var $drawn = array(); + + function dialog ($function_name, $params = array(), $js_options = array()) { - function generateid () { - return "dialog_trigger_" . $this->current++; + if (!empty($this->drawn[$function_name])) + return ''; + + $this->drawn[$function_name] = true; + + if (is_array($params)) $params = join(", ", $params); + $params = 'element, ' . $params; + + + $function = "function {$function_name} ({$params}) { new Dialog.Box(element, " . $this->_options_for_dialog($js_options) . "); }"; + return JavaScriptHelper::javascript_tag($function); } + + function _options_for_dialog($options) { + $_js_options = array(); + + foreach ($options as $k => $v) { + if ($v === false) $options[$k] = 'false'; + else if ($v === true) $options[$k] = 'true'; + } - function dialog ($url, $request_parameters = array()) { + foreach (array('onShow', 'onHide', 'onYes', 'onNo', 'onCancel', 'autoshow', 'autohide', 'unique') as $k) { + if ( array_key_exists($k, $options) ) $_js_options[] = "$k: {$options[$k]}"; + } - if (empty($request_parameters['reference_element'])) { - return "alert('id of element that triggered the dialog should be passed, please contact developers on this subject')"; + foreach (array('title', 'body', 'yes', 'no', 'cancel', 'hfloat', 'vfloat', 'class') as $k) { + if ( array_key_exists($k, $options) ) { + $options[$k] = addslashes($options[$k]); + $options[$k] = preg_replace('/\n/', '\n', $options[$k]); + $_js_options[] = "$k: \"{$options[$k]}\""; + } } - $request_parameters = JavaScriptHelper::_options_for_javascript(array_map(create_function('$e', 'return "\'$e\'";'), $request_parameters)); - return "__remote_dialog('$url', {$request_parameters})"; + return '{'.join(', ',$_js_options).'}'; } } Modified: app/models/city.php =================================================================== --- app/models/city.php 2008-05-13 09:16:01 UTC (rev 188) +++ app/models/city.php 2008-05-13 10:08:47 UTC (rev 189) @@ -4,6 +4,7 @@ { var $belongs_to = array('Country', 'Region'); var $votes_model = 'CityVote'; + var $strtolower = false; function findConditions () { return array('conditions' => array("country_id = ? AND region_id = ? AND name LIKE ?", $this->country_id, $this->region_id, $this->name)); Modified: app/views/message/inbox.tpl =================================================================== --- app/views/message/inbox.tpl 2008-05-13 09:16:01 UTC (rev 188) +++ app/views/message/inbox.tpl 2008-05-13 10:08:47 UTC (rev 189) @@ -74,70 +74,59 @@ }; function mark_as_unread (element) { - new Ajax.Updater('messages', - '/message/mark_unread', - { method:'post', asynchronous:true, parameters:$('messages_form').serialize()}); + new Ajax.Updater('messages', '/message/mark_unread', { + parameters:$('messages_form').serialize() + }); disable_action_links(); return false; } function mark_as_read (element) { - new Ajax.Updater('messages', - '/message/mark_read', - { method:'post', asynchronous:true, parameters:$('messages_form').serialize()}); + new Ajax.Updater('messages', '/message/mark_read', { + parameters:$('messages_form').serialize() + }); disable_action_links(); return false; } function delete_threads (element) { - new Dialog.Box('dlg', { - reference: element, - title: '_{Delete Threads}', - body: '_{Are you sure you want to delete selected threads}?', - yes: '_{Delete}', - cancel: '_{Cancel}', + new Dialog.Box(element, { + title: '_{Delete Threads}', + body: '_{Are you sure you want to delete selected threads}?', + yes: '_{Delete}', + cancel: '_{Cancel}', onYes : function () { - new Ajax.Updater('messages', - '/message/delete_inbox_thread', - { method:'post', - asynchronous:true, - parameters:$('messages_form').serialize(), - onSuccess: function () { - disable_action_links(); - } - }); - } - }); - + new Ajax.Updater('messages', '/message/delete_inbox_thread', { + parameters:$('messages_form').serialize(), + onSuccess: function () { + disable_action_links(); + } + }); + } + }); return false; } function delete_single_thread (element) { - new Dialog.Box('dlg', { - reference: element, - title: '_{Delete Thread}', - body: '_{Are you sure you want to delete this thread}?', - yes: '_{Delete}', - cancel: '_{Cancel}', + new Dialog.Box(element, { + title: '_{Delete Thread}', + body: '_{Are you sure you want to delete this thread}?', + yes: '_{Delete}', + cancel: '_{Cancel}', onYes : function () { - new Ajax.Updater('messages', - '/message/delete_inbox_thread', - { method:'post', - asynchronous:true, - parameters: 'check_messages[]=' + element.name, - onComplete: function () { - disable_action_links(); - tocheck = new Array(); - $$('input[type=checkbox]').each( - function (el) { - if (checkids.indexOf(el.value) != -1) { tocheck.push(el); } - }); - tocheck.invoke('click'); - } - }); - } - }); - + new Ajax.Updater('messages', '/message/delete_inbox_thread', { + parameters: 'check_messages[]=' + element.name, + onComplete: function () { + disable_action_links(); + tocheck = new Array(); + $$('input[type=checkbox]').each( function (el) { + if (checkids.indexOf(el.value) != -1) { tocheck.push(el); } + }); + tocheck.invoke('click'); + } + }); + } + }); return false; } @@ -149,28 +138,22 @@ } function onread (row_id) { - new Ajax.Updater(row_id, - '/message/mark_read_row', - { method:'post', - asynchronous: true, - parameters: 'row_id=' + row_id, - onSuccess: function () { - $(row_id).removeClassName('new_message'); - } - }); + new Ajax.Updater(row_id, '/message/mark_read_row', { + parameters: 'row_id=' + row_id, + onSuccess: function () { + $(row_id).removeClassName('new_message'); + } + }); return false; } function onunread (row_id) { - new Ajax.Updater(row_id, - '/message/mark_unread_row', - { method:'post', - asynchronous: true, - parameters: 'row_id=' + row_id, - onSuccess: function () { - $(row_id).addClassName('new_message'); - } - }); + new Ajax.Updater(row_id, '/message/mark_unread_row', { + parameters: 'row_id=' + row_id, + onSuccess: function () { + $(row_id).addClassName('new_message'); + } + }); } </script> Modified: app/views/message/outbox.tpl =================================================================== --- app/views/message/outbox.tpl 2008-05-13 09:16:01 UTC (rev 188) +++ app/views/message/outbox.tpl 2008-05-13 10:08:47 UTC (rev 189) @@ -51,60 +51,51 @@ if (checkboxes.length) { /* bug , see http://dev.rubyonrails.org/ticket/9976 checkboxes.invoke('click'); - */ + */ checkboxes.each( function(el) { el.click(); }); } }; function delete_threads (element) { - new Dialog.Box('dlg', { - reference: Element.extend(element), - title: '_{Delete Threads}', - body: '_{Are you sure you want to delete selected threads}?', - yes: '_{Delete}', - cancel: '_{Cancel}', + new Dialog.Box(element, { + title: '_{Delete Threads}', + body: '_{Are you sure you want to delete selected threads}?', + yes: '_{Delete}', + cancel: '_{Cancel}', hfloat: 'left', onYes : function () { - new Ajax.Updater('messages', - '/message/delete_outbox_thread', - { method:'post', - asynchronous:true, - parameters:$('messages_form').serialize(), - onSuccess: function () { - $("delete_link").addClassName('disabled'); - } - } - ); - } + new Ajax.Updater('messages', '/message/delete_outbox_thread', { + parameters:$('messages_form').serialize(), + onSuccess: function () { + $("delete_link").addClassName('disabled'); + } + }); + } }); + return false; } function delete_single_thread (element) { - new Dialog.Box('dlg', { - reference: Element.extend(element), - title: '_{Delete Thread}', - body: '_{Are you sure you want to delete this thread}?', - yes: '_{Delete}', + new Dialog.Box(element, { + title: '_{Delete Thread}', + body: '_{Are you sure you want to delete this thread}?', + yes: '_{Delete}', cancel: '_{Cancel}', onYes : function () { - new Ajax.Updater('messages', - '/message/delete_outbox_thread', - { method:'post', - asynchronous:true, - parameters: 'check_messages[]=' + element.name, - onComplete: function () { - $("delete_link").addClassName('disabled'); - tocheck = new Array(); - $$('input[type=checkbox]').each( - function (el) { - if (checkids.indexOf(el.value) != -1) { tocheck.push(el); } - }); - tocheck.invoke('click'); - } - } - ); - } + new Ajax.Updater('messages', '/message/delete_outbox_thread', { + parameters: 'check_messages[]=' + element.name, + onComplete: function () { + $("delete_link").addClassName('disabled'); + tocheck = new Array(); + $$('input[type=checkbox]').each(function (el) { + if (checkids.indexOf(el.value) != -1) { tocheck.push(el); } + }); + tocheck.invoke('click'); + } + }); + } }); + return false; } </script> Modified: public/javascripts/dialog.js =================================================================== --- public/javascripts/dialog.js 2008-05-13 09:16:01 UTC (rev 188) +++ public/javascripts/dialog.js 2008-05-13 10:08:47 UTC (rev 189) @@ -1,68 +1,98 @@ var Dialog = {}; -Dialog._collection = {}; +Dialog._collection = new Hash (); Dialog.Box = Class.create(); Object.extend(Dialog.Box.prototype, { + initialize: function(element, options) { + if (!$(element)) { + alert('Reference element is not specified'); + return; + } + + this.reference = $(element); + this.options = Object.extend({ - hfloat: 'right', - vfloat: 'bottom', - hide: true, - clone: true + hfloat: 'right', + vfloat: 'bottom', + autoshow: true, + autohide: true, }, options || {}); - this.reference = this.options['reference'] ? $(this.options['reference']) : null; - if (!this.reference) { - alert('Reference element is not specified'); - return; + this.id = 'dlg' + Dialog._collection.keys().size(); + this.dialog = new Element('div', { id: this.id, class: "action_dialog" }); + this.title = new Element('div', { id: "dlgheader" }); + this.body = new Element('div', { id: "dlgbody" }); + this.footer = new Element('div', { id: "dlgfooter" }); + this.buttons = new Element('div', { id: "dlgbuttons" }); + + // initializing buttons + if (this.options.yes) { + this.yesButton = new Element('input', { id: "dlgyes", type: "button", class: 'submitinput', value: this.options.yes }); + this.yesButton.observe('click', this.onYes.bind(this)); + this.buttons.insert(this.yesButton); } - this.dialog = $(element); + if (this.options.no) { + this.noButton = new Element('input', { id: "dlgno", type: "button", class: 'submitinput', value: this.options.no }); + this.noButton.observe('click', this.onNo.bind(this)); + this.buttons.insert(this.noButton); + } + if (this.options.cancel) { + this.cancelButton = new Element('input', { id: "dlgcancel", type: "button", class: 'cancelinput', value: this.options.cancel }); + this.cancelButton.observe('click', this.onCancel.bind(this)); + this.buttons.insert(this.cancelButton); + } + + if (this.options.title) { + this.title.update(this.options.title); + } + + if (this.options.body) { + this.body.update(this.options.body); + } + + this.footer.insert(this.buttons); + this.footer.insert(new Element('div', { class: "clearfix" })); + + this.dialog.insert(this.title); + this.dialog.insert(this.body); + this.dialog.insert(this.footer); + + var offset = this.reference.viewportOffset(); var dimensions = this.reference.getDimensions(); var vdimensions = document.viewport.getDimensions(); var vscrolloffset = document.viewport.getScrollOffsets(); - //alert(vdimensions.width + " : " + offset.left + " : " + dimensions.width); - if (this.options['hfloat'] == 'right') { + if (this.options.hfloat == 'right') { this.dialog.style.right = vdimensions.width - offset.left - dimensions.width + "px"; } else { this.dialog.style.left = offset.left + "px"; } - if (this.options['vfloat'] == 'bottom') { + if (this.options.vfloat == 'bottom') { this.dialog.style.top = vscrolloffset.top + offset.top + dimensions.height + "px"; } else { this.dialog.style.bottom = offset.top + "px"; } - - this.title = this._getDescendant('dlgheader'); - this.body = this._getDescendant('dlgbody'); - this.yesButton = this._getDescendant('dlgyes'); - this.noButton = this._getDescendant('dlgno'); - this.cancelButton = this._getDescendant('dlgcancel'); - if (this.options.title) this.title.update(this.options.title); - if (this.options.body) this.body.update(this.options.body); + if (this.options.class) + this.dialog.addClassName(this.options.class); - if (this.yesButton) this.yesButton.observe('click', this.onYes.bind(this)); - if (this.noButton) this.noButton.observe('click', this.onNo.bind(this)); - if (this.cancelButton) this.cancelButton.observe('click', this.onCancel.bind(this)); - - Dialog._collection[$(this.options.reference).id] = this; - + Dialog._collection[this.id] = this; + if (this.options.autoshow) this.show(); }, fixIEOverlapping: function () { Element.clonePosition(this.iefix, this.dialog); - this.iefix.style.zIndex = 1; + this.iefix.style.zIndex = 1; this.dialog.style.zIndex = 2; this.iefix.show(); }, show: function (event) { - this.dialog.hide(); Element.insert(document.body, this.dialog); if(!this.iefix && Prototype.Browser.IE && Element.getStyle(this.dialog, 'position')=='absolute') { @@ -73,59 +103,45 @@ this.iefix = $(this.dialog.id+'_iefix'); } - this.dialog.show(); - if (this.iefix) this.fixIEOverlapping(); - if (this.options.onShow) { this.options.onShow(this, event); } + + this.dialog.show(); + if (this.iefix) this.fixIEOverlapping(); }, hide: function (event) { - if(this.iefix) + + if(this.iefix) { this.iefix.hide(); + this.iefix.remove(); + } + this.dialog.hide(); + this.dialog.remove(); + if (this.options.onHide) { this.options.onHide(this, event); } }, - _getDescendant: function (id) { - return this.dialog.down('#' + id) || - this.dialog.descendants().find( function (d) { return d.id == id; }); - }, - onYes: function (event) { - if (this.options.hide) this.hide(); + if (this.options.autohide) this.hide(); if (this.options.onYes) { this.options.onYes(this, event); } }, onNo: function (event) { - if (this.options.hide) this.hide(); + if (this.options.autohide) this.hide(); if (this.options.onNo) { this.options.onNo(this, event); } }, onCancel: function (event) { - if (this.options.hide) this.hide(); + if (this.options.autohide) this.hide(); if (this.options.onCancel) { this.options.onCancel(this, event); } } }); - -function __remote_dialog (url, parameters) { - if (Dialog._collection[parameters.reference_element]) { - Dialog._collection[parameters.reference_element].show(); - } else { - new Ajax.Request(url, { - method: 'get', - parameters: parameters, - onSuccess: function (response) { - var html = new Element('div', { style: "display: none"}).update(response.responseText); - Element.insert(document.body, html); // triggering execution of javascripts - } - }); - } -} Modified: public/stylesheets/common/Error.css =================================================================== --- public/stylesheets/common/Error.css 2008-05-13 09:16:01 UTC (rev 188) +++ public/stylesheets/common/Error.css 2008-05-13 10:08:47 UTC (rev 189) @@ -1,5 +1,5 @@ .error { - margin: 0px 10px 10px 10px; + margin: 10px 10px 10px 10px; padding: 10px; border: 1px solid #dd3c10; background-color: #ffebe8; Modified: public/stylesheets/dialog.css =================================================================== --- public/stylesheets/dialog.css 2008-05-13 09:16:01 UTC (rev 188) +++ public/stylesheets/dialog.css 2008-05-13 10:08:47 UTC (rev 189) @@ -25,7 +25,7 @@ padding: 5px; } -.action_dialog #dlgfooter .buttons { +.action_dialog #dlgbuttons { margin: 0px 6px 0px 0px; float: right; } @@ -37,7 +37,7 @@ } .city_dialog { - width: 435px; + width: 500px; } .access_dialog { Modified: timesheet/aguidrevitch.txt =================================================================== --- timesheet/aguidrevitch.txt 2008-05-13 09:16:01 UTC (rev 188) +++ timesheet/aguidrevitch.txt 2008-05-13 10:08:47 UTC (rev 189) @@ -3,3 +3,5 @@ 2008-05-02,18:30,22:30,main,RT:1,"working on contact form, working around ie6 select bug" 2008-05-03,12:10,13:30,main,RT:1,"working on dialogs (fixing ie6 bug)" 2008-05-03,14:10,17:20,main,RT:1,"working on dialogs (fixing ie6 bug)" +2008-05-12,21:00,22:45,main,RT:1,"rewriting dialogs" +2008-05-13,10:10,13:10,main,RT:1,"rewriting dialogs" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-05-13 14:24:39
|
Revision: 193 http://isocial.svn.sourceforge.net/isocial/?rev=193&view=rev Author: aguidrevitch Date: 2008-05-13 07:24:46 -0700 (Tue, 13 May 2008) Log Message: ----------- city selector improved Modified Paths: -------------- app/controllers/city_controller.php app/helpers/city_helper.php app/models/city.php public/stylesheets/autocomplete.css Modified: app/controllers/city_controller.php =================================================================== --- app/controllers/city_controller.php 2008-05-13 11:51:13 UTC (rev 192) +++ app/controllers/city_controller.php 2008-05-13 14:24:46 UTC (rev 193) @@ -23,7 +23,7 @@ empty($this->regions) ? $this->renderNothing() : $this->renderPartial('regions'); } - function _get_conditions_for_city( $to_ascii = true) { + function _get_conditions_for_city( $to_ascii = true ) { $query = $this->params['city']; $aquery = utf8_to_ascii($query); if ($to_ascii && $aquery != $query) { @@ -51,6 +51,20 @@ ) ); + $aquery = utf8_to_ascii($this->params['city']); + + $native = array(); + $alternate = array(); + foreach ($entries as $entry) { + if (strpos($entry->name, $aquery) === false) { + array_push($native, $entry); + } else { + $entry->_alternate = true; + array_push($alternate, $entry); + } + } + $entries = array_merge($native, $alternate); + $this->renderText(empty($entries) ? ' ' : $this->city_helper->auto_complete_result($entries, $this->params['city'])); } } @@ -59,13 +73,13 @@ if (empty($this->params['city'])) { $this->renderNothing(); } else { - $entry = $this->City->findFirst( + $entries = $this->City->findFirst( array( 'conditions' => $this->_get_conditions_for_city(false), ) ); - - $this->renderText(empty($entry) ? ' ' : $entry->toJson()); + + $this->renderText(empty($entries) ? ' ' : $entries->toJson()); } } } Modified: app/helpers/city_helper.php =================================================================== --- app/helpers/city_helper.php 2008-05-13 11:51:13 UTC (rev 192) +++ app/helpers/city_helper.php 2008-05-13 14:24:46 UTC (rev 193) @@ -16,7 +16,7 @@ : TextHelper::h($city->name); $item = TagHelper::content_tag('div', $name) ; $comment = TagHelper::content_tag('div', $city->country->name, array('class' => 'informal')) ; - $items[] = TagHelper::content_tag('li', $name . $comment, array('id' => $city->getId())); + $items[] = TagHelper::content_tag('li', $name . $comment, array_merge(array('id' => $city->getId()), ($city->_alternate ? array('class' => 'alternate') : array() ))); } return TagHelper::content_tag('ul', join('', array_unique($items))); } @@ -124,7 +124,8 @@ $new_city = TagHelper::tag('input', array( 'class' => 'submitinput', - 'type' => 'button', + 'type' => 'button', + 'tabindex' => "0", 'value' => $this->t('Not Listed') . "?", 'onclick' => "city_dialog(this, 'auto_{$object}_{$method}', '{$object}_{$method}')")); Modified: app/models/city.php =================================================================== --- app/models/city.php 2008-05-13 11:51:13 UTC (rev 192) +++ app/models/city.php 2008-05-13 14:24:46 UTC (rev 193) @@ -5,6 +5,7 @@ var $belongs_to = array('Country', 'Region'); var $votes_model = 'CityVote'; var $strtolower = false; + var $_alternate = false; function findConditions () { return array('conditions' => array("country_id = ? AND region_id = ? AND name LIKE ?", $this->country_id, $this->region_id, $this->name)); Modified: public/stylesheets/autocomplete.css =================================================================== --- public/stylesheets/autocomplete.css 2008-05-13 11:51:13 UTC (rev 192) +++ public/stylesheets/autocomplete.css 2008-05-13 14:24:46 UTC (rev 193) @@ -29,12 +29,19 @@ list-style-type:none; } + div.auto_complete ul li { margin: 0; border-bottom: 1px solid #bdc7d8; padding: 4px; cursor: pointer; } + +div.auto_complete ul li.alternate { + background-color: #eeeeee; + color: #bdc7d8; +} + div.auto_complete ul li .informal { color: #bdc7d8; font-weight: bold; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-05-13 14:40:57
|
Revision: 195 http://isocial.svn.sourceforge.net/isocial/?rev=195&view=rev Author: dim0s77 Date: 2008-05-13 07:41:01 -0700 (Tue, 13 May 2008) Log Message: ----------- Added functionality to the 'show topic' tab Modified Paths: -------------- app/controllers/groupapp/board_controller.php app/locales/groupapp/board/ru.php app/models/groupapp_message.php app/views/groupapp/board/show_topic.tpl public/stylesheets/groupapp/Board.css Modified: app/controllers/groupapp/board_controller.php =================================================================== --- app/controllers/groupapp/board_controller.php 2008-05-13 14:25:40 UTC (rev 194) +++ app/controllers/groupapp/board_controller.php 2008-05-13 14:41:01 UTC (rev 195) @@ -7,8 +7,9 @@ function index () { if (!empty($this->params['id'])) { $messages = $this->GroupappMessage->find('all', - array('conditions' => - array("group_id = ?", $this->params['id'])) + array( + 'conditions' => array("group_id = ?", $this->params['id']) + ) ); $topics = array(); $persons = array(); @@ -37,8 +38,10 @@ function show_topic () { if (!empty($this->params['id'])) { $messages = $this->GroupappMessage->find('all', - array('conditions' => - array("topic_id = ?", $this->params['id'])) + array( + 'conditions' => array("topic_id = ?", $this->params['id']), + 'include' => 'user' + ) ); if ($messages) { $member = $this->GroupappMember->findFirst(array( 'group_id' => $messages[0]->group_id, Modified: app/locales/groupapp/board/ru.php =================================================================== --- app/locales/groupapp/board/ru.php 2008-05-13 14:25:40 UTC (rev 194) +++ app/locales/groupapp/board/ru.php 2008-05-13 14:41:01 UTC (rev 195) @@ -23,4 +23,18 @@ $dictionary['Search all topics'] = 'Искать все темы'; $dictionary['There are no discussions'] ='Обсуждений пока нет'; +$dictionary['Topic'] = 'Тема'; +$dictionary['Delete Topic'] = 'Удалить тему'; +$dictionary['Reply to Topic'] = 'Ответить по теме'; +$dictionary['You'] = 'Вы'; +$dictionary['wrote'] = 'по теме'; +$dictionary['replied to post'] = 'в ответ на сообщение'; +$dictionary['Reply'] = 'Ответить'; +$dictionary['to Your Post'] = 'себе'; +$dictionary['replies'] = 'ответов'; +$dictionary['Post'] = ''; +$dictionary['Mark as Irrelevant'] = 'Пометить как неуместное'; +$dictionary['Delete Post'] = 'Удалить сообщение'; +$dictionary['Report'] = 'Пожаловаться'; + ?> Modified: app/models/groupapp_message.php =================================================================== --- app/models/groupapp_message.php 2008-05-13 14:25:40 UTC (rev 194) +++ app/models/groupapp_message.php 2008-05-13 14:41:01 UTC (rev 195) @@ -2,11 +2,11 @@ class GroupappMessage extends ActiveRecord { - var $has_one = array('user' => array('class_name' => 'User', - 'foreign_key' => 'user_id'), - 'group' => array('class_name' => 'GroupappGroup', - 'foreign_key' => 'group_id') - ); + var $belongs_to = array('user' => array('class_name' => 'User', + 'foreign_key' => 'user_id'), + 'group' => array('class_name' => 'GroupappGroup', + 'foreign_key' => 'group_id') + ); /* function validateOnCreate () */ /* { */ Modified: app/views/groupapp/board/show_topic.tpl =================================================================== --- app/views/groupapp/board/show_topic.tpl 2008-05-13 14:25:40 UTC (rev 194) +++ app/views/groupapp/board/show_topic.tpl 2008-05-13 14:41:01 UTC (rev 195) @@ -23,29 +23,38 @@ <div class="actions"> <ul class="actions_list"> - <li><a href="/groupapp/">_{Reply to}</a></li> + <li><a href="/groupapp/">_{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="/groupapp/group/edit_info/{group.id?}">_{Mark as Irrelevant}</a></li> <li><a href="/groupapp/group/edit_members/{group.id?}">_{Report}</a></li> + <? } ?> <li><a href="/groupapp/group/edit_members/{group.id?}">_{Delete Post}</a></li> </ul> </div> <div class="avatar"> - <a href="/profile/show/{sender.id?}"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> - <div class="subtext">Post #{message_loop_counter}</div> - <div class="subtext black">1 reply</div> + <a href="/profile/show/{message.user_id?}"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> + <div class="subtext">_{Post} #{message_loop_counter}</div> + <input id="message_id{message.id?}" name="message_id{message.id?}" type="hidden" value="{message_loop_counter}" /> + <div class="subtext black">_{replies}: </div> </div> <div class="message"> <div class="head"> - <div class="sender">{message.user?}</div> + <span class="sender"> + <? if ($current_user->getId() == $message->user_id) { ?><span class="current_user">_{You}</span> + <? } else { ?><a href="/profile/show/{message.user_id?}"><span class="other_user">{message.user.name?}</span></a><? } ?> + </span> + {?message.reply_message_id} + <span>_{replied to post} #<script>document.write($('message_id{message.reply_message_id?}').readAttribute('value'));</script></span> + {else}_{wrote}{end} <div class="subtext">{message.created_at?}</div> </div> <div class="body">{message.body?}</div> </div> + <div class="clearfix"></div> </div> - <div class="clearfix"></div> {end} </div> <div class="clearfix"></div> Modified: public/stylesheets/groupapp/Board.css =================================================================== --- public/stylesheets/groupapp/Board.css 2008-05-13 14:25:40 UTC (rev 194) +++ public/stylesheets/groupapp/Board.css 2008-05-13 14:41:01 UTC (rev 195) @@ -89,6 +89,13 @@ background: #f7f7f7; } +.message .head .sender .current_user { +} + +.message .head .sender .other_user { + font-weight: bold; +} + .messages_list .row .message .body { background: #ffffff; padding: 10px 3px 10px 3px; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-05-13 18:20:23
|
Revision: 198 http://isocial.svn.sourceforge.net/isocial/?rev=198&view=rev Author: aguidrevitch Date: 2008-05-13 11:10:43 -0700 (Tue, 13 May 2008) Log Message: ----------- IE6 dialogs compatibility issues adressed Modified Paths: -------------- app/helpers/access_field_helper.php app/helpers/city_helper.php app/helpers/dialog_helper.php app/views/message/inbox.tpl app/views/message/outbox.tpl public/stylesheets/dialog.css Modified: app/helpers/access_field_helper.php =================================================================== --- app/helpers/access_field_helper.php 2008-05-13 18:09:45 UTC (rev 197) +++ app/helpers/access_field_helper.php 2008-05-13 18:10:43 UTC (rev 198) @@ -13,18 +13,18 @@ $hidden = $this->_controller->form_helper->hidden_field($object, $method); $dialog = $this->_controller->dialog_helper->dialog('access_dialog', 'hidden, title', array( - 'class' => 'access_dialog', - 'title' => $this->t('Who can see this?'), - 'yes' => $this->t('Save'), - 'cancel' => $this->t('Cancel'), - 'body' => TagHelper::content_tag('div', '', array('id' => 'access_title', 'class' => 'field')) . + 'classname' => 'access_dialog', + 'title' => $this->t('Who can see this?'), + 'yes' => $this->t('Save'), + 'cancel' => $this->t('Cancel'), + 'body' => TagHelper::content_tag('div', '', array('id' => 'access_title', 'class' => 'field')) . "<select id='access_select'> <option value='0'>$everyone</option> <option value='1'>$friendsoffriends</option> <option value='2'>$onlyfriends</option> <option value='4'>$onlyme</option> </select>", - 'onShow' => 'function (object) { + 'onShow' => 'function (object) { object._data = \'access_select_\' + Math.round(Math.random() * 1000000); $(\'access_title\').id += object._data; Modified: app/helpers/city_helper.php =================================================================== --- app/helpers/city_helper.php 2008-05-13 18:09:45 UTC (rev 197) +++ app/helpers/city_helper.php 2008-05-13 18:10:43 UTC (rev 198) @@ -57,12 +57,12 @@ $text_country = $this->t('Country'); $Country = new Country (); $dialog = $this->_controller->dialog_helper->dialog('city_dialog', 'input, hidden', array( - 'class' => 'city_dialog', - 'autohide' => false, - 'title' => $this->t('Add New City'), - 'yes' => $this->t('Save'), - 'cancel' => $this->t('Cancel'), - 'body' => " + 'classname' => 'city_dialog', + 'autohide' => false, + 'title' => $this->t('Add New City'), + 'yes' => $this->t('Save'), + 'cancel' => $this->t('Cancel'), + 'body' => " <form id='city_addition_form'> <div class='editform'> <div id='ncdlg_errors'></div> @@ -78,7 +78,7 @@ </div> </form>", - 'onShow' => 'function (object) { + 'onShow' => 'function (object) { object._data = Math.round(Math.random() * 1000000); // updating ids @@ -99,7 +99,7 @@ } }', - 'onYes' => 'function (object) { + 'onYes' => 'function (object) { new Ajax.Request(\'/city/add\', { postBody: $(\'city_addition_form\' + object._data).serialize(), onSuccess: function (response) { @@ -117,7 +117,7 @@ }); }', - 'onCancel' => 'function (object) { + 'onCancel' => 'function (object) { object.hide(); }', )); Modified: app/helpers/dialog_helper.php =================================================================== --- app/helpers/dialog_helper.php 2008-05-13 18:09:45 UTC (rev 197) +++ app/helpers/dialog_helper.php 2008-05-13 18:10:43 UTC (rev 198) @@ -15,7 +15,9 @@ $params = 'element, ' . $params; - $function = "function {$function_name} ({$params}) { new Dialog.Box(element, " . $this->_options_for_dialog($js_options) . "); }"; + $function = "function {$function_name} ({$params}) { + return new Dialog.Box(element, " . $this->_options_for_dialog($js_options) . "); +}"; return JavaScriptHelper::javascript_tag($function); } @@ -27,19 +29,19 @@ else if ($v === true) $options[$k] = 'true'; } - foreach (array('onShow', 'onHide', 'onYes', 'onNo', 'onCancel', 'autoshow', 'autohide', 'unique') as $k) { - if ( array_key_exists($k, $options) ) $_js_options[] = "$k: {$options[$k]}"; + foreach (array('onShow', 'onHide', 'onYes', 'onNo', 'onCancel', 'autoshow', 'autohide') as $k) { + if ( array_key_exists($k, $options) ) $_js_options[] = " '$k': {$options[$k]}"; } - foreach (array('title', 'body', 'yes', 'no', 'cancel', 'hfloat', 'vfloat', 'class') as $k) { + foreach (array('title', 'body', 'yes', 'no', 'cancel', 'hfloat', 'vfloat', 'classname') as $k) { if ( array_key_exists($k, $options) ) { $options[$k] = addslashes($options[$k]); - $options[$k] = preg_replace('/\n/', '\n', $options[$k]); - $_js_options[] = "$k: \"{$options[$k]}\""; + $options[$k] = preg_replace('/\n/', "\"\n + \"", $options[$k]); + $_js_options[] = " '$k': \"{$options[$k]}\""; } } - return '{'.join(', ',$_js_options).'}'; + return "{\n".join(",\n",$_js_options)."\n}"; } } Modified: app/views/message/inbox.tpl =================================================================== --- app/views/message/inbox.tpl 2008-05-13 18:09:45 UTC (rev 197) +++ app/views/message/inbox.tpl 2008-05-13 18:10:43 UTC (rev 198) @@ -91,10 +91,11 @@ function delete_threads (element) { new Dialog.Box(element, { - title: '_{Delete Threads}', - body: '_{Are you sure you want to delete selected threads}?', - yes: '_{Delete}', - cancel: '_{Cancel}', + classname: 'delete_dialog', + title: '_{Delete Threads}', + body: '_{Are you sure you want to delete selected threads}?', + yes: '_{Delete}', + cancel: '_{Cancel}', onYes : function () { new Ajax.Updater('messages', '/message/delete_inbox_thread', { parameters:$('messages_form').serialize(), @@ -109,10 +110,11 @@ function delete_single_thread (element) { new Dialog.Box(element, { - title: '_{Delete Thread}', - body: '_{Are you sure you want to delete this thread}?', - yes: '_{Delete}', - cancel: '_{Cancel}', + classname: 'delete_dialog', + title: '_{Delete Thread}', + body: '_{Are you sure you want to delete this thread}?', + yes: '_{Delete}', + cancel: '_{Cancel}', onYes : function () { new Ajax.Updater('messages', '/message/delete_inbox_thread', { parameters: 'check_messages[]=' + element.name, Modified: app/views/message/outbox.tpl =================================================================== --- app/views/message/outbox.tpl 2008-05-13 18:09:45 UTC (rev 197) +++ app/views/message/outbox.tpl 2008-05-13 18:10:43 UTC (rev 198) @@ -58,6 +58,7 @@ function delete_threads (element) { new Dialog.Box(element, { + classname: 'delete_dialog', title: '_{Delete Threads}', body: '_{Are you sure you want to delete selected threads}?', yes: '_{Delete}', @@ -77,6 +78,7 @@ function delete_single_thread (element) { new Dialog.Box(element, { + classname: 'delete_dialog', title: '_{Delete Thread}', body: '_{Are you sure you want to delete this thread}?', yes: '_{Delete}', Modified: public/stylesheets/dialog.css =================================================================== --- public/stylesheets/dialog.css 2008-05-13 18:09:45 UTC (rev 197) +++ public/stylesheets/dialog.css 2008-05-13 18:10:43 UTC (rev 198) @@ -32,8 +32,8 @@ /* particular dialogs */ -.loading_dialog { - width: 300px; +.delete_dialog { + width: 450px; } .city_dialog { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-14 10:32:23
|
Revision: 200 http://isocial.svn.sourceforge.net/isocial/?rev=200&view=rev Author: fsnobody Date: 2008-05-14 03:32:30 -0700 (Wed, 14 May 2008) Log Message: ----------- change location strore path, delimiter = @ Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/controllers/preview_controller.php app/views/photoapp/album/uploaded.tpl timesheet/eerunov.txt Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-13 18:14:45 UTC (rev 199) +++ app/controllers/photoapp/album_controller.php 2008-05-14 10:32:30 UTC (rev 200) @@ -134,13 +134,19 @@ if ($_FILES['album']['error'][$field] == 0 ) { // copy file; save photo - $copy_to = PROJECT_DIR . "public/images/uploaded/" . $_FILES['album']['name'][$field]; + $photo_name = microtime(true) . ".jpeg"; + $user_path = PROJECT_DIR . "public/images/uploaded/" . $this->current_user->getId(); + if(!file_exists($user_path)) { + `mkdir $user_path`; + `chmod 777 $user_path`; + } + $copy_to = $user_path . "/" . $photo_name;//$_FILES['album']['name'][$field]; $copy_from = $_FILES['album']['tmp_name'][$field]; if (move_uploaded_file($copy_from, $copy_to)) { $album = $this->PhotoappAlbum->find($this->params['id']); $photo = new PhotoappPhoto (); - $photo->img = $_FILES['album']['name'][$field]; + $photo->img = $this->current_user->getId() . "@" . $photo_name; $photo->album_id = $album->getId(); if( empty($album->img)) { $photo->is_cover = 1; Modified: app/controllers/preview_controller.php =================================================================== --- app/controllers/preview_controller.php 2008-05-13 18:14:45 UTC (rev 199) +++ app/controllers/preview_controller.php 2008-05-14 10:32:30 UTC (rev 200) @@ -10,6 +10,7 @@ @list($width, $height, $type) = explode('x', $this->params['size']); if ($width > 10 && $height > 10) { //$filename = join(DS, $this->params['path']); + $this->params['path'] = str_replace("@", "/", $this->params['path']); $file = AK_PUBLIC_DIR . "/images/uploaded/" . $this->params['path']; if (file_exists($file) && !is_dir($file)) { Modified: app/views/photoapp/album/uploaded.tpl =================================================================== --- app/views/photoapp/album/uploaded.tpl 2008-05-13 18:14:45 UTC (rev 199) +++ app/views/photoapp/album/uploaded.tpl 2008-05-14 10:32:30 UTC (rev 200) @@ -17,6 +17,7 @@ {loop uploaded_photos} <div class="photo_comment"> <div class="img"> + <img src="/preview/index/100x100/<?= $uploaded_photo->get('img')?>" /> </div> <div class="data"> Modified: timesheet/eerunov.txt =================================================================== --- timesheet/eerunov.txt 2008-05-13 18:14:45 UTC (rev 199) +++ timesheet/eerunov.txt 2008-05-14 10:32:30 UTC (rev 200) @@ -10,3 +10,4 @@ 2008-05-07,14:00,15:30,photoapp,RT:2,"photo controller" 2008-05-08,09:00,11:00,photoapp,RT:2,"preview controller use + add photo designet and part functional" 2008-05-12,09:00,11:00,photoapp,RT:2,"comment uploaded + cover onoad" +2008-05-13,07:00,09:10,photoapp,RT:2,"photo list + delete" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-05-15 09:21:39
|
Revision: 203 http://isocial.svn.sourceforge.net/isocial/?rev=203&view=rev Author: dim0s77 Date: 2008-05-15 02:21:41 -0700 (Thu, 15 May 2008) Log Message: ----------- complete page 'discussion board: topics list' Modified Paths: -------------- app/controllers/groupapp/board_controller.php app/controllers/groupapp/group_controller.php app/locales/groupapp/board/ru.php app/models/groupapp_member.php app/views/groupapp/board/_head.tpl app/views/groupapp/board/index.tpl app/views/groupapp/board/show_topic.tpl config/routes.php public/stylesheets/groupapp/Board.css timesheet/dim0s77.txt Modified: app/controllers/groupapp/board_controller.php =================================================================== --- app/controllers/groupapp/board_controller.php 2008-05-14 17:07:32 UTC (rev 202) +++ app/controllers/groupapp/board_controller.php 2008-05-15 09:21:41 UTC (rev 203) @@ -8,16 +8,16 @@ if (!empty($this->params['id'])) { $messages = $this->GroupappMessage->find('all', array( - 'conditions' => array("group_id = ?", $this->params['id']) + 'conditions' => array("group_id = ?", $this->params['id']), + 'include' => 'user' ) ); + $group = $this->GroupappGroup->findFirst(array( 'id = ?' => $this->params['id'] )); $topics = array(); - $persons = array(); if(!empty($messages)) { foreach ($messages as $message_loop_key => $message) { if (!isset($topics[$message->topic_id])) { $topics[$message->topic_id]['first'] = $message; - } else { } isset($topics[$message->topic_id]['posts']) ? $topics[$message->topic_id]['posts']++ : @@ -29,8 +29,10 @@ $topics[$message->topic_id]['persons'] = 1; } $topics[$message->topic_id]['last'] = $message; + $topics[$message->topic_id]['last'] = $message; } } + $this->group = $group; $this->topics = $topics; } } @@ -68,7 +70,7 @@ 'user_id' => $this->current_user->getId() )); if ($member) { - $message = $member->message->build(); + $message = $member->message->build(); $message->setAttributes($this->params['topic']); if (empty($message->subject)) { $message->subject = $this->t('(no topic)'); @@ -77,7 +79,7 @@ if (!$message->topic_id) { $message->topic_id = $message->getId(); if ($message->save()) { - $this->redirectTo(array('action' => 'show_topic', 'id' => $topic->getId())); + $this->redirectTo(array('action' => 'show_topic', 'id' => $message->getId())); return; } } Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-05-14 17:07:32 UTC (rev 202) +++ app/controllers/groupapp/group_controller.php 2008-05-15 09:21:41 UTC (rev 203) @@ -40,14 +40,14 @@ return; } } else if (!empty($this->params['id']) && $this->GroupappGroup->find($this->params['id'])) { - $this->group = $this->GroupappGroup->find($this->params['id']); + $this->group = $this->GroupappGroup->findFirst($this->params['id']); } $this->importErrors( $this->GroupappGroup->getErrors() ); } function edit_group () { if (!empty($this->params['group']) && !empty($this->params['id'])){ - $group = $this->GroupappGroup->findFirst(array( 'id' => $this->params['id'] )); + $group = $this->GroupappGroup->findFirst(array( 'id = ?' => $this->params['id'] )); $group->setAttributes($this->params['group']); if ($this->Request->isPost() && $group->save()) { $this->group = $group; Modified: app/locales/groupapp/board/ru.php =================================================================== --- app/locales/groupapp/board/ru.php 2008-05-14 17:07:32 UTC (rev 202) +++ app/locales/groupapp/board/ru.php 2008-05-15 09:21:41 UTC (rev 203) @@ -4,7 +4,7 @@ $dictionary = array(); $dictionary['Discussions'] = 'Обсуждения'; -$dictionary['Back to'] = 'Обратно в'; +$dictionary['Back to group'] = 'Обратно в группу'; $dictionary['Discussion Board'] = 'Список обсуждений'; $dictionary['Topic View'] = 'Просмотр темы'; $dictionary['Start New Topic'] = 'Начать новую тему'; @@ -23,6 +23,13 @@ $dictionary['Search all topics'] = 'Искать все темы'; $dictionary['There are no discussions'] ='Обсуждений пока нет'; +$dictionary['The total number of discussion topics'] = 'Общее число обсуждаемых тем'; +$dictionary['Latest post'] = 'Последнее сообщение'; +$dictionary['by'] = 'написал(а)'; +$dictionary['Posted on'] = ''; +$dictionary['Created on'] = 'Тема создана'; +$dictionary['posts'] = 'сообщений'; +$dictionary['persons'] = 'участников'; $dictionary['Topic'] = 'Тема'; $dictionary['Create new Topic'] = 'Создать новую тему'; $dictionary['Delete Topic'] = 'Удалить тему'; Modified: app/models/groupapp_member.php =================================================================== --- app/models/groupapp_member.php 2008-05-14 17:07:32 UTC (rev 202) +++ app/models/groupapp_member.php 2008-05-15 09:21:41 UTC (rev 203) @@ -2,8 +2,10 @@ 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') + var $belongs_to = array('user' => array('class_name' => 'User', + 'primary_key_name' => 'user_id'), + 'role' => array('class_name' => 'GroupMemberRole', + 'primary_key_name' => 'role_id') ); var $has_many = array( 'messages' => array('class_name' => 'GroupappMessage', 'foreign_key' => 'user_id') ); Modified: app/views/groupapp/board/_head.tpl =================================================================== --- app/views/groupapp/board/_head.tpl 2008-05-14 17:07:32 UTC (rev 202) +++ app/views/groupapp/board/_head.tpl 2008-05-15 09:21:41 UTC (rev 203) @@ -4,10 +4,10 @@ </div> <div class="info"> <div class="header"> - <div class="name groupapp">{group.name?} _{Discussions}</div> + <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 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-05-14 17:07:32 UTC (rev 202) +++ app/views/groupapp/board/index.tpl 2008-05-15 09:21:41 UTC (rev 203) @@ -23,27 +23,32 @@ </label> </div> - <input class="mediumtextinput search right" id="searchfield" name="" type="text" value="_{Search all topics}" onclick="on_search_topic_click(this)" onblur="on_search_topic_blur(this)" /> - </div> <div class="clearfix"></div> {?topics} <div class="messages_list"> - <div class="info">Displaying all 2 topics.</div> + <div class="info"> + <div class="left">_{The total number of discussion topics}: <?= count($topics) ?></div> + <input class="mediumtextinput search" id="searchfield" name="" type="text" value="_{Search all topics}" onclick="on_search_topic_click(this)" onblur="on_search_topic_blur(this)" /> + </div> + <div class="clearfix"></div> + <div class="container"> {loop topics} <div class="row<? if ($topic_loop_counter == 1) echo ' first'; ?>"> <div class="topic_info"> - <div class="subject"><a href="#">{topic-first.subject?}</a></div> - <span class="subtext black">{topic-posts?} post by {topic-persons?} person</span> - <span class="subtext">Created on {topic-first.created_at?}</span> + <div class="subject"><a href="/groupapp/board/show_topic/{topic-first.topic_id?}">{topic-first.subject?}</a></div> + <div class="subtext black">_{posts}: {topic-posts?}; _{persons}: {topic-persons?}</div> + <div class="subtext">_{Created on} {topic-first.created_at?}</div> </div> <div class="latest_post_info"> - <div class="sender">Latest post by</div> - <div class="subtext">Posted on {topic-last.created_at?}</div> + <div class="sender"> + <a href="/groupapp/board/show_topic/{topic-last.topic_id}#{topic-last.id}">_{Latest post}</a> _{by} + <a href="/profile/show/{topic-last.user.id?}">{topic-last.user.name?}</a></div> + <div class="subtext">_{Posted on} {topic-last.created_at?}</div> </div> <div class="clearfix"></div> Modified: app/views/groupapp/board/show_topic.tpl =================================================================== --- app/views/groupapp/board/show_topic.tpl 2008-05-14 17:07:32 UTC (rev 202) +++ app/views/groupapp/board/show_topic.tpl 2008-05-15 09:21:41 UTC (rev 203) @@ -17,7 +17,7 @@ <?= $controller->renderErrors() ?> <div class="messages_list"> - <div class="info">Displaying all 3 posts by 2 people.</div> + <div class="info"> </div> {loop messages} <div class="row"> @@ -36,7 +36,6 @@ <a href="/profile/show/{message.user_id?}"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> <div class="subtext">#{message_loop_counter}</div> <input id="message_id{message.id?}" name="message_id{message.id?}" type="hidden" value="{message_loop_counter}" /> - <div class="subtext black">_{replies}: </div> </div> <div class="message"> Modified: config/routes.php =================================================================== --- config/routes.php 2008-05-14 17:07:32 UTC (rev 202) +++ config/routes.php 2008-05-15 09:21:41 UTC (rev 203) @@ -3,8 +3,11 @@ // You can find more about routes on /lib/AkRouters.php and /test/test_AkRouter.php $Map->connect('/', array('controller' => 'default', 'action' => 'index')); -$Map->connect('/groupapp/:controller/:action/:id', array('controller' => 'group', 'action' => 'index', 'module' => 'groupapp')); -$Map->connect('/photoapp/:controller/:action/:id', array('controller' => 'album', 'action' => 'index', 'module' => 'photoapp')); +$Map->connect('/groupapp', array('controller' => 'group', 'action' => 'index', 'module' => 'groupapp')); +$Map->connect('/groupapp/board/:id', array('controller' => 'board', 'action' => 'index', 'module' => 'groupapp')); +$Map->connect('/groupapp/board/:action/:id', array('controller' => 'board', 'module' => 'groupapp')); +$Map->connect('/groupapp/group/:action/:id', array('controller' => 'group', 'module' => 'groupapp')); +$Map->connect('/photoapp/:controller/:action/:id', array('controller' => 'album', 'module' => 'photoapp')); $Map->connect('/preview/:action/:size/:path',array('controller' => 'preview', 'action' => 'index') ); $Map->connect('/:controller/:action/:id', array('controller' => 'default', 'action' => 'index')); $Map->connect('/:controller/:action/:from/:id', array('controller' => 'message', 'action' => 'show')); Modified: public/stylesheets/groupapp/Board.css =================================================================== --- public/stylesheets/groupapp/Board.css 2008-05-14 17:07:32 UTC (rev 202) +++ public/stylesheets/groupapp/Board.css 2008-05-15 09:21:41 UTC (rev 203) @@ -16,9 +16,16 @@ } .messages_list .info { - padding: 0px 0px 5px 20px; + padding: 0px 10px 5px 20px; + margin-bottom: 5px; + text-align: right; } +.messages_list .info .left { + float: left; + padding-top: 5px; +} + .messages_list .container { border-top: solid 1px #dddddd; background: #f7f7f7; Modified: timesheet/dim0s77.txt =================================================================== --- timesheet/dim0s77.txt 2008-05-14 17:07:32 UTC (rev 202) +++ timesheet/dim0s77.txt 2008-05-15 09:21:41 UTC (rev 203) @@ -18,3 +18,6 @@ 2008-05-13,16:30,17:40,groupapp,RT:3,"Add functionality to the 'show topic' tab" 2008-05-14,12:40,13:35,groupapp,RT:3,"discussions for group (replying to topic)" +2008-05-14,15:00,16:35,groupapp,RT:3,"discussions for group (replying to topic)" + +2008-05-15,10:20,12:20,groupapp,RT:3,"discussion board: topics list" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-05-15 19:05:04
|
Revision: 208 http://isocial.svn.sourceforge.net/isocial/?rev=208&view=rev Author: dim0s77 Date: 2008-05-15 12:04:44 -0700 (Thu, 15 May 2008) Log Message: ----------- discussion board: 'reply to post' implementation started Modified Paths: -------------- app/controllers/groupapp/board_controller.php app/views/groupapp/board/_menu.tpl app/views/groupapp/board/reply_to_post.tpl timesheet/dim0s77.txt Modified: app/controllers/groupapp/board_controller.php =================================================================== --- app/controllers/groupapp/board_controller.php 2008-05-15 18:20:44 UTC (rev 207) +++ app/controllers/groupapp/board_controller.php 2008-05-15 19:04:44 UTC (rev 208) @@ -142,7 +142,35 @@ function reply_to_post () { if (!empty($this->params['id'])) { + $messages = $this->GroupappMessage->find('all', + array( + 'conditions' => array("group_id = ?", $this->params['id']), + 'include' => 'user' + ) + ); + $message = $this->GroupappMessage->findFirst( + array( + 'conditions' => array("id = ?", $this->params['id']), + 'include' => 'user' + ) + ); + if ($message) { + $member = $this->GroupappMember->findFirst(array( 'group_id' => $message->group_id, + 'user_id' => $this->current_user->getId() + )); + $group = $this->GroupappGroup->find( $message->group_id ); + if (($group && $group->access == 1) || $member) { + $this->message_to_reply = $message; + $this->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; + } } + $this->addError('_common', 'Topic not found', 'This topic is not founded'); } } Modified: app/views/groupapp/board/_menu.tpl =================================================================== --- app/views/groupapp/board/_menu.tpl 2008-05-15 18:20:44 UTC (rev 207) +++ app/views/groupapp/board/_menu.tpl 2008-05-15 19:04:44 UTC (rev 208) @@ -1,19 +1,22 @@ <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/{group_id?}" class="<?= $controller->getActionName() == 'index' ? 'selected' : '' ?>">_{Discussion Board}</a></li><? if ($controller->getActionName() == 'show_topic' || - $controller->getActionName() == 'reply_to_topic' - ) { ?><li><a href="/groupapp/board/show_topic/{messages-0.topic_id?}" class="<?= $controller->getActionName() == 'show_topic' ? 'last selected' : '' ?>" >_{Topic View}</a></li><? } ?><? + $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><? } ?><? if ($controller->getActionName() == 'reply_to_topic') { ?> - <li><a href="/groupapp/board/reply_to_topic/{messages-0.topic_id?}" class="last selected">_{Post Reply}</a></li> + <li><a href="/groupapp/board/reply_to_topic/{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> <? } ?> </ul> </div> <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/{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-15 18:20:44 UTC (rev 207) +++ app/views/groupapp/board/reply_to_post.tpl 2008-05-15 19:04:44 UTC (rev 208) @@ -14,10 +14,7 @@ </div> <div class="formrow"> <label> - <!-- <?= $form_helper->hidden_field('topic', 'group_id', array('value' => $group->getId()))?> --> - <!-- {?topic.group_id}<input id="topic_group_id" name="topic[group_id]" type="hidden" value="{topic.group_id?}" />{end} --> - <!-- {?topic.topic_id}<input id="topic_topic_id" name="topic[topic_id]" type="hidden" value="{topic.topic_id?}" />{end} --> - <!-- {?topic.reply_message_id}<input id="topic_reply_topic_id" name="topic[reply_message_id]" type="hidden" value="{topic.reply_message_id?}" />{end} --> + <?= $form_helper->hidden_field('topic', 'group_id', array('value' => $message_to_reply->group_id))?> </label> <input class="submitinput" type="submit" value="_{Post}"> <input class="cancelinput" type="button" value="_{Cancel}"> Modified: timesheet/dim0s77.txt =================================================================== --- timesheet/dim0s77.txt 2008-05-15 18:20:44 UTC (rev 207) +++ timesheet/dim0s77.txt 2008-05-15 19:04:44 UTC (rev 208) @@ -22,3 +22,4 @@ 2008-05-15,10:20,12:20,groupapp,RT:3,"discussion board: topics list" 2008-05-15,18:35,21:15,groupapp,RT:3,"discussion board: reply to topic" +2008-05-15,21:15,22:00,groupapp,RT:3,"discussion board: reply to post" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-05-15 19:05:14
|
Revision: 209 http://isocial.svn.sourceforge.net/isocial/?rev=209&view=rev Author: aguidrevitch Date: 2008-05-15 12:05:14 -0700 (Thu, 15 May 2008) Log Message: ----------- instant messengers profile support added Modified Paths: -------------- app/controllers/profile_controller.php app/installers/user_installer.php app/models/user.php app/views/profile/contact.tpl timesheet/aguidrevitch.txt Modified: app/controllers/profile_controller.php =================================================================== --- app/controllers/profile_controller.php 2008-05-15 19:04:44 UTC (rev 208) +++ app/controllers/profile_controller.php 2008-05-15 19:05:14 UTC (rev 209) @@ -48,7 +48,9 @@ function contact () { $this->contact_profile = $this->current_user->contact_profile->load(); - $this->imcontact_profile = $this->current_user->contact_profile->load(); + $this->im_profiles = $this->current_user->im_profile->load(); + + //var_dump($this->im_profiles); if ($this->Request->isPost() && !empty($this->params['contact_profile'])) { $this->contact_profile->setAttributes($this->params['contact_profile']); if ($this->contact_profile->save()) { @@ -57,6 +59,31 @@ $this->current_user->save(); } // saving IM info + if (!empty($this->params['im']) && is_array($this->params['im'])) { + if (!empty($this->params['delete_im'])) { + foreach ($this->params['delete_im'] as $id) { + $im_profile = $this->current_user->im_profile->find($id); + $im_profile->destroy(); + } + } + foreach ($this->params['im'] as $im) { + if ($im['im_id'] && $im['im_type']) { + unset($im_profile); + + if ($im['id']) { + $im_profile = $this->current_user->im_profile->find($im['id']); + } + + if (empty($im_profile) || $im_profile == false) { + $im_profile = $this->current_user->im_profile->build(); + } + + $im_profile->setAttributes($im); + $im_profile->save(); + } + } + } + $this->redirectTo(array('action' => 'contact')); } } Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-05-15 19:04:44 UTC (rev 208) +++ app/installers/user_installer.php 2008-05-15 19:05:14 UTC (rev 209) @@ -187,34 +187,8 @@ INDEX user_idx (user_id) ) ENGINE=InnoDB"); - $this->execute( - "CREATE TABLE `ims` ( - `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `name` char(100) NOT NULL DEFAULT '' - ) ENGINE=InnoDB"); - - $this->execute("INSERT INTO ims (id, name) VALUES (0, 'ICQ')"); - $this->execute("INSERT INTO ims (id, name) VALUES (0, 'Mail.ru Agent')"); - $this->execute("INSERT INTO ims (id, name) VALUES (0, 'Skype')"); - $this->execute("INSERT INTO ims (id, name) VALUES (0, 'Windows Live')"); - $this->execute("INSERT INTO ims (id, name) VALUES (0, 'Google Talk')"); - $this->execute("INSERT INTO ims (id, name) VALUES (0, 'Yahoo')"); - $this->execute("INSERT INTO ims (id, name) VALUES (0, 'AIM')"); - $this->execute("INSERT INTO ims (id, name) VALUES (0, 'Jabber')"); - $this->execute("INSERT INTO ims (id, name) VALUES (0, 'Gadu-Gadu')"); $this->execute( - "CREATE TABLE `im_profiles` ( - `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `im_id` int(11), - `value` varchar(50), - FOREIGN KEY (user_id) REFERENCES users(id), - FOREIGN KEY (im_id) REFERENCES ims(id), - INDEX user_idx (user_id) - ) ENGINE=InnoDB"); - - $this->execute( "CREATE TABLE `contact_profiles` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `user_id` int(11) NOT NULL, @@ -236,14 +210,21 @@ INDEX user_idx (user_id) ) ENGINE=InnoDB"); + $this->execute( + "CREATE TABLE `im_profiles` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `im_id` varchar(50), + `im_type` varchar(50), + FOREIGN KEY (user_id) REFERENCES users(id), + INDEX user_idx (user_id) + ) ENGINE=InnoDB"); } function down_1() { - $this->dropTable('contact_profiles'); $this->dropTable('im_profiles'); - $this->dropTable('ims'); - $this->dropTable('email_profiles'); + $this->dropTable('contact_profiles'); $this->dropTable('basic_profiles'); // triggers should be dropped automatically // http://dev.mysql.com/doc/refman/5.1/en/drop-trigger.html Modified: app/models/user.php =================================================================== --- app/models/user.php 2008-05-15 19:04:44 UTC (rev 208) +++ app/models/user.php 2008-05-15 19:05:14 UTC (rev 209) @@ -10,6 +10,8 @@ 'order' => 'created_at desc', 'foreign_key' => 'recipient_id', 'conditions' => 'is_recipient_del = 0'), + 'im_profiles' => array('class_name' => 'ImProfile', + 'foreign_key' => 'user_id'), ); var $has_one = array('BasicProfile', 'ContactProfile'); Modified: app/views/profile/contact.tpl =================================================================== --- app/views/profile/contact.tpl 2008-05-15 19:04:44 UTC (rev 208) +++ app/views/profile/contact.tpl 2008-05-15 19:05:14 UTC (rev 209) @@ -24,17 +24,62 @@ <label>_{IM Screen Name(s)}:</label> <div class="formcol"> <div class="middle"> - <?= $form_helper->text_field('contact_profile', 'im', array('class' => 'mediumtextinput') )?> - <select class="imselect"> - <option>AIM</option> - <option>Google talk</option> - <option>Skype</option> - <option>Windows Live</option> - <option>Yahoo</option> - <option>Gadu-Gadu</option> - <option>ICQ</option> - </select> - </div> + <div id="im" class="im" style="display: none"> + <input type="hidden"> + <input type="text" class="mediumtextinput"> + <select class="imselect"> + <option>AIM</option> + <option>Google talk</option> + <option>Skype</option> + <option>Windows Live</option> + <option>Yahoo</option> + <option>Gadu-Gadu</option> + <option>ICQ</option> + </select> + <div class="delete"></div> + <div class="clearfix"></div> + </div> + </div> + <script text="textjavascript"> + var imcount = 0; + + function add_im ( id, im_id, im_type) { + + if (imcount >= 10) + return; + + var im = Element.extend($('im').cloneNode(true)); + + im.childElements()[0].writeAttribute('name', 'im['+imcount+'][id]'); + im.childElements()[1].writeAttribute('name', 'im['+imcount+'][im_id]'); + im.childElements()[2].writeAttribute('name', 'im['+imcount+'][im_type]'); + + im.childElements()[0].setValue(id); + im.childElements()[1].setValue(im_id); + im.childElements()[2].setValue(im_type); + im.childElements()[3].observe("click", function (event) { + if (imcount > 1) { + if (id) + $(im.parentNode).insert(new Element('input', { type: 'hidden', name: 'delete_im[]', value: id })); + im.remove(); + imcount--; + } + }); + + $($('im').parentNode).insert(im); + im.show(); + + imcount++; + } + <? + if (!empty($im_profiles)) { + foreach ($im_profiles as $im) { + echo "add_im('" . $im->id . "', '" . addslashes($im->im_id) . "', '" . addslashes($im->im_type) . "');\n"; + } + } + ?> + add_im(); + </script> <div class="third"> <?= $access_field_helper->access_field('contact_profile', 'im_access', array('title' => 'Instant Messenger')); ?> </div> @@ -44,7 +89,7 @@ <label></label> <div class="formcol"> <div class="middle"> - <a href="#">Add another screen name</a> + <a href="#" onclick='add_im()'>Add another screen name</a> </div> </div> </div> Modified: timesheet/aguidrevitch.txt =================================================================== --- timesheet/aguidrevitch.txt 2008-05-15 19:04:44 UTC (rev 208) +++ timesheet/aguidrevitch.txt 2008-05-15 19:05:14 UTC (rev 209) @@ -7,3 +7,6 @@ 2008-05-13,10:10,13:10,main,RT:1,"rewriting dialogs" 2008-05-13,13:10,13:30,main,RT:1,"helping dimos with models" 2008-05-13,14:20,17:30,main,RT:1,"improving city selector" +2008-05-13,20:40,21:20,main,RT:1,"fixing IE6 compatibility issues for dialog, minor fixes to city dialog" +2008-05-14,19:10,22:00,main,RT:1,"instant messagers profile" +2008-05-15,20:40,22:10,main,RT:1,"instant messagers profile implemented" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |