[Isocial-svn] SF.net SVN: isocial: [211] timesheet
Status: Pre-Alpha
Brought to you by:
aguidrevitch
From: <di...@us...> - 2008-05-17 08:40:29
|
Revision: 211 http://isocial.svn.sourceforge.net/isocial/?rev=211&view=rev Author: dim0s77 Date: 2008-05-17 01:40:36 -0700 (Sat, 17 May 2008) Log Message: ----------- discussion board: 'reply to post' implementation ended Modified Paths: -------------- app/controllers/groupapp/board_controller.php app/views/groupapp/board/_head.tpl app/views/groupapp/board/reply_to_post.tpl app/views/groupapp/board/reply_to_topic.tpl app/views/groupapp/board/show_topic.tpl app/views/groupapp/board/start_topic.tpl public/stylesheets/groupapp/Board.css timesheet/dim0s77.txt Modified: app/controllers/groupapp/board_controller.php =================================================================== --- app/controllers/groupapp/board_controller.php 2008-05-16 06:28:55 UTC (rev 210) +++ app/controllers/groupapp/board_controller.php 2008-05-17 08:40:36 UTC (rev 211) @@ -33,7 +33,8 @@ $topics[$message->topic_id]['last'] = $message; } } - $this->group = $group; + $this->group_id = $group->getId(); + $this->group_name = $group->name; $this->topics = $topics; } } @@ -53,7 +54,9 @@ $group = $this->GroupappGroup->find( $messages[0]->group_id ); if (($group && $group->access == 1) || $member) { $this->messages = $messages; - $this->group = $group; + $this->group_id = $group->getId(); + $this->group_name = $group->name; + $this->topic_id = $messages[0]->topic_id; } else { $this->addError('_common', 'Access denied', 'Group id closed. You can\'t to see this topic'); } @@ -90,8 +93,11 @@ } $this->addError('_common', 'Sending message error', 'please, try again'); } else if (!empty($this->params['id'])) { - if ( $this->group = $this->GroupappGroup->find( $this->params['id'] ) ) { - $this->topic = $this->group->message->build(); + if ( $group = $this->GroupappGroup->find( $this->params['id'] ) ) { + $this->topic = $group->message->build(); + $this->group_id = $group->getId(); + $this->group_name = $group->name; + $this->topic_id = $this->topic->getId(); } } else { $this->addError('_common', 'Start topic error', 'please, specify group'); @@ -130,7 +136,9 @@ $group = $this->GroupappGroup->find( $messages[0]->group_id ); if (($group && $group->access == 1) || $member) { $this->messages = $messages; - $this->group = $group; + $this->group_id = $group->getId(); + $this->group_name = $group->name; + $this->topic_id = $messages[0]->topic_id; } else { $this->addError('_common', 'Access denied', 'Group id closed. You can\'t reply to this topic'); } @@ -141,13 +149,22 @@ } function reply_to_post () { - if (!empty($this->params['id'])) { - $messages = $this->GroupappMessage->find('all', - array( - 'conditions' => array("group_id = ?", $this->params['id']), - 'include' => 'user' - ) - ); + if (!empty($this->params['topic'])) { + if ( $this->group = $this->GroupappGroup->find( $this->params['topic']['group_id'] ) ) { + $member = $this->GroupappMember->findFirst(array( 'group_id' => $this->group->getId(), + 'user_id' => $this->current_user->getId() + )); + if ($member) { + $message = $member->message->build(); + $message->setAttributes($this->params['topic']); + if ($message->save()) { + $this->redirectTo(array('action' => 'show_topic', 'id' => $message->topic_id)); + return; + } + } + } + $this->addError('_common', 'Sending message error', 'please, try again'); + } else if (!empty($this->params['id'])) { $message = $this->GroupappMessage->findFirst( array( 'conditions' => array("id = ?", $this->params['id']), Modified: app/views/groupapp/board/_head.tpl =================================================================== --- app/views/groupapp/board/_head.tpl 2008-05-16 06:28:55 UTC (rev 210) +++ app/views/groupapp/board/_head.tpl 2008-05-17 08:40:36 UTC (rev 211) @@ -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} {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/reply_to_post.tpl =================================================================== --- app/views/groupapp/board/reply_to_post.tpl 2008-05-16 06:28:55 UTC (rev 210) +++ app/views/groupapp/board/reply_to_post.tpl 2008-05-17 08:40:36 UTC (rev 211) @@ -1,23 +1,63 @@ <?= $controller->renderPartial("head") ?> +{?message_to_reply} + <?= $controller->renderErrors() ?> -<form action="/groupapp/board/reply_to_post" method="post"> +<div class="submenu"> + <div class="menu_block"> + <div class="header">_{Topic}: <a href="/groupapp/board/show_topic/{message_to_reply.topic_id}">{message_to_reply.subject?}</a></div> + </div> +</div> +<div class="clearfix"></div> + +<div class="messages_list"> + <div class="row first"> + <div class="actions"> + </div> + + <div class="avatar"> + <a href="/profile/show/{message_to_reply.user_id?}"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> + </div> + + <div class="message"> + <div class="head"> + <span class="sender"> + <? if ($current_user->getId() == $message_to_reply->user_id) { ?><span class="current_user">_{You}</span> + <? } else { ?><a href="/profile/show/{message_to_reply.user_id?}"><span class="other_user">{message_to_reply.user.name?}</span></a><? } ?> + </span> + _{wrote} + <div class="subtext">{message_to_reply.created_at?}</div> + </div> + <div class="body">{message_to_reply.body?}</div> + </div> + <div class="clearfix"></div> + + </div> +</div> +<div class="clearfix"></div> + +<div class="board_from_background"> +<form action="/groupapp/board/reply_to_topic/{message_to_reply.topic_id?}" method="post"> <div class="editform"> <div class="formrow"> - <label>_{Topic}:</label> - <?= $form_helper->text_field('topic', 'subject', array('class' => 'textinput'))?> - </div> - <div class="formrow"> - <label>_{Post}:</label> + <label> </label><span class="label">_{Your reply}</span><br> <?= $form_helper->text_area('topic', 'body', array('class' => 'textinput'))?> </div> <div class="formrow"> <label> <?= $form_helper->hidden_field('topic', 'group_id', array('value' => $message_to_reply->group_id))?> + <?= $form_helper->hidden_field('topic', 'topic_id', array('value' => $message_to_reply->topic_id))?> + <?= $form_helper->hidden_field('topic', 'subject', array('value' => $message_to_reply->subject))?> + <?= $form_helper->hidden_field('topic', 'reply_message_id', array('value' => $message_to_reply->getId()))?> </label> - <input class="submitinput" type="submit" value="_{Post}"> + <input class="submitinput" type="submit" value="_{Post reply}"> <input class="cancelinput" type="button" value="_{Cancel}"> </div> </div> </form> +</div> +<div class="clearfix"></div> +{else} +<?= $controller->renderErrors() ?> +{end} Modified: app/views/groupapp/board/reply_to_topic.tpl =================================================================== --- app/views/groupapp/board/reply_to_topic.tpl 2008-05-16 06:28:55 UTC (rev 210) +++ app/views/groupapp/board/reply_to_topic.tpl 2008-05-17 08:40:36 UTC (rev 211) @@ -1,6 +1,9 @@ <?= $controller->renderPartial("head") ?> {?messages} + +<?= $controller->renderErrors() ?> + <div class="submenu"> <div class="menu_block"> <div class="header">_{Topic}: <a href="/groupapp/board/show_topic/{messages-0.topic_id}">{messages-0.subject?}</a></div> @@ -8,8 +11,7 @@ </div> <div class="clearfix"></div> -<?= $controller->renderErrors() ?> - +<div class="board_from_background"> <form action="/groupapp/board/reply_to_topic/{messages-0.topic_id?}" method="post"> <div class="editform"> <div class="formrow"> @@ -27,6 +29,7 @@ </div> </div> </form> +</div> <div class="clearfix"></div> {else} <?= $controller->renderErrors() ?> Modified: app/views/groupapp/board/show_topic.tpl =================================================================== --- app/views/groupapp/board/show_topic.tpl 2008-05-16 06:28:55 UTC (rev 210) +++ app/views/groupapp/board/show_topic.tpl 2008-05-17 08:40:36 UTC (rev 211) @@ -17,7 +17,6 @@ <?= $controller->renderErrors() ?> <div class="messages_list"> - <div class="info"> </div> {loop messages} <div class="row"> Modified: app/views/groupapp/board/start_topic.tpl =================================================================== --- app/views/groupapp/board/start_topic.tpl 2008-05-16 06:28:55 UTC (rev 210) +++ app/views/groupapp/board/start_topic.tpl 2008-05-17 08:40:36 UTC (rev 211) @@ -2,7 +2,8 @@ <?= $controller->renderErrors() ?> -<form action="/groupapp/board/start_topic/{group.id?}" method="post"> +<div class="board_from_background"> +<form action="/groupapp/board/start_topic/{group_id?}" method="post"> <div class="editform"> <div class="formrow"> <label>_{Topic}:</label> @@ -14,10 +15,12 @@ </div> <div class="formrow"> <label> - <?= $form_helper->hidden_field('topic', 'group_id', array('value' => $group->getId()))?> + <?= $form_helper->hidden_field('topic', 'group_id', array('value' => $group_id))?> </label> <input class="submitinput" type="submit" value="_{Create new Topic}"> <input class="cancelinput" type="button" value="_{Cancel}"> </div> </div> </form> +</div> +<div class="clearfix"></div> Modified: public/stylesheets/groupapp/Board.css =================================================================== --- public/stylesheets/groupapp/Board.css 2008-05-16 06:28:55 UTC (rev 210) +++ public/stylesheets/groupapp/Board.css 2008-05-17 08:40:36 UTC (rev 211) @@ -1,3 +1,7 @@ +.board_from_background { + background: #f7f7f7; +} + .nodiscus { font-size: 12px; text-align: center; @@ -9,16 +13,15 @@ } .messages_list { - padding-top: 10px; float: left; background: #ffffff; width: 100%; } .messages_list .info { - padding: 0px 10px 5px 20px; - margin-bottom: 5px; + padding: 5px 10px 5px 20px; text-align: right; + border-bottom: solid 1px #dddddd; } .messages_list .info .left { @@ -27,7 +30,6 @@ } .messages_list .container { - border-top: solid 1px #dddddd; background: #f7f7f7; padding: 10px; } @@ -58,7 +60,7 @@ } .messages_list .row { - border-top: 1px solid #cccccc; + border-bottom: 1px solid #cccccc; display: block; padding: 10px; } @@ -96,14 +98,14 @@ background: #f7f7f7; } +.messages_list .row .message .body { + background: #ffffff; + padding: 10px 3px 10px 3px; +} + .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; -} \ No newline at end of file Modified: timesheet/dim0s77.txt =================================================================== --- timesheet/dim0s77.txt 2008-05-16 06:28:55 UTC (rev 210) +++ timesheet/dim0s77.txt 2008-05-17 08:40:36 UTC (rev 211) @@ -23,3 +23,5 @@ 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" + +2008-05-17,10:50,11:40,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. |