[Isocial-svn] SF.net SVN: isocial: [260] public/stylesheets/groupapp
Status: Pre-Alpha
Brought to you by:
aguidrevitch
From: <di...@us...> - 2008-07-03 13:52:56
|
Revision: 260 http://isocial.svn.sourceforge.net/isocial/?rev=260&view=rev Author: dim0s77 Date: 2008-07-03 06:53:04 -0700 (Thu, 03 Jul 2008) Log Message: ----------- added form for uploading group avatar Modified Paths: -------------- app/controllers/blogapp/post_controller.php app/controllers/groupapp/group_controller.php app/models/groupapp_group.php app/views/groupapp/group/_customize.tpl public/stylesheets/common/Form.css public/stylesheets/groupapp/Group.css Modified: app/controllers/blogapp/post_controller.php =================================================================== --- app/controllers/blogapp/post_controller.php 2008-07-02 17:31:31 UTC (rev 259) +++ app/controllers/blogapp/post_controller.php 2008-07-03 13:53:04 UTC (rev 260) @@ -8,7 +8,7 @@ $this->posts = $this->BlogappPost->find('all', array('conditions' => array('user_id = ' . $this->current_user->getId()))); //$this->debug($this->posts); for ($i = 0 ; $i < count($this->posts) ; $i++) { - $this->posts[$i]->media_item->load(); + // $this->posts[$i]->media_item->load(); /* $this->posts[$i]->attachments = $this->posts[$i]->attachment->load(); foreach ($this->posts[$i]->attachments as $k => $attach) { Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-07-02 17:31:31 UTC (rev 259) +++ app/controllers/groupapp/group_controller.php 2008-07-03 13:53:04 UTC (rev 260) @@ -42,6 +42,10 @@ function create () { $this->step = 'group_info'; if (!empty($this->params['group'])){ + if (empty($this->params['group']['type_id']) || $this->params['group']['type_id'] == 0) { + $this->addError('_common', 'Group type is missing', 'please select the group type'); + return; + } $this->GroupappGroup->setAttributes($this->params['group']); $this->GroupappGroup->members_count = 1; if ($this->Request->isPost() && $this->GroupappGroup->save()){ @@ -255,7 +259,7 @@ $type_id = $this->subgroup_type_id > 0 ? " = " . $this->subgroup_type_id : " BETWEEN " . $this->group_type_id * 100 . " and " . ($this->group_type_id + 1) * 100; - $_filter_pagination = array('items_per_page' => 10, 'count_conditions' => "type_id" . $type_id ); + $_filter_pagination = array('items_per_page' => 2, 'count_conditions' => "type_id" . $type_id ); $group_pages = $this->pagination_helper->getPaginator($this->GroupappGroup, $_filter_pagination);// paginator $this->first_group = ($group_pages->getCurrentPage() - 1) * $group_pages->getItemsPerPage() + 1; $this->last_group = ($group_pages->getCurrentPage() * $group_pages->getItemsPerPage() < $group_pages->getItemCount()) ? Modified: app/models/groupapp_group.php =================================================================== --- app/models/groupapp_group.php 2008-07-02 17:31:31 UTC (rev 259) +++ app/models/groupapp_group.php 2008-07-03 13:53:04 UTC (rev 260) @@ -20,6 +20,9 @@ $this->validatesPresenceOf('name', 'Name is missing|please enter the name'); $this->validatesPresenceOf('description', 'Description is missing|please enter the description'); $this->validatesPresenceOf('type_id', 'Group type is missing|please select the group type'); + if (!$this->getErrors()) { + $this->validatesNumericalityOf('type_id', "Type: hack attempt detected|type does not exist"); + } # $this->validatesFormatOf('email', AK_EMAIL_REGULAR_EXPRESSION, 'Incorrect email|please enter the correct email'); } } Modified: app/views/groupapp/group/_customize.tpl =================================================================== --- app/views/groupapp/group/_customize.tpl 2008-07-02 17:31:31 UTC (rev 259) +++ app/views/groupapp/group/_customize.tpl 2008-07-03 13:53:04 UTC (rev 260) @@ -2,8 +2,56 @@ <?= $controller->renderErrors() ?> </div> - <div class="picture"></div> + <div class="picture"> + <div class="two_column"> + <div class="left_small"> + <div class="left_content"> + + <div class="imghead">_{Current picture}:<br><br> + <img src="/images/nophoto_men_sm.gif" alt="" class=""> + </div> + + </div> + </div> + + <div class="right_big"> + <div class="left_content"> + + <form action="/groupapp/group/customize/{group.id?}" method="post"> + + <div class="upload_picture"> + <div class="upload_title"> + _{Upload Picture} + </div> + + <div class="upload_text"> + _{You can upload a JPG, GIF or PNG file}. + </div> + + <div class="upload_field"> + <?= $form_helper->file_field('upload', 'photo', array('class' => 'textinput small')) ?> + </div> + + <div class="filter_name certify"> + <?= $form_helper->check_box('upload', 'certify', array()) ?> + <label for="group_certify">_{I certify that I have the right to distribute this picture and that it does not violate the} <a href="#">_{Terms of Use}</a>.</label> + </div> + + <div class="upload_submit"> + <input class="submitinput" type="submit" value="_{Upload Picture}"/> + </div> + </div> + + </form> + + </div> + </div> + + </div> + <div class="clearfix"></div> + </div> + <div class="formrow"> <label>_{Website}:</label> <div class="formcol"> Modified: public/stylesheets/common/Form.css =================================================================== --- public/stylesheets/common/Form.css 2008-07-02 17:31:31 UTC (rev 259) +++ public/stylesheets/common/Form.css 2008-07-03 13:53:04 UTC (rev 260) @@ -1,5 +1,5 @@ #content .editform { - padding: 20px 0px 20px 10px; + padding: 10px 0px 10px 0px; margin: auto; } Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-07-02 17:31:31 UTC (rev 259) +++ public/stylesheets/groupapp/Group.css 2008-07-03 13:53:04 UTC (rev 260) @@ -241,4 +241,32 @@ font-weight: bold; font-size: 12px; padding: 10px 0px 3px 0px; -} \ No newline at end of file +} + +.imghead { + color: #333333; + font-weight: bold; + font-size: 12px; + text-align: center; + padding: 0px 10px 20px 10px; +} + +.upload_picture { + padding: 0px 10px 20px 10px; +} + +.upload_picture .upload_title { + color: #333333; + font-weight: bold; + font-size: 13px; + border-bottom: solid 1px #d8dfea; + padding: 0px 0px 5px 0px; +} + +.upload_picture .upload_text { + padding: 10px 0px 10px 0px; +} + +.filter_name.certify { + padding: 10px 0px 10px 0px; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |