Skip to content

Commit

Permalink
mergered user_profiles branch to master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Maumasi committed Feb 4, 2017
2 parents 1d403a0 + e62f0bc commit 028eeca
Show file tree
Hide file tree
Showing 55 changed files with 1,539 additions and 291 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/web/bundles/
/web/uploads/*
!/web/uploads/.gitkeep
/app/bootstrap.php.cache
/app/cache/*
/app/config/parameters.yml
Expand All @@ -9,4 +11,7 @@
/build/
/vendor/
/bin/
/node_modules/
*.DS_Store
/composer.phar

546 changes: 317 additions & 229 deletions .idea/workspace.xml

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions app/DoctrineMigrations/Version20170201193521.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

namespace Application\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170201193521 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE artist CHANGE website website VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE venue CHANGE website website VARCHAR(255) DEFAULT NULL');
}

/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE artist CHANGE website website VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
$this->addSql('ALTER TABLE venue CHANGE website website VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
}
}
34 changes: 34 additions & 0 deletions app/DoctrineMigrations/Version20170203064353.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace Application\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170203064353 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE artist ADD password VARCHAR(255) NOT NULL');
}

/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE artist DROP password');
}
}
36 changes: 36 additions & 0 deletions app/DoctrineMigrations/Version20170203071858.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

namespace Application\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170203071858 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE artist ADD created_at DATETIME NOT NULL, ADD roles LONGTEXT NOT NULL COMMENT \'(DC2Type:json_array)\', CHANGE password password VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE user CHANGE password password VARCHAR(255) DEFAULT NULL');
}

/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE artist DROP created_at, DROP roles, CHANGE password password VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
$this->addSql('ALTER TABLE user CHANGE password password VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
}
}
36 changes: 36 additions & 0 deletions app/DoctrineMigrations/Version20170203084244.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

namespace Application\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170203084244 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE artist DROP password, DROP created_at, DROP roles');
$this->addSql('ALTER TABLE user CHANGE password password VARCHAR(255) NOT NULL');
}

/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE artist ADD password VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD created_at DATETIME NOT NULL, ADD roles LONGTEXT NOT NULL COLLATE utf8_unicode_ci COMMENT \'(DC2Type:json_array)\'');
$this->addSql('ALTER TABLE user CHANGE password password VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci');
}
}
50 changes: 50 additions & 0 deletions app/DoctrineMigrations/Version20170203095936.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

namespace Application\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170203095936 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('CREATE TABLE artist (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, bio LONGTEXT DEFAULT NULL, business_name VARCHAR(255) DEFAULT NULL, profile_image VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, website VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_1599687E7927C74 (email), UNIQUE INDEX UNIQ_1599687A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE venue (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, bio LONGTEXT DEFAULT NULL, market_name VARCHAR(255) NOT NULL, market_subtitle VARCHAR(255) NOT NULL, profile_image VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, website VARCHAR(255) DEFAULT NULL, city VARCHAR(255) NOT NULL, state VARCHAR(255) NOT NULL, address1 VARCHAR(255) NOT NULL, address2 VARCHAR(255) NOT NULL, zip_code VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_91911B0DE7927C74 (email), UNIQUE INDEX UNIQ_91911B0DA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE phone (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, phone VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_444F97DD444F97DD (phone), INDEX IDX_444F97DDA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE urls (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, url VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, INDEX IDX_2A9437A1A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, roles LONGTEXT NOT NULL COMMENT \'(DC2Type:json_array)\', created_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE artist ADD CONSTRAINT FK_1599687A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE venue ADD CONSTRAINT FK_91911B0DA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE phone ADD CONSTRAINT FK_444F97DDA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE urls ADD CONSTRAINT FK_2A9437A1A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
}

/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE artist DROP FOREIGN KEY FK_1599687A76ED395');
$this->addSql('ALTER TABLE venue DROP FOREIGN KEY FK_91911B0DA76ED395');
$this->addSql('ALTER TABLE phone DROP FOREIGN KEY FK_444F97DDA76ED395');
$this->addSql('ALTER TABLE urls DROP FOREIGN KEY FK_2A9437A1A76ED395');
$this->addSql('DROP TABLE artist');
$this->addSql('DROP TABLE venue');
$this->addSql('DROP TABLE phone');
$this->addSql('DROP TABLE urls');
$this->addSql('DROP TABLE user');
}
}
43 changes: 41 additions & 2 deletions app/Resources/views/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,53 @@
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>{% block title %}Local Art{% endblock %}</title>
{% block stylesheets %}{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/styles.css') }}" />
{% endblock %}

{#<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />#}
</head>

<body>
{% block body %}{% endblock %}


{#/ this <ul> is only for development /#}
{#<ul class="devGrid">#}
{#<li>1</li>#}
{#<li>2</li>#}
{#<li>3</li>#}
{#<li>4</li>#}
{#<li>5</li>#}
{#<li>6</li>#}
{#<li>7</li>#}
{#<li>8</li>#}
{#<li>9</li>#}
{#<li>10</li>#}
{#<li>11</li>#}
{#<li>12</li>#}
{#</ul>#}

{#/ header component /#}
{% block header %}
{{ include(':common:header.html.twig') }}
{% endblock %}

{#/ main body /#}
{% block body %}
<main></main>
{% endblock %}


{#/ only used to push the footer down /#}
<div class="footer-pusher"></div>

{#/ footer component /#}
{% block footer %}
{{ include(':common:footer.html.twig') }}
{% endblock %}

{% block javascripts %}{% endblock %}
</body>
</html>
24 changes: 19 additions & 5 deletions app/Resources/views/common/footer.html.twig
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
{% extends 'base.html.twig' %}

{% block body %}

<footer>
<footer>
<ul>
<li><p><a href="#">Terms of service</a></p></li>
<li><p><a href="#">Content guidline</a></p></li>
<li><p><a href="#">Privacy police</a></p></li>

</footer>
</ul>

{% endblock %}
<ul>
<li><p><a href="#">Contact local art</a></p></li>
<li><p><a href="#">Advertise with us</a></p></li>
<li><p><a href="#">FAQ</a></p></li>
</ul>

<ul>
<li><p><a href="{{ path('secure_login') }}">Log in</a></p></li>
<li><p><a href="{{ path('venue_registration') }}">Venue sign up</a></p></li>
<li><p><a href="{{ path('artist_registration') }}">Artist sign up</a></p></li>
</ul>

</footer>
28 changes: 23 additions & 5 deletions app/Resources/views/common/header.html.twig
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
{% extends 'base.html.twig' %}

{% block body %}

<header>

</header>
<a href="{{ path('home_page') }}" class="logo" >logo</a>
{#<image class="logo" src="{{ asset('assets/local_art_logo_50x50.svg') }}" alt="Local Art logo" >#}
<div>

{% endblock %}
<h1><a href="{{ path('home_page') }}">Local Art</a></h1>
<p><a href="{{ path('home_page') }}">Find art where ever you are.</a></p>
</div>

{#login and register#}
<ul>
{% if is_granted('ROLE_USER') %}
<li><p><a href="{{ path('logout') }}">Log out</a></p></li>
{% else %}
<li><p><a href="{{ path('secure_login') }}">Log in</a></p></li>
<li>
<p><a href="#" class="sign_up">Sign up</a></p>
{#<ul>#}
{#<li><p><a href="{{ path('venue_registration') }}">Venue sign up</a></p></li>#}
{#<li><p><a href="{{ path('artist_registration') }}">Artist sign up</a></p></li>#}
{#</ul>#}
</li>
{% endif %}
</ul>
</header>
36 changes: 18 additions & 18 deletions app/Resources/views/main/index.html.twig
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{% extends 'base.html.twig' %}

{% block body %}
<main>
{# give different users a different message #}
{% if is_granted('ROLE_ARTIST') %}
<div>
{% for msg in app.session.flashBag.get('artistRegistered') %}
<h2>{{ msg }}</h2>
{% endfor %}
</div>

{# give different users a different message #}
{% if is_granted('ROLE_ARTIST') %}
<div>
{% for msg in app.session.flashBag.get('artistRegistered') %}
<h2>{{ msg }}</h2>
{% endfor %}
</div>
{% elseif is_granted('ROLE_VENUE') %}

{% elseif is_granted('ROLE_VENUE') %}
<div>
{% for msg in app.session.flashBag.get('venueRegistered') %}
<h2>{{ msg }}</h2>
{% endfor %}
</div>
{% endif %}

<div>
{% for msg in app.session.flashBag.get('venueRegistered') %}
<h2>{{ msg }}</h2>
{% endfor %}
</div>
{% endif %}

<h1>Home page</h1>

{% endblock %}
<h1>Home page</h1>
</main>
{% endblock %}
Loading

0 comments on commit 028eeca

Please sign in to comment.