isocial-svn Mailing List for isocial (Page 9)
Status: Pre-Alpha
Brought to you by:
aguidrevitch
You can subscribe to this list here.
2008 |
Jan
|
Feb
(11) |
Mar
(80) |
Apr
(22) |
May
(90) |
Jun
(28) |
Jul
(33) |
Aug
(12) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
---|
From: <agu...@us...> - 2008-03-20 17:07:45
|
Revision: 104 http://isocial.svn.sourceforge.net/isocial/?rev=104&view=rev Author: aguidrevitch Date: 2008-03-20 10:07:51 -0700 (Thu, 20 Mar 2008) Log Message: ----------- module support for text helper added Modified Paths: -------------- akelos.diff Modified: akelos.diff =================================================================== --- akelos.diff 2008-03-20 15:57:54 UTC (rev 103) +++ akelos.diff 2008-03-20 17:07:51 UTC (rev 104) @@ -1,7 +1,7 @@ -Index: lib/Ak.php +Index: Ak.php =================================================================== ---- lib/Ak.php (revision 509) -+++ lib/Ak.php (working copy) +--- Ak.php (revision 509) ++++ Ak.php (working copy) @@ -183,6 +183,11 @@ return @$string[$try_whith_lang]; } @@ -23,10 +23,10 @@ }else { $string = isset($framework_dictionary[$string]) ? $framework_dictionary[$string] : $string; } -Index: lib/AkActionController.php +Index: AkActionController.php =================================================================== ---- lib/AkActionController.php (revision 509) -+++ lib/AkActionController.php (working copy) +--- AkActionController.php (revision 509) ++++ AkActionController.php (working copy) @@ -190,10 +190,6 @@ } @@ -48,19 +48,34 @@ } } -Index: lib/AkActiveRecord.php +Index: AkActionView/helpers/text_helper.php =================================================================== ---- lib/AkActiveRecord.php (revision 509) -+++ lib/AkActiveRecord.php (working copy) -@@ -4721,7 +4721,7 @@ - $resulting_array = array(); - if(!empty($source_array) && is_array($source_array)) { - foreach ($source_array as $source_item){ -- $resulting_array[$source_item->get($key_index)] = $source_item->get($value_index); -+ $resulting_array[$source_item->get($key_index, false)] = $source_item->get($value_index, false); - } - } - return $resulting_array; +--- AkActionView/helpers/text_helper.php (revision 509) ++++ AkActionView/helpers/text_helper.php (working copy) +@@ -518,8 +518,17 @@ + */ + function translate($string, $args = null, $locale_namespace = null) + { +- return Ak::t($string, $args, empty($locale_namespace) ? +- AkInflector::underscore($this->_controller->getControllerName()) : $locale_namespace); ++ ++ if ($locale_namespace) { ++ return Ak::t($string, $args, $locale_namespace); ++ } else { ++ $controller_namespace = ''; ++ if ($this->_controller->getModuleName()) { ++ $controller_namespace = AkInflector::underscore($this->_controller->getControllerName()) . DS; ++ } ++ $controller_namespace .= AkInflector::underscore($this->_controller->getControllerName()); ++ return Ak::t($string, $args, $controller_namespace); ++ } + } + + /** +Index: AkActiveRecord.php +=================================================================== +--- AkActiveRecord.php (revision 509) ++++ AkActiveRecord.php (working copy) @@ -5003,8 +5003,27 @@ $sql .= empty($options['joins']) ? '' : " {$options['joins']} "; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-20 15:57:49
|
Revision: 103 http://isocial.svn.sourceforge.net/isocial/?rev=103&view=rev Author: aguidrevitch Date: 2008-03-20 08:57:54 -0700 (Thu, 20 Mar 2008) Log Message: ----------- using filtering feature (postfiltering) to replace PROJECT_NAME Modified Paths: -------------- app/application_controller.php Removed Paths: ------------- app/vendor/ext_template/ Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-03-20 15:43:18 UTC (rev 102) +++ app/application_controller.php 2008-03-20 15:57:54 UTC (rev 103) @@ -3,7 +3,6 @@ require_once(AK_LIB_DIR.DS.'AkActionController.php'); require_once(AK_VENDOR_DIR.DS.'phputf8'.DS.'ucfirst.php'); require_once(AK_APP_DIR.DS.'vendor'.DS.'utf8_to_ascii'.DS.'utf8_to_ascii.php'); -require_once(AK_APP_DIR.DS.'vendor'.DS.'ext_template'.DS.'ExtPhpTemplateHandler.php'); /** * This file is application-wide controller file. You can put all @@ -25,14 +24,13 @@ var $app_helpers = array('AutoComplete', 'City'); var $current_user; - function _loadActionView () { - $this->Template =& new AkActionView($this->_getTemplateBasePath(), $this->Request->getParameters(), $this->Request->getController()); - - $this->Template->_controllerInstance =& $this; - $this->Template->_registerTemplateHandler('tpl','ExtPhpTemplateHandler'); - - return parent::_loadActionView(); + function __construct () { + $this->afterFilter('_replaceProjectName'); } + + function _replaceProjectName (&$controller) { + $controller->Response->body = str_replace('PROJECT_NAME', PROJECT_NAME, $controller->Response->body); + } function beforeAction ( $method = '' ) { $this->_validateLoginStatus(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-20 15:43:15
|
Revision: 102 http://isocial.svn.sourceforge.net/isocial/?rev=102&view=rev Author: aguidrevitch Date: 2008-03-20 08:43:18 -0700 (Thu, 20 Mar 2008) Log Message: ----------- more fixes to akelos Modified Paths: -------------- akelos.diff Modified: akelos.diff =================================================================== --- akelos.diff 2008-03-19 19:56:04 UTC (rev 101) +++ akelos.diff 2008-03-20 15:43:18 UTC (rev 102) @@ -1,6 +1,6 @@ Index: lib/Ak.php =================================================================== ---- lib/Ak.php (revision 505) +--- lib/Ak.php (revision 509) +++ lib/Ak.php (working copy) @@ -183,6 +183,11 @@ return @$string[$try_whith_lang]; @@ -23,9 +23,34 @@ }else { $string = isset($framework_dictionary[$string]) ? $framework_dictionary[$string] : $string; } +Index: lib/AkActionController.php +=================================================================== +--- lib/AkActionController.php (revision 509) ++++ lib/AkActionController.php (working copy) +@@ -190,10 +190,6 @@ + } + + $this->performActionWithFilters($this->_action_name); +- +- if (!$this->_hasPerformed()){ +- $this->_enableLayoutOnRender ? $this->renderWithLayout() : $this->renderWithoutLayout(); +- } + + if(!empty($this->validate_output)){ + $this->_validateGeneratedXhtml(); +@@ -1926,6 +1922,9 @@ + { + if(method_exists(&$this, $action)){ + call_user_func_array(array(&$this, $action), @(array)$this->passed_args); ++ if (!$this->_hasPerformed()){ ++ $this->_enableLayoutOnRender ? $this->renderWithLayout() : $this->renderWithoutLayout(); ++ } + } + } + Index: lib/AkActiveRecord.php =================================================================== ---- lib/AkActiveRecord.php (revision 505) +--- lib/AkActiveRecord.php (revision 509) +++ lib/AkActiveRecord.php (working copy) @@ -4721,7 +4721,7 @@ $resulting_array = array(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-19 19:55:58
|
Revision: 101 http://isocial.svn.sourceforge.net/isocial/?rev=101&view=rev Author: aguidrevitch Date: 2008-03-19 12:56:04 -0700 (Wed, 19 Mar 2008) Log Message: ----------- russian db localization added Modified Paths: -------------- app/installers/user_installer.php Added Paths: ----------- app/installers/russian_installer.php Added: app/installers/russian_installer.php =================================================================== --- app/installers/russian_installer.php (rev 0) +++ app/installers/russian_installer.php 2008-03-19 19:56:04 UTC (rev 101) @@ -0,0 +1,40 @@ +<?php +class RussianInstaller extends AkInstaller +{ + + function up_1() + { + $locale = 'ru'; + $this->execute("ALTER TABLE sexes ADD COLUMN {$locale}_name char(7) NOT NULL AFTER en_name"); + $this->execute("UPDATE sexes set {$locale}_name ='Мужской' WHERE id = 1"); + $this->execute("UPDATE sexes set {$locale}_name ='Женский' WHERE id = 2"); + + $this->execute("ALTER TABLE political_views ADD COLUMN {$locale}_name char(22) NOT NULL AFTER en_name"); + $this->execute("UPDATE political_views set {$locale}_name ='Крайне Либеральные' WHERE id = 1"); + $this->execute("UPDATE political_views set {$locale}_name ='Либеральные' WHERE id = 2"); + $this->execute("UPDATE political_views set {$locale}_name ='Умеренные' WHERE id = 3"); + $this->execute("UPDATE political_views set {$locale}_name ='Консервативные' WHERE id = 4"); + $this->execute("UPDATE political_views set {$locale}_name ='Крайне Консервативные' WHERE id = 5"); + $this->execute("UPDATE political_views set {$locale}_name ='Безразличные' WHERE id = 6"); + $this->execute("UPDATE political_views set {$locale}_name ='Философские' WHERE id = 7"); + + $this->execute("ALTER TABLE group_types ADD COLUMN {$locale}_name char(22) NOT NULL AFTER en_name"); + $this->execute("UPDATE group_types set {$locale}_name ='Бизнес' WHERE id = 1"); + $this->execute("UPDATE group_types set {$locale}_name ='Клубы по интересам' WHERE id = 2"); + $this->execute("UPDATE group_types set {$locale}_name ='Искусство' WHERE id = 3"); + $this->execute("UPDATE group_types set {$locale}_name ='География' WHERE id = 4"); + $this->execute("UPDATE group_types set {$locale}_name ='Интернет' WHERE id = 5"); + $this->execute("UPDATE group_types set {$locale}_name ='Развлечения' WHERE id = 6"); + $this->execute("UPDATE group_types set {$locale}_name ='Музыка' WHERE id = 7"); + $this->execute("UPDATE group_types set {$locale}_name ='Организации' WHERE id = 8"); + $this->execute("UPDATE group_types set {$locale}_name ='Отдых и Спорт' WHERE id = 9"); + $this->execute("UPDATE group_types set {$locale}_name ='Студенческие группы' WHERE id = 10"); + + } + + function down_1() + { + } +} + +?> Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-03-19 19:18:51 UTC (rev 100) +++ app/installers/user_installer.php 2008-03-19 19:56:04 UTC (rev 101) @@ -98,11 +98,11 @@ $this->execute( "CREATE TABLE `sexes` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `en_name` char(255) NOT NULL DEFAULT '' + `en_name` char(6) ) ENGINE=InnoDB"); - $this->execute("INSERT INTO sexes (id, en_name) VALUES (0, 'Male')"); - $this->execute("INSERT INTO sexes (id, en_name) VALUES (0, 'Female')"); + $this->execute("INSERT INTO sexes (id, en_name) VALUES (1, 'Male')"); + $this->execute("INSERT INTO sexes (id, en_name) VALUES (2, 'Female')"); $this->execute( "CREATE TABLE `political_views` ( @@ -110,13 +110,13 @@ `en_name` char(255) NOT NULL DEFAULT '' ) ENGINE=InnoDB"); - $this->execute("INSERT INTO political_views (id, en_name) VALUES (0, 'Very Liberal')"); - $this->execute("INSERT INTO political_views (id, en_name) VALUES (0, 'Liberal')"); - $this->execute("INSERT INTO political_views (id, en_name) VALUES (0, 'Moderate')"); - $this->execute("INSERT INTO political_views (id, en_name) VALUES (0, 'Conservative')"); - $this->execute("INSERT INTO political_views (id, en_name) VALUES (0, 'Very Conservative')"); - $this->execute("INSERT INTO political_views (id, en_name) VALUES (0, 'Apathetic')"); - $this->execute("INSERT INTO political_views (id, en_name) VALUES (0, 'Libertarian')"); + $this->execute("INSERT INTO political_views (id, en_name) VALUES (1, 'Very Liberal')"); + $this->execute("INSERT INTO political_views (id, en_name) VALUES (2, 'Liberal')"); + $this->execute("INSERT INTO political_views (id, en_name) VALUES (3, 'Moderate')"); + $this->execute("INSERT INTO political_views (id, en_name) VALUES (4, 'Conservative')"); + $this->execute("INSERT INTO political_views (id, en_name) VALUES (5, 'Very Conservative')"); + $this->execute("INSERT INTO political_views (id, en_name) VALUES (6, 'Apathetic')"); + $this->execute("INSERT INTO political_views (id, en_name) VALUES (7, 'Libertarian')"); $this->execute( "CREATE TABLE `religious_views` ( @@ -231,16 +231,16 @@ `en_name` char(100) NOT NULL DEFAULT '' ) ENGINE=InnoDB"); - $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (0, 0, 'Business')"); - $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (0, 0, 'Common Interest')"); - $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (0, 0, 'Entertainment & Arts')"); - $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (0, 0, 'Geography')"); - $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (0, 0, 'Internet & Technology')"); - $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (0, 0, 'Just for Fun')"); - $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (0, 0, 'Music')"); - $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (0, 0, 'Organizations')"); - $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (0, 0, 'Sports & Recreation')"); - $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (0, 0, 'Student Group')"); + $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (1, 0, 'Business')"); + $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (2, 0, 'Common Interest')"); + $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (3, 0, 'Entertainment & Arts')"); + $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (4, 0, 'Geography')"); + $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (5, 0, 'Internet & Technology')"); + $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (6, 0, 'Just for Fun')"); + $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (7, 0, 'Music')"); + $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (8, 0, 'Organizations')"); + $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (9, 0, 'Sports & Recreation')"); + $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (10, 0, 'Student Group')"); $this->execute( "CREATE TABLE `groups` ( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-19 19:18:44
|
Revision: 100 http://isocial.svn.sourceforge.net/isocial/?rev=100&view=rev Author: aguidrevitch Date: 2008-03-19 12:18:51 -0700 (Wed, 19 Mar 2008) Log Message: ----------- minor style update Modified Paths: -------------- app/models/religious_view.php Modified: app/models/religious_view.php =================================================================== --- app/models/religious_view.php 2008-03-19 19:18:26 UTC (rev 99) +++ app/models/religious_view.php 2008-03-19 19:18:51 UTC (rev 100) @@ -6,10 +6,9 @@ } -class ReligiousViewVote extends ActiveRecord { - +class ReligiousViewVote extends ActiveRecord +{ var $primary_key_name = 'religious_view_id'; - } ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-19 19:18:20
|
Revision: 99 http://isocial.svn.sourceforge.net/isocial/?rev=99&view=rev Author: aguidrevitch Date: 2008-03-19 12:18:26 -0700 (Wed, 19 Mar 2008) Log Message: ----------- fix for new country / city db schema Modified Paths: -------------- app/application_controller.php Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-03-19 19:17:40 UTC (rev 98) +++ app/application_controller.php 2008-03-19 19:18:26 UTC (rev 99) @@ -194,11 +194,11 @@ $aquery = utf8_to_ascii($query); if ($aquery != $query) { $conditions = array( - 'first_id IS NOT NULL AND name LIKE ? OR name LIKE ?', $query . '%', $aquery . '%' + 'name LIKE ? OR name LIKE ?', $query . '%', $aquery . '%' ); } else { $conditions = array( - 'first_id IS NOT NULL AND name LIKE ?', $query . '%' + 'name LIKE ?', $query . '%' ); } @@ -207,14 +207,14 @@ 'conditions' => $conditions, 'include' => 'country', 'limit' => 10, - 'order' => 'is_native DESC, name' + 'order' => 'name' ) ); - if (!empty($entries)) { + if (!empty($entries)) { $this->renderText( $this->city_helper->auto_complete_result($entries, $query, $this->params['city']) ); - } else { - $this->renderNothing(); - } + } else { + $this->renderNothing(); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-19 19:17:37
|
Revision: 98 http://isocial.svn.sourceforge.net/isocial/?rev=98&view=rev Author: aguidrevitch Date: 2008-03-19 12:17:40 -0700 (Wed, 19 Mar 2008) Log Message: ----------- sample country / region / city list in Russian added Added Paths: ----------- countries.sql.bz2 Added: countries.sql.bz2 =================================================================== (Binary files differ) Property changes on: countries.sql.bz2 ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-19 19:16:57
|
Revision: 97 http://isocial.svn.sourceforge.net/isocial/?rev=97&view=rev Author: aguidrevitch Date: 2008-03-19 12:17:02 -0700 (Wed, 19 Mar 2008) Log Message: ----------- cities list is going to be extensible / votable Modified Paths: -------------- app/installers/user_installer.php app/models/city.php Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-03-18 19:21:16 UTC (rev 96) +++ app/installers/user_installer.php 2008-03-19 19:17:02 UTC (rev 97) @@ -57,27 +57,43 @@ $this->execute( "CREATE TABLE `countries` ( - `id` int(11) PRIMARY KEY, - `oid` int(11), - `name` char(255), - UNIQUE name_idx (name), - INDEX oid_idx (oid) + `id` int(11) PRIMARY KEY, + `name` char(50), + INDEX name_idx (name) ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `regions` ( + `id` int(11) PRIMARY KEY, + `country_id` int(11), + `parent_id` int(11), + `name` char(100), + FOREIGN KEY (country_id) REFERENCES countries(id), + FOREIGN KEY (parent_id) REFERENCES regions(id), + INDEX name_idx (name) + ) ENGINE=InnoDB"); $this->execute( "CREATE TABLE `cities` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `oid` int(11), `country_id` int(11), - `first_id` int(11), - `second_id` int(11), - `third_id` int(11), - `is_native` bool NOT NULL DEFAULT 0, + `region_id` int(11), `name` char(100) NOT NULL DEFAULT '', + `votes` int(11) NOT NULL DEFAULT 0, FOREIGN KEY (country_id) REFERENCES countries(id), - INDEX oid_idx (oid), - INDEX name_idx (name, first_id) + FOREIGN KEY (country_id) REFERENCES countries(id), + INDEX name_idx (name) ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `city_votes` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11), + `city_id` int(11), + FOREIGN KEY (user_id) REFERENCES users(id), + FOREIGN KEY (city_id) REFERENCES cities(id), + UNIQUE vote_idx (user_id, city_id) + ) ENGINE=InnoDB"); $this->execute( "CREATE TABLE `sexes` ( @@ -247,14 +263,15 @@ $this->dropTable('ims'); $this->dropTable('email_profiles'); $this->dropTable('basic_profiles'); - // triggers should be dropped automatically // http://dev.mysql.com/doc/refman/5.1/en/drop-trigger.html $this->dropTable('religious_view_votes'); $this->dropTable('religious_views'); $this->dropTable('political_views'); $this->dropTable('sexes'); + $this->dropTable('city_votes'); $this->dropTable('cities'); + $this->dropTable('regions'); $this->dropTable('countries'); $this->dropTable('messages'); $this->dropTable('friends'); Modified: app/models/city.php =================================================================== --- app/models/city.php 2008-03-18 19:21:16 UTC (rev 96) +++ app/models/city.php 2008-03-19 19:17:02 UTC (rev 97) @@ -1,8 +1,14 @@ <?php -class City extends ActiveRecord +class City extends VotableActiveRecord { var $belongs_to = array('Country'); + var $votes_model = 'ReligiousViewVote'; } +class CityVote extends ActiveRecord +{ + var $primary_key_name = 'city_id'; +} + ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-03-18 19:21:11
|
Revision: 96 http://isocial.svn.sourceforge.net/isocial/?rev=96&view=rev Author: dim0s77 Date: 2008-03-18 12:21:16 -0700 (Tue, 18 Mar 2008) Log Message: ----------- changed groups installer Modified Paths: -------------- app/installers/user_installer.php Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-03-18 19:16:07 UTC (rev 95) +++ app/installers/user_installer.php 2008-03-18 19:21:16 UTC (rev 96) @@ -209,27 +209,38 @@ ) ENGINE=InnoDB"); $this->execute( - "CREATE TABLE `groups` ( + "CREATE TABLE `group_types` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `parent_id` int(11) NOT NULL DEFAULT '0', `en_name` char(100) NOT NULL DEFAULT '' ) ENGINE=InnoDB"); - $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Business')"); - $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Common Interest')"); - $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Entertainment & Arts')"); - $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Geography')"); - $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Internet & Technology')"); - $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Just for Fun')"); - $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Music')"); - $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Organizations')"); - $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Sports & Recreation')"); - $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Student Group')"); + $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (0, 0, 'Business')"); + $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (0, 0, 'Common Interest')"); + $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (0, 0, 'Entertainment & Arts')"); + $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (0, 0, 'Geography')"); + $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (0, 0, 'Internet & Technology')"); + $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (0, 0, 'Just for Fun')"); + $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (0, 0, 'Music')"); + $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (0, 0, 'Organizations')"); + $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (0, 0, 'Sports & Recreation')"); + $this->execute("INSERT INTO `group_types` (id, parent_id, en_name) VALUES (0, 0, 'Student Group')"); + $this->execute( + "CREATE TABLE `groups` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `group_id` int(11) NOT NULL DEFAULT '0', + `en_name` char(100) NOT NULL DEFAULT '', + `en_desc` char(255) NOT NULL DEFAULT '', + FOREIGN KEY (group_id) REFERENCES group_types(id), + INDEX group_idx (group_id) + ) ENGINE=InnoDB"); + } function down_1() { + $this->dropTable('group_types'); $this->dropTable('groups'); $this->dropTable('contact_profiles'); $this->dropTable('im_profiles'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-03-18 19:16:01
|
Revision: 95 http://isocial.svn.sourceforge.net/isocial/?rev=95&view=rev Author: dim0s77 Date: 2008-03-18 12:16:07 -0700 (Tue, 18 Mar 2008) Log Message: ----------- added controller, installer and bases view for groups Modified Paths: -------------- app/installers/user_installer.php Added Paths: ----------- app/controllers/group_controller.php app/views/group/ app/views/group/show.tpl Added: app/controllers/group_controller.php =================================================================== --- app/controllers/group_controller.php (rev 0) +++ app/controllers/group_controller.php 2008-03-18 19:16:07 UTC (rev 95) @@ -0,0 +1,13 @@ +<?php + +class GroupController extends ApplicationController +{ + function index () { + $this->redirectTo(array('action' => 'show')); + } + + function show () { + } +} + +?> Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-03-18 11:03:51 UTC (rev 94) +++ app/installers/user_installer.php 2008-03-18 19:16:07 UTC (rev 95) @@ -207,10 +207,30 @@ FOREIGN KEY (city_id) REFERENCES cities(id), INDEX user_idx (user_id) ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `groups` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `parent_id` int(11) NOT NULL DEFAULT '0', + `en_name` char(100) NOT NULL DEFAULT '' + ) ENGINE=InnoDB"); + + $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Business')"); + $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Common Interest')"); + $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Entertainment & Arts')"); + $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Geography')"); + $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Internet & Technology')"); + $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Just for Fun')"); + $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Music')"); + $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Organizations')"); + $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Sports & Recreation')"); + $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Student Group')"); + } function down_1() { + $this->dropTable('groups'); $this->dropTable('contact_profiles'); $this->dropTable('im_profiles'); $this->dropTable('ims'); Added: app/views/group/show.tpl =================================================================== --- app/views/group/show.tpl (rev 0) +++ app/views/group/show.tpl 2008-03-18 19:16:07 UTC (rev 95) @@ -0,0 +1 @@ +groups \ 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-03-18 11:03:46
|
Revision: 94 http://isocial.svn.sourceforge.net/isocial/?rev=94&view=rev Author: dim0s77 Date: 2008-03-18 04:03:51 -0700 (Tue, 18 Mar 2008) Log Message: ----------- added template of single messages thread Added Paths: ----------- app/views/message/_row.tpl Added: app/views/message/_row.tpl =================================================================== --- app/views/message/_row.tpl (rev 0) +++ app/views/message/_row.tpl 2008-03-18 11:03:51 UTC (rev 94) @@ -0,0 +1,25 @@ +{loop messages} +<? $sender = $message['message']->sender->load() ?> + <td class="msg_icon"> + <a class="email_img" href="#" onclick="on{?message-message.is_read}un{end}read('thread-{message-message.thread_id}')"></a> + </td> + <td class="checkbox"><input onclick="oncheck(this, {?message-message.is_read}{message-message.is_read}{else}0{end})" type="checkbox" class="check{?message-message.is_read}read{else}unread{end}" id="{message-message.thread_id}" name="check_messages[]" value="{message-message.thread_id}"></td> + <td class="profile_photo"><a href="/profile/show/{sender.id}"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a></td> + <td class="info"> + <div class="name"><a href="/profile/show/{sender.id}">{sender.name?}</a></div> + <div class="datetime">{message-message.created_at?}</div> + <div class="unread_count">{?message-unread}_{unread messages}: {message-unread}{end}</div> + </td> + <td class="msg"> + <div class="wrapper"> + <a href="/message/show/{last_box}/{message-message.thread_id?}" class="subject">{message-message.subject?}</a> + <div class="body_wrap"> + <? (utf8_strlen($message['message']->body) > 47) ? $msg_body = utf8_substr($message['message']->body, 0, 47) . " [..]" : $msg_body = $message['message']->body; ?> + <a href="/message/show/{last_box}/{message-message.thread_id?}" class="body">{msg_body?}</a> + </div> + </div> + </td> + <td class="delete_msg"> + <a href="#" onclick="delete_single_thread(this); return false;" name="{message-message.id}"> </a> + </td> +{end} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-03-18 11:02:12
|
Revision: 93 http://isocial.svn.sourceforge.net/isocial/?rev=93&view=rev Author: dim0s77 Date: 2008-03-18 04:02:18 -0700 (Tue, 18 Mar 2008) Log Message: ----------- mark thread as read/unread by click on thread icon Modified Paths: -------------- app/controllers/message_controller.php app/views/message/_rows.tpl app/views/message/inbox.tpl public/stylesheets/Message.css Modified: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php 2008-03-17 20:05:51 UTC (rev 92) +++ app/controllers/message_controller.php 2008-03-18 11:02:18 UTC (rev 93) @@ -18,8 +18,10 @@ $this->last_box = 'outbox'; } - function _getBoxMessages ($box_message) { - $messages = $this->current_user->$box_message->load(); + function _getBoxMessages ($box_message, $thread_id = '') { + $messages = $thread_id ? + $this->current_user->$box_message->find('all', array('conditions' => array("thread_id = ?", $thread_id))) : + $this->current_user->$box_message->load(); $box_messages = array(); if(!empty($messages)) { foreach ($messages as $message_loop_key => $message) { @@ -129,12 +131,12 @@ } function mark_unread () { - $this->last_box = 'inbox'; // there is no way message can be read/unread in outbox + $this->last_box = 'inbox'; return $this->_mark_messages(0); } function mark_read () { - $this->last_box = 'inbox'; // there is no way message can be read/unread in outbox + $this->last_box = 'inbox'; return $this->_mark_messages(1); } @@ -148,10 +150,7 @@ ) ); if ($messages) { - foreach ($messages as $message_loop_key => $message) { - $message->is_read = $is_read; - $message->save(); - } + $this->_update_messages($messages, "is_read = $is_read"); } } return $this->render(array('partial' => 'rows', @@ -159,6 +158,47 @@ 'target' => 'sender'))); } + function _update_messages ($messages, $updates) { + $ids = array(); + foreach ($messages as $message_loop_key => $message) { + $ids[] = $message->getId(); + } + $this->Message->updateAll($updates, + "id IN (" . $this->Message->_make_in_statement_from_array('id', $ids) . ")" + ); + } + + function mark_unread_row () { + $this->last_box = 'inbox'; + return $this->_mark_message_row(0); + } + + function mark_read_row () { + $this->last_box = 'inbox'; + return $this->_mark_message_row(1); + } + + function _mark_message_row ($is_read) { + if (!empty($this->params['row_id'])) { + list ($row_name, $thread_id) = explode("-", $this->params['row_id']); + if ($row_name == "thread" && $thread_id) { + $messages = $this->Message->find('all', + array('conditions' => + array("thread_id = ? AND (recipient_id = ?)", + $thread_id, $this->current_user->getId() + ) + ) + ); + if ($messages) { + $this->_update_messages($messages, "is_read = $is_read"); + return $this->render(array('partial' => 'row', + 'locals' => array('messages' => $this->_getBoxMessages('inbox_message', $thread_id)) + )); + } + } + } + } + function delete_inbox_thread () { $this->_delete_thread(); return $this->render(array('partial' => 'rows', Modified: app/views/message/_rows.tpl =================================================================== --- app/views/message/_rows.tpl 2008-03-17 20:05:51 UTC (rev 92) +++ app/views/message/_rows.tpl 2008-03-18 11:02:18 UTC (rev 93) @@ -2,18 +2,11 @@ <tbody> {loop messages} <? $sender = $message['message']->$target->load() ?> -<tr class="<? if ($target == 'sender' && !$message['message']->is_read) { echo 'new_message'; } ?>"> +<tr id="thread-{message-message.thread_id}" class="<? if ($target == 'sender' && !$message['message']->is_read) { echo 'new_message'; } ?>"> <td class="msg_icon"> - <? if ($target == 'sender') { - if ($message['message']->is_read) { - echo '<a class="email_open" href="#" onclick="oncheck(this, 1)"></a>'; - } else { - echo '<a class="email_closed" href="#" onclick="oncheck(this, 0)"></a>'; - } - } else { - echo '<span> </span>'; - } - ?> + <? if ($target == 'sender') { ?> + <a class="email_img" href="#" onclick="on{?message-message.is_read}un{end}read('thread-{message-message.thread_id}')"></a> + <? } else { echo '<span> </span>'; } ?> </td> <td class="checkbox"><input onclick="oncheck(this, {?message-message.is_read}{message-message.is_read}{else}0{end})" type="checkbox" class="check{?message-message.is_read}read{else}unread{end}" id="{message-message.thread_id}" name="check_messages[]" value="{message-message.thread_id}"></td> <td class="profile_photo"><a href="/profile/show/{sender.id}"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a></td> Modified: app/views/message/inbox.tpl =================================================================== --- app/views/message/inbox.tpl 2008-03-17 20:05:51 UTC (rev 92) +++ app/views/message/inbox.tpl 2008-03-18 11:02:18 UTC (rev 93) @@ -148,4 +148,29 @@ $("delete_link").addClassName('disabled'); } +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'); + } + }); + 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'); + } + }); +} + </script> Modified: public/stylesheets/Message.css =================================================================== --- public/stylesheets/Message.css 2008-03-17 20:05:51 UTC (rev 92) +++ public/stylesheets/Message.css 2008-03-18 11:02:18 UTC (rev 93) @@ -23,6 +23,14 @@ font-weight: bold; } +.message_row .new_message .email_img { + background: url('/images/email.png') no-repeat 10px; +} + +.message_row .email_img { + background: url('/images/email_open.png') no-repeat 10px; +} + .message_row tr td { border-bottom: 1px solid #e1e1e1; padding: 5px 0px 5px 0px; @@ -229,10 +237,3 @@ color: #999999; } -.email_closed { - background: url('/images/email.png') no-repeat 10px; -} - -.email_open { - background: url('/images/email_open.png') no-repeat 10px; -} \ 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-03-17 20:05:45
|
Revision: 92 http://isocial.svn.sourceforge.net/isocial/?rev=92&view=rev Author: aguidrevitch Date: 2008-03-17 13:05:51 -0700 (Mon, 17 Mar 2008) Log Message: ----------- only active users can be logged in Modified Paths: -------------- app/application_controller.php Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-03-17 20:01:58 UTC (rev 91) +++ app/application_controller.php 2008-03-17 20:05:51 UTC (rev 92) @@ -48,8 +48,10 @@ if (isset($this->session['user_id'])) { $user_id = $this->session['user_id']; if ( $user_id && $user = $this->User->find($user_id)) { - $this->current_user = $user; - return $this->current_user; + if ($user && $user->active) { + $this->current_user = $user; + return $this->current_user; + } } } return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-17 20:02:23
|
Revision: 91 http://isocial.svn.sourceforge.net/isocial/?rev=91&view=rev Author: aguidrevitch Date: 2008-03-17 13:01:58 -0700 (Mon, 17 Mar 2008) Log Message: ----------- minor fixes Modified Paths: -------------- app/application_controller.php app/controllers/profile_controller.php app/controllers/user_controller.php app/installers/user_installer.php app/shared_model.php Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-03-17 19:04:39 UTC (rev 90) +++ app/application_controller.php 2008-03-17 20:01:58 UTC (rev 91) @@ -1,6 +1,7 @@ <?php require_once(AK_LIB_DIR.DS.'AkActionController.php'); +require_once(AK_VENDOR_DIR.DS.'phputf8'.DS.'ucfirst.php'); require_once(AK_APP_DIR.DS.'vendor'.DS.'utf8_to_ascii'.DS.'utf8_to_ascii.php'); require_once(AK_APP_DIR.DS.'vendor'.DS.'ext_template'.DS.'ExtPhpTemplateHandler.php'); Modified: app/controllers/profile_controller.php =================================================================== --- app/controllers/profile_controller.php 2008-03-17 19:04:39 UTC (rev 90) +++ app/controllers/profile_controller.php 2008-03-17 20:01:58 UTC (rev 91) @@ -44,6 +44,12 @@ } function contact () { + $this->contact_profile = $this->current_user->contact_profile->load(); + if ($this->Request->isPost()) { + if (!empty($this->params['contact_profile'])) { + + } + } } function relationships () { Modified: app/controllers/user_controller.php =================================================================== --- app/controllers/user_controller.php 2008-03-17 19:04:39 UTC (rev 90) +++ app/controllers/user_controller.php 2008-03-17 20:01:58 UTC (rev 91) @@ -3,7 +3,7 @@ class UserController extends ApplicationController { - var $models = 'user, confirmation'; + var $models = array('User', 'Confirmation'); function beforeAction ( $method = '' ) { Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-03-17 19:04:39 UTC (rev 90) +++ app/installers/user_installer.php 2008-03-17 20:01:58 UTC (rev 91) @@ -16,22 +16,24 @@ $this->execute( "CREATE TABLE `confirmations` ( - `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `user_id` int(11) NOT NULL, + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11), `uuid` char(40) NOT NULL, `created_at` datetime NOT NULL, - FOREIGN KEY (user_id) REFERENCES users(id) + FOREIGN KEY (user_id) REFERENCES users(id), + INDEX user_idx (user_id) ) ENGINE=innoDB"); $this->execute( "CREATE TABLE `friends` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `user_id` int(11) NOT NULL DEFAULT 0, + `user_id` int(11), `friend_id` int(11) NOT NULL DEFAULT 0, FOREIGN KEY (user_id) REFERENCES users(id), FOREIGN KEY (friend_id) REFERENCES users(id), UNIQUE forward_key (user_id, friend_id), - UNIQUE reverse_key (friend_id, user_id) + UNIQUE reverse_key (friend_id, user_id), + INDEX user_idx (user_id) ) ENGINE=InnoDB"); $this->execute( @@ -47,7 +49,10 @@ `is_sender_del` tinyint(1) NOT NULL DEFAULT '0', `is_recipient_del` tinyint(1) NOT NULL DEFAULT '0', FOREIGN KEY (sender_id) REFERENCES users(id), - FOREIGN KEY (recipient_id) REFERENCES users(id) + FOREIGN KEY (recipient_id) REFERENCES users(id), + INDEX thread_idx (thread_id), + INDEX sender_idx (sender_id, is_sender_del), + INDEX recipient_idx (recipient_id, is_read, is_recipient_del) ) ENGINE=InnoDB"); $this->execute( @@ -69,9 +74,9 @@ `third_id` int(11), `is_native` bool NOT NULL DEFAULT 0, `name` char(100) NOT NULL DEFAULT '', + FOREIGN KEY (country_id) REFERENCES countries(id), INDEX oid_idx (oid), - INDEX name_idx (name, first_id), - FOREIGN KEY (country_id) REFERENCES countries(id) + INDEX name_idx (name, first_id) ) ENGINE=InnoDB"); $this->execute( @@ -86,7 +91,7 @@ $this->execute( "CREATE TABLE `political_views` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `en_name` char(255) NOT NULL DEFAULT '' + `en_name` char(255) NOT NULL DEFAULT '' ) ENGINE=InnoDB"); $this->execute("INSERT INTO political_views (id, en_name) VALUES (0, 'Very Liberal')"); @@ -101,37 +106,38 @@ "CREATE TABLE `religious_views` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `name` char(100) NOT NULL DEFAULT '', - `votes` int(11) NOT NULL DEFAULT 0, + `votes` int(11) NOT NULL DEFAULT 0, INDEX name_idx (name, votes) ) ENGINE=InnoDB"); $this->execute( "CREATE TABLE `religious_view_votes` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `user_id` int(11), - `religious_view_id` int(11), + `user_id` int(11), + `religious_view_id` int(11), FOREIGN KEY (user_id) REFERENCES users(id), - FOREIGN KEY (religious_view_id) REFERENCES religious_views(id) + FOREIGN KEY (religious_view_id) REFERENCES religious_views(id), + UNIQUE vote_idx (user_id, religious_view_id) ) ENGINE=InnoDB"); $this->execute( "CREATE TRIGGER rvv_insert AFTER INSERT ON religious_view_votes - FOR EACH ROW BEGIN - UPDATE `religious_views` SET votes = votes + 1 WHERE id = NEW.religious_view_id; - END; + FOR EACH ROW BEGIN + UPDATE `religious_views` SET votes = votes + 1 WHERE id = NEW.religious_view_id; + END; "); $this->execute( "CREATE TRIGGER rvv_delete AFTER DELETE ON religious_view_votes - FOR EACH ROW BEGIN - UPDATE `religious_views` SET votes = votes - 1 WHERE id = OLD.religious_view_id; - END; + FOR EACH ROW BEGIN + UPDATE `religious_views` SET votes = votes - 1 WHERE id = OLD.religious_view_id; + END; "); $this->execute( "CREATE TABLE `basic_profiles` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `user_id` int(11) NOT NULL, + `user_id` int(11), `sex_id` int(11), `city_id` int(11), `city_other` char(100), @@ -141,20 +147,76 @@ `religious_view_id` int(11), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, - FOREIGN KEY (user_id) REFERENCES users(id), - FOREIGN KEY (sex_id) REFERENCES sexes(id), - FOREIGN KEY (city_id) REFERENCES cities(id), - FOREIGN KEY (country_id) REFERENCES countries(id), + FOREIGN KEY (user_id) REFERENCES users(id), + FOREIGN KEY (sex_id) REFERENCES sexes(id), + FOREIGN KEY (city_id) REFERENCES cities(id), + FOREIGN KEY (country_id) REFERENCES countries(id), FOREIGN KEY (political_view_id) REFERENCES political_views(id), - FOREIGN KEY (religious_view_id) REFERENCES religious_views(id) + FOREIGN KEY (religious_view_id) REFERENCES religious_views(id), + INDEX user_idx (user_id) ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `email_profiles` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11), + `email` char(100) NOT NULL DEFAULT '', + FOREIGN KEY (user_id) REFERENCES users(id), + 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, + `mobile` varchar(40), + `land` varchar(40), + `address` varchar(100), + `website` text, + `city_id` int(11), + `created_at` datetime NOT NULL, + `updated_at` datetime NOT NULL, + FOREIGN KEY (user_id) REFERENCES users(id), + FOREIGN KEY (city_id) REFERENCES cities(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('basic_profiles'); + // triggers should be dropped automatically // http://dev.mysql.com/doc/refman/5.1/en/drop-trigger.html $this->dropTable('religious_view_votes'); Modified: app/shared_model.php =================================================================== --- app/shared_model.php 2008-03-17 19:04:39 UTC (rev 90) +++ app/shared_model.php 2008-03-17 20:01:58 UTC (rev 91) @@ -29,6 +29,8 @@ var $votes_model; var $min_votes_to_appear = 2; + var $strtolower = true; + var $ucfirst = true; function &voteOrCreate ($value, $user) { @@ -40,6 +42,15 @@ $record = $this->findFirst(array('conditions' => array("name LIKE ?", $value))); if (empty($record)) { + + if ($this->strtolower) { + $value = utf8_strtolower($value); + } + + if ($this->ucfirst) { + $value = utf8_ucfirst($value); + } + $this->name = $value; $this->save(); $record =& $this; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-17 19:04:36
|
Revision: 90 http://isocial.svn.sourceforge.net/isocial/?rev=90&view=rev Author: aguidrevitch Date: 2008-03-17 12:04:39 -0700 (Mon, 17 Mar 2008) Log Message: ----------- all the db creation moved to user_installer.php Modified Paths: -------------- app/installers/user_installer.php Removed Paths: ------------- app/installers/basic_profile_installer.php app/installers/city_installer.php app/installers/confirmation_installer.php app/installers/country_installer.php app/installers/friend_installer.php app/installers/message_installer.php app/installers/political_view_installer.php app/installers/religious_view_installer.php app/installers/sex_installer.php Deleted: app/installers/basic_profile_installer.php =================================================================== --- app/installers/basic_profile_installer.php 2008-03-17 14:22:12 UTC (rev 89) +++ app/installers/basic_profile_installer.php 2008-03-17 19:04:39 UTC (rev 90) @@ -1,37 +0,0 @@ -<?php -class BasicProfileInstaller extends AkInstaller -{ - function up_1() - { - $this->execute( - "CREATE TABLE `basic_profiles` ( - `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `sex_id` int(11), - `city_id` int(11), - `city_other` char(100), - `country_id` int(11), - `birthdate` date DEFAULT NULL, - `political_view_id` int(11), - `religious_view_id` int(11), - `created_at` datetime NOT NULL, - `updated_at` datetime NOT NULL, - FOREIGN KEY (user_id) REFERENCES users(id), - FOREIGN KEY (sex_id) REFERENCES sexes(id), - FOREIGN KEY (city_id) REFERENCES cities(id), - FOREIGN KEY (country_id) REFERENCES countries(id), - FOREIGN KEY (political_view_id) REFERENCES political_views(id), - FOREIGN KEY (religious_view_id) REFERENCES religious_views(id) - ) ENGINE=InnoDB"); - - } - - function down_1() - { - /**/ - $this->dropTable('basic_profiles'); - /**/ - } -} - -?> Deleted: app/installers/city_installer.php =================================================================== --- app/installers/city_installer.php 2008-03-17 14:22:12 UTC (rev 89) +++ app/installers/city_installer.php 2008-03-17 19:04:39 UTC (rev 90) @@ -1,31 +0,0 @@ -<?php -class CityInstaller extends AkInstaller -{ - function up_1() - { - $this->execute( - "CREATE TABLE `cities` ( - `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `oid` int(11), - `country_id` int(11), - `first_id` int(11), - `second_id` int(11), - `third_id` int(11), - `is_native` bool NOT NULL DEFAULT 0, - `name` char(100) NOT NULL DEFAULT '', - INDEX oid_idx (oid), - INDEX name_idx (name, first_id), - FOREIGN KEY (country_id) REFERENCES countries(id) - ) ENGINE=InnoDB"); - - } - - function down_1() - { - /**/ - $this->dropTable('cities'); - /**/ - } -} - -?> Deleted: app/installers/confirmation_installer.php =================================================================== --- app/installers/confirmation_installer.php 2008-03-17 14:22:12 UTC (rev 89) +++ app/installers/confirmation_installer.php 2008-03-17 19:04:39 UTC (rev 90) @@ -1,25 +0,0 @@ -<?php -class ConfirmationInstaller extends AkInstaller -{ - function up_1() - { - $this->execute( - "CREATE TABLE `confirmations` ( - `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `uuid` char(40) NOT NULL, - `created_at` datetime NOT NULL, - FOREIGN KEY (user_id) REFERENCES users(id) - ) ENGINE=innoDB"); - - } - - function down_1() - { - /**/ - $this->dropTable('confirmations'); - /**/ - } -} - -?> Deleted: app/installers/country_installer.php =================================================================== --- app/installers/country_installer.php 2008-03-17 14:22:12 UTC (rev 89) +++ app/installers/country_installer.php 2008-03-17 19:04:39 UTC (rev 90) @@ -1,24 +0,0 @@ -<?php -class CountryInstaller extends AkInstaller -{ - function up_1() - { - $this->execute( - "CREATE TABLE `countries` ( - `id` int(11) PRIMARY KEY, - `oid` int(11), - `name` char(255), - UNIQUE name_idx (name), - INDEX oid_idx (oid) - ) ENGINE=InnoDB"); - } - - function down_1() - { - /**/ - $this->dropTable('countries'); - /**/ - } -} - -?> Deleted: app/installers/friend_installer.php =================================================================== --- app/installers/friend_installer.php 2008-03-17 14:22:12 UTC (rev 89) +++ app/installers/friend_installer.php 2008-03-17 19:04:39 UTC (rev 90) @@ -1,27 +0,0 @@ -<?php -class FriendInstaller extends AkInstaller -{ - function up_1() - { - $this->execute( - "CREATE TABLE `friends` ( - `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `user_id` int(11) NOT NULL DEFAULT 0, - `friend_id` int(11) NOT NULL DEFAULT 0, - FOREIGN KEY (user_id) REFERENCES users(id), - FOREIGN KEY (friend_id) REFERENCES users(id), - UNIQUE forward_key (user_id, friend_id), - UNIQUE reverse_key (friend_id, user_id) - ) ENGINE=InnoDB"); - - } - - function down_1() - { - /**/ - $this->dropTable('friends'); - /**/ - } -} - -?> Deleted: app/installers/message_installer.php =================================================================== --- app/installers/message_installer.php 2008-03-17 14:22:12 UTC (rev 89) +++ app/installers/message_installer.php 2008-03-17 19:04:39 UTC (rev 90) @@ -1,32 +0,0 @@ -<?php -class MessageInstaller extends AkInstaller -{ - function up_1() - { - $this->execute( - "CREATE TABLE `messages` ( - `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `sender_id` int(11) NOT NULL DEFAULT 0, - `recipient_id` int(11) NOT NULL DEFAULT 0, - `thread_id` int(11) NOT NULL DEFAULT 0, - `subject` char(255) NOT NULL DEFAULT '', - `body` text NOT NULL DEFAULT '', - `created_at` datetime NOT NULL, - `is_read` tinyint(1) NOT NULL DEFAULT '0', - `is_sender_del` tinyint(1) NOT NULL DEFAULT '0', - `is_recipient_del` tinyint(1) NOT NULL DEFAULT '0', - FOREIGN KEY (sender_id) REFERENCES users(id), - FOREIGN KEY (recipient_id) REFERENCES users(id) - ) ENGINE=InnoDB"); - - } - - function down_1() - { - /**/ - $this->dropTable('messages'); - /**/ - } -} - -?> Deleted: app/installers/political_view_installer.php =================================================================== --- app/installers/political_view_installer.php 2008-03-17 14:22:12 UTC (rev 89) +++ app/installers/political_view_installer.php 2008-03-17 19:04:39 UTC (rev 90) @@ -1,46 +0,0 @@ -<?php -class PoliticalViewInstaller extends AkInstaller -{ - function up_1() - { - $this->execute( - "CREATE TABLE `political_views` ( - `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT - ) ENGINE=InnoDB"); - - $fields = array(); - foreach (Ak::langs() as $lang) { - $fields[] = $lang . "_name"; - $this->execute("ALTER TABLE political_views ADD column ${lang}_name char(255) NOT NULL DEFAULT \"\""); - } - $fields = join(", ", $fields); - - foreach (array(1 => "Very Liberal", - 2 => "Liberal", - 3 => "Moderate", - 4 => "Conservative", - 5 => "Very Conservative", - 6 => "Apathetic", - 7 => "Libertarian", - ) as $id => $view) - { - - $values = array(); - foreach (Ak::langs() as $lang) { - Ak::lang($lang); - $values[] = '"' . Ak::t($view) . '"'; - } - $values = join(", ", $values); - $this->execute("INSERT INTO political_views (id, $fields) VALUES ($id, $values)"); - } - } - - function down_1() - { - /**/ - $this->dropTable('political_views'); - /**/ - } -} - -?> Deleted: app/installers/religious_view_installer.php =================================================================== --- app/installers/religious_view_installer.php 2008-03-17 14:22:12 UTC (rev 89) +++ app/installers/religious_view_installer.php 2008-03-17 19:04:39 UTC (rev 90) @@ -1,49 +0,0 @@ -<?php -class ReligiousViewInstaller extends AkInstaller -{ - function up_1() - { - $this->execute( - "CREATE TABLE `religious_views` ( - `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `name` char(100) NOT NULL DEFAULT '', - `votes` int(11) NOT NULL DEFAULT 0, - INDEX name_idx (name, votes) - ) ENGINE=InnoDB"); - - $this->execute( - "CREATE TABLE `religious_view_votes` ( - `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `user_id` int(11), - `religious_view_id` int(11), - FOREIGN KEY (user_id) REFERENCES users(id), - FOREIGN KEY (religious_view_id) REFERENCES religious_views(id) - ) ENGINE=InnoDB"); - - $this->execute( - "CREATE TRIGGER rvv_insert AFTER INSERT ON religious_view_votes - FOR EACH ROW BEGIN - UPDATE `religious_views` SET votes = votes + 1 WHERE id = NEW.religious_view_id; - END; - "); - - $this->execute( - "CREATE TRIGGER rvv_delete AFTER DELETE ON religious_view_votes - FOR EACH ROW BEGIN - UPDATE `religious_views` SET votes = votes - 1 WHERE id = OLD.religious_view_id; - END; - "); - } - - function down_1() - { - /**/ - // triggers should be dropped automatically - // http://dev.mysql.com/doc/refman/5.1/en/drop-trigger.html - $this->dropTable('religious_view_votes'); - $this->dropTable('religious_views'); - /**/ - } -} - -?> Deleted: app/installers/sex_installer.php =================================================================== --- app/installers/sex_installer.php 2008-03-17 14:22:12 UTC (rev 89) +++ app/installers/sex_installer.php 2008-03-17 19:04:39 UTC (rev 90) @@ -1,39 +0,0 @@ -<?php -class SexInstaller extends AkInstaller -{ - function up_1() - { - $this->execute( - "CREATE TABLE `sexes` ( - `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT - ) ENGINE=InnoDB"); - - $fields = array(); - foreach (Ak::langs() as $lang) { - $fields[] = $lang . "_name"; - $this->execute("ALTER TABLE sexes ADD column ${lang}_name char(255) NOT NULL DEFAULT \"\""); - } - $fields = join(", ", $fields); - - foreach (array(1 => "Male", - 2 => "Female") as $id => $sex) - { - $values = array(); - foreach (Ak::langs() as $lang) { - Ak::lang($lang); - $values[] = '"' . Ak::t($sex) . '"'; - } - $values = join(", ", $values); - $this->execute("INSERT INTO sexes (id, $fields) VALUES ($id, $values)"); - } - } - - function down_1() - { - /**/ - $this->dropTable('sexes'); - /**/ - } -} - -?> Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-03-17 14:22:12 UTC (rev 89) +++ app/installers/user_installer.php 2008-03-17 19:04:39 UTC (rev 90) @@ -14,13 +14,159 @@ `active` tinyint(1) NOT NULL DEFAULT '0' ) ENGINE=InnoDB"); + $this->execute( + "CREATE TABLE `confirmations` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `uuid` char(40) NOT NULL, + `created_at` datetime NOT NULL, + FOREIGN KEY (user_id) REFERENCES users(id) + ) ENGINE=innoDB"); + + $this->execute( + "CREATE TABLE `friends` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11) NOT NULL DEFAULT 0, + `friend_id` int(11) NOT NULL DEFAULT 0, + FOREIGN KEY (user_id) REFERENCES users(id), + FOREIGN KEY (friend_id) REFERENCES users(id), + UNIQUE forward_key (user_id, friend_id), + UNIQUE reverse_key (friend_id, user_id) + ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `messages` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `sender_id` int(11) NOT NULL DEFAULT 0, + `recipient_id` int(11) NOT NULL DEFAULT 0, + `thread_id` int(11) NOT NULL DEFAULT 0, + `subject` char(255) NOT NULL DEFAULT '', + `body` text NOT NULL DEFAULT '', + `created_at` datetime NOT NULL, + `is_read` tinyint(1) NOT NULL DEFAULT '0', + `is_sender_del` tinyint(1) NOT NULL DEFAULT '0', + `is_recipient_del` tinyint(1) NOT NULL DEFAULT '0', + FOREIGN KEY (sender_id) REFERENCES users(id), + FOREIGN KEY (recipient_id) REFERENCES users(id) + ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `countries` ( + `id` int(11) PRIMARY KEY, + `oid` int(11), + `name` char(255), + UNIQUE name_idx (name), + INDEX oid_idx (oid) + ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `cities` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `oid` int(11), + `country_id` int(11), + `first_id` int(11), + `second_id` int(11), + `third_id` int(11), + `is_native` bool NOT NULL DEFAULT 0, + `name` char(100) NOT NULL DEFAULT '', + INDEX oid_idx (oid), + INDEX name_idx (name, first_id), + FOREIGN KEY (country_id) REFERENCES countries(id) + ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `sexes` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `en_name` char(255) NOT NULL DEFAULT '' + ) ENGINE=InnoDB"); + + $this->execute("INSERT INTO sexes (id, en_name) VALUES (0, 'Male')"); + $this->execute("INSERT INTO sexes (id, en_name) VALUES (0, 'Female')"); + + $this->execute( + "CREATE TABLE `political_views` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `en_name` char(255) NOT NULL DEFAULT '' + ) ENGINE=InnoDB"); + + $this->execute("INSERT INTO political_views (id, en_name) VALUES (0, 'Very Liberal')"); + $this->execute("INSERT INTO political_views (id, en_name) VALUES (0, 'Liberal')"); + $this->execute("INSERT INTO political_views (id, en_name) VALUES (0, 'Moderate')"); + $this->execute("INSERT INTO political_views (id, en_name) VALUES (0, 'Conservative')"); + $this->execute("INSERT INTO political_views (id, en_name) VALUES (0, 'Very Conservative')"); + $this->execute("INSERT INTO political_views (id, en_name) VALUES (0, 'Apathetic')"); + $this->execute("INSERT INTO political_views (id, en_name) VALUES (0, 'Libertarian')"); + + $this->execute( + "CREATE TABLE `religious_views` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `name` char(100) NOT NULL DEFAULT '', + `votes` int(11) NOT NULL DEFAULT 0, + INDEX name_idx (name, votes) + ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `religious_view_votes` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11), + `religious_view_id` int(11), + FOREIGN KEY (user_id) REFERENCES users(id), + FOREIGN KEY (religious_view_id) REFERENCES religious_views(id) + ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TRIGGER rvv_insert AFTER INSERT ON religious_view_votes + FOR EACH ROW BEGIN + UPDATE `religious_views` SET votes = votes + 1 WHERE id = NEW.religious_view_id; + END; + "); + + $this->execute( + "CREATE TRIGGER rvv_delete AFTER DELETE ON religious_view_votes + FOR EACH ROW BEGIN + UPDATE `religious_views` SET votes = votes - 1 WHERE id = OLD.religious_view_id; + END; + "); + + $this->execute( + "CREATE TABLE `basic_profiles` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `sex_id` int(11), + `city_id` int(11), + `city_other` char(100), + `country_id` int(11), + `birthdate` date DEFAULT NULL, + `political_view_id` int(11), + `religious_view_id` int(11), + `created_at` datetime NOT NULL, + `updated_at` datetime NOT NULL, + FOREIGN KEY (user_id) REFERENCES users(id), + FOREIGN KEY (sex_id) REFERENCES sexes(id), + FOREIGN KEY (city_id) REFERENCES cities(id), + FOREIGN KEY (country_id) REFERENCES countries(id), + FOREIGN KEY (political_view_id) REFERENCES political_views(id), + FOREIGN KEY (religious_view_id) REFERENCES religious_views(id) + ) ENGINE=InnoDB"); + + } function down_1() { - /**/ + $this->dropTable('basic_profiles'); + // triggers should be dropped automatically + // http://dev.mysql.com/doc/refman/5.1/en/drop-trigger.html + $this->dropTable('religious_view_votes'); + $this->dropTable('religious_views'); + $this->dropTable('political_views'); + $this->dropTable('sexes'); + $this->dropTable('cities'); + $this->dropTable('countries'); + $this->dropTable('messages'); + $this->dropTable('friends'); + $this->dropTable('confirmations'); $this->dropTable('users'); - /**/ } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-03-17 14:22:07
|
Revision: 89 http://isocial.svn.sourceforge.net/isocial/?rev=89&view=rev Author: dim0s77 Date: 2008-03-17 07:22:12 -0700 (Mon, 17 Mar 2008) Log Message: ----------- show count of all unread messages in the thread Modified Paths: -------------- app/controllers/message_controller.php app/installers/religious_view_installer.php app/locales/message/ru.php app/views/message/_rows.tpl app/views/message/inbox.tpl public/stylesheets/Message.css Modified: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php 2008-03-17 11:39:36 UTC (rev 88) +++ app/controllers/message_controller.php 2008-03-17 14:22:12 UTC (rev 89) @@ -24,8 +24,15 @@ if(!empty($messages)) { foreach ($messages as $message_loop_key => $message) { if (!isset($box_messages[$message->thread_id])) { - $box_messages[$message->thread_id] = $message; + $box_messages[$message->thread_id]['message'] = $message; } + if (!$message->is_read) { + if (!isset($box_messages[$message->thread_id]['unread'])) { + $box_messages[$message->thread_id]['unread'] = 1; + } else { + $box_messages[$message->thread_id]['unread']++; + } + } } } $this->message_threads = count($box_messages); @@ -135,18 +142,15 @@ if (!empty($this->params['check_messages'])) { $messages = $this->Message->find('all', array('conditions' => - array("id IN (" . $this->Message->_make_in_statement_from_array('id', $this->params['check_messages']) . ") AND (sender_id = ? OR recipient_id = ?)", - $this->current_user->getId(), $this->current_user->getId() - ) - ) - ); + array("thread_id IN (" . $this->Message->_make_in_statement_from_array('thread_id', $this->params['check_messages']) . ") AND (recipient_id = ?)", + $this->current_user->getId() + ) + ) + ); if ($messages) { foreach ($messages as $message_loop_key => $message) { - if ($message->sender_id == $this->current_user->getId() || - $message->recipient_id == $this->current_user->getId()) { - $message->is_read = $is_read; - $message->save(); - } + $message->is_read = $is_read; + $message->save(); } } } Modified: app/installers/religious_view_installer.php =================================================================== --- app/installers/religious_view_installer.php 2008-03-17 11:39:36 UTC (rev 88) +++ app/installers/religious_view_installer.php 2008-03-17 14:22:12 UTC (rev 89) @@ -7,15 +7,15 @@ "CREATE TABLE `religious_views` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `name` char(100) NOT NULL DEFAULT '', - `votes` int(11) NOT NULL DEFAULT 0, + `votes` int(11) NOT NULL DEFAULT 0, INDEX name_idx (name, votes) ) ENGINE=InnoDB"); $this->execute( "CREATE TABLE `religious_view_votes` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `user_id` int(11), - `religious_view_id` int(11), + `user_id` int(11), + `religious_view_id` int(11), FOREIGN KEY (user_id) REFERENCES users(id), FOREIGN KEY (religious_view_id) REFERENCES religious_views(id) ) ENGINE=InnoDB"); @@ -23,15 +23,15 @@ $this->execute( "CREATE TRIGGER rvv_insert AFTER INSERT ON religious_view_votes FOR EACH ROW BEGIN - UPDATE `religious_views` SET votes = votes + 1 WHERE id = NEW.religious_view_id; - END; + UPDATE `religious_views` SET votes = votes + 1 WHERE id = NEW.religious_view_id; + END; "); $this->execute( "CREATE TRIGGER rvv_delete AFTER DELETE ON religious_view_votes FOR EACH ROW BEGIN UPDATE `religious_views` SET votes = votes - 1 WHERE id = OLD.religious_view_id; - END; + END; "); } Modified: app/locales/message/ru.php =================================================================== --- app/locales/message/ru.php 2008-03-17 11:39:36 UTC (rev 88) +++ app/locales/message/ru.php 2008-03-17 14:22:12 UTC (rev 89) @@ -20,6 +20,7 @@ $dictionary['Mark as'] = 'Отметить как'; $dictionary['Delete'] = 'Удалить'; $dictionary['New message'] = 'Новое сообщение'; +$dictionary['unread messages'] = 'новых сообщений'; $dictionary['Message is readed'] = 'Сообщение прочитано'; $dictionary['Message successfully sent'] = 'Сообщение отправлено'; $dictionary['Thread unavailable'] = 'Нить сообщений недоступна'; Modified: app/views/message/_rows.tpl =================================================================== --- app/views/message/_rows.tpl 2008-03-17 11:39:36 UTC (rev 88) +++ app/views/message/_rows.tpl 2008-03-17 14:22:12 UTC (rev 89) @@ -1,33 +1,38 @@ <table class="message_row"> <tbody> {loop messages} -<? $sender = $message->$target->load() ?> -<tr class="<? if ($target == 'sender' && !$message->is_read) { echo 'new_message'; } ?>"> +<? $sender = $message['message']->$target->load() ?> +<tr class="<? if ($target == 'sender' && !$message['message']->is_read) { echo 'new_message'; } ?>"> <td class="msg_icon"> <? if ($target == 'sender') { - echo '<a class="'. ($message->is_read ? 'email_open' : 'email_closed') . ' href=""></a>'; + if ($message['message']->is_read) { + echo '<a class="email_open" href="#" onclick="oncheck(this, 1)"></a>'; + } else { + echo '<a class="email_closed" href="#" onclick="oncheck(this, 0)"></a>'; + } } else { echo '<span> </span>'; } ?> </td> - <td class="checkbox"><input onclick="oncheck(this, {?message.is_read}{message.is_read}{else}0{end})" type="checkbox" class="check{?message.is_read}read{else}unread{end}" id="{message.id}" name="check_messages[]" value="{message.id}"></td> + <td class="checkbox"><input onclick="oncheck(this, {?message-message.is_read}{message-message.is_read}{else}0{end})" type="checkbox" class="check{?message-message.is_read}read{else}unread{end}" id="{message-message.thread_id}" name="check_messages[]" value="{message-message.thread_id}"></td> <td class="profile_photo"><a href="/profile/show/{sender.id}"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a></td> <td class="info"> - <span class="name"><? if ($target == 'recipient') { ?>_{To}: <? } ?><a href="/profile/show/{sender.id}">{sender.name?}</a></span> - <span class="datetime">{message.created_at?}</span> + <div class="name"><? if ($target == 'recipient') { ?>_{To}: <? } ?><a href="/profile/show/{sender.id}">{sender.name?}</a></div> + <div class="datetime">{message-message.created_at?}</div> + <div class="unread_count">{?message-unread}_{unread messages}: {message-unread}{end}</div> </td> <td class="msg"> <div class="wrapper"> - <a href="/message/show/{last_box}/{message.thread_id?}" class="subject">{message.subject?}</a> + <a href="/message/show/{last_box}/{message-message.thread_id?}" class="subject">{message-message.subject?}</a> <div class="body_wrap"> - <? (utf8_strlen($message->body) > 47) ? $msg_body = utf8_substr($message->body, 0, 47) . " [..]" : $msg_body = $message->body; ?> - <a href="/message/show/{last_box}/{message.thread_id?}" class="body">{msg_body?}</a> + <? (utf8_strlen($message['message']->body) > 47) ? $msg_body = utf8_substr($message['message']->body, 0, 47) . " [..]" : $msg_body = $message['message']->body; ?> + <a href="/message/show/{last_box}/{message-message.thread_id?}" class="body">{msg_body?}</a> </div> </div> </td> <td class="delete_msg"> - <a href="#" onclick="delete_single_thread(this); return false;" name="{message.id}"> </a> + <a href="#" onclick="delete_single_thread(this); return false;" name="{message-message.id}"> </a> </td> </tr> {else} Modified: app/views/message/inbox.tpl =================================================================== --- app/views/message/inbox.tpl 2008-03-17 11:39:36 UTC (rev 88) +++ app/views/message/inbox.tpl 2008-03-17 14:22:12 UTC (rev 89) @@ -3,7 +3,7 @@ <div class="submenu"> <div class="menu_block selector"> <label for="action_select">_{Select}: - <select onchange="doselect(this)" id="action_select" name="action_selector"> + <select onchange="doselect(this)" id="action_select" name="action_select"> <option selected="selected" value="_">---------</option> <option value="none">_{None}</option> <option value="read">_{Read}</option> @@ -142,6 +142,7 @@ } function disable_action_links () { + $("action_select").selectedIndex = 0; $("read_link").addClassName('disabled'); $("unread_link").addClassName('disabled'); $("delete_link").addClassName('disabled'); Modified: public/stylesheets/Message.css =================================================================== --- public/stylesheets/Message.css 2008-03-17 11:39:36 UTC (rev 88) +++ public/stylesheets/Message.css 2008-03-17 14:22:12 UTC (rev 89) @@ -62,6 +62,13 @@ color: #777777; } +.message_row .info .unread_count { + display: block; + padding: 1px 0px 0px 0px; + font-size: 9px; + color: #000000; +} + .message_row .msg { margin-right: 10px; line-height: 14px; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-17 11:39:31
|
Revision: 88 http://isocial.svn.sourceforge.net/isocial/?rev=88&view=rev Author: aguidrevitch Date: 2008-03-17 04:39:36 -0700 (Mon, 17 Mar 2008) Log Message: ----------- a better way of handling PROJECT_NAME implemented Modified Paths: -------------- app/application_controller.php app/controllers/message_controller.php config/DEFAULT-config.php Added Paths: ----------- app/vendor/ext_template/ app/vendor/ext_template/ExtPhpTemplateHandler.php Removed Paths: ------------- app/helpers/translate_helper.php app/vendor/ext_sintags/ Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-03-16 20:08:31 UTC (rev 87) +++ app/application_controller.php 2008-03-17 11:39:36 UTC (rev 88) @@ -2,7 +2,7 @@ require_once(AK_LIB_DIR.DS.'AkActionController.php'); require_once(AK_APP_DIR.DS.'vendor'.DS.'utf8_to_ascii'.DS.'utf8_to_ascii.php'); -require_once(AK_APP_DIR.DS.'vendor'.DS.'ext_sintags'.DS.'ExtSintags.php'); +require_once(AK_APP_DIR.DS.'vendor'.DS.'ext_template'.DS.'ExtPhpTemplateHandler.php'); /** * This file is application-wide controller file. You can put all @@ -21,10 +21,18 @@ var $_errors = array(); var $app_models = array('User', 'Message'); - var $app_helpers = array('AutoComplete', 'City', 'Translate'); + var $app_helpers = array('AutoComplete', 'City'); var $current_user; + function _loadActionView () { + $this->Template =& new AkActionView($this->_getTemplateBasePath(), $this->Request->getParameters(), $this->Request->getController()); + $this->Template->_controllerInstance =& $this; + $this->Template->_registerTemplateHandler('tpl','ExtPhpTemplateHandler'); + + return parent::_loadActionView(); + } + function beforeAction ( $method = '' ) { $this->_validateLoginStatus(); } Modified: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php 2008-03-16 20:08:31 UTC (rev 87) +++ app/controllers/message_controller.php 2008-03-17 11:39:36 UTC (rev 88) @@ -134,7 +134,12 @@ function _mark_messages ($is_read) { if (!empty($this->params['check_messages'])) { $messages = $this->Message->find('all', - array('conditions' => array("id IN (" . $this->Message->_make_in_statement_from_array('id', $this->params['check_messages']) . ")"))); + array('conditions' => + array("id IN (" . $this->Message->_make_in_statement_from_array('id', $this->params['check_messages']) . ") AND (sender_id = ? OR recipient_id = ?)", + $this->current_user->getId(), $this->current_user->getId() + ) + ) + ); if ($messages) { foreach ($messages as $message_loop_key => $message) { if ($message->sender_id == $this->current_user->getId() || Deleted: app/helpers/translate_helper.php =================================================================== --- app/helpers/translate_helper.php 2008-03-16 20:08:31 UTC (rev 87) +++ app/helpers/translate_helper.php 2008-03-17 11:39:36 UTC (rev 88) @@ -1,16 +0,0 @@ -<?php - -class TranslateHelper extends TextHelper { - - /** - * Translate strings to the current locale. PROJECT_NAME will be replaced with real project name - */ - function translate($string, $args = null, $locale_namespace = null) - { - $result = Ak::t($string, $args, empty($locale_namespace) ? - AkInflector::underscore($this->_controller->getControllerName()) : $locale_namespace); - return str_replace('PROJECT_NAME', PROJECT_NAME, $result); - } -} - -?> \ No newline at end of file Added: app/vendor/ext_template/ExtPhpTemplateHandler.php =================================================================== --- app/vendor/ext_template/ExtPhpTemplateHandler.php (rev 0) +++ app/vendor/ext_template/ExtPhpTemplateHandler.php 2008-03-17 11:39:36 UTC (rev 88) @@ -0,0 +1,14 @@ +<?php + +require_once(AK_LIB_DIR.DS.'AkActionView.php'); +require_once(AK_LIB_DIR.DS.'AkActionView'.DS.'AkPhpTemplateHandler.php'); + +class ExtPhpTemplateHandler extends AkPhpTemplateHandler +{ + function render(&$____code, $____local_assigns, $____file_path) + { + $output = parent::render($____code, $____local_assigns, $____file_path); + return str_replace('PROJECT_NAME', PROJECT_NAME, $output); + } +} +?> Modified: config/DEFAULT-config.php =================================================================== --- config/DEFAULT-config.php 2008-03-16 20:08:31 UTC (rev 87) +++ config/DEFAULT-config.php 2008-03-17 11:39:36 UTC (rev 88) @@ -52,8 +52,6 @@ define('AK_AUTOMATICALLY_UPDATE_LANGUAGE_FILES', false); // disable security checks, at least before http://trac.akelos.org/ticket/122 gets fixed define('AK_TEMPLATE_SECURITY_CHECK', false); -// overriding default translation mechanics -define('AK_DEFAULT_TEMPLATE_ENGINE', 'ExtSintags'); define('PROJECT_NAME', 'iSocial'); define('NOREPLY_EMAIL', 'no-reply <no-...@is...>'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-16 20:08:28
|
Revision: 87 http://isocial.svn.sourceforge.net/isocial/?rev=87&view=rev Author: aguidrevitch Date: 2008-03-16 13:08:31 -0700 (Sun, 16 Mar 2008) Log Message: ----------- minor fixes to marking messages + css fixes Modified Paths: -------------- app/controllers/message_controller.php public/stylesheets/Message.css Modified: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php 2008-03-16 18:56:29 UTC (rev 86) +++ app/controllers/message_controller.php 2008-03-16 20:08:31 UTC (rev 87) @@ -122,10 +122,12 @@ } function mark_unread () { + $this->last_box = 'inbox'; // there is no way message can be read/unread in outbox return $this->_mark_messages(0); } function mark_read () { + $this->last_box = 'inbox'; // there is no way message can be read/unread in outbox return $this->_mark_messages(1); } Modified: public/stylesheets/Message.css =================================================================== --- public/stylesheets/Message.css 2008-03-16 18:56:29 UTC (rev 86) +++ public/stylesheets/Message.css 2008-03-16 20:08:31 UTC (rev 87) @@ -223,13 +223,9 @@ } .email_closed { - width: 16px; - height: 16px; background: url('/images/email.png') no-repeat 10px; } .email_open { - width: 16px; - height: 16px; background: url('/images/email_open.png') no-repeat 10px; } \ 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-03-16 18:56:23
|
Revision: 86 http://isocial.svn.sourceforge.net/isocial/?rev=86&view=rev Author: aguidrevitch Date: 2008-03-16 11:56:29 -0700 (Sun, 16 Mar 2008) Log Message: ----------- minor fixes Modified Paths: -------------- config/DEFAULT-config.php Modified: config/DEFAULT-config.php =================================================================== --- config/DEFAULT-config.php 2008-03-16 18:52:55 UTC (rev 85) +++ config/DEFAULT-config.php 2008-03-16 18:56:29 UTC (rev 86) @@ -58,8 +58,8 @@ define('PROJECT_NAME', 'iSocial'); define('NOREPLY_EMAIL', 'no-reply <no-...@is...>'); -if (!defined(NOREPLY_EMAIL) || - !defined(PROJECT_NAME)) { +if (!defined('NOREPLY_EMAIL') || + !defined('PROJECT_NAME')) { die("NOREPLY_EMAIL, PROJECT_NAME should be defined"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-16 18:52:53
|
Revision: 85 http://isocial.svn.sourceforge.net/isocial/?rev=85&view=rev Author: aguidrevitch Date: 2008-03-16 11:52:55 -0700 (Sun, 16 Mar 2008) Log Message: ----------- project name can be changed easily now, as well as outgoing email Modified Paths: -------------- app/application_controller.php app/locales/layout/en.php app/locales/layout/ru.php app/locales/user/en.php app/locales/user/ru.php app/views/layouts/application.tpl app/views/message/email/send.tpl app/views/user/email/confirm.tpl app/views/user/email/forgot_password.tpl app/views/user/email/register.tpl app/views/user/login.tpl config/DEFAULT-config.php Added Paths: ----------- app/helpers/translate_helper.php app/vendor/ext_sintags/ app/vendor/ext_sintags/ExtSintags/ app/vendor/ext_sintags/ExtSintags/ExtSintagsParser.php app/vendor/ext_sintags/ExtSintags.php Removed Paths: ------------- app/views/shared/compiled/ app/views/shared/default/compiled/ app/views/shared/loggedin/compiled/ Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-03-16 17:43:01 UTC (rev 84) +++ app/application_controller.php 2008-03-16 18:52:55 UTC (rev 85) @@ -2,6 +2,7 @@ require_once(AK_LIB_DIR.DS.'AkActionController.php'); require_once(AK_APP_DIR.DS.'vendor'.DS.'utf8_to_ascii'.DS.'utf8_to_ascii.php'); +require_once(AK_APP_DIR.DS.'vendor'.DS.'ext_sintags'.DS.'ExtSintags.php'); /** * This file is application-wide controller file. You can put all @@ -20,9 +21,10 @@ var $_errors = array(); var $app_models = array('User', 'Message'); - var $app_helpers = array('AutoComplete', 'City'); + var $app_helpers = array('AutoComplete', 'City', 'Translate'); var $current_user; + function beforeAction ( $method = '' ) { $this->_validateLoginStatus(); } Added: app/helpers/translate_helper.php =================================================================== --- app/helpers/translate_helper.php (rev 0) +++ app/helpers/translate_helper.php 2008-03-16 18:52:55 UTC (rev 85) @@ -0,0 +1,16 @@ +<?php + +class TranslateHelper extends TextHelper { + + /** + * Translate strings to the current locale. PROJECT_NAME will be replaced with real project name + */ + function translate($string, $args = null, $locale_namespace = null) + { + $result = Ak::t($string, $args, empty($locale_namespace) ? + AkInflector::underscore($this->_controller->getControllerName()) : $locale_namespace); + return str_replace('PROJECT_NAME', PROJECT_NAME, $result); + } +} + +?> \ No newline at end of file Modified: app/locales/layout/en.php =================================================================== --- app/locales/layout/en.php 2008-03-16 17:43:01 UTC (rev 84) +++ app/locales/layout/en.php 2008-03-16 18:52:55 UTC (rev 85) @@ -4,19 +4,6 @@ $dictionary = array(); -$dictionary['Email'] = 'Email'; -$dictionary['Password'] = 'Password'; -$dictionary['Login'] = 'Login'; -$dictionary['Remember me'] = 'Remember me'; -$dictionary['Forgot Password?'] = 'Forgot Password?'; -$dictionary['Hello world'] = 'Hello world'; -$dictionary['About iSocial'] = 'About iSocial'; -$dictionary['Terms'] = 'Terms'; -$dictionary['Help'] = 'Help'; -$dictionary['Sign Up'] = 'Sign Up'; -$dictionary['Everyone Can Join'] = 'Everyone Can Join'; - - $dictionary['PhotoApp'] = 'Photos'; $dictionary['GroupApp'] = 'Groups'; $dictionary['EventApp'] = 'Events'; Modified: app/locales/layout/ru.php =================================================================== --- app/locales/layout/ru.php 2008-03-16 17:43:01 UTC (rev 84) +++ app/locales/layout/ru.php 2008-03-16 18:52:55 UTC (rev 85) @@ -10,7 +10,7 @@ $dictionary['Remember me'] = 'Запомнить меня'; $dictionary['Forgot Password?'] = 'Забыли пароль?'; $dictionary['Hello world'] = 'Привет, мир'; -$dictionary['About iSocial'] = 'Про iSocial'; +$dictionary['About PROJECT_NAME'] = 'Про PROJECT_NAME'; $dictionary['Terms'] = 'Соглашение'; $dictionary['Help'] = 'Помощь'; $dictionary['Sign Up'] = 'Регистрация'; Modified: app/locales/user/en.php =================================================================== --- app/locales/user/en.php 2008-03-16 17:43:01 UTC (rev 84) +++ app/locales/user/en.php 2008-03-16 18:52:55 UTC (rev 85) @@ -3,8 +3,5 @@ // File created on: 2008-02-17 15:13:51 $dictionary = array(); -$dictionary['iSocial Login'] = 'iSocial Login'; -$dictionary['Incorrect email/password combination'] = 'Incorrect email/password combination'; -$dictionary['Passwords are case sensitive. Please check your CAPS lock key'] = 'Passwords are case sensitive. Please check your CAPS lock key'; ?> Modified: app/locales/user/ru.php =================================================================== --- app/locales/user/ru.php 2008-03-16 17:43:01 UTC (rev 84) +++ app/locales/user/ru.php 2008-03-16 18:52:55 UTC (rev 85) @@ -3,8 +3,8 @@ // File created on: 2008-02-17 15:13:51 $dictionary = array(); -$dictionary['iSocial Login'] = 'Вход в iSocial'; -$dictionary['Sign Up for iSocial'] = 'Регистрация в iSocial'; +$dictionary['PROJECT_NAME Login'] = 'Вход в PROJECT_NAME'; +$dictionary['Sign Up for PROJECT_NAME'] = 'Регистрация в PROJECT_NAME'; $dictionary['Sign Up'] = 'Регистрация'; $dictionary['Incorrect email/password combination'] = 'Неправильные email и/или пароль'; $dictionary['Passwords are case sensitive. Please check your CAPS lock key'] = 'Пароли чувствительны к регистру. Проверьте, не нажата ли клавиша Caps Lock'; @@ -29,15 +29,15 @@ $dictionary['Check please your email and click on confirmation link'] = 'Проверьте, пожалуйста, Ваш email и подтвердите регистрацию переходом по ссылке'; $dictionary['go to login'] = 'войти'; $dictionary['Confirmation'] = 'Подтверждение'; -$dictionary['Thank you for signing up on iSocial'] = 'Спасибо за регистрацию в iSocial'; +$dictionary['Thank you for signing up on PROJECT_NAME'] = 'Спасибо за регистрацию в PROJECT_NAME'; $dictionary['With best regards'] = 'С наилучшими пожеланиями'; -$dictionary['The iSocial Team'] = 'команда iSocial'; +$dictionary['The PROJECT_NAME Team'] = 'команда PROJECT_NAME'; $dictionary['Hey'] = 'Привет'; -$dictionary['iSocial confirm registration'] = 'Подтверждение регистрации в iSocial'; -$dictionary['You recently registered for iSocial using this email address.'] = 'Вы только что зарегистрировались в iSocial используя этот email адрес'; +$dictionary['PROJECT_NAME confirm registration'] = 'Подтверждение регистрации в PROJECT_NAME'; +$dictionary['You recently registered for PROJECT_NAME using this email address.'] = 'Вы только что зарегистрировались в PROJECT_NAME используя этот email адрес'; $dictionary['To complete your registration, follow the link below'] = 'Для завершения регистрации, перейдите по ссылке ниже'; $dictionary['If clicking on the link doesn\'t work, try copying and pasting it into your browser'] = 'Если переход по ссылке не работает, попробуйте скопировать ее и вставить в адресную строку Вашего браузера'; -$dictionary['If you did not register for iSocial, please disregard this message'] = 'Если Вы не регистрировались в iSocial, проигнорируйте, пожалуйста, это сообщение'; +$dictionary['If you did not register for PROJECT_NAME, please disregard this message'] = 'Если Вы не регистрировались в PROJECT_NAME, проигнорируйте, пожалуйста, это сообщение'; $dictionary['Check out'] = 'Посетите'; $dictionary['if you have any questions'] = 'если у Вас есть какие-либо вопросы'; $dictionary['Thanks'] = 'Спасибо'; @@ -58,7 +58,7 @@ $dictionary['Please enter a new password'] = 'Введите, пожалуйста, новый пароль'; $dictionary['Link for login'] = 'Ссылка для входа'; $dictionary['here'] = 'здесь'; -$dictionary['iSocial Password Reset Confirmation'] = 'Подтверждение сброса пароля на iSocial'; +$dictionary['PROJECT_NAME Password Reset Confirmation'] = 'Подтверждение сброса пароля на PROJECT_NAME'; $dictionary['You recently requested a new password'] = 'Вы недавно запросили новый пароль'; $dictionary['To reset your password, follow the link below'] = 'Чтобы сбросить Ваш старый пароль, перейдите по ссылке ниже'; $dictionary['If you did not reset your password, please disregard this message'] = 'Если Вы не хотите менять пароль, не обращайте внимание на это письмо'; Added: app/vendor/ext_sintags/ExtSintags/ExtSintagsParser.php =================================================================== --- app/vendor/ext_sintags/ExtSintags/ExtSintagsParser.php (rev 0) +++ app/vendor/ext_sintags/ExtSintags/ExtSintagsParser.php 2008-03-16 18:52:55 UTC (rev 85) @@ -0,0 +1,21 @@ +<?php +class ExtSintagsParser extends AkSintagsParser +{ + function Translation($match, $state) + { + switch ($state){ + case AK_LEXER_ENTER: + $this->_translation_tokens = array(); + $this->output .= '<?php echo $translate_helper->translate(\''; + break; + case AK_LEXER_UNMATCHED: + $this->output.= $this->_unescapeChars(str_replace("'","\'",$match), true); + break; + case AK_LEXER_EXIT: + $this->output .= '\', array('.(empty($this->_translation_tokens)?'':join(', ',$this->_translation_tokens)).')); ?>'; + } + return true; + } +} + +?> \ No newline at end of file Added: app/vendor/ext_sintags/ExtSintags.php =================================================================== --- app/vendor/ext_sintags/ExtSintags.php (rev 0) +++ app/vendor/ext_sintags/ExtSintags.php 2008-03-16 18:52:55 UTC (rev 85) @@ -0,0 +1,16 @@ +<?php + +require_once(AK_LIB_DIR.DS.'AkActionView'.DS.'TemplateEngines'.DS.'AkSintags.php'); +require_once(AK_APP_DIR.DS.'vendor'.DS.'ext_sintags'.DS.'ExtSintags'.DS.'ExtSintagsParser.php'); + +class ExtSintags extends AkSintags +{ + + function toPhp() + { + $Parser =& new ExtSintagsParser(); + return $Parser->parse($this->_code); + } +} + +?> \ No newline at end of file Modified: app/views/layouts/application.tpl =================================================================== --- app/views/layouts/application.tpl 2008-03-16 17:43:01 UTC (rev 84) +++ app/views/layouts/application.tpl 2008-03-16 18:52:55 UTC (rev 85) @@ -47,11 +47,11 @@ </div> <div id="pagefooter"> <div class="copyright"> - <a href="http://isocial.sourceforge.net/">iSocial © 2008</a>; + <a href="http://isocial.sourceforge.net/">_{PROJECT_NAME} © 2008</a>; </div> <div class="linksarea"> <ul> - <li><a href="/">_{About iSocial}</a></li> + <li><a href="/">_{About PROJECT_NAME}</a></li> <li><a href="/">_{Terms}</a></li> <li><a href="/">_{Help}</a></li> </ul> Modified: app/views/message/email/send.tpl =================================================================== --- app/views/message/email/send.tpl 2008-03-16 17:43:01 UTC (rev 84) +++ app/views/message/email/send.tpl 2008-03-16 18:52:55 UTC (rev 85) @@ -1,5 +1,5 @@ -Subject: <?= $controller->current_user->name ?> _{sent you a message} _{on} iSocial... -From: iSocial <no-...@ma...> +Subject: <?= $controller->current_user->name ?> _{sent you a message} _{on} _{PROJECT_NAME}... +From: <?= NOREPLY_EMAIL ?> <?= $controller->current_user->name ?> _{sent you a message}. Modified: app/views/user/email/confirm.tpl =================================================================== --- app/views/user/email/confirm.tpl 2008-03-16 17:43:01 UTC (rev 84) +++ app/views/user/email/confirm.tpl 2008-03-16 18:52:55 UTC (rev 85) @@ -1,13 +1,13 @@ -Subject: _{Thank you for signing up on iSocial} -From: iSocial <no-...@ma...> +Subject: _{Thank you for signing up on PROJECT_NAME} +From: <?= NOREPLY_EMAIL ?> <? $user = $controller->User->findFirst(array( 'email' => $controller->params['email'] )) ?> <p>_{Hey}, <?= $user->name ?>!</p> -<p>_{Thank you for signing up on iSocial}.</p> +<p>_{Thank you for signing up on PROJECT_NAME}.</p> <? $link = AK_SITE_URL . "user/login" ?> <p>_{Link for login} <a href="{link}">_{here}</a>.</p> <p>_{With best regards},<br> -_{The iSocial Team}</p> +_{The PROJECT_NAME Team}</p> Modified: app/views/user/email/forgot_password.tpl =================================================================== --- app/views/user/email/forgot_password.tpl 2008-03-16 17:43:01 UTC (rev 84) +++ app/views/user/email/forgot_password.tpl 2008-03-16 18:52:55 UTC (rev 85) @@ -1,5 +1,5 @@ -Subject: _{iSocial Password Reset Confirmation} -From: iSocial <no-...@ma...> +Subject: _{PROJECT_NAME Password Reset Confirmation} +From: <?= NOREPLY_EMAIL ?> <? $user = $controller->User->findFirst(array( 'email' => $controller->params['email'] )) ?> <p>_{Hey}, <?= $user->name ?>!</p> @@ -15,4 +15,4 @@ _{Check out} <a href="{link}">{link}</a> _{if you have any questions}.</p> <p>_{Thanks},<br> -_{The iSocial Team}</p> +_{The PROJECT_NAME Team}</p> Modified: app/views/user/email/register.tpl =================================================================== --- app/views/user/email/register.tpl 2008-03-16 17:43:01 UTC (rev 84) +++ app/views/user/email/register.tpl 2008-03-16 18:52:55 UTC (rev 85) @@ -1,18 +1,18 @@ -Subject: _{iSocial confirm registration} -From: iSocial <no-...@ma...> +Subject: _{PROJECT_NAME confirm registration} +From: <?= NOREPLY_EMAIL ?> <p>_{Hey}, <?= $controller->User->name ?>!</p> -<p>_{You recently registered for iSocial using this email address.} _{To complete your registration, follow the link below}:<br> +<p>_{You recently registered for PROJECT_NAME using this email address.} _{To complete your registration, follow the link below}:<br> <? $link = AK_SITE_URL . "user/confirm?uuid=" . $controller->Confirmation->uuid . "&email=" . $controller->User->email ?> <a href="<?= $link ?>"><?= $link ?></a><br> (_{If clicking on the link doesn't work, try copying and pasting it into your browser})</p> -<p>_{If you did not register for iSocial, please disregard this message}.<br> +<p>_{If you did not register for PROJECT_NAME, please disregard this message}.<br> <? $link = AK_SITE_URL . "help" ?> _{Check out} <a href="{link}">{link}</a> _{if you have any questions}.</p> <p>_{Thanks},<br> -_{The iSocial Team}</p> +_{The PROJECT_NAME Team}</p> Modified: app/views/user/login.tpl =================================================================== --- app/views/user/login.tpl 2008-03-16 17:43:01 UTC (rev 84) +++ app/views/user/login.tpl 2008-03-16 18:52:55 UTC (rev 85) @@ -1,4 +1,4 @@ -<div class="title">_{iSocial Login}</div> +<div class="title">_{PROJECT_NAME Login}</div> <?= $controller->renderErrors() ?> @@ -24,7 +24,7 @@ </div> <div class="formrow"> <label></label> - _{or} <strong><a href="/user/register">_{Sign Up for iSocial}</a></strong> + _{or} <strong><a href="/user/register">_{Sign Up for PROJECT_NAME}</a></strong> </div> <p class="formrow forgotpassword"> <label></label> Modified: config/DEFAULT-config.php =================================================================== --- config/DEFAULT-config.php 2008-03-16 17:43:01 UTC (rev 84) +++ config/DEFAULT-config.php 2008-03-16 18:52:55 UTC (rev 85) @@ -52,9 +52,17 @@ define('AK_AUTOMATICALLY_UPDATE_LANGUAGE_FILES', false); // disable security checks, at least before http://trac.akelos.org/ticket/122 gets fixed define('AK_TEMPLATE_SECURITY_CHECK', false); +// overriding default translation mechanics +define('AK_DEFAULT_TEMPLATE_ENGINE', 'ExtSintags'); -define('I_NOREPLAY_EMAIL', ''); +define('PROJECT_NAME', 'iSocial'); +define('NOREPLY_EMAIL', 'no-reply <no-...@is...>'); +if (!defined(NOREPLY_EMAIL) || + !defined(PROJECT_NAME)) { + die("NOREPLY_EMAIL, PROJECT_NAME should be defined"); +} + include_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'boot.php'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-16 17:42:57
|
Revision: 84 http://isocial.svn.sourceforge.net/isocial/?rev=84&view=rev Author: aguidrevitch Date: 2008-03-16 10:43:01 -0700 (Sun, 16 Mar 2008) Log Message: ----------- generic autocomplete fields implemented, currently used for religious views field in basic user profile Modified Paths: -------------- app/application_controller.php app/controllers/profile_controller.php app/helpers/auto_complete_helper.php app/helpers/city_helper.php app/installers/basic_profile_installer.php app/installers/religious_view_installer.php app/models/basic_profile.php app/models/religious_view.php app/shared_model.php app/views/profile/basic.tpl public/stylesheets/Application.css Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-03-16 13:46:01 UTC (rev 83) +++ app/application_controller.php 2008-03-16 17:43:01 UTC (rev 84) @@ -197,7 +197,11 @@ 'order' => 'is_native DESC, name' ) ); - $this->renderText( $this->city_helper->auto_complete_result($entries, $query, $this->params['city']) ); + if (!empty($entries)) { + $this->renderText( $this->city_helper->auto_complete_result($entries, $query, $this->params['city']) ); + } else { + $this->renderNothing(); + } } } Modified: app/controllers/profile_controller.php =================================================================== --- app/controllers/profile_controller.php 2008-03-16 13:46:01 UTC (rev 83) +++ app/controllers/profile_controller.php 2008-03-16 17:43:01 UTC (rev 84) @@ -15,28 +15,31 @@ function basic () { $this->basic_profile = $this->current_user->basic_profile->load(); - if (!empty($this->params['basic_profile'])) { - $this->BasicProfile->setAttributes($this->params['basic_profile']); - $this->BasicProfile->user->assign($this->current_user); - if ($this->Request->isPost() && $this->BasicProfile->save()) { + if ($this->Request->isPost() && !empty($this->params['basic_profile'])) { + + $this->basic_profile->setAttributes($this->params['basic_profile']); + if (!empty($this->params['basic_profile']['religious_view_id'])) { + $religious_view = $this->ReligiousView->voteOrCreate($this->params['basic_profile']['religious_view_id'], + $this->current_user); + $this->basic_profile->religious_view->assign($religious_view); + } + + if ($this->basic_profile->save()) { $this->redirectTo(array('action' => 'basic')); } } } - function auto_complete_for_basic_religious_view () { - if (empty($this->params['basic_profile']['religious_view'])) { - echo 1; + function auto_complete_for_basic_profile_religious_view_id () { + if (empty($this->params['basic_profile'])) { $this->renderNothing(); } else { - $entries = $this->ReligiousView->find('all', - array('conditions' => - array( - 'name LIKE ?', '%' . $this->params['basic_profile']['religious_view'] . '%' - ), - ) - ); - $this->renderText( $this->auto_complete_helper->auto_complete_result($entries, 'name', $this->params['basic_profile']['religious_view']) ); + $entries = $this->ReligiousView->findVoted($this->params['basic_profile']['religious_view_id']); + if (!empty($entries)) { + $this->renderText( $this->auto_complete_helper->auto_complete_result($entries, 'name', $this->params['basic_profile']['religious_view_id']) ); + } else { + $this->renderNothing(); + } } } Modified: app/helpers/auto_complete_helper.php =================================================================== --- app/helpers/auto_complete_helper.php 2008-03-16 13:46:01 UTC (rev 83) +++ app/helpers/auto_complete_helper.php 2008-03-16 17:43:01 UTC (rev 84) @@ -38,15 +38,56 @@ return ''; } foreach ($entries as $entry) { - $items[] = TagHelper::content_tag('li',!empty($phrase) ? TextHelper::highlight(TextHelper::h($entry->get($field)), $phrase) : TextHelper::h(@$entry->get($field))); + $items[] = TagHelper::content_tag('li', + !empty($phrase) + ? TextHelper::highlight(TextHelper::h($entry->get($field)), $phrase) + : TextHelper::h(@$entry->get($field)), array('id' => $entry->getId())); } return TagHelper::content_tag('ul', join('', array_unique($items))); } function text_field_with_auto_complete($object, $method, $tag_options = array(), $completion_options = array()) { - $completion_options['indicator'] = "'{$object}_{$method}'"; - return parent::text_field_with_auto_complete($object, $method, $tag_options, $completion_options); + + $this->object =& $this->_controller->{$object}; + $this->value = ''; + + if ($this->object) { + $id = $this->object->get($method); + if ($id) { + $model = @$completion_options['model']; + if (!$model) { + foreach ($this->object->getAssociated('belongsTo') as $name => $association) { + if ($association->getAssociationOption('primary_key_name') == $method) { + $model = $association; + break; + } + } + } + $dep = $model->find($id); + if (!empty($dep)) { + $this->value = $dep->name; + } + } + } + + $tag_options = array_merge(array( + 'value' => $this->value, + 'autocomplete' => 'on', + ), $tag_options); + + $completion_options = array_merge(array( + 'skip_style' => true, + 'url' => array('action' => "auto_complete_for_{$object}_{$method}"), + 'frequency' => 0.4, + 'indicator' => "'{$object}_{$method}'", + ), $completion_options); + + $text_field = $this->_controller->form_helper->text_field($object, $method, $tag_options); + $div = TagHelper::content_tag('div', '', array('id' => "{$object}_{$method}_auto_complete", 'class' => 'auto_complete')); + $javascript = $this->auto_complete_field("{$object}_{$method}", $completion_options); + + return $text_field . $div . $javascript; } } Modified: app/helpers/city_helper.php =================================================================== --- app/helpers/city_helper.php 2008-03-16 13:46:01 UTC (rev 83) +++ app/helpers/city_helper.php 2008-03-16 17:43:01 UTC (rev 84) @@ -28,7 +28,9 @@ $this->value = ''; if ($this->object && $city_id = $this->object->get($method)) { $city = $this->_controller->City->find($city_id); - $this->value = $city->name; + if (!empty($city)) { + $this->value = $city->name; + } } $tag_options = array_merge(array( Modified: app/installers/basic_profile_installer.php =================================================================== --- app/installers/basic_profile_installer.php 2008-03-16 13:46:01 UTC (rev 83) +++ app/installers/basic_profile_installer.php 2008-03-16 17:43:01 UTC (rev 84) @@ -9,14 +9,19 @@ `user_id` int(11) NOT NULL, `sex_id` int(11), `city_id` int(11), + `city_other` char(100), + `country_id` int(11), `birthdate` date DEFAULT NULL, `political_view_id` int(11), + `religious_view_id` int(11), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, FOREIGN KEY (user_id) REFERENCES users(id), FOREIGN KEY (sex_id) REFERENCES sexes(id), FOREIGN KEY (city_id) REFERENCES cities(id), - FOREIGN KEY (political_view_id) REFERENCES political_views(id) + FOREIGN KEY (country_id) REFERENCES countries(id), + FOREIGN KEY (political_view_id) REFERENCES political_views(id), + FOREIGN KEY (religious_view_id) REFERENCES religious_views(id) ) ENGINE=InnoDB"); } Modified: app/installers/religious_view_installer.php =================================================================== --- app/installers/religious_view_installer.php 2008-03-16 13:46:01 UTC (rev 83) +++ app/installers/religious_view_installer.php 2008-03-16 17:43:01 UTC (rev 84) @@ -6,15 +6,42 @@ $this->execute( "CREATE TABLE `religious_views` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `name` char(100) NOT NULL DEFAULT '' + `name` char(100) NOT NULL DEFAULT '', + `votes` int(11) NOT NULL DEFAULT 0, + INDEX name_idx (name, votes) ) ENGINE=InnoDB"); + $this->execute( + "CREATE TABLE `religious_view_votes` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11), + `religious_view_id` int(11), + FOREIGN KEY (user_id) REFERENCES users(id), + FOREIGN KEY (religious_view_id) REFERENCES religious_views(id) + ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TRIGGER rvv_insert AFTER INSERT ON religious_view_votes + FOR EACH ROW BEGIN + UPDATE `religious_views` SET votes = votes + 1 WHERE id = NEW.religious_view_id; + END; + "); + + $this->execute( + "CREATE TRIGGER rvv_delete AFTER DELETE ON religious_view_votes + FOR EACH ROW BEGIN + UPDATE `religious_views` SET votes = votes - 1 WHERE id = OLD.religious_view_id; + END; + "); } function down_1() { /**/ - $this->dropTable('religious_view'); + // triggers should be dropped automatically + // http://dev.mysql.com/doc/refman/5.1/en/drop-trigger.html + $this->dropTable('religious_view_votes'); + $this->dropTable('religious_views'); /**/ } } Modified: app/models/basic_profile.php =================================================================== --- app/models/basic_profile.php 2008-03-16 13:46:01 UTC (rev 83) +++ app/models/basic_profile.php 2008-03-16 17:43:01 UTC (rev 84) @@ -2,7 +2,7 @@ class BasicProfile extends ActiveRecord { - var $belongs_to = array('User', 'City'); + var $belongs_to = array('User', 'City', 'PoliticalView', 'ReligiousView'); } ?> Modified: app/models/religious_view.php =================================================================== --- app/models/religious_view.php 2008-03-16 13:46:01 UTC (rev 83) +++ app/models/religious_view.php 2008-03-16 17:43:01 UTC (rev 84) @@ -1,7 +1,15 @@ <?php -class ReligiousView extends ActiveRecord +class ReligiousView extends VotableActiveRecord { + var $votes_model = 'ReligiousViewVote'; + } +class ReligiousViewVote extends ActiveRecord { + + var $primary_key_name = 'religious_view_id'; + +} + ?> Modified: app/shared_model.php =================================================================== --- app/shared_model.php 2008-03-16 13:46:01 UTC (rev 83) +++ app/shared_model.php 2008-03-16 17:43:01 UTC (rev 84) @@ -25,4 +25,57 @@ } +class VotableActiveRecord extends ActiveRecord { + + var $votes_model; + var $min_votes_to_appear = 2; + + function &voteOrCreate ($value, $user) { + + if ($this->votes_model) { + @include_once(AkInflector::toModelFilename($this->votes_model)); + } + + $this->votes_object = new $this->votes_model(); + + $record = $this->findFirst(array('conditions' => array("name LIKE ?", $value))); + if (empty($record)) { + $this->name = $value; + $this->save(); + $record =& $this; + } + + if ($record->votes < $this->min_votes_to_appear) { + + $vote = $this->votes_object->findFirst( + array('conditions' => + array('user_id = ? and ' . $this->votes_object->primary_key_name . ' = ?', $user->getId(), $record->getId()) + ) + ); + + if (empty($vote)) { + $this->votes_object->setAttributes(array( + 'user_id' => $user->getId(), + $this->votes_object->primary_key_name => $record->getId() + )); + + if ($this->votes_object->save()) { + $record->reload(); + } + } + } + return $record; + } + + function &findVoted ($value) { + $records = $this->find('all', + array('conditions' => + array('name LIKE ? AND votes >= ' . $this->min_votes_to_appear, '%'. $value . '%') + ) + ); + return $records; + } + +} + ?> Modified: app/views/profile/basic.tpl =================================================================== --- app/views/profile/basic.tpl 2008-03-16 13:46:01 UTC (rev 83) +++ app/views/profile/basic.tpl 2008-03-16 17:43:01 UTC (rev 84) @@ -23,7 +23,7 @@ </div> <div class="formrow"> <label>_{Religious views}:</label> - <?= $auto_complete_helper->text_field_with_auto_complete('basic_profile', 'religious_view', array('autocomplete' => 'on', 'class' => 'textinput autocomplete'), array('skip_style' => true) )?> + <?= $auto_complete_helper->text_field_with_auto_complete('basic_profile', 'religious_view_id', array('autocomplete' => 'on', 'class' => 'textinput autocomplete'), array('skip_style' => true))?> </div> <div class="formrow"> <label></label> Modified: public/stylesheets/Application.css =================================================================== --- public/stylesheets/Application.css 2008-03-16 13:46:01 UTC (rev 83) +++ public/stylesheets/Application.css 2008-03-16 17:43:01 UTC (rev 84) @@ -375,7 +375,6 @@ width: 645px; } - .tabs .left { float: left; padding-left: 10px; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-16 13:46:00
|
Revision: 83 http://isocial.svn.sourceforge.net/isocial/?rev=83&view=rev Author: aguidrevitch Date: 2008-03-16 06:46:01 -0700 (Sun, 16 Mar 2008) Log Message: ----------- getting rid of images Modified Paths: -------------- app/views/message/_rows.tpl public/stylesheets/Message.css Modified: app/views/message/_rows.tpl =================================================================== --- app/views/message/_rows.tpl 2008-03-14 20:16:11 UTC (rev 82) +++ app/views/message/_rows.tpl 2008-03-16 13:46:01 UTC (rev 83) @@ -5,13 +5,7 @@ <tr class="<? if ($target == 'sender' && !$message->is_read) { echo 'new_message'; } ?>"> <td class="msg_icon"> <? if ($target == 'sender') { - echo '<a href="">'; - if (!$message->is_read) { - echo '<img src="/images/email.png" alt="' . $text_helper->translate("New message", array()) . '">'; - } else { - echo '<img src="/images/email_open.png" alt="' . $text_helper->translate("Message is read", array()) . '">'; - } - echo '</a>'; + echo '<a class="'. ($message->is_read ? 'email_open' : 'email_closed') . ' href=""></a>'; } else { echo '<span> </span>'; } Modified: public/stylesheets/Message.css =================================================================== --- public/stylesheets/Message.css 2008-03-14 20:16:11 UTC (rev 82) +++ public/stylesheets/Message.css 2008-03-16 13:46:01 UTC (rev 83) @@ -221,3 +221,15 @@ padding: 7px 0px 0px 0px; color: #999999; } + +.email_closed { + width: 16px; + height: 16px; + background: url('/images/email.png') no-repeat 10px; +} + +.email_open { + width: 16px; + height: 16px; + background: url('/images/email_open.png') no-repeat 10px; +} \ 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-03-14 20:16:11
|
Revision: 82 http://isocial.svn.sourceforge.net/isocial/?rev=82&view=rev Author: aguidrevitch Date: 2008-03-14 13:16:11 -0700 (Fri, 14 Mar 2008) Log Message: ----------- multiple cross-browser css/html/javascript fixes Modified Paths: -------------- app/views/default/_sidebar.tpl app/views/layouts/application.tpl app/views/message/_rows.tpl app/views/message/_thread.tpl app/views/message/inbox.tpl app/views/message/outbox.tpl app/views/message/send.tpl app/views/message/show.tpl app/views/profile/basic.tpl app/views/shared/dialog.tpl public/javascripts/autocomplete.js public/stylesheets/Application.css public/stylesheets/Default.css public/stylesheets/Message.css public/stylesheets/autocomplete.css Added Paths: ----------- public/stylesheets/dialog.css Modified: app/views/default/_sidebar.tpl =================================================================== --- app/views/default/_sidebar.tpl 2008-03-14 16:58:46 UTC (rev 81) +++ app/views/default/_sidebar.tpl 2008-03-14 20:16:11 UTC (rev 82) @@ -2,11 +2,11 @@ <form action="/user/login" method="post"> <label> <span>_{Email}:</span> - <input class="sidetextinput" type="text" name="email"> + <input class="textinput sidetextinput" type="text" name="email"> </label> <label> <span>_{Password}:</span> - <input class="sidetextinput" type="password" name="password"> + <input class="textinput sidetextinput" type="password" name="password"> </label> <label class="persistent"> <input class="checkboxinput" type="checkbox" name="remember_me"> Modified: app/views/layouts/application.tpl =================================================================== --- app/views/layouts/application.tpl 2008-03-14 16:58:46 UTC (rev 81) +++ app/views/layouts/application.tpl 2008-03-14 20:16:11 UTC (rev 82) @@ -4,6 +4,7 @@ <title><?= @$title ?></title> <link href="/stylesheets/reset.css" rel="stylesheet" type="text/css"> <link href="/stylesheets/autocomplete.css" rel="stylesheet" type="text/css"> +<link href="/stylesheets/dialog.css" rel="stylesheet" type="text/css"> <link href="/stylesheets/Application.css" rel="stylesheet" type="text/css"> <link href="/stylesheets/<?= $controller->getControllerName() ?>.css" rel="stylesheet" type="text/css"> <script src="/javascripts/prototype.js" type="text/javascript"></script> Modified: app/views/message/_rows.tpl =================================================================== --- app/views/message/_rows.tpl 2008-03-14 16:58:46 UTC (rev 81) +++ app/views/message/_rows.tpl 2008-03-14 20:16:11 UTC (rev 82) @@ -33,7 +33,7 @@ </div> </td> <td class="delete_msg"> - <a href="#" onclick="delete_single_thread(this)" name="{message.id}"> </a> + <a href="#" onclick="delete_single_thread(this); return false;" name="{message.id}"> </a> </td> </tr> {else} @@ -43,5 +43,5 @@ {end} </tbody> </table> - -<div class="inbox_footer"><div class="mailbox_size">{message_threads} _{Message Threads}</div></div> +<div class="footer"><div class="mailbox_size">{message_threads} _{Message Threads}</div></div> +<div class="clearfix"></div> Modified: app/views/message/_thread.tpl =================================================================== --- app/views/message/_thread.tpl 2008-03-14 16:58:46 UTC (rev 81) +++ app/views/message/_thread.tpl 2008-03-14 20:16:11 UTC (rev 82) @@ -17,5 +17,6 @@ </div> <div class="message_body">{message.body?}</div> </div> +<div class="clearfix"></div> <div class="divide_line"> </div> {end} Modified: app/views/message/inbox.tpl =================================================================== --- app/views/message/inbox.tpl 2008-03-14 16:58:46 UTC (rev 81) +++ app/views/message/inbox.tpl 2008-03-14 20:16:11 UTC (rev 82) @@ -1,9 +1,9 @@ <?= $controller->renderPartial("menu") ?> -<div class="inbox_submenu"> +<div class="submenu"> <div class="menu_block selector"> <label for="action_select">_{Select}: - <select class="" onchange="onselect(this)" id="action_select" name="action_selector"> + <select onchange="doselect(this)" id="action_select" name="action_selector"> <option selected="selected" value="_">---------</option> <option value="none">_{None}</option> <option value="read">_{Read}</option> @@ -16,11 +16,12 @@ <ul id="inbox_action" class="buttons"> <li><a class="disabled">_{Mark as}:</a></li> <li><a href="#" onclick="mark_as_unread(this)" id="unread_link" class="disabled">_{Unread},</a></li> - <li><a href="#" onclick="mark_as_read(this)" id="read_link" class="disabled">_{Read};</a></li> - <li><a href="#" onclick="delete_threads(this)" id="delete_link" class="disabled">_{Delete}</a></li> + <li><a href="#" onclick="mark_as_read(this);" id="read_link" class="disabled">_{Read};</a></li> + <li><a href="#" onclick="delete_threads(this);" id="delete_link" class="disabled">_{Delete}</a></li> </ul> </div> </div> +<div class="clearfix"></div> <form id="messages_form" action="/message/inbox" method="post" onsubmit="return false;"> <div id="messages"> @@ -46,7 +47,7 @@ checkunread.length || checkread.length ? $("delete_link").removeClassName('disabled') : $("delete_link").addClassName('disabled'); }; -function onselect (element) { +function doselect (element) { var checkboxes; switch (element.getValue()) { case "none": @@ -65,7 +66,10 @@ break; } if (checkboxes) { - checkboxes.invoke('click'); + /* bug , see http://dev.rubyonrails.org/ticket/9976 + checkboxes.invoke('click'); + */ + checkboxes.each( function(el) { el.click(); }); } }; Modified: app/views/message/outbox.tpl =================================================================== --- app/views/message/outbox.tpl 2008-03-14 16:58:46 UTC (rev 81) +++ app/views/message/outbox.tpl 2008-03-14 20:16:11 UTC (rev 82) @@ -1,9 +1,9 @@ <?= $controller->renderPartial("menu") ?> -<div class="inbox_submenu"> +<div class="submenu"> <div class="menu_block selector"> <label for="action_select">_{Select}: - <select class="" onchange="onselect(this)" id="action_select" name="action_selector"> + <select onchange="doselect(this)" id="action_select" name="action_selector"> <option selected="selected" value="_">---------</option> <option value="none">_{None}</option> <option value="all">_{All}</option> @@ -12,10 +12,11 @@ </div> <div class="menu_block"> <ul id="inbox_action" class="buttons"> - <li><a href="#" onclick="delete_threads(this)" id="delete_link" class="disabled">_{Delete}</a></li> + <li><a href="#" onclick="delete_threads(this); return false;" id="delete_link" class="disabled">_{Delete}</a></li> </ul> </div> </div> +<div class="clearfix"></div> <form id="messages_form" action="/message/outbox" method="post" onsubmit="return false;"> <div id="messages"> @@ -36,9 +37,9 @@ checked.length ? $("delete_link").removeClassName('disabled') : $("delete_link").addClassName('disabled'); }; -function onselect (element) { +function doselect (element) { var checkboxes; - switch (element.getValue()) { + switch (Form.Element.getValue(element)) { case "none": checkboxes = $$('input[type=checkbox]:checked'); break; @@ -46,14 +47,18 @@ checkboxes = $$('input[type=checkbox]:not(:checked)'); break; } - if (checkboxes) { - checkboxes.invoke('click'); + + 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({ - reference: element, + reference: Element.extend(element), title: '_{Delete Threads}', body: '_{Are you sure you want to delete selected threads}?', yes: '_{Delete}', @@ -72,12 +77,11 @@ ); } }); - return false; } function delete_single_thread (element) { new Dialog.Box({ - reference: element, + reference: Element.extend(element), title: '_{Delete Thread}', body: '_{Are you sure you want to delete this thread}?', yes: '_{Delete}', @@ -101,7 +105,6 @@ ); } }); - return false; } </script> Modified: app/views/message/send.tpl =================================================================== --- app/views/message/send.tpl 2008-03-14 16:58:46 UTC (rev 81) +++ app/views/message/send.tpl 2008-03-14 20:16:11 UTC (rev 82) @@ -8,8 +8,7 @@ <label>_{To}:</label> <?= $form_options_helper->select('message', 'recipient', - $User->collect($current_user->getFriends(), 'name', 'id'), - array('class' => 'textinput') ); ?> + $User->collect($current_user->getFriends(), 'name', 'id'), array(), array('class' => 'textinput')); ?> </div> <div class="formrow"> <label>_{Subject}:</label> Modified: app/views/message/show.tpl =================================================================== --- app/views/message/show.tpl 2008-03-14 16:58:46 UTC (rev 81) +++ app/views/message/show.tpl 2008-03-14 20:16:11 UTC (rev 82) @@ -23,6 +23,7 @@ <div class="sub_controls"><a href="#" onclick="delete_single_thread(this)" name="{messages-0.id}">_{Delete}</a></div> </form> </div> + <div class="clearfix"></div> </div> <script> Modified: app/views/profile/basic.tpl =================================================================== --- app/views/profile/basic.tpl 2008-03-14 16:58:46 UTC (rev 81) +++ app/views/profile/basic.tpl 2008-03-14 20:16:11 UTC (rev 82) @@ -15,7 +15,7 @@ </div> <div class="formrow"> <label>_{Hometown}:</label> - <?= $city_helper->city_field('basic_profile', 'city_id', array('class' => 'autocomplete')); ?> + <?= $city_helper->city_field('basic_profile', 'city_id', array('class' => 'textinput autocomplete')); ?> </div> <div class="formrow"> <label>_{Political views}:</label> @@ -23,7 +23,7 @@ </div> <div class="formrow"> <label>_{Religious views}:</label> - <?= $auto_complete_helper->text_field_with_auto_complete('basic_profile', 'religious_view', array('autocomplete' => 'on', 'class' => 'autocomplete'), array('skip_style' => true) )?> + <?= $auto_complete_helper->text_field_with_auto_complete('basic_profile', 'religious_view', array('autocomplete' => 'on', 'class' => 'textinput autocomplete'), array('skip_style' => true) )?> </div> <div class="formrow"> <label></label> Modified: app/views/shared/dialog.tpl =================================================================== --- app/views/shared/dialog.tpl 2008-03-14 16:58:46 UTC (rev 81) +++ app/views/shared/dialog.tpl 2008-03-14 20:16:11 UTC (rev 82) @@ -1,12 +1,13 @@ <div id="dlg" class="action_dialog" style="display: none"> - <div id="dlgheader" class="header"> </div> - <div id="dlgbody" class="body"> </div> - <div id="dlgfooter" class="footer"> + <div id="dlgheader"> </div> + <div id="dlgbody"> </div> + <div id="dlgfooter"> <div id="dlgbuttons" class="buttons"> <input id="dlgyes" class="submitinput" type="button" value="_{Yes}"> <input id="dlgno" class="submitinput" type="button" value="_{No}"> <input id="dlgcancel" class="cancelinput" type="button" value="_{Cancel}"> </div> </div> + <div class="clearfix"></div> </div> Modified: public/javascripts/autocomplete.js =================================================================== --- public/javascripts/autocomplete.js 2008-03-14 16:58:46 UTC (rev 81) +++ public/javascripts/autocomplete.js 2008-03-14 20:16:11 UTC (rev 82) @@ -15,15 +15,15 @@ }); function city_updated (input, prev, hidden) { - if ($F(input)) { - if ($F(input) != $F(prev)) { - $(input).value = ''; - $(hidden).value = ''; - $(prev).value = ''; - new Effect.Highlight(input, { keepBackgroundImage: true, startcolor: '#ff0000', afterFinish: function (obj) { obj.element.setStyle('') } }); - } - } else { - $(hidden).value = ''; - } + if ($F(input) && (!$F(hidden) || $F(input) != $F(prev))) { + $(input).value = ''; + $(hidden).value = ''; + $(prev).value = ''; + new Effect.Highlight(input, { keepBackgroundImage: true, startcolor: '#ff0000', afterFinish: function (obj) { obj.element.setStyle('') } }); + } else if (!$F(input)) { + $(hidden).value = ''; + $(prev).value = ''; + } + } Modified: public/stylesheets/Application.css =================================================================== --- public/stylesheets/Application.css 2008-03-14 16:58:46 UTC (rev 81) +++ public/stylesheets/Application.css 2008-03-14 20:16:11 UTC (rev 82) @@ -3,18 +3,12 @@ font-size: 11px; } -input, textarea { - padding: 3px; - border: 1px solid #bdc7d8; - font-family: verdana, arial, sans-serif; - font-size: 11px; -} - -select{ +select { border:1px solid #BDC7D8; font-family:verdana,arial,sans-serif; font-size:11px; - padding:2px; + padding: 3px; + line-height: 22px; } label { @@ -47,7 +41,7 @@ a.logo { position: absolute; display: block; - width: 150px; + width: 151px; height: 55px; background-image: url(/images/logo.gif); } @@ -273,7 +267,7 @@ clear: both; height: 0px; width: 0px; - line-heght: 0px; + line-height: 0px; overflow: hidden; } @@ -294,6 +288,8 @@ } .submitinput, .buttoninput { + padding: 3px; + font-size: 11px; cursor: pointer; color: white; background-color: #3b5998; @@ -306,6 +302,8 @@ } .cancelinput { + padding: 3px; + font-size: 11px; cursor: pointer; color: black; background-color: lightgray; @@ -317,7 +315,10 @@ border-right: 1px solid #0e1f5b; } -.textinput, .passwordinput { +textarea, .textinput, .passwordinput { + border: 1px solid #bdc7d8; + font-family: verdana, arial, sans-serif; + font-size: 11px; width: 200px; margin: 0px 0px 5px 0px; padding: 3px; @@ -326,6 +327,14 @@ .shorttextinput { width: 80px; + padding: 3px; + border: 1px solid #bdc7d8; + font-family: verdana, arial, sans-serif; + font-size: 11px; + width: 200px; + margin: 0px 0px 5px 0px; + padding: 3px; + font-size: 11px; } .checkboxinput { @@ -366,6 +375,7 @@ width: 645px; } + .tabs .left { float: left; padding-left: 10px; @@ -380,25 +390,25 @@ .toggle_tabs { display: block; - margin: 0px; - padding: 0px; list-style: none; text-align: center; } .toggle_tabs li { - display: inline; - padding: 2px 0px 3px 0px; - background: #f1f1f1; - line-height: 22px; + display: block; + float: left; + margin: 0px; } .toggle_tabs li a { + display: block; border: 1px solid #898989; border-left: 0px; color: #333; font-weight: bold; - padding:2px 8px 3px 9px; + margin-rigth: 10px; + padding :4px 8px 6px 9px; + background: #f1f1f1; } .toggle_tabs li a small { @@ -452,6 +462,47 @@ text-decoration:none; } +#content .submenu { + background: #f7f7f7; + border-bottom: 1px solid #ccc; + padding: 8px 20px 8px 20px; + float: left; + width: 605px; +} + +.submenu .menu_block { + float: left; +} + +.submenu .menu_block.selector { + padding-right: 5px; +} + +.submenu .menu_block.selector select { + margin-left: 5px; +} + +.submenu .buttons { + list-style: none; + margin: 0px; + padding: 0px; +} + +.submenu .buttons li { + float: left; +} + +.submenu .buttons li a { + padding: 4px 5px 4px 5px; + display: block; +} + +.submenu .disabled { + color: #aaaaaa; + cursor: default; + text-decoration: none; +} + .divider { margin: 5px 0px 5px 0px; border-bottom: 1px solid #cccccc; @@ -518,3 +569,11 @@ .formrow .note { font-size: 10px; } + +.footer { + float: left; + display: block; + padding: 0px 10px 8px 13px; + background: #f7f7f7; + width: 622px; +} Modified: public/stylesheets/Default.css =================================================================== --- public/stylesheets/Default.css 2008-03-14 16:58:46 UTC (rev 81) +++ public/stylesheets/Default.css 2008-03-14 20:16:11 UTC (rev 82) @@ -2,5 +2,4 @@ width: 120px; margin: 0px 0px 5px 0px; padding: 3px; - font-size: 11px; } \ No newline at end of file Modified: public/stylesheets/Message.css =================================================================== --- public/stylesheets/Message.css 2008-03-14 16:58:46 UTC (rev 81) +++ public/stylesheets/Message.css 2008-03-14 20:16:11 UTC (rev 82) @@ -1,42 +1,3 @@ -#content .inbox_submenu { - background: #f7f7f7; - border-bottom: 1px solid #ccc; - padding: 8px 20px 28px 20px; -} - -.inbox_submenu .menu_block { - float: left; -} - -.inbox_submenu .menu_block.selector { - padding-right: 5px; -} - -.inbox_submenu .menu_block.selector select { - margin-left: 5px; -} - -.inbox_submenu .buttons { - list-style: none; - margin: 0px; - padding: 0px; -} - -.inbox_submenu .buttons li { - float: left; -} - -.inbox_submenu .buttons li a { - padding: 4px 5px 4px 5px; - display: block; -} - -.inbox_submenu .disabled { - color: #aaaaaa; - cursor: default; - text-decoration: none; -} - .no_messages { color: #666666; font-size: 13px; @@ -119,8 +80,6 @@ .message_row .msg .subject { padding: 2px 0px 3px 22px; - background-position: 0px 1px 0px 1px; - background-repeat: no-repeat; } .message_row .msg .body_wrap { @@ -149,21 +108,7 @@ background: #3B5998 url(/images/x_to_hide_hover.gif) no-repeat; } -.inbox_footer { - display: block; - margin-top: -1px; - padding: 0px 10px 8px 13px; - border-top: 1px solid #cccccc; - background: #f7f7f7; - overflow: auto; -} -.inbox_footer .mailbox_size { - float: left; - padding: 7px 0px 0px 0px; - color: #999999; -} - .messages_thread { padding: 20px 30px 0px 30px; } @@ -184,18 +129,6 @@ font-weight: normal; } -.message { - //height: 1%; -} - -.message:after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; -} - .message div { float: left; padding: 5px 0px 10px 0px; @@ -283,38 +216,8 @@ overflow: hidden; } -.action_dialog { - border: 6px solid #999999; - width: 465px; - overflow: auto; - top: 34px; - position: relative; - z-index: 100; +.footer .mailbox_size { + float: left; + padding: 7px 0px 0px 0px; + color: #999999; } - -.action_dialog .header { - background-color: #6d84b4; - border: 1px solid #3b5998; - color: #ffffff; - font-weight: bold; - font-size: 13px; - padding: 6px 0px 6px 10px; -} - -.action_dialog .body { - background-color: #ffffff; - color: #000000; - font-size: 11px; - padding: 15px; -} - -.action_dialog .footer { - background-color: #f2f2f2; - border: 1px solid #a6a6a6; - overflow: auto; -} - -.action_dialog .footer .buttons { - margin: 0px 6px 0px 0px; - float: right; -} Modified: public/stylesheets/autocomplete.css =================================================================== --- public/stylesheets/autocomplete.css 2008-03-14 16:58:46 UTC (rev 81) +++ public/stylesheets/autocomplete.css 2008-03-14 20:16:11 UTC (rev 82) @@ -1,8 +1,3 @@ -span.indicator { - display: none; - margin-left: 4px; -} - input.autocomplete { padding-right: 18px; background: url('/images/spinner-faded.gif') no-repeat right; Added: public/stylesheets/dialog.css =================================================================== --- public/stylesheets/dialog.css (rev 0) +++ public/stylesheets/dialog.css 2008-03-14 20:16:11 UTC (rev 82) @@ -0,0 +1,36 @@ +#dlg { + border: 6px solid #999999; + width: 465px; + overflow: auto; + top: 34px; + position: relative; + z-index: 100; +} + +#dlgheader { + background-color: #6d84b4; + border: 1px solid #3b5998; + color: #ffffff; + font-weight: bold; + font-size: 13px; + padding: 6px 0px 6px 10px; +} + +#dlgbody { + background-color: #ffffff; + color: #000000; + font-size: 11px; + padding: 15px; +} + +#dlgfooter { + background-color: #f2f2f2; + border: 1px solid #a6a6a6; + float: left; + width: 463px; +} + +#dlgfooter .buttons { + margin: 0px 6px 0px 0px; + float: right; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-03-14 16:58:43
|
Revision: 81 http://isocial.svn.sourceforge.net/isocial/?rev=81&view=rev Author: dim0s77 Date: 2008-03-14 09:58:46 -0700 (Fri, 14 Mar 2008) Log Message: ----------- fixed link in the email Modified Paths: -------------- app/views/message/email/send.tpl Modified: app/views/message/email/send.tpl =================================================================== --- app/views/message/email/send.tpl 2008-03-14 16:23:52 UTC (rev 80) +++ app/views/message/email/send.tpl 2008-03-14 16:58:46 UTC (rev 81) @@ -7,7 +7,7 @@ <p>"{message.body}"</p> <p>_{To reply to this message, follow the link below}:<br> -<? $link = AK_SITE_URL . "message/show?t=" . $message->thread_id ?> +<? $link = AK_SITE_URL . "message/show/inbox/" . $message->thread_id ?> <a href="{link}">{link}</a>.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-14 16:23:46
|
Revision: 80 http://isocial.svn.sourceforge.net/isocial/?rev=80&view=rev Author: aguidrevitch Date: 2008-03-14 09:23:52 -0700 (Fri, 14 Mar 2008) Log Message: ----------- css fixes for top menu to be correctly displayed in all browsers Modified Paths: -------------- app/views/message/_menu.tpl app/views/profile/_menu.tpl public/stylesheets/Application.css Modified: app/views/message/_menu.tpl =================================================================== --- app/views/message/_menu.tpl 2008-03-14 16:12:10 UTC (rev 79) +++ app/views/message/_menu.tpl 2008-03-14 16:23:52 UTC (rev 80) @@ -11,3 +11,4 @@ </ul> </div> </div> +<div class="clearfix"> </div> Modified: app/views/profile/_menu.tpl =================================================================== --- app/views/profile/_menu.tpl 2008-03-14 16:12:10 UTC (rev 79) +++ app/views/profile/_menu.tpl 2008-03-14 16:23:52 UTC (rev 80) @@ -11,3 +11,4 @@ </ul> </div> </div> +<div class="clearfix"></div> \ No newline at end of file Modified: public/stylesheets/Application.css =================================================================== --- public/stylesheets/Application.css 2008-03-14 16:12:10 UTC (rev 79) +++ public/stylesheets/Application.css 2008-03-14 16:23:52 UTC (rev 80) @@ -47,7 +47,7 @@ a.logo { position: absolute; display: block; - width: 151px; + width: 150px; height: 55px; background-image: url(/images/logo.gif); } @@ -269,6 +269,14 @@ padding-left: 20px; } +.clearfix { + clear: both; + height: 0px; + width: 0px; + line-heght: 0px; + overflow: hidden; +} + .photoapp { background: url('/images/photo.png') no-repeat 0px; } @@ -352,18 +360,22 @@ #content .tabs { display:block; - padding: 20px 0px 15px 0px; + padding: 20px 0px 0px 0px; border-bottom: 1px solid #898989; + float: left; + width: 645px; } .tabs .left { float: left; padding-left: 10px; + margin-bottom: -1px; } .tabs .right { float: right; padding-right: 10px; + margin-bottom: -1px; } .toggle_tabs { @@ -378,6 +390,7 @@ display: inline; padding: 2px 0px 3px 0px; background: #f1f1f1; + line-height: 22px; } .toggle_tabs li a { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |