Initial symfony commit

This commit is contained in:
goo
2012-09-19 13:34:22 +10:00
parent 3128a6366b
commit fd1ab5f78e
81 changed files with 10309 additions and 0 deletions

9
sandbox/app/AppCache.php Normal file
View File

@@ -0,0 +1,9 @@
<?php
require_once __DIR__.'/AppKernel.php';
use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;
class AppCache extends HttpCache
{
}

38
sandbox/app/AppKernel.php Normal file
View File

@@ -0,0 +1,38 @@
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\AopBundle\JMSAopBundle(),
new JMS\DiExtraBundle\JMSDiExtraBundle($this),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
new BodyRep\BodyRep()
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
}
return $bundles;
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
}
}

View File

@@ -0,0 +1,638 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/*
* Users of PHP 5.2 should be able to run the requirements checks.
* This is why the file and all classes must be compatible with PHP 5.2+
* (e.g. not using namespaces and closures).
*
* ************** CAUTION **************
*
* DO NOT EDIT THIS FILE as it will be overriden by Composer as part of
* the installation/update process. The original file resides in the
* SensioDistributionBundle.
*
* ************** CAUTION **************
*/
/**
* Represents a single PHP requirement, e.g. an installed extension.
* It can be a mandatory requirement or an optional recommendation.
* There is a special subclass, named PhpIniRequirement, to check a php.ini configuration.
*
* @author Tobias Schultze <http://tobion.de>
*/
class Requirement
{
private $fulfilled;
private $testMessage;
private $helpText;
private $helpHtml;
private $optional;
/**
* Constructor that initializes the requirement.
*
* @param Boolean $fulfilled Whether the requirement is fulfilled
* @param string $testMessage The message for testing the requirement
* @param string $helpHtml The help text formatted in HTML for resolving the problem
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
* @param Boolean $optional Whether this is only an optional recommendation not a mandatory requirement
*/
public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false)
{
$this->fulfilled = (Boolean) $fulfilled;
$this->testMessage = (string) $testMessage;
$this->helpHtml = (string) $helpHtml;
$this->helpText = null === $helpText ? strip_tags($this->helpHtml) : (string) $helpText;
$this->optional = (Boolean) $optional;
}
/**
* Returns whether the requirement is fulfilled.
*
* @return Boolean true if fulfilled, otherwise false
*/
public function isFulfilled()
{
return $this->fulfilled;
}
/**
* Returns the message for testing the requirement.
*
* @return string The test message
*/
public function getTestMessage()
{
return $this->testMessage;
}
/**
* Returns the help text for resolving the problem
*
* @return string The help text
*/
public function getHelpText()
{
return $this->helpText;
}
/**
* Returns the help text formatted in HTML.
*
* @return string The HTML help
*/
public function getHelpHtml()
{
return $this->helpHtml;
}
/**
* Returns whether this is only an optional recommendation and not a mandatory requirement.
*
* @return Boolean true if optional, false if mandatory
*/
public function isOptional()
{
return $this->optional;
}
}
/**
* Represents a PHP requirement in form of a php.ini configuration.
*
* @author Tobias Schultze <http://tobion.de>
*/
class PhpIniRequirement extends Requirement
{
/**
* Constructor that initializes the requirement.
*
* @param string $cfgName The configuration name used for ini_get()
* @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
* @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
* @param string|null $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
* @param string|null $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
* @param Boolean $optional Whether this is only an optional recommendation not a mandatory requirement
*/
public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
{
$cfgValue = ini_get($cfgName);
if (is_callable($evaluation)) {
if (null === $testMessage || null === $helpHtml) {
throw new InvalidArgumentException('You must provide the parameters testMessage and helpHtml for a callback evaluation.');
}
$fulfilled = call_user_func($evaluation, $cfgValue);
} else {
if (null === $testMessage) {
$testMessage = sprintf('%s %s be %s in php.ini',
$cfgName,
$optional ? 'should' : 'must',
$evaluation ? 'enabled' : 'disabled'
);
}
if (null === $helpHtml) {
$helpHtml = sprintf('Set <strong>%s</strong> to <strong>%s</strong> in php.ini<a href="#phpini">*</a>.',
$cfgName,
$evaluation ? 'on' : 'off'
);
}
$fulfilled = $evaluation == $cfgValue;
}
parent::__construct($fulfilled || ($approveCfgAbsence && false === $cfgValue), $testMessage, $helpHtml, $helpText, $optional);
}
}
/**
* A RequirementCollection represents a set of Requirement instances.
*
* @author Tobias Schultze <http://tobion.de>
*/
class RequirementCollection implements IteratorAggregate
{
private $requirements = array();
/**
* Gets the current RequirementCollection as an Iterator.
*
* @return Traversable A Traversable interface
*/
public function getIterator()
{
return new ArrayIterator($this->requirements);
}
/**
* Adds a Requirement.
*
* @param Requirement $requirement A Requirement instance
*/
public function add(Requirement $requirement)
{
$this->requirements[] = $requirement;
}
/**
* Adds a mandatory requirement.
*
* @param Boolean $fulfilled Whether the requirement is fulfilled
* @param string $testMessage The message for testing the requirement
* @param string $helpHtml The help text formatted in HTML for resolving the problem
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
*/
public function addRequirement($fulfilled, $testMessage, $helpHtml, $helpText = null)
{
$this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, false));
}
/**
* Adds an optional recommendation.
*
* @param Boolean $fulfilled Whether the recommendation is fulfilled
* @param string $testMessage The message for testing the recommendation
* @param string $helpHtml The help text formatted in HTML for resolving the problem
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
*/
public function addRecommendation($fulfilled, $testMessage, $helpHtml, $helpText = null)
{
$this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, true));
}
/**
* Adds a mandatory requirement in form of a php.ini configuration.
*
* @param string $cfgName The configuration name used for ini_get()
* @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
* @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
* @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
* @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
*/
public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
{
$this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, false));
}
/**
* Adds an optional recommendation in form of a php.ini configuration.
*
* @param string $cfgName The configuration name used for ini_get()
* @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
* @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
* @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
* @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
*/
public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
{
$this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, true));
}
/**
* Adds a requirement collection to the current set of requirements.
*
* @param RequirementCollection $collection A RequirementCollection instance
*/
public function addCollection(RequirementCollection $collection)
{
$this->requirements = array_merge($this->requirements, $collection->all());
}
/**
* Returns both requirements and recommendations.
*
* @return array Array of Requirement instances
*/
public function all()
{
return $this->requirements;
}
/**
* Returns all mandatory requirements.
*
* @return array Array of Requirement instances
*/
public function getRequirements()
{
$array = array();
foreach ($this->requirements as $req) {
if (!$req->isOptional()) {
$array[] = $req;
}
}
return $array;
}
/**
* Returns the mandatory requirements that were not met.
*
* @return array Array of Requirement instances
*/
public function getFailedRequirements()
{
$array = array();
foreach ($this->requirements as $req) {
if (!$req->isFulfilled() && !$req->isOptional()) {
$array[] = $req;
}
}
return $array;
}
/**
* Returns all optional recommmendations.
*
* @return array Array of Requirement instances
*/
public function getRecommendations()
{
$array = array();
foreach ($this->requirements as $req) {
if ($req->isOptional()) {
$array[] = $req;
}
}
return $array;
}
/**
* Returns the recommendations that were not met.
*
* @return array Array of Requirement instances
*/
public function getFailedRecommendations()
{
$array = array();
foreach ($this->requirements as $req) {
if (!$req->isFulfilled() && $req->isOptional()) {
$array[] = $req;
}
}
return $array;
}
/**
* Returns whether a php.ini configuration is not correct.
*
* @return Boolean php.ini configuration problem?
*/
public function hasPhpIniConfigIssue()
{
foreach ($this->requirements as $req) {
if (!$req->isFulfilled() && $req instanceof PhpIniRequirement) {
return true;
}
}
return false;
}
/**
* Returns the PHP configuration file (php.ini) path.
*
* @return string|false php.ini file path
*/
public function getPhpIniConfigPath()
{
return get_cfg_var('cfg_file_path');
}
}
/**
* This class specifies all requirements and optional recommendations that
* are necessary to run the Symfony Standard Edition.
*
* @author Tobias Schultze <http://tobion.de>
* @author Fabien Potencier <fabien@symfony.com>
*/
class SymfonyRequirements extends RequirementCollection
{
const REQUIRED_PHP_VERSION = '5.3.3';
/**
* Constructor that initializes the requirements.
*/
public function __construct()
{
/* mandatory requirements follow */
$installedPhpVersion = phpversion();
$this->addRequirement(
version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>='),
sprintf('PHP version must be at least %s (%s installed)', self::REQUIRED_PHP_VERSION, $installedPhpVersion),
sprintf('You are running PHP version "<strong>%s</strong>", but Symfony needs at least PHP "<strong>%s</strong>" to run.
Before using Symfony, upgrade your PHP installation, preferably to the latest version.',
$installedPhpVersion, self::REQUIRED_PHP_VERSION),
sprintf('Install PHP %s or newer (installed version is %s)', self::REQUIRED_PHP_VERSION, $installedPhpVersion)
);
$this->addRequirement(
version_compare($installedPhpVersion, '5.3.16', '!='),
'PHP version must not be 5.3.16 as Symfony won\'t work properly with it',
'Install PHP 5.3.17 or newer (or downgrade to an earlier PHP version)'
);
$this->addRequirement(
is_dir(__DIR__.'/../vendor/composer'),
'Vendor libraries must be installed',
'Vendor libraries are missing. Install composer following instructions from <a href="http://getcomposer.org/">http://getcomposer.org/</a>. ' .
'Then run "<strong>php composer.phar install</strong>" to install them.'
);
$baseDir = basename(__DIR__);
$this->addRequirement(
is_writable(__DIR__.'/cache'),
"$baseDir/cache/ directory must be writable",
"Change the permissions of the \"<strong>$baseDir/cache/</strong>\" directory so that the web server can write into it."
);
$this->addRequirement(
is_writable(__DIR__.'/logs'),
"$baseDir/logs/ directory must be writable",
"Change the permissions of the \"<strong>$baseDir/logs/</strong>\" directory so that the web server can write into it."
);
$this->addPhpIniRequirement(
'date.timezone', true, false,
'date.timezone setting must be set',
'Set the "<strong>date.timezone</strong>" setting in php.ini<a href="#phpini">*</a> (like Europe/Paris).'
);
if (version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>=')) {
$this->addRequirement(
(in_array(date_default_timezone_get(), DateTimeZone::listIdentifiers())),
sprintf('Configured default timezone "%s" must be supported by your installation of PHP', date_default_timezone_get()),
'Your default timezone is not supported by PHP. Check for typos in your <strong>php.ini</strong> file and have a look at the list of deprecated timezones at <a href="http://php.net/manual/en/timezones.others.php">http://php.net/manual/en/timezones.others.php</a>.'
);
}
$this->addRequirement(
function_exists('json_encode'),
'json_encode() must be available',
'Install and enable the <strong>JSON</strong> extension.'
);
$this->addRequirement(
function_exists('session_start'),
'session_start() must be available',
'Install and enable the <strong>session</strong> extension.'
);
$this->addRequirement(
function_exists('ctype_alpha'),
'ctype_alpha() must be available',
'Install and enable the <strong>ctype</strong> extension.'
);
$this->addRequirement(
function_exists('token_get_all'),
'token_get_all() must be available',
'Install and enable the <strong>Tokenizer</strong> extension.'
);
$this->addRequirement(
function_exists('simplexml_import_dom'),
'simplexml_import_dom() must be available',
'Install and enable the <strong>SimpleXML</strong> extension.'
);
if (function_exists('apc_store') && ini_get('apc.enabled')) {
$this->addRequirement(
version_compare(phpversion('apc'), '3.0.17', '>='),
'APC version must be at least 3.0.17',
'Upgrade your <strong>APC</strong> extension (3.0.17+).'
);
}
$this->addPhpIniRequirement('detect_unicode', false);
if (extension_loaded('suhosin')) {
$this->addPhpIniRequirement(
'suhosin.executor.include.whitelist',
create_function('$cfgValue', 'return false !== stripos($cfgValue, "phar");'),
false,
'suhosin.executor.include.whitelist must be configured correctly in php.ini',
'Add "<strong>phar</strong>" to <strong>suhosin.executor.include.whitelist</strong> in php.ini<a href="#phpini">*</a>.'
);
}
if (extension_loaded('xdebug')) {
$this->addPhpIniRequirement(
'xdebug.show_exception_trace', false, true
);
$this->addPhpIniRequirement(
'xdebug.scream', false, true
);
}
$pcreVersion = defined('PCRE_VERSION') ? (float) PCRE_VERSION : null;
$this->addRequirement(
null !== $pcreVersion && $pcreVersion > 8.0,
sprintf('PCRE extension must be available and at least 8.0 (%s installed)', $pcreVersion ? $pcreVersion : 'not'),
'Upgrade your <strong>PCRE</strong> extension (8.0+).'
);
/* optional recommendations follow */
$this->addRecommendation(
file_get_contents(__FILE__) === file_get_contents(__DIR__.'/../vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/app/SymfonyRequirements.php'),
'Requirements file should be up-to-date',
'Your requirements file is outdated. Run composer install and re-check your configuration.'
);
$this->addRecommendation(
version_compare($installedPhpVersion, '5.3.4', '>='),
'You should use at least PHP 5.3.4 due to PHP bug #52083 in earlier versions',
'Your project might malfunction randomly due to PHP bug #52083 ("Notice: Trying to get property of non-object"). Install PHP 5.3.4 or newer.'
);
$this->addRecommendation(
version_compare($installedPhpVersion, '5.3.8', '>='),
'When using annotations you should have at least PHP 5.3.8 due to PHP bug #55156',
'Install PHP 5.3.8 or newer if your project uses annotations.'
);
$this->addRecommendation(
version_compare($installedPhpVersion, '5.4.0', '!='),
'You should not use PHP 5.4.0 due to the PHP bug #61453',
'Your project might not work properly due to the PHP bug #61453 ("Cannot dump definitions which have method calls"). Install PHP 5.4.1 or newer.'
);
$this->addRecommendation(
class_exists('DomDocument'),
'PHP-XML module should be installed',
'Install and enable the <strong>PHP-XML</strong> module.'
);
$this->addRecommendation(
function_exists('mb_strlen'),
'mb_strlen() should be available',
'Install and enable the <strong>mbstring</strong> extension.'
);
$this->addRecommendation(
function_exists('iconv'),
'iconv() should be available',
'Install and enable the <strong>iconv</strong> extension.'
);
$this->addRecommendation(
function_exists('utf8_decode'),
'utf8_decode() should be available',
'Install and enable the <strong>XML</strong> extension.'
);
if (!defined('PHP_WINDOWS_VERSION_BUILD')) {
$this->addRecommendation(
function_exists('posix_isatty'),
'posix_isatty() should be available',
'Install and enable the <strong>php_posix</strong> extension (used to colorize the CLI output).'
);
}
$this->addRecommendation(
class_exists('Locale'),
'intl extension should be available',
'Install and enable the <strong>intl</strong> extension (used for validators).'
);
if (class_exists('Collator')) {
$this->addRecommendation(
null !== new Collator('fr_FR'),
'intl extension should be correctly configured',
'The intl extension does not behave properly. This problem is typical on PHP 5.3.X x64 WIN builds.'
);
}
if (class_exists('Locale')) {
if (defined('INTL_ICU_VERSION')) {
$version = INTL_ICU_VERSION;
} else {
$reflector = new ReflectionExtension('intl');
ob_start();
$reflector->info();
$output = strip_tags(ob_get_clean());
preg_match('/^ICU version +(?:=> )?(.*)$/m', $output, $matches);
$version = $matches[1];
}
$this->addRecommendation(
version_compare($version, '4.0', '>='),
'intl ICU version should be at least 4+',
'Upgrade your <strong>intl</strong> extension with a newer ICU version (4+).'
);
}
$accelerator =
(function_exists('apc_store') && ini_get('apc.enabled'))
||
function_exists('eaccelerator_put') && ini_get('eaccelerator.enable')
||
function_exists('xcache_set')
;
$this->addRecommendation(
$accelerator,
'a PHP accelerator should be installed',
'Install and enable a <strong>PHP accelerator</strong> like APC (highly recommended).'
);
$this->addPhpIniRecommendation('short_open_tag', false);
$this->addPhpIniRecommendation('magic_quotes_gpc', false, true);
$this->addPhpIniRecommendation('register_globals', false, true);
$this->addPhpIniRecommendation('session.auto_start', false);
$this->addRecommendation(
class_exists('PDO'),
'PDO should be installed',
'Install <strong>PDO</strong> (mandatory for Doctrine).'
);
if (class_exists('PDO')) {
$drivers = PDO::getAvailableDrivers();
$this->addRecommendation(
count($drivers),
sprintf('PDO should have some drivers installed (currently available: %s)', count($drivers) ? implode(', ', $drivers) : 'none'),
'Install <strong>PDO drivers</strong> (mandatory for Doctrine).'
);
}
}
}

16
sandbox/app/autoload.php Normal file
View File

@@ -0,0 +1,16 @@
<?php
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = require __DIR__.'/../vendor/autoload.php';
// intl
if (!function_exists('intl_get_error_code')) {
require_once __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
$loader->add('', __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs');
}
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
return $loader;

55
sandbox/app/check.php Normal file
View File

@@ -0,0 +1,55 @@
<?php
require_once dirname(__FILE__).'/SymfonyRequirements.php';
$symfonyRequirements = new SymfonyRequirements();
$iniPath = $symfonyRequirements->getPhpIniConfigPath();
echo "********************************\n";
echo "* *\n";
echo "* Symfony requirements check *\n";
echo "* *\n";
echo "********************************\n\n";
echo $iniPath ? sprintf("* Configuration file used by PHP: %s\n\n", $iniPath) : "* WARNING: No configuration file (php.ini) used by PHP!\n\n";
echo "** ATTENTION **\n";
echo "* The PHP CLI can use a different php.ini file\n";
echo "* than the one used with your web server.\n";
if ('\\' == DIRECTORY_SEPARATOR) {
echo "* (especially on the Windows platform)\n";
}
echo "* To be on the safe side, please also launch the requirements check\n";
echo "* from your web server using the web/config.php script.\n";
echo_title('Mandatory requirements');
foreach ($symfonyRequirements->getRequirements() as $req) {
echo_requirement($req);
}
echo_title('Optional recommendations');
foreach ($symfonyRequirements->getRecommendations() as $req) {
echo_requirement($req);
}
/**
* Prints a Requirement instance
*/
function echo_requirement(Requirement $requirement)
{
$result = $requirement->isFulfilled() ? 'OK' : ($requirement->isOptional() ? 'WARNING' : 'ERROR');
echo ' ' . str_pad($result, 9);
echo $requirement->getTestMessage() . "\n";
if (!$requirement->isFulfilled()) {
echo sprintf(" %s\n\n", $requirement->getHelpText());
}
}
function echo_title($title)
{
echo "\n** $title **\n\n";
}

View File

@@ -0,0 +1,58 @@
imports:
- { resource: parameters.yml }
- { resource: security.yml }
framework:
#esi: ~
#translator: { fallback: %locale% }
secret: %secret%
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: %kernel.debug%
form: true
csrf_protection: true
validation: { enable_annotations: true }
templating: { engines: ['twig'] } #assets_version: SomeVersionScheme
default_locale: %locale%
trust_proxy_headers: false # Whether or not the Request object should trust proxy headers (X_FORWARDED_FOR/HTTP_CLIENT_IP)
session: ~
# Twig Configuration
twig:
debug: %kernel.debug%
strict_variables: %kernel.debug%
# Assetic Configuration
assetic:
debug: %kernel.debug%
use_controller: false
bundles: [ ]
#java: /usr/bin/java
filters:
cssrewrite: ~
#closure:
# jar: %kernel.root_dir%/Resources/java/compiler.jar
#yui_css:
# jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar
# Doctrine Configuration
doctrine:
dbal:
driver: pdo_pgsql
host: localhost
dbname: bodyrep
user: goo
password:
charset: UTF8
orm:
auto_generate_proxy_classes: %kernel.debug%
auto_mapping: true
# Swiftmailer Configuration
swiftmailer:
transport: %mailer_transport%
host: %mailer_host%
username: %mailer_user%
password: %mailer_password%
spool: { type: memory }

View File

@@ -0,0 +1,26 @@
imports:
- { resource: config.yml }
framework:
router: { resource: "%kernel.root_dir%/config/routing_dev.yml" }
profiler: { only_exceptions: false }
web_profiler:
toolbar: true
intercept_redirects: false
monolog:
handlers:
main:
type: stream
path: %kernel.logs_dir%/%kernel.environment%.log
level: debug
firephp:
type: firephp
level: info
assetic:
use_controller: true
#swiftmailer:
# delivery_address: me@example.com

View File

@@ -0,0 +1,19 @@
imports:
- { resource: config.yml }
#doctrine:
# orm:
# metadata_cache_driver: apc
# result_cache_driver: apc
# query_cache_driver: apc
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
nested:
type: stream
path: %kernel.logs_dir%/%kernel.environment%.log
level: debug

View File

@@ -0,0 +1,14 @@
imports:
- { resource: config_dev.yml }
framework:
test: ~
session:
storage_id: session.storage.mock_file
web_profiler:
toolbar: false
intercept_redirects: false
swiftmailer:
disable_delivery: true

View File

@@ -0,0 +1,15 @@
parameters:
database_driver: pdo_mysql
database_host: localhost
database_port: ~
database_name: symfony
database_user: root
database_password: ~
mailer_transport: smtp
mailer_host: localhost
mailer_user: ~
mailer_password: ~
locale: en
secret: ThisTokenIsNotSoSecretChangeIt

View File

@@ -0,0 +1,13 @@
_landing:
resource: "@BodyRep/Controller/LandingController.php"
type: annotation
prefix: /
_profile:
pattern: /{username}
defaults: { _controller: BodyRep:Profile:index }
_member:
resource: "@BodyRep/Controller/MemberController.php"
type: annotation
prefix: /m

View File

@@ -0,0 +1,14 @@
_wdt:
resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
prefix: /_wdt
_profiler:
resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
prefix: /_profiler
_configurator:
resource: "@SensioDistributionBundle/Resources/config/routing/webconfigurator.xml"
prefix: /_configurator
_main:
resource: routing.yml

View File

@@ -0,0 +1,49 @@
jms_security_extra:
secure_all_services: false
expressions: true
security:
encoders:
Symfony\Component\Security\Core\User\User: plaintext
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
providers:
in_memory:
memory:
users:
alexzb: { password: d559ko54, roles: [ 'ROLE_ADMIN' ] }
alexl: { password: d559ko54, roles: [ 'ROLE_ADMIN' ] }
ghuntley: { password: d559ko54, roles: [ 'ROLE_ADMIN' ] }
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
login:
pattern: ^/m/login$
security: false
landing:
pattern: ^/$
security: false
contact:
pattern: ^/contact$
security: false
secured_area:
pattern: ^/
form_login:
check_path: /m/login_check
login_path: /m/login
logout:
path: /m/logout
target: /
access_control:
#- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }
#- { path: ^/_internal/secure, roles: IS_AUTHENTICATED_ANONYMOUSLY, ip: 127.0.0.1 }

22
sandbox/app/console Normal file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env php
<?php
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
//umask(0000);
set_time_limit(0);
require_once __DIR__.'/bootstrap.php.cache';
require_once __DIR__.'/AppKernel.php';
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
$input = new ArgvInput();
$env = $input->getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev');
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(array('--no-debug', '')) && $env !== 'prod';
$kernel = new AppKernel($env, $debug);
$application = new Application($kernel);
$application->run($input);

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit
backupGlobals = "false"
backupStaticAttributes = "false"
colors = "true"
convertErrorsToExceptions = "true"
convertNoticesToExceptions = "true"
convertWarningsToExceptions = "true"
processIsolation = "false"
stopOnFailure = "false"
syntaxCheck = "false"
bootstrap = "bootstrap.php.cache" >
<testsuites>
<testsuite name="Project Test Suite">
<directory>../src/*/*Bundle/Tests</directory>
<directory>../src/*/Bundle/*Bundle/Tests</directory>
</testsuite>
</testsuites>
<!--
<php>
<server name="KERNEL_DIR" value="/path/to/your/app/" />
</php>
-->
<filter>
<whitelist>
<directory>../src</directory>
<exclude>
<directory>../src/*/*Bundle/Resources</directory>
<directory>../src/*/*Bundle/Tests</directory>
<directory>../src/*/Bundle/*Bundle/Resources</directory>
<directory>../src/*/Bundle/*Bundle/Tests</directory>
</exclude>
</whitelist>
</filter>
</phpunit>

View File

@@ -0,0 +1,9 @@
<?php
namespace BodyRep;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class BodyRep extends Bundle
{
}

View File

@@ -0,0 +1,42 @@
<?php
namespace BodyRep\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use BodyRep\Form\ContactType;
class LandingController extends Controller
{
/**
* @Route("/", name="_landing")
* @Template()
*/
public function indexAction()
{
/*
* The action's view can be rendered using render() method
* or @Template annotation as demonstrated in DemoController.
*
*/
return $this->render('BodyRep:Landing:index.html.twig');
}
/**
* @Route("/about", name="_landing_about")
* @Template()
*/
public function aboutAction()
{
/*
* The action's view can be rendered using render() method
* or @Template annotation as demonstrated in DemoController.
*
*/
return $this->render('BodyRep:Landing:about.html.twig');
}
}

View File

@@ -0,0 +1,214 @@
<?php
namespace BodyRep\Controller;
use BodyRep\Form\Profile;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Security\Core\SecurityContext;
# Annotations & templates
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use JMS\SecurityExtraBundle\Annotation\Secure;
class MemberController extends Controller
{
/**
* @Route("/login", name="_login")
* @Template()
*/
public function loginAction()
{
if ($this->get('request')->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) {
$error = $this->get('request')->attributes->get(SecurityContext::AUTHENTICATION_ERROR);
} else {
$error = $this->get('request')->getSession()->get(SecurityContext::AUTHENTICATION_ERROR);
}
return array(
'last_username' => $this->get('request')->getSession()->get(SecurityContext::LAST_USERNAME),
'error' => $error,
);
}
/**
* @Route("/login_check", name="_security_check")
*/
public function securityCheckAction()
{
// The security layer will intercept this request
}
/**
* @Route("/logout", name="_logout")
*/
public function logoutAction()
{
// The security layer will intercept this request
}
/**
* @Route("/", name="_member")
* @Template()
*/
public function indexAction()
{
$username = $this->getUser()->getUsername();
$db = $this->getDoctrine()->getManager();
$query = $db->createQuery('
SELECT m
FROM BodyRep:Member m
WHERE m.username = :username')
->setParameter('username', $username)
->setMaxResults(1);
if (sizeof($query->getResult()) != 1)
throw $this->createNotFoundException("User '".$username."' not found");
$member = $query->getSingleResult();
return array('name' => $member->getFullName());
}
/**
* @Route("/profile/", name="_member_profile")
* @Template()
*/
public function profileAction()
{
$username = $this->getUser()->getUsername();
$db = $this->getDoctrine()->getManager();
$query = $db->createQuery('
SELECT p
FROM BodyRep:Profile p
WHERE p.username = :username')
->setParameter('username', $username)
->setMaxResults(1);
if (sizeof($query->getResult()) != 1)
throw $this->createNotFoundException("User '".$username."' not found");
$profile = $query->getSingleResult();
$db = $this->getDoctrine()->getManager();
$query = $db->createQuery('
SELECT m
FROM BodyRep:Member m
WHERE m.username = :username')
->setParameter('username', $username)
->setMaxResults(1);
if (sizeof($query->getResult()) != 1)
throw $this->createNotFoundException("User '".$username."' not found");
$member = $query->getSingleResult();
return (array('sFullName' => $profile->getFullName(), 'name' => $member->getFullName()));
}
/**
* @Route("/profile/edit", name="_member_profile_edit")
* @Template()
*/
public function editProfileAction()
{
$username = $this->getUser()->getUsername();
$db = $this->getDoctrine()->getManager();
$query = $db->createQuery('
SELECT m
FROM BodyRep:Member m
WHERE m.username = :username')
->setParameter('username', $username)
->setMaxResults(1);
if (sizeof($query->getResult()) != 1)
throw $this->createNotFoundException("User '".$username."' not found");
$member = $query->getSingleResult();
$form = $this->get('form.factory')->create(new Profile(), array('fullname' => $member->getFullName()));
$error = '';
return array('form' => $form->createView(), 'error' => '');
}
/**
* @Route("/profile/save", name="_member_profile_save")
*/
public function saveAction()
{
$username = $this->getUser()->getUsername();
$db = $this->getDoctrine()->getManager();
$query = $db->createQuery('
SELECT m
FROM BodyRep:Member m
WHERE m.username = :username')
->setParameter('username', $username)
->setMaxResults(1);
if (sizeof($query->getResult()) != 1)
throw $this->createNotFoundException("User '".$username."' not found");
$member = $query->getSingleResult();
$json = array('result' => 0);
$form = $this->get('form.factory')->create(new Profile());
$request = $this->get('request');
$form->bind($request);
if ($form->isValid())
{
$json['result'] = 1;
$d = $form->getClientData();
$member->setFullName($d['fullname']);
$db->persist($member);
$db->flush();
}
$resp = new Response (json_encode($json));
$resp->headers->set('Content-Type', 'text/plain');
return $resp;
}
/**
* @Route("/search/{param}", name="_member_search", defaults={"param" = 0})
* @Template()
*/
public function searchAction($param='')
{
/*
* Integreted suggester response
*
*/
$em = $this->getDoctrine()->getManager();
$query = $em->createQuery("SELECT m FROM BodyRep:Member m WHERE m.fullname ILIKE '%$param%'");
$res = $query->getResult();
$resc = sizeof($res);
$sugg = array();
/*if ($res > 0)
{
foreach ($res as $member)
{
$text = preg_replace('/<br[^\>]*>/i', "\n", $member->getFullname());
$item['text'] = strip_tags($text);
$item['html'] = $text;
$item['data'] = array('username' => htmlspecialchars($member->getUsername()));
$sugg[] = $item;
}
}
if (!empty($param))
{
$json = array('result' => 1, 'suggestions' => $sugg);
$resp = new Response (json_encode($json));
$resp->headers->set('Content-Type', 'text/plain');
return $resp;
}
else*/
return array('search' => $res);
}
}

View File

@@ -0,0 +1,57 @@
<?php
namespace BodyRep\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\HttpFoundation\RedirectResponse;
use JMS\SecurityExtraBundle\Annotation\Secure;
# Annotations
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
class ProfileController extends Controller
{
/**
* @Route("/{username}", name="_profile")
* @Template()
*/
public function indexAction($username)
{
if ($this->getUser()->getUsername() == $username)
return new RedirectResponse($this->generateUrl('_member_profile'));
$db = $this->getDoctrine()->getManager();
$query = $db->createQuery('
SELECT p
FROM BodyRep:Profile p
WHERE p.username = :username')
->setParameter('username', $username)
->setMaxResults(1);
if (sizeof($query->getResult()) != 1)
throw $this->createNotFoundException("User '".$username."' not found");
$profile = $query->getSingleResult();
$username = $this->getUser()->getUsername();
$db = $this->getDoctrine()->getManager();
$query = $db->createQuery('
SELECT m
FROM BodyRep:Member m
WHERE m.username = :username')
->setParameter('username', $username)
->setMaxResults(1);
if (sizeof($query->getResult()) != 1)
throw $this->createNotFoundException("User '".$username."' not found");
$member = $query->getSingleResult();
return (array('sFullName' => $profile->getFullName(), 'name' => $member->getFullName()));
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace BodyRep\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\Config\FileLocator;
class BodyRepExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
}
public function getAlias()
{
return 'body_rep';
}
}

View File

@@ -0,0 +1,135 @@
<?php
namespace BodyRep\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;
/**
* Bodyrep\Entity\Member
*
* @ORM\Table(name="member")
* @ORM\Entity(repositoryClass="BodyRep\Entity\UserRepository")
*/
class Member implements UserInterface
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", length=25, unique=true)
*/
private $username;
/**
* @var string $fullname
*
* @ORM\Column(name="fullname", type="string")
*/
private $fullname;
/**
* @ORM\Column(type="string", length=32)
*/
private $salt;
/**
* @ORM\Column(type="string", length=40)
*/
private $password;
/**
* @ORM\Column(type="string", length=60, unique=true)
*/
private $email;
/**
* @ORM\Column(name="active", type="integer")
*/
private $isActive;
private $roles;
public function __construct($username, $password = '', $salt = '', $roles = array())
{
$this->username = $username;
$this->password = $password;
$this->salt = $salt;
$this->roles = $roles;
}
/**
* @inheritDoc
*/
public function getUsername()
{
return $this->username;
}
/**
* @inheritDoc
*/
public function getSalt()
{
return $this->salt;
}
/**
* @inheritDoc
*/
public function getPassword()
{
return $this->password;
}
/**
* @inheritDoc
*/
public function getRoles()
{
return array('ROLE_USER');
}
/**
* @inheritDoc
*/
public function eraseCredentials()
{
}
/**
* Set fullName
*
* @param string $fullname
* @return Member
*/
public function setfullname($fullname)
{
$this->fullname = $fullname;
return $this;
}
/**
* Get fullName
*
* @return string
*/
public function getFullName()
{
return $this->fullname;
}
/**
* Get fullName
*
* @return string
*/
public function getLink()
{
return '/app_dev.php/' . $this->getUsername();
}
}

View File

@@ -0,0 +1,127 @@
<?php
namespace BodyRep\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;
/**
* Bodyrep\Entity\Profile
*
* @ORM\Table(name="member")
* @ORM\Entity
*/
class Profile
{
/**
* @var integer $id
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string $fullname
*
* @ORM\Column(name="fullname", type="string")
*/
private $fullname;
/**
* @var string $username
*
* @ORM\Column(name="username", type="string")
*/
private $username;
/**
* @var float $currentweight
*
* @ORM\Column(name="currentweight", type="float")
*/
private $currentweight;
/**
* Get id
*
* @return integer
*/
public function getid()
{
return $this->id;
}
/**
* Set fullName
*
* @param string $fullname
* @return Profile
*/
public function setfullname($fullname)
{
$this->fullname = $fullname;
return $this;
}
/**
* Get fullName
*
* @return string
*/
public function getFullName()
{
return $this->fullname;
}
/**
* Set userName
*
* @param string $username
* @return Profile
*/
public function setUserName($username)
{
$this->username = $userName;
return $this;
}
/**
* Get userName
*
* @return string
*/
public function getUserName()
{
return $this->username;
}
/**
* Set currentWeight
*
* @param float $currentWeight
* @return Profile
*/
public function setCurrentWeight($currentWeight)
{
$this->currentweight = $currentWeight;
return $this;
}
/**
* Get currentWeight
*
* @return float
*/
public function getCurrentWeight()
{
return $this->currentweight;
}
}

View File

@@ -0,0 +1,26 @@
<?php
namespace BodyRep\EventListener;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
use BodyRep\Twig\Extension\TemplateExtension;
class ControllerListener
{
protected $extension;
public function __construct(TemplateExtension $extension)
{
$this->extension = $extension;
}
public function onKernelController(FilterControllerEvent $event)
{
if (HttpKernelInterface::MASTER_REQUEST === $event->getRequestType()) {
$this->extension->setController($event->getController());
}
}
}

View File

@@ -0,0 +1,25 @@
<?php
namespace BodyRep\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
class Profile extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('fullname', 'text');
//$builder->add('newpass1', 'text');
//$builder->add('newpass2', 'text');
}
public function getName()
{
return 'profile';
}
}

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="twig.extension.bodyrep" class="BodyRep\Twig\Extension\TemplateExtension" public="false">
<tag name="twig.extension" />
<argument type="service" id="twig.loader" />
</service>
<service id="bodyrep.listener" class="BodyRep\EventListener\ControllerListener">
<tag name="kernel.event_listener" event="kernel.controller" method="onKernelController" />
<argument type="service" id="twig.extension.bodyrep" />
</service>
</services>
</container>

View File

@@ -0,0 +1,9 @@
{% extends "BodyRep::layout.html.twig" %}
{% block title "BodyRep - About Us" %}
{% block content %}
{% include 'BodyRep:Landing:navbar.html.twig' %}
About
{% endblock %}

View File

@@ -0,0 +1,12 @@
{% extends 'BodyRep::layout.html.twig' %}
{% block title %}BodyRep - Welcome{% endblock %}
{% block content_header '' %}
{% block content %}
{% include 'BodyRep:Landing:navbar.html.twig' %}
Landing Page
{% endblock %}

View File

@@ -0,0 +1,18 @@
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<img src="/img/logo-nav.png" class='pull-left' style='padding-right : 5px; margin-top : 10px;' />
<a class="brand" href="#">BODY<b>REP</b></a>
<div class="btn-group pull-right">
<a class="btn " href="{{ path('_member') }}" style="background : transparent; color : white; text-shadow : none; border : none; box-shadow : 0 0 0 #fff;">
<i class="icon-user icon-white"></i> Login
</a>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,25 @@
{% block content %}
<h1>Update Profile</h1>
<form action="{{ path('_member_profile_save') }}" method="post" id="profile">
<div>
{{ form_errors(form) }}
</div>
<div>
<label for="fullname">Name</label>
{{ form_row(form.fullname) }}
</div>
<div>&nbsp;</div>
<div>
<label for="newpass1">New Password:</label><br />
<input type="password" id="newpass1" name="_newpass1" /> <br />
<input type="password" id="newpass2" name="_newpass2" />
</div>
<div>&nbsp;</div>
{{ form_rest(form) }}
<input type="submit" class="btn btn-primary btn-mini" value="Save" />
</form>
{% endblock %}

View File

@@ -0,0 +1,12 @@
{% extends "BodyRep:Member:layout.html.twig" %}
{% block title "Hello " ~ name %}
{% block content %}
{% include 'BodyRep:Member:navbar.html.twig' %}
<h1>Member landing page</h1>
{{name}}
{% endblock %}

View File

@@ -0,0 +1,4 @@
{% extends 'BodyRep::layout.html.twig' %}
{% block content_header '' %}

View File

@@ -0,0 +1,25 @@
{% extends 'BodyRep::layout.html.twig' %}
{% block content %}
{% include 'BodyRep:Landing:navbar.html.twig' %}
<h1>Login</h1>
{% if error %}
<div class="error">{{ error.message }}</div>
{% endif %}
<form action="{{ path("_security_check") }}" method="post" id="login">
<div>
<label for="username">Username</label>
<input type="text" id="username" name="_username" value="{{ last_username }}" />
</div>
<div>
<label for="password">Password</label>
<input type="password" id="password" name="_password" />
</div>
<input type="submit" class="btn btn-primary btn-mini" value="LOGIN" />
</form>
{% endblock %}

View File

@@ -0,0 +1,35 @@
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<img src="/img/logo-nav.png" class='pull-left' style='padding-right : 5px; margin-top : 10px;' />
<a class="brand" href="#">BODY<b>REP</b></a>
<div class="btn-group pull-right">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#" style="background : transparent; color : white; text-shadow : none; border : none; box-shadow : 0 0 0 #fff;">
<i class="icon-user icon-white"></i> {{name}}
<span class="caret" style='border-top-color : white; border-bottom-color : white;'></span>
</a>
<ul class="dropdown-menu">
<li><a href="{{ path('_member_profile') }}">Profile</a></li>
<li class="divider"></li>
<li><a href="{{ path('_logout') }}">Sign Out</a></li>
</ul>
</div>
<div class='offset2'>
<form class="navbar-search pull-left" id='topsearch' action="{{ path('_member_search') }}">
<input type="text" class="search-query span4" id="topsearch" style='height : 28px;' placeholder="Search"><span id='msg_topsearch'></span>
</form>
</div>
<a class="btn dropdown-toggle pull-right" data-toggle="dropdown" href="#" style="margin : 0; background : transparent; color : white; text-shadow : none; border : none; box-shadow : 0 0 0 #fff;">
<i class='licon-calendar licon-white'></i>
</a>
<a class="btn dropdown-toggle pull-right" data-toggle="dropdown" href="#" style="margin : 0; background : transparent; color : white; text-shadow : none; border : none; box-shadow : 0 0 0 #fff;">
<i class='licon-mail-new licon-white'></i>
</a>
</div>
</div>
</div>

View File

@@ -0,0 +1,313 @@
{% extends 'BodyRep::layout.html.twig' %}
{% block title %}BodyRep{% endblock %}
{% block content_header '' %}
{% block content %}
{% include 'BodyRep:Member:navbar.html.twig' %}
<div class="row-fluid">
<div class="span2">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">Profile</li>
<li class="active"><a href="#">Body Stats</a></li>
<li><a href="#">Body Reputation</a></li>
<li><a href="#">Challenges</a></li>
<li class="nav-header">Workouts</li>
<li class="nav-header">Meals</li>
<li class="nav-header">Community</li>
<li class="nav-header">Learning</li>
<li class="nav-header">Apps</li>
<li class="nav-header">Shopping</li>
</ul>
</div><!--/.well -->
</div><!--/span-->
<div class="span6" id='mcnt'>
<div class="row-fluid">
<h2 class="pull-left">{{ sFullName }}</h2>
<a class="pull-right btn btn-primary btn-mini" id='edprf' href="#"><i class="icon-cog icon-white"></i> Edit Profile</a>
</div>
<div class="row-fluid" style='font-size : 12px;'>
<i class="icon-signal"></i><span> Weight: 100kg ( <div class='arrowup'></div> 0)</span>
<span>Bodyfat: 20% ( <div class='arrowup'></div> 2)</span>
<span>Measurements: 400cm ( <div class='arrowup'></div> 15)</span>
</div>
<div class="row-fluid" style='font-size : 12px;'>
<i class="icon-home"></i><span> Lives in </span><a>Calgary, Alberta</a>
<i class="icon-signal"></i><span> Trains at </span><a>Talisman Center,Fitness First</a>
<i class="icon-signal"></i><span> Hobbies: </span><a>Skiing,</a><span> and </span><a>(5) other</a><span> ...</span>
<i class="icon-signal"></i><span> Professionals: </span><a>Heath Spence</a><span>,</span><a>Steve Baudo</a><a> see more...</a>
</div>
<hr />
<div class="row-fluid">
<h5 class="pull-left">Filters:</h5>
<div class="pull-left">
<div class="block_type_small redbg redbd pull-left">
<i class="icon-user icon-white"></i>
</div>
<div class="block_type_small bluebg bluebd pull-left">
<i class="icon-wrench icon-white"></i>
</div>
<div class="block_type_small orangebg orangebd pull-left">
<i class="icon-magnet icon-white"></i>
</div>
<div class="block_type_small tealbg tealbd pull-left">
<i class="icon-heart icon-white"></i>
</div>
<div class="block_type_small purplebg purplebd pull-left">
<i class="icon-th icon-white"></i>
</div>
<div class="block_type_small greenbg greenbd pull-left">
<i class="icon-book icon-white"></i>
</div>
<div class="block_type_small graybg graybd pull-left">
<i class="icon-file icon-white"></i>
</div>
</div>
</div>
<div class="stats">
<div class="comment_block">
<div class="block_types">
<div class="block_type redbd">
<i class="gicon-magnet"></i>
</div>
</div>
</div>
<div class="tnc-blurb">
<i class="icon-signal"></i>
565
</div>
<div class="basic-comment">
<b>Breakfast:</b><span> 30g Oats, 1x Banana, 5x Egg Whites</span>
</div>
<div class="like-comment-time">
<i class="icon-thumbs-up"></i>
<i class="icon-comment"></i>
<span>14 minutes ago</span>
</div>
<div class="user-sub-comment">
<div class='sub-avatar user1'></div>
<a>Brian Goff</a>
<p>Good to see you're keeping up the good work mate. Keep us posted ;)</p>
<div class="like-comment-time">
<i class="icon-thumbs-up"></i>
<i class="icon-comment"></i>
<span>April 3 at 2:05pm</span>
</div>
</div>
<div class="user-sub-comment">
<div class='sub-avatar user2'></div>
<a>Alex Zborowski</a>
<p>Well it's not easy but you do your best every day and you judge every action.</p>
<div class="like-comment-time">
<i class="icon-thumbs-up"></i>
<i class="icon-comment"></i>
<span>April 3 at 2:05pm</span>
</div>
</div>
</div>
<div class="stats">
<div class="comment_block">
<div class="block_types">
<div class="block_type greenbd">
<i class="gicon-search"></i>
</div>
<div class="block_type orangebd">
<i class="gicon-screen"></i>
</div>
</div>
</div>
<div class="tnc-blurb">
<i class="icon-time"></i>
45
<i class="icon-signal"></i>
900
</div>
<div class="basic-comment">
Workout at <a>Talisman Center</a> with <a>Brian Goff</a>
</div>
<div class="like-comment-time">
<i class="icon-thumbs-up"></i>
<i class="icon-comment"></i>
<span>37 minutes ago</span>
</div>
</div>
<div class="stats">
<div class="comment_block">
<div class="block_types">
<div class="block_type greenbd">
<i class="gicon-search"></i>
</div>
</div>
</div>
<div class="tnc-blurb">
<i class="icon-time"></i>
90
<i class="icon-signal"></i>
720
</div>
<div class="basic-comment">
Workout at <a>Talisman Center</a>
</div>
<div class="like-comment-time">
<i class="icon-thumbs-up"></i>
<i class="icon-comment"></i>
<span>April 4 at 7:00pm</span>
</div>
</div>
<div class="stats">
<div class="comment_block">
<div class="block_types">
<div class="block_type bluebd">
<i class="gicon-profile"></i>
</div>
</div>
</div>
<div class="tnc-blurb">
</div>
<div class="basic-comment">
You commented on <a>Brian Goff's workout</a>
</div>
<div class="like-comment-time">
<i class="icon-thumbs-up"></i>
<i class="icon-comment"></i>
<span>April 4 at 6:30pm</span>
</div>
</div>
<div class="stats">
<div class="comment_block">
<div class="block_types">
<div class="block_type purplebd">
<i class="gicon-profile"></i>
</div>
</div>
</div>
<div class="tnc-blurb">
</div>
<div class="basic-comment">
Your read <a>"Fatigue Recovery & Supercompensation Theory"</a>
</div>
<div class="like-comment-time">
<i class="icon-thumbs-up"></i>
<i class="icon-comment"></i>
<span>April 2 at 8:00am</span>
</div>
</div>
<div class="stats">
<div class="comment_block">
<div class="block_types">
<div class="block_type greenbd">
<i class="gicon-search"></i>
</div>
<div class="block_type orangebd">
<i class="gicon-screen"></i>
</div>
<div class="block_type tealbd">
<i class="gicon-line"></i>
</div>
</div>
</div>
<div class="tnc-blurb">
<i class="icon-time"></i>
30
<i class="icon-signal"></i>
450
</div>
<div class="basic-comment">
<a>Workout</a> using <a>Runtracker</a> with <a>Brian Goff</a>
</div>
<div class="like-comment-time">
<i class="icon-thumbs-up"></i>
<i class="icon-comment"></i>
<span>April 2 at 6:00am</span>
</div>
</div>
<div class="stats">
<div class="comment_block">
<div class="block_types">
<div class="block_type orangebd">
<i class="gicon-screen"></i>
</div>
</div>
</div>
<div class="user-comment">
<div class='avatar user1'></div>
<a>Brian Goff</a>
<p>Hey "mate"! Want to train at the <a>Talisman</a> again tonight?</p>
</div>
<div class="like-comment-time">
<i class="icon-thumbs-up"></i>
<i class="icon-comment"></i>
<span>April 3 at 2:00pm</span>
</div>
<div class="user-sub-comment">
<div class='sub-avatar user2'></div>
<a>Alex Zborowski</a>
<p>Sorry Brian, working on the BodyREP pitch tonight.</p>
<div class="like-comment-time">
<i class="icon-thumbs-up"></i>
<i class="icon-comment"></i>
<span>April 3 at 2:05pm</span>
</div>
</div>
<div class="user-sub-comment">
<div class='sub-avatar user1'></div>
<a>Brian Goff</a>
<p>No worries "mate", maybe next time.</p>
<div class="like-comment-time">
<i class="icon-thumbs-up"></i>
<i class="icon-comment"></i>
<span>April 3 at 2:07pm</span>
</div>
</div>
</div>
</div>
<div class="span4">
<div class="hero-unit">
<h1>Hello, world!</h1>
<p>This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
<p><a class="btn btn-primary btn-large">Learn more &raquo;</a></p>
</div>
<div class="row-fluid">
<div class="span4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn" href="#">View details &raquo;</a></p>
</div><!--/span-->
<div class="span4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn" href="#">View details &raquo;</a></p>
</div><!--/span-->
<div class="span4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn" href="#">View details &raquo;</a></p>
</div><!--/span-->
</div><!--/row-->
<div class="row-fluid">
<div class="span4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn" href="#">View details &raquo;</a></p>
</div><!--/span-->
<div class="span4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn" href="#">View details &raquo;</a></p>
</div><!--/span-->
<div class="span4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn" href="#">View details &raquo;</a></p>
</div><!--/span-->
</div><!--/row-->
</div><!--/span-->
</div><!--/row-->
{% endblock %}

View File

@@ -0,0 +1,15 @@
{% block content %}
<h1>Search Results</h1>
{% for result in search %}
<li>
<a href="{{ result.getLink() }}">
{{ result.getFullName() }}
</a>
</li>
{% endfor %}
{% endblock %}

View File

@@ -0,0 +1,312 @@
{% extends 'BodyRep::layout.html.twig' %}
{% block title %}BodyRep{% endblock %}
{% block content_header '' %}
{% block content %}
{% include 'BodyRep:Member:navbar.html.twig' %}
<div class="row-fluid">
<div class="span2">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">Profile</li>
<li class="active"><a href="#">Body Stats</a></li>
<li><a href="#">Body Reputation</a></li>
<li><a href="#">Challenges</a></li>
<li class="nav-header">Workouts</li>
<li class="nav-header">Meals</li>
<li class="nav-header">Community</li>
<li class="nav-header">Learning</li>
<li class="nav-header">Apps</li>
<li class="nav-header">Shopping</li>
</ul>
</div><!--/.well -->
</div><!--/span-->
<div class="span6" id='mcnt'>
<div class="row-fluid">
<h2 class="pull-left">{{ sFullName }}</h2>
</div>
<div class="row-fluid" style='font-size : 12px;'>
<i class="icon-signal"></i><span> Weight: 100kg ( <div class='arrowup'></div> 0)</span>
<span>Bodyfat: 20% ( <div class='arrowup'></div> 2)</span>
<span>Measurements: 400cm ( <div class='arrowup'></div> 15)</span>
</div>
<div class="row-fluid" style='font-size : 12px;'>
<i class="icon-home"></i><span> Lives in </span><a>Calgary, Alberta</a>
<i class="icon-signal"></i><span> Trains at </span><a>Talisman Center,Fitness First</a>
<i class="icon-signal"></i><span> Hobbies: </span><a>Skiing,</a><span> and </span><a>(5) other</a><span> ...</span>
<i class="icon-signal"></i><span> Professionals: </span><a>Heath Spence</a><span>,</span><a>Steve Baudo</a><a> see more...</a>
</div>
<hr />
<div class="row-fluid">
<h5 class="pull-left">Filters:</h5>
<div class="pull-left">
<div class="block_type_small redbg redbd pull-left">
<i class="icon-user icon-white"></i>
</div>
<div class="block_type_small bluebg bluebd pull-left">
<i class="icon-wrench icon-white"></i>
</div>
<div class="block_type_small orangebg orangebd pull-left">
<i class="icon-magnet icon-white"></i>
</div>
<div class="block_type_small tealbg tealbd pull-left">
<i class="icon-heart icon-white"></i>
</div>
<div class="block_type_small purplebg purplebd pull-left">
<i class="icon-th icon-white"></i>
</div>
<div class="block_type_small greenbg greenbd pull-left">
<i class="icon-book icon-white"></i>
</div>
<div class="block_type_small graybg graybd pull-left">
<i class="icon-file icon-white"></i>
</div>
</div>
</div>
<div class="stats">
<div class="comment_block">
<div class="block_types">
<div class="block_type redbd">
<i class="gicon-magnet"></i>
</div>
</div>
</div>
<div class="tnc-blurb">
<i class="icon-signal"></i>
565
</div>
<div class="basic-comment">
<b>Breakfast:</b><span> 30g Oats, 1x Banana, 5x Egg Whites</span>
</div>
<div class="like-comment-time">
<i class="icon-thumbs-up"></i>
<i class="icon-comment"></i>
<span>14 minutes ago</span>
</div>
<div class="user-sub-comment">
<div class='sub-avatar user1'></div>
<a>Brian Goff</a>
<p>Good to see you're keeping up the good work mate. Keep us posted ;)</p>
<div class="like-comment-time">
<i class="icon-thumbs-up"></i>
<i class="icon-comment"></i>
<span>April 3 at 2:05pm</span>
</div>
</div>
<div class="user-sub-comment">
<div class='sub-avatar user2'></div>
<a>Alex Zborowski</a>
<p>Well it's not easy but you do your best every day and you judge every action.</p>
<div class="like-comment-time">
<i class="icon-thumbs-up"></i>
<i class="icon-comment"></i>
<span>April 3 at 2:05pm</span>
</div>
</div>
</div>
<div class="stats">
<div class="comment_block">
<div class="block_types">
<div class="block_type greenbd">
<i class="gicon-search"></i>
</div>
<div class="block_type orangebd">
<i class="gicon-screen"></i>
</div>
</div>
</div>
<div class="tnc-blurb">
<i class="icon-time"></i>
45
<i class="icon-signal"></i>
900
</div>
<div class="basic-comment">
Workout at <a>Talisman Center</a> with <a>Brian Goff</a>
</div>
<div class="like-comment-time">
<i class="icon-thumbs-up"></i>
<i class="icon-comment"></i>
<span>37 minutes ago</span>
</div>
</div>
<div class="stats">
<div class="comment_block">
<div class="block_types">
<div class="block_type greenbd">
<i class="gicon-search"></i>
</div>
</div>
</div>
<div class="tnc-blurb">
<i class="icon-time"></i>
90
<i class="icon-signal"></i>
720
</div>
<div class="basic-comment">
Workout at <a>Talisman Center</a>
</div>
<div class="like-comment-time">
<i class="icon-thumbs-up"></i>
<i class="icon-comment"></i>
<span>April 4 at 7:00pm</span>
</div>
</div>
<div class="stats">
<div class="comment_block">
<div class="block_types">
<div class="block_type bluebd">
<i class="gicon-profile"></i>
</div>
</div>
</div>
<div class="tnc-blurb">
</div>
<div class="basic-comment">
You commented on <a>Brian Goff's workout</a>
</div>
<div class="like-comment-time">
<i class="icon-thumbs-up"></i>
<i class="icon-comment"></i>
<span>April 4 at 6:30pm</span>
</div>
</div>
<div class="stats">
<div class="comment_block">
<div class="block_types">
<div class="block_type purplebd">
<i class="gicon-profile"></i>
</div>
</div>
</div>
<div class="tnc-blurb">
</div>
<div class="basic-comment">
Your read <a>"Fatigue Recovery & Supercompensation Theory"</a>
</div>
<div class="like-comment-time">
<i class="icon-thumbs-up"></i>
<i class="icon-comment"></i>
<span>April 2 at 8:00am</span>
</div>
</div>
<div class="stats">
<div class="comment_block">
<div class="block_types">
<div class="block_type greenbd">
<i class="gicon-search"></i>
</div>
<div class="block_type orangebd">
<i class="gicon-screen"></i>
</div>
<div class="block_type tealbd">
<i class="gicon-line"></i>
</div>
</div>
</div>
<div class="tnc-blurb">
<i class="icon-time"></i>
30
<i class="icon-signal"></i>
450
</div>
<div class="basic-comment">
<a>Workout</a> using <a>Runtracker</a> with <a>Brian Goff</a>
</div>
<div class="like-comment-time">
<i class="icon-thumbs-up"></i>
<i class="icon-comment"></i>
<span>April 2 at 6:00am</span>
</div>
</div>
<div class="stats">
<div class="comment_block">
<div class="block_types">
<div class="block_type orangebd">
<i class="gicon-screen"></i>
</div>
</div>
</div>
<div class="user-comment">
<div class='avatar user1'></div>
<a>Brian Goff</a>
<p>Hey "mate"! Want to train at the <a>Talisman</a> again tonight?</p>
</div>
<div class="like-comment-time">
<i class="icon-thumbs-up"></i>
<i class="icon-comment"></i>
<span>April 3 at 2:00pm</span>
</div>
<div class="user-sub-comment">
<div class='sub-avatar user2'></div>
<a>Alex Zborowski</a>
<p>Sorry Brian, working on the BodyREP pitch tonight.</p>
<div class="like-comment-time">
<i class="icon-thumbs-up"></i>
<i class="icon-comment"></i>
<span>April 3 at 2:05pm</span>
</div>
</div>
<div class="user-sub-comment">
<div class='sub-avatar user1'></div>
<a>Brian Goff</a>
<p>No worries "mate", maybe next time.</p>
<div class="like-comment-time">
<i class="icon-thumbs-up"></i>
<i class="icon-comment"></i>
<span>April 3 at 2:07pm</span>
</div>
</div>
</div>
</div>
<div class="span4">
<div class="hero-unit">
<h1>Hello, world!</h1>
<p>This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
<p><a class="btn btn-primary btn-large">Learn more &raquo;</a></p>
</div>
<div class="row-fluid">
<div class="span4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn" href="#">View details &raquo;</a></p>
</div><!--/span-->
<div class="span4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn" href="#">View details &raquo;</a></p>
</div><!--/span-->
<div class="span4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn" href="#">View details &raquo;</a></p>
</div><!--/span-->
</div><!--/row-->
<div class="row-fluid">
<div class="span4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn" href="#">View details &raquo;</a></p>
</div><!--/span-->
<div class="span4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn" href="#">View details &raquo;</a></p>
</div><!--/span-->
<div class="span4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn" href="#">View details &raquo;</a></p>
</div><!--/span-->
</div><!--/row-->
</div><!--/span-->
</div><!--/row-->
{% endblock %}

View File

@@ -0,0 +1,54 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>{% block title %}BodyRep{% endblock %}</title>
<link rel="stylesheet" href="{{ asset('css/bootstrap.css') }}" media="all" />
<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}
</style>
<link rel="stylesheet" href="{{ asset('css/bootstrap-responsive.css') }}" />
<link rel="stylesheet" href="{{ asset('css/site.css') }}" />
<link rel="stylesheet" href="{{ asset('css/chosen.css') }}" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></script>
<script type="text/javascript" src="{{ asset('js/application.js') }}"></script>
<script type="text/javascript" src="{{ asset('js/jquery.chosen.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('js/bootstrap.js') }}"></script>
</head>
<body>
<div class="container-fluid symfony-content">
{% block content %}
{% endblock %}
<hr>
<footer>
<p>&copy; BodyRep 2012</p>
</footer>
</div><!--/.fluid-container-->
</body>
</html>

View File

@@ -0,0 +1,33 @@
<?php
namespace BodyRep\Twig\Extension;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Bundle\TwigBundle\Loader\FilesystemLoader;
use CG\Core\ClassUtils;
class TemplateExtension extends \Twig_Extension
{
protected $loader;
protected $controller;
public function __construct(FilesystemLoader $loader)
{
$this->loader = $loader;
}
public function setController($controller)
{
$this->controller = $controller;
}
/**
* Returns the name of the extension.
*
* @return string The extension name
*/
public function getName()
{
return 'demo';
}
}

24
sandbox/web/app.php Normal file
View File

@@ -0,0 +1,24 @@
<?php
use Symfony\Component\ClassLoader\ApcClassLoader;
use Symfony\Component\HttpFoundation\Request;
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
// Use APC for autoloading to improve performance
// Change 'sf2' by the prefix you want in order to prevent key conflict with another application
/*
$loader = new ApcClassLoader('sf2', $loader);
$loader->register(true);
*/
require_once __DIR__.'/../app/AppKernel.php';
//require_once __DIR__.'/../app/AppCache.php';
$kernel = new AppKernel('prod', false);
$kernel->loadClassCache();
//$kernel = new AppCache($kernel);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);

13
sandbox/web/app_dev.php Normal file
View File

@@ -0,0 +1,13 @@
<?php
use Symfony\Component\HttpFoundation\Request;
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
require_once __DIR__.'/../app/AppKernel.php';
require_once('/data/framework/lib/functions.php');
$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

815
sandbox/web/css/bootstrap-responsive.css vendored Normal file
View File

@@ -0,0 +1,815 @@
/*!
* Bootstrap Responsive v2.0.4
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/
.clearfix {
*zoom: 1;
}
.clearfix:before,
.clearfix:after {
display: table;
content: "";
}
.clearfix:after {
clear: both;
}
.hide-text {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.input-block-level {
display: block;
width: 100%;
min-height: 28px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
.hidden {
display: none;
visibility: hidden;
}
.visible-phone {
display: none !important;
}
.visible-tablet {
display: none !important;
}
.hidden-desktop {
display: none !important;
}
@media (max-width: 767px) {
.visible-phone {
display: inherit !important;
}
.hidden-phone {
display: none !important;
}
.hidden-desktop {
display: inherit !important;
}
.visible-desktop {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 979px) {
.visible-tablet {
display: inherit !important;
}
.hidden-tablet {
display: none !important;
}
.hidden-desktop {
display: inherit !important;
}
.visible-desktop {
display: none !important ;
}
}
@media (max-width: 480px) {
.nav-collapse {
-webkit-transform: translate3d(0, 0, 0);
}
.page-header h1 small {
display: block;
line-height: 18px;
}
input[type="checkbox"],
input[type="radio"] {
border: 1px solid #ccc;
}
.form-horizontal .control-group > label {
float: none;
width: auto;
padding-top: 0;
text-align: left;
}
.form-horizontal .controls {
margin-left: 0;
}
.form-horizontal .control-list {
padding-top: 0;
}
.form-horizontal .form-actions {
padding-right: 10px;
padding-left: 10px;
}
.modal {
position: absolute;
top: 10px;
right: 10px;
left: 10px;
width: auto;
margin: 0;
}
.modal.fade.in {
top: auto;
}
.modal-header .close {
padding: 10px;
margin: -10px;
}
.carousel-caption {
position: static;
}
}
@media (max-width: 767px) {
body {
padding-right: 20px;
padding-left: 20px;
}
.navbar-fixed-top,
.navbar-fixed-bottom {
margin-right: -20px;
margin-left: -20px;
}
.container-fluid {
padding: 0;
}
.dl-horizontal dt {
float: none;
width: auto;
clear: none;
text-align: left;
}
.dl-horizontal dd {
margin-left: 0;
}
.container {
width: auto;
}
.row-fluid {
width: 100%;
}
.row,
.thumbnails {
margin-left: 0;
}
[class*="span"],
.row-fluid [class*="span"] {
display: block;
float: none;
width: auto;
margin-left: 0;
}
.input-large,
.input-xlarge,
.input-xxlarge,
input[class*="span"],
select[class*="span"],
textarea[class*="span"],
.uneditable-input {
display: block;
width: 100%;
min-height: 28px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
.input-prepend input,
.input-append input,
.input-prepend input[class*="span"],
.input-append input[class*="span"] {
display: inline-block;
width: auto;
}
}
@media (min-width: 768px) and (max-width: 979px) {
.row {
margin-left: -20px;
*zoom: 1;
}
.row:before,
.row:after {
display: table;
content: "";
}
.row:after {
clear: both;
}
[class*="span"] {
float: left;
margin-left: 20px;
}
.container,
.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
width: 724px;
}
.span12 {
width: 724px;
}
.span11 {
width: 662px;
}
.span10 {
width: 600px;
}
.span9 {
width: 538px;
}
.span8 {
width: 476px;
}
.span7 {
width: 414px;
}
.span6 {
width: 352px;
}
.span5 {
width: 290px;
}
.span4 {
width: 228px;
}
.span3 {
width: 166px;
}
.span2 {
width: 104px;
}
.span1 {
width: 42px;
}
.offset12 {
margin-left: 764px;
}
.offset11 {
margin-left: 702px;
}
.offset10 {
margin-left: 640px;
}
.offset9 {
margin-left: 578px;
}
.offset8 {
margin-left: 516px;
}
.offset7 {
margin-left: 454px;
}
.offset6 {
margin-left: 392px;
}
.offset5 {
margin-left: 330px;
}
.offset4 {
margin-left: 268px;
}
.offset3 {
margin-left: 206px;
}
.offset2 {
margin-left: 144px;
}
.offset1 {
margin-left: 82px;
}
.row-fluid {
width: 100%;
*zoom: 1;
}
.row-fluid:before,
.row-fluid:after {
display: table;
content: "";
}
.row-fluid:after {
clear: both;
}
.row-fluid [class*="span"] {
display: block;
float: left;
width: 100%;
min-height: 28px;
margin-left: 2.762430939%;
*margin-left: 2.709239449638298%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
.row-fluid [class*="span"]:first-child {
margin-left: 0;
}
.row-fluid .span12 {
width: 99.999999993%;
*width: 99.9468085036383%;
}
.row-fluid .span11 {
width: 91.436464082%;
*width: 91.38327259263829%;
}
.row-fluid .span10 {
width: 82.87292817100001%;
*width: 82.8197366816383%;
}
.row-fluid .span9 {
width: 74.30939226%;
*width: 74.25620077063829%;
}
.row-fluid .span8 {
width: 65.74585634900001%;
*width: 65.6926648596383%;
}
.row-fluid .span7 {
width: 57.182320438000005%;
*width: 57.129128948638304%;
}
.row-fluid .span6 {
width: 48.618784527%;
*width: 48.5655930376383%;
}
.row-fluid .span5 {
width: 40.055248616%;
*width: 40.0020571266383%;
}
.row-fluid .span4 {
width: 31.491712705%;
*width: 31.4385212156383%;
}
.row-fluid .span3 {
width: 22.928176794%;
*width: 22.874985304638297%;
}
.row-fluid .span2 {
width: 14.364640883%;
*width: 14.311449393638298%;
}
.row-fluid .span1 {
width: 5.801104972%;
*width: 5.747913482638298%;
}
input,
textarea,
.uneditable-input {
margin-left: 0;
}
input.span12,
textarea.span12,
.uneditable-input.span12 {
width: 714px;
}
input.span11,
textarea.span11,
.uneditable-input.span11 {
width: 652px;
}
input.span10,
textarea.span10,
.uneditable-input.span10 {
width: 590px;
}
input.span9,
textarea.span9,
.uneditable-input.span9 {
width: 528px;
}
input.span8,
textarea.span8,
.uneditable-input.span8 {
width: 466px;
}
input.span7,
textarea.span7,
.uneditable-input.span7 {
width: 404px;
}
input.span6,
textarea.span6,
.uneditable-input.span6 {
width: 342px;
}
input.span5,
textarea.span5,
.uneditable-input.span5 {
width: 280px;
}
input.span4,
textarea.span4,
.uneditable-input.span4 {
width: 218px;
}
input.span3,
textarea.span3,
.uneditable-input.span3 {
width: 156px;
}
input.span2,
textarea.span2,
.uneditable-input.span2 {
width: 94px;
}
input.span1,
textarea.span1,
.uneditable-input.span1 {
width: 32px;
}
}
@media (min-width: 1200px) {
.row {
margin-left: -30px;
*zoom: 1;
}
.row:before,
.row:after {
display: table;
content: "";
}
.row:after {
clear: both;
}
[class*="span"] {
float: left;
margin-left: 30px;
}
.container,
.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
width: 1170px;
}
.span12 {
width: 1170px;
}
.span11 {
width: 1070px;
}
.span10 {
width: 970px;
}
.span9 {
width: 870px;
}
.span8 {
width: 770px;
}
.span7 {
width: 670px;
}
.span6 {
width: 570px;
}
.span5 {
width: 470px;
}
.span4 {
width: 370px;
}
.span3 {
width: 270px;
}
.span2 {
width: 170px;
}
.span1 {
width: 70px;
}
.offset12 {
margin-left: 1230px;
}
.offset11 {
margin-left: 1130px;
}
.offset10 {
margin-left: 1030px;
}
.offset9 {
margin-left: 930px;
}
.offset8 {
margin-left: 830px;
}
.offset7 {
margin-left: 730px;
}
.offset6 {
margin-left: 630px;
}
.offset5 {
margin-left: 530px;
}
.offset4 {
margin-left: 430px;
}
.offset3 {
margin-left: 330px;
}
.offset2 {
margin-left: 230px;
}
.offset1 {
margin-left: 130px;
}
.row-fluid {
width: 100%;
*zoom: 1;
}
.row-fluid:before,
.row-fluid:after {
display: table;
content: "";
}
.row-fluid:after {
clear: both;
}
.row-fluid [class*="span"] {
display: block;
float: left;
width: 100%;
min-height: 28px;
margin-left: 2.564102564%;
*margin-left: 2.510911074638298%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
.row-fluid [class*="span"]:first-child {
margin-left: 0;
}
.row-fluid .span12 {
width: 100%;
*width: 99.94680851063829%;
}
.row-fluid .span11 {
width: 91.45299145300001%;
*width: 91.3997999636383%;
}
.row-fluid .span10 {
width: 82.905982906%;
*width: 82.8527914166383%;
}
.row-fluid .span9 {
width: 74.358974359%;
*width: 74.30578286963829%;
}
.row-fluid .span8 {
width: 65.81196581200001%;
*width: 65.7587743226383%;
}
.row-fluid .span7 {
width: 57.264957265%;
*width: 57.2117657756383%;
}
.row-fluid .span6 {
width: 48.717948718%;
*width: 48.6647572286383%;
}
.row-fluid .span5 {
width: 40.170940171000005%;
*width: 40.117748681638304%;
}
.row-fluid .span4 {
width: 31.623931624%;
*width: 31.5707401346383%;
}
.row-fluid .span3 {
width: 23.076923077%;
*width: 23.0237315876383%;
}
.row-fluid .span2 {
width: 14.529914530000001%;
*width: 14.4767230406383%;
}
.row-fluid .span1 {
width: 5.982905983%;
*width: 5.929714493638298%;
}
input,
textarea,
.uneditable-input {
margin-left: 0;
}
input.span12,
textarea.span12,
.uneditable-input.span12 {
width: 1160px;
}
input.span11,
textarea.span11,
.uneditable-input.span11 {
width: 1060px;
}
input.span10,
textarea.span10,
.uneditable-input.span10 {
width: 960px;
}
input.span9,
textarea.span9,
.uneditable-input.span9 {
width: 860px;
}
input.span8,
textarea.span8,
.uneditable-input.span8 {
width: 760px;
}
input.span7,
textarea.span7,
.uneditable-input.span7 {
width: 660px;
}
input.span6,
textarea.span6,
.uneditable-input.span6 {
width: 560px;
}
input.span5,
textarea.span5,
.uneditable-input.span5 {
width: 460px;
}
input.span4,
textarea.span4,
.uneditable-input.span4 {
width: 360px;
}
input.span3,
textarea.span3,
.uneditable-input.span3 {
width: 260px;
}
input.span2,
textarea.span2,
.uneditable-input.span2 {
width: 160px;
}
input.span1,
textarea.span1,
.uneditable-input.span1 {
width: 60px;
}
.thumbnails {
margin-left: -30px;
}
.thumbnails > li {
margin-left: 30px;
}
.row-fluid .thumbnails {
margin-left: 0;
}
}
@media (max-width: 979px) {
body {
padding-top: 0;
}
.navbar-fixed-top,
.navbar-fixed-bottom {
position: static;
}
.navbar-fixed-top {
margin-bottom: 18px;
}
.navbar-fixed-bottom {
margin-top: 18px;
}
.navbar-fixed-top .navbar-inner,
.navbar-fixed-bottom .navbar-inner {
padding: 5px;
}
.navbar .container {
width: auto;
padding: 0;
}
.navbar .brand {
padding-right: 10px;
padding-left: 10px;
margin: 0 0 0 -5px;
}
.nav-collapse {
clear: both;
}
.nav-collapse .nav {
float: none;
margin: 0 0 9px;
}
.nav-collapse .nav > li {
float: none;
}
.nav-collapse .nav > li > a {
margin-bottom: 2px;
}
.nav-collapse .nav > .divider-vertical {
display: none;
}
.nav-collapse .nav .nav-header {
color: #999999;
text-shadow: none;
}
.nav-collapse .nav > li > a,
.nav-collapse .dropdown-menu a {
padding: 6px 15px;
font-weight: bold;
color: #999999;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.nav-collapse .btn {
padding: 4px 10px 4px;
font-weight: normal;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.nav-collapse .dropdown-menu li + li a {
margin-bottom: 2px;
}
.nav-collapse .nav > li > a:hover,
.nav-collapse .dropdown-menu a:hover {
background-color: #222222;
}
.nav-collapse.in .btn-group {
padding: 0;
margin-top: 5px;
}
.nav-collapse .dropdown-menu {
position: static;
top: auto;
left: auto;
display: block;
float: none;
max-width: none;
padding: 0;
margin: 0 15px;
background-color: transparent;
border: none;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.nav-collapse .dropdown-menu:before,
.nav-collapse .dropdown-menu:after {
display: none;
}
.nav-collapse .dropdown-menu .divider {
display: none;
}
.nav-collapse .navbar-form,
.nav-collapse .navbar-search {
float: none;
padding: 9px 15px;
margin: 9px 0;
border-top: 1px solid #222222;
border-bottom: 1px solid #222222;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
}
.navbar .nav-collapse .nav.pull-right {
float: none;
margin-left: 0;
}
.nav-collapse,
.nav-collapse.collapse {
height: 0;
overflow: hidden;
}
.navbar .btn-navbar {
display: block;
}
.navbar-static .navbar-inner {
padding-right: 10px;
padding-left: 10px;
}
}
@media (min-width: 980px) {
.nav-collapse.collapse {
height: auto !important;
overflow: visible !important;
}
}

File diff suppressed because one or more lines are too long

4281
sandbox/web/css/bootstrap.css vendored Normal file

File diff suppressed because it is too large Load Diff

9
sandbox/web/css/bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

397
sandbox/web/css/chosen.css Normal file
View File

@@ -0,0 +1,397 @@
/* @group Base */
.chzn-container {
font-size: 13px;
position: relative;
display: inline-block;
zoom: 1;
*display: inline;
}
.chzn-container .chzn-drop {
background: #fff;
border: 1px solid #aaa;
border-top: 0;
position: absolute;
top: 29px;
left: 0;
-webkit-box-shadow: 0 4px 5px rgba(0,0,0,.15);
-moz-box-shadow : 0 4px 5px rgba(0,0,0,.15);
box-shadow : 0 4px 5px rgba(0,0,0,.15);
z-index: 1010;
}
/* @end */
/* @group Single Chosen */
.chzn-container-single .chzn-single {
background-color: #ffffff;
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0 );
background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
background-image: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
background-image: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
background-image: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
background-image: linear-gradient(#ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
-webkit-border-radius: 5px;
-moz-border-radius : 5px;
border-radius : 5px;
-moz-background-clip : padding;
-webkit-background-clip: padding-box;
background-clip : padding-box;
border: 1px solid #aaaaaa;
-webkit-box-shadow: 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
-moz-box-shadow : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
box-shadow : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
display: block;
overflow: hidden;
white-space: nowrap;
position: relative;
height: 23px;
line-height: 24px;
padding: 0 0 0 8px;
color: #444444;
text-decoration: none;
}
.chzn-container-single .chzn-default {
color: #999;
}
.chzn-container-single .chzn-single span {
margin-right: 26px;
display: block;
overflow: hidden;
white-space: nowrap;
-o-text-overflow: ellipsis;
-ms-text-overflow: ellipsis;
text-overflow: ellipsis;
}
.chzn-container-single .chzn-single abbr {
display: block;
position: absolute;
right: 26px;
top: 6px;
width: 12px;
height: 13px;
font-size: 1px;
background: url('chosen-sprite.png') right top no-repeat;
}
.chzn-container-single .chzn-single abbr:hover {
background-position: right -11px;
}
.chzn-container-single.chzn-disabled .chzn-single abbr:hover {
background-position: right top;
}
.chzn-container-single .chzn-single div {
position: absolute;
right: 0;
top: 0;
display: block;
height: 100%;
width: 18px;
}
.chzn-container-single .chzn-single div b {
background: url('chosen-sprite.png') no-repeat 0 0;
display: block;
width: 100%;
height: 100%;
}
.chzn-container-single .chzn-search {
padding: 3px 4px;
position: relative;
margin: 0;
white-space: nowrap;
z-index: 1010;
}
.chzn-container-single .chzn-search input {
background: #fff url('chosen-sprite.png') no-repeat 100% -22px;
background: url('chosen-sprite.png') no-repeat 100% -22px, -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
background: url('chosen-sprite.png') no-repeat 100% -22px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background: url('chosen-sprite.png') no-repeat 100% -22px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background: url('chosen-sprite.png') no-repeat 100% -22px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background: url('chosen-sprite.png') no-repeat 100% -22px, linear-gradient(#eeeeee 1%, #ffffff 15%);
margin: 1px 0;
padding: 4px 20px 4px 5px;
outline: 0;
border: 1px solid #aaa;
font-family: sans-serif;
font-size: 1em;
}
.chzn-container-single .chzn-drop {
-webkit-border-radius: 0 0 4px 4px;
-moz-border-radius : 0 0 4px 4px;
border-radius : 0 0 4px 4px;
-moz-background-clip : padding;
-webkit-background-clip: padding-box;
background-clip : padding-box;
}
/* @end */
.chzn-container-single-nosearch .chzn-search input {
position: absolute;
left: -9000px;
}
/* @group Multi Chosen */
.chzn-container-multi .chzn-choices {
background-color: #fff;
background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);
border: 1px solid #aaa;
margin: 0;
padding: 0;
cursor: text;
overflow: hidden;
height: auto !important;
height: 1%;
position: relative;
}
.chzn-container-multi .chzn-choices li {
float: left;
list-style: none;
}
.chzn-container-multi .chzn-choices .search-field {
white-space: nowrap;
margin: 0;
padding: 0;
}
.chzn-container-multi .chzn-choices .search-field input {
color: #666;
background: transparent !important;
border: 0 !important;
font-family: sans-serif;
font-size: 100%;
height: 15px;
padding: 5px;
margin: 1px 0;
outline: 0;
-webkit-box-shadow: none;
-moz-box-shadow : none;
box-shadow : none;
}
.chzn-container-multi .chzn-choices .search-field .default {
color: #999;
}
.chzn-container-multi .chzn-choices .search-choice {
-webkit-border-radius: 3px;
-moz-border-radius : 3px;
border-radius : 3px;
-moz-background-clip : padding;
-webkit-background-clip: padding-box;
background-clip : padding-box;
background-color: #e4e4e4;
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
-webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
-moz-box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
color: #333;
border: 1px solid #aaaaaa;
line-height: 13px;
padding: 3px 20px 3px 5px;
margin: 3px 0 3px 5px;
position: relative;
cursor: default;
}
.chzn-container-multi .chzn-choices .search-choice.search-choice-disabled {
background-color: #e4e4e4;
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
color: #666;
border: 1px solid #cccccc;
padding-right: 5px;
}
.chzn-container-multi .chzn-choices .search-choice-focus {
background: #d4d4d4;
}
.chzn-container-multi .chzn-choices .search-choice .search-choice-close {
display: block;
position: absolute;
right: 3px;
top: 4px;
width: 12px;
height: 13px;
font-size: 1px;
background: url('chosen-sprite.png') right top no-repeat;
}
.chzn-container-multi .chzn-choices .search-choice .search-choice-close:hover {
background-position: right -11px;
}
.chzn-container-multi .chzn-choices .search-choice-focus .search-choice-close {
background-position: right -11px;
}
/* @end */
/* @group Results */
.chzn-container .chzn-results {
margin: 0 4px 4px 0;
max-height: 240px;
padding: 0 0 0 4px;
position: relative;
overflow-x: hidden;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.chzn-container-multi .chzn-results {
margin: -1px 0 0;
padding: 0;
}
.chzn-container .chzn-results li {
display: none;
line-height: 15px;
padding: 5px 6px;
margin: 0;
list-style: none;
}
.chzn-container .chzn-results .active-result {
cursor: pointer;
display: list-item;
}
.chzn-container .chzn-results .highlighted {
background-color: #3875d7;
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3875d7', endColorstr='#2a62bc', GradientType=0 );
background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
background-image: -webkit-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
background-image: -moz-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
background-image: -o-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
color: #fff;
}
.chzn-container .chzn-results li em {
background: #feffde;
font-style: normal;
}
.chzn-container .chzn-results .highlighted em {
background: transparent;
}
.chzn-container .chzn-results .no-results {
background: #f4f4f4;
display: list-item;
}
.chzn-container .chzn-results .group-result {
cursor: default;
color: #999;
font-weight: bold;
}
.chzn-container .chzn-results .group-option {
padding-left: 15px;
}
.chzn-container-multi .chzn-drop .result-selected {
display: none;
}
.chzn-container .chzn-results-scroll {
background: white;
margin: 0 4px;
position: absolute;
text-align: center;
width: 321px; /* This should by dynamic with js */
z-index: 1;
}
.chzn-container .chzn-results-scroll span {
display: inline-block;
height: 17px;
text-indent: -5000px;
width: 9px;
}
.chzn-container .chzn-results-scroll-down {
bottom: 0;
}
.chzn-container .chzn-results-scroll-down span {
background: url('chosen-sprite.png') no-repeat -4px -3px;
}
.chzn-container .chzn-results-scroll-up span {
background: url('chosen-sprite.png') no-repeat -22px -3px;
}
/* @end */
/* @group Active */
.chzn-container-active .chzn-single {
-webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
-moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
box-shadow : 0 0 5px rgba(0,0,0,.3);
border: 1px solid #5897fb;
}
.chzn-container-active .chzn-single-with-drop {
border: 1px solid #aaa;
-webkit-box-shadow: 0 1px 0 #fff inset;
-moz-box-shadow : 0 1px 0 #fff inset;
box-shadow : 0 1px 0 #fff inset;
background-color: #eee;
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0 );
background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff));
background-image: -webkit-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
background-image: -moz-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
background-image: -o-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
background-image: linear-gradient(#eeeeee 20%, #ffffff 80%);
-webkit-border-bottom-left-radius : 0;
-webkit-border-bottom-right-radius: 0;
-moz-border-radius-bottomleft : 0;
-moz-border-radius-bottomright: 0;
border-bottom-left-radius : 0;
border-bottom-right-radius: 0;
}
.chzn-container-active .chzn-single-with-drop div {
background: transparent;
border-left: none;
}
.chzn-container-active .chzn-single-with-drop div b {
background-position: -18px 1px;
}
.chzn-container-active .chzn-choices {
-webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
-moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
box-shadow : 0 0 5px rgba(0,0,0,.3);
border: 1px solid #5897fb;
}
.chzn-container-active .chzn-choices .search-field input {
color: #111 !important;
}
/* @end */
/* @group Disabled Support */
.chzn-disabled {
cursor: default;
opacity:0.5 !important;
}
.chzn-disabled .chzn-single {
cursor: default;
}
.chzn-disabled .chzn-choices .search-choice .search-choice-close {
cursor: default;
}
/* @group Right to Left */
.chzn-rtl { text-align: right; }
.chzn-rtl .chzn-single { padding: 0 8px 0 0; overflow: visible; }
.chzn-rtl .chzn-single span { margin-left: 26px; margin-right: 0; direction: rtl; }
.chzn-rtl .chzn-single div { left: 3px; right: auto; }
.chzn-rtl .chzn-single abbr {
left: 26px;
right: auto;
}
.chzn-rtl .chzn-choices .search-field input { direction: rtl; }
.chzn-rtl .chzn-choices li { float: right; }
.chzn-rtl .chzn-choices .search-choice { padding: 3px 5px 3px 19px; margin: 3px 5px 3px 0; }
.chzn-rtl .chzn-choices .search-choice .search-choice-close { left: 4px; right: auto; background-position: right top;}
.chzn-rtl.chzn-container-single .chzn-results { margin: 0 0 4px 4px; padding: 0 4px 0 0; }
.chzn-rtl .chzn-results .group-option { padding-left: 0; padding-right: 15px; }
.chzn-rtl.chzn-container-active .chzn-single-with-drop div { border-right: none; }
.chzn-rtl .chzn-search input {
background: #fff url('chosen-sprite.png') no-repeat -38px -22px;
background: url('chosen-sprite.png') no-repeat -38px -22px, -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
background: url('chosen-sprite.png') no-repeat -38px -22px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background: url('chosen-sprite.png') no-repeat -38px -22px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background: url('chosen-sprite.png') no-repeat -38px -22px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background: url('chosen-sprite.png') no-repeat -38px -22px, linear-gradient(#eeeeee 1%, #ffffff 15%);
padding: 4px 5px 4px 20px;
direction: rtl;
}
/* @end */

310
sandbox/web/css/site.css Normal file
View File

@@ -0,0 +1,310 @@
.main-content {
background-color : #fff;
overflow: hidden;
height : 1000px;
}
.mc-main-nav {
width : 170px;
border-right : 1px solid #e6e6e6;
}
.mc-profile-pic {
width : 140px;
height : 125px;
border-radius : 3px;
border : 4px solid #fff;
box-shadow : 1px 1px 5px #ccc;
background : url('/img/profile-pic.png') no-repeat;
margin : 0 auto;
}
.big-menu {
/*height : 15px;*/
padding : 5px 10px 5px 35px;
text-transform : uppercase;
font-size : 15px;
line-height : 15px;
font-weight : bold;
margin : 12px 0 0 0;
width : 100%;
height : 15px;
}
.menu-selected {
text-decoration : underline;
}
.sub-menu {
font-size : 13px;
padding : 4px 0 4px 22px;
}
.sub-side-menu {
padding-left : 12px;
font-weight : bold;
}
.side-menu {
padding : 11px;
}
.sicon-bodystats {background : url('/img/sicon-bodystats.png') no-repeat left center;}
.sicon-bodyreputation {background : url('/img/sicon-bodyreputation.png') no-repeat left center;}
.sicon-challenges {background : url('/img/sicon-challenges.png') no-repeat left center;}
.icon-apps {background : url('/img/icon-apps.png') no-repeat left center;}
.icon-community {background : url('/img/icon-community.png') no-repeat left center;}
.icon-learning {background : url('/img/icon-learning.png') no-repeat left center;}
.icon-meals {background : url('/img/icon-meals.png') no-repeat left center;}
.icon-profile {background : url('/img/icon-profile.png') no-repeat left center;}
.icon-shopping {background : url('/img/icon-shopping.png') no-repeat left center;}
.icon-workout {background : url('/img/icon-workout.png') no-repeat left center;}
/*OLD NEW CONTENT*/
.arrowup {
width : 12px;
height : 14px;
background-image : url('/img/arrowup.PNG');
display : inline-block;
}
.stats {
padding : 10px;
background-color : fff;
position: relative;
}
.comment_block {
border-top : 1px solid #bbb;
padding-left : 10px;
}
.block_types {
overflow: hidden;
}
.avatar {
left: 14px;
position: absolute;
width: 50px;
height: 50px;
border-radius: 3px;
}
.sub-avatar {
width: 50px;
height: 50px;
border-radius: 3px;
left: 79px;
position: absolute;
}
.user1 {
background-image: url('/img/user1.jpg');
}
.user2 {
background-image: url('/img/user2.jpg');
}
.block_type {
width : 50px;
height : 0px;
float : left;
border-bottom-right-radius : 4px;
border-bottom-left-radius : 4px;
overflow: hidden;
z-index : 100;
border : 3px solid gray;
background-color : #e5e5e5;
}
.block_type i{
margin : 12px 10px;
}
.tnc-blurb {
padding : 10px;
float: right;
font-size : 12px;
font-weight : bold;
color : #888;
}
.basic-comment {
margin-top : 10px;
font-size : 13px;
margin-left : 10px;
}
.user-comment {
font-size : 13px;
padding: 13px 13px 20px 66px;
}
.user-sub-comment {
font-size : 13px;
padding: 5px 5px 5px 66px;
background-color : #e5e5e5;
margin-left : 65px;
margin-top : 5px;
border-radius: 3px;
}
.like-comment-time {
font-size : 12px;
color : #888;
margin-top : 5px;
margin-left : 10px;
}
.block_type_small {
width : 14px;
height : 15px;
border-radius : 3px;
border : 3px solid gray;
margin-left : 3px;
box-shadow: 0 1px 4px rgba(151, 156, 159, .4);
}
.block_type_small:hover {
box-shadow: 0 1px 4px rgba(151, 156, 159, .9);
}
.bluebg {background-color : #429ECD;}
.greenbg {background-color : #45C700;}
.redbg {background-color : #EC1C24;}
.orangebg {background-color : #FF9200;}
.purplebg {background-color : #90278E;}
.tealbg {background-color : #00BC98;}
.graybg {background-color : #808080;}
.bluebd {border-color : #429ECD;}
.greenbd {border-color : #45C700;}
.redbd {border-color : #EC1C24;}
.orangebd {border-color : #FF9200;}
.purplebd {border-color : #90278E;}
.tealbd {border-color : #00BC98;}
.graybd {border-color : #808080;}
.blue {color : #429ECD;}
.green {color : #45C700;}
.red {color : #EC1C24;}
.orange {color : #FF9200;}
.purple {color : #90278E;}
.teal {color : #00BC98;}
.gray {color : #808080;}
.sicon-bodystats {background : url('/img/sicon-bodystats.png') no-repeat left center;}
.sicon-bodyreputation {background : url('/img/sicon-bodyreputation.png') no-repeat left center;}
.sicon-challenges {background : url('/img/sicon-challenges.png') no-repeat left center;}
.icon-apps {background : url('/img/icon-apps.png') no-repeat left center;}
.icon-community {background : url('/img/icon-community.png') no-repeat left center;}
.icon-learning {background : url('/img/icon-learning.png') no-repeat left center;}
.icon-meals {background : url('/img/icon-meals.png') no-repeat left center;}
.icon-profile {background : url('/img/icon-profile.png') no-repeat left center;}
.icon-shopping {background : url('/img/icon-shopping.png') no-repeat left center;}
.icon-workout {background : url('/img/icon-workout.png') no-repeat left center;}
.scroll
{
position: absolute;
/* margin: 0 auto;*/
visibility: hidden;
background-color: white;
z-index: 10000;
border: 1px 0px 1px 1px;
border-collapse: collapse;
border-color: #111;
overflow: visible;
}
.suggest_types li:hover
{
color: black;
background-color: #f6f6f6;
}
.scroll div
{
margin: 0 auto;
overflow: visible;
text-align:left
}
.normalcell {
width: 50%;
padding: 10px 5px 10px 3px;
}
.suggest table
{
font-size: 11px;
font-weight: normal;
color: #676767;
text-decoration: none;
border: 0px;
padding: 0px;
z-index: 10000;
overflow: inherit;
text-align:left;
margin: 0px
}
.highlightrow
{
background-color: rgb(100,135,220);
color: white;
cursor: pointer;
padding: 0.3em;
}
.normallink
{
cursor: pointer;
margin-left: 2px;
text-decoration: none;
color: rgb(0,51,153);
}
.highlightlink
{
margin-left: 2px;
text-decoration: none;
color: white;
}
.typecell
{
color: rgb(0,51,153);
padding: 0.3em;
font-size: 10px;
text-align: right;
}
.search {
background-repeat: no-repeat;
background-position: center left;
padding-left: 18px;
}
.highlightcell
{
background-color: rgb(100,135,220);
color: white;
cursor: pointer;
}

View File

BIN
sandbox/web/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
sandbox/web/img/arrowup.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

BIN
sandbox/web/img/nav-cal.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

BIN
sandbox/web/img/user1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
sandbox/web/img/user2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

5
sandbox/web/index.php Normal file
View File

@@ -0,0 +1,5 @@
<?php
header('Location: app_dev.php');
?>

View File

@@ -0,0 +1,33 @@
$(function() {
$('#edprf').unbind().live('click', function() {
$.get('/app_dev.php/m/profile/edit', {}, function(data) {
$('#mcnt').html(data);
});
});
$('form#topsearch').live('submit', function(){
frm = $(this);
var searchTerm = frm.find('input').val();
url = frm.attr('action') + '/'+searchTerm;
$.get(url, {}, function(data) {
$('.symfony-content > .row-fluid').html(data);
});
return false;
});
$('form#profile').live('submit', function(){
frm = $(this);
$.post(frm.attr('action'), frm.serialize(), function(data) {
response = $.parseJSON(data);
if(response.result)
$('#mcnt').append('Updated');
});
return false;
});
$('.block_type').hover(function(){
$(this).animate({height:'50px'},{queue:false,duration:200});
}, function(){
$(this).animate({height:'0px'},{queue:false,duration:200});
});
});

1825
sandbox/web/js/bootstrap.js vendored Normal file

File diff suppressed because it is too large Load Diff

6
sandbox/web/js/bootstrap.min.js vendored Normal file

File diff suppressed because one or more lines are too long

10
sandbox/web/js/jquery.chosen.min.js vendored Normal file

File diff suppressed because one or more lines are too long

4
sandbox/web/robots.txt Normal file
View File

@@ -0,0 +1,4 @@
# www.robotstxt.org/
# www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449
User-agent: *