From 8b0c8bd760262c92120b8bc45cf79f7ad2cb6f9b Mon Sep 17 00:00:00 2001 From: mespeche Date: Fri, 13 Sep 2013 18:03:45 +0200 Subject: [PATCH] First version of installation wizard --- .../Config/Resources/routing/install.xml | 20 ++- .../Install/BaseInstallController.php | 2 +- .../Controller/Install/InstallController.php | 51 ++++++- core/lib/Thelia/Install/BaseInstall.php | 3 +- .../default/assets/less/thelia/thelia.less | 1 + .../default/assets/less/thelia/wizard.less | 129 ++++++++++++++++++ templates/install/index.html | 52 +++++-- templates/install/layout.html | 49 ------- templates/install/layout.tpl | 62 +++++++++ templates/install/step-2.html | 51 +++++++ templates/install/step-3.html | 56 ++++++++ templates/install/step-4.html | 77 +++++++++++ templates/install/step-5.html | 72 ++++++++++ templates/install/thanks.html | 42 ++++++ 14 files changed, 601 insertions(+), 66 deletions(-) create mode 100644 templates/admin/default/assets/less/thelia/wizard.less delete mode 100644 templates/install/layout.html create mode 100644 templates/install/layout.tpl create mode 100644 templates/install/step-2.html create mode 100644 templates/install/step-3.html create mode 100644 templates/install/step-4.html create mode 100644 templates/install/step-5.html create mode 100644 templates/install/thanks.html diff --git a/core/lib/Thelia/Config/Resources/routing/install.xml b/core/lib/Thelia/Config/Resources/routing/install.xml index d53763948..37ddde487 100644 --- a/core/lib/Thelia/Config/Resources/routing/install.xml +++ b/core/lib/Thelia/Config/Resources/routing/install.xml @@ -4,12 +4,28 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> - + Thelia\Controller\Install\InstallController::index - + Thelia\Controller\Install\InstallController::checkPermission + + Thelia\Controller\Install\InstallController::databaseConnection + + + + Thelia\Controller\Install\InstallController::databaseSelection + + + + Thelia\Controller\Install\InstallController::generalInformation + + + + Thelia\Controller\Install\InstallController::thanks + + diff --git a/core/lib/Thelia/Controller/Install/BaseInstallController.php b/core/lib/Thelia/Controller/Install/BaseInstallController.php index 35293904e..bac7a4f19 100644 --- a/core/lib/Thelia/Controller/Install/BaseInstallController.php +++ b/core/lib/Thelia/Controller/Install/BaseInstallController.php @@ -39,7 +39,7 @@ class BaseInstallController extends BaseController { $parser = $this->container->get("thelia.parser"); - // Define the template thant shoud be used + // Define the template that shoud be used $parser->setTemplate("install"); return $parser; diff --git a/core/lib/Thelia/Controller/Install/InstallController.php b/core/lib/Thelia/Controller/Install/InstallController.php index 0514ba0ff..40e6643db 100644 --- a/core/lib/Thelia/Controller/Install/InstallController.php +++ b/core/lib/Thelia/Controller/Install/InstallController.php @@ -33,18 +33,61 @@ class InstallController extends BaseInstallController { public function index() { - $this->verifyStep(1); + //$this->verifyStep(1); $this->getSession()->set("step", 1); - $this->render("index.html"); + return $this->render("index.html"); } public function checkPermission() { - $this->verifyStep(2); + //$this->verifyStep(2); - $permission = new CheckPermission(); + //$permission = new CheckPermission(); + + $this->getSession()->set("step", 2); + return $this->render("step-2.html"); + } + + public function databaseConnection() + { + //$this->verifyStep(2); + + //$permission = new CheckPermission(); + + $this->getSession()->set("step", 3); + return $this->render("step-3.html"); + } + + public function databaseSelection() + { + //$this->verifyStep(2); + + //$permission = new CheckPermission(); + + $this->getSession()->set("step", 4); + return $this->render("step-4.html"); + } + + public function generalInformation() + { + //$this->verifyStep(2); + + //$permission = new CheckPermission(); + + $this->getSession()->set("step", 5); + return $this->render("step-5.html"); + } + + public function thanks() + { + //$this->verifyStep(2); + + //$permission = new CheckPermission(); + + $this->getSession()->set("step", 6); + return $this->render("thanks.html"); } protected function verifyStep($step) diff --git a/core/lib/Thelia/Install/BaseInstall.php b/core/lib/Thelia/Install/BaseInstall.php index 58c510267..11b8d0999 100644 --- a/core/lib/Thelia/Install/BaseInstall.php +++ b/core/lib/Thelia/Install/BaseInstall.php @@ -34,9 +34,10 @@ abstract class BaseInstall */ public function __construct($verifyInstall = true) { + /* TODO : activate this part if (file_exists(THELIA_ROOT . '/local/config/database.yml') && $verifyInstall) { throw new AlreadyInstallException("Thelia is already installed"); - } + }*/ $this->exec(); diff --git a/templates/admin/default/assets/less/thelia/thelia.less b/templates/admin/default/assets/less/thelia/thelia.less index ac525566f..50cd9bde6 100644 --- a/templates/admin/default/assets/less/thelia/thelia.less +++ b/templates/admin/default/assets/less/thelia/thelia.less @@ -8,6 +8,7 @@ @import "modals.less"; @import "tables.less"; @import "tablesorter.less"; +@import "wizard.less"; @import "bootstrap-editable.less"; @import "bootstrap-switch.less"; diff --git a/templates/admin/default/assets/less/thelia/wizard.less b/templates/admin/default/assets/less/thelia/wizard.less new file mode 100644 index 000000000..0d130a2d5 --- /dev/null +++ b/templates/admin/default/assets/less/thelia/wizard.less @@ -0,0 +1,129 @@ +.wizard { + background-color: #fff; + border: 1px solid #d4d4d4; + border-radius: 4px; + .box-shadow(0 1px 4px rgba(0, 0, 0, 0.065)); + *zoom: 1; + margin-bottom: 20px; + + &:before, + &:after { + display: table; + line-height: 0; + content: ""; + clear: both; + } + + ul { + padding: 0; + margin: 0; + list-style: none outside none; + } + + li { + position: relative; + float: left; + height: 46px; + padding: 0 10px 0 30px; + margin: 0; + font-size: 15px; + line-height: 46px; + color: #999999; + cursor: default; + background: #ededed; + + &.complete { + color: #468847; + background: #f3f4f5; + + &:hover{ + background: #e8e8e8; + + .chevron:before { + border-left: 14px solid #e8e8e8; + } + } + + a{ + color: inherit; + text-decoration: none; + font-weight: normal; + } + + .chevron:before { + border-left: 14px solid #f3f4f5; + } + + } + + &.active { + color: @link-color; + background: #fff; + + .chevron:before { + border-left: 14px solid #fff; + } + } + + .chevron { + position: absolute; + top: 0; + right: -14px; + display: block; + border: 24px solid transparent; + border-right: 0; + border-left: 14px solid #d4d4d4; + + &:before { + position: absolute; + top: -24px; + right: 1px; + display: block; + border: 24px solid transparent; + border-right: 0; + border-left: 14px solid #ededed; + content: ""; + } + + } + + .badge { + margin-right: 8px; + } + + &:nth-child(1) { + z-index: 10; + padding-left: 20px; + border-radius: 4px 0 0 4px; + } + &:nth-child(2) { + z-index: 9; + } + &:nth-child(3) { + z-index: 8; + } + &:nth-child(4) { + z-index: 7; + } + &:nth-child(5) { + z-index: 6; + } + &:nth-child(6) { + z-index: 5; + } + &:nth-child(7) { + z-index: 4; + } + &:nth-child(8) { + z-index: 3; + } + &:nth-child(9) { + z-index: 2; + } + &:nth-child(10) { + z-index: 1; + } + + } + +} \ No newline at end of file diff --git a/templates/install/index.html b/templates/install/index.html index a996cc241..dd1d5f62b 100644 --- a/templates/install/index.html +++ b/templates/install/index.html @@ -1,12 +1,46 @@ -{extends file="layout.html"} -{block name="content"} -

{intl l="Thelia installation wizard"}

-
+{extends file="layout.tpl"} - {intl l="Bienvenue au sein du programme d'installation de Thelia."}
- {intl l="Nous allons vous guider tout au long de ce processus afin d'installer l'application sur votre système."}

+{block name="page-title"}{intl l='Installation'}{/block} -
- -
+{block name="main-content"} +
+
+ +
+
+
+ +

{intl l="Thelia installation wizard"}

+ +
+
    +
  • 1{intl l="Welcome"}
  • +
  • 2{intl l="Checking permissions"}
  • +
  • 3{intl l="Database connection"}
  • +
  • 4{intl l="Database selection"}
  • +
  • 5{intl l="General information"}
  • +
  • 6{intl l="Thanks"}
  • +
+
+ +
+

+ {intl l="Welcome in the Thelia installation wizard."} +

+

+ {intl l="We will guide you throughout this process to install any application on your system."} +

+ +
+ + + +
+
+
+ +
+
{/block} \ No newline at end of file diff --git a/templates/install/layout.html b/templates/install/layout.html deleted file mode 100644 index 0a13586ad..000000000 --- a/templates/install/layout.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - {block name="title"}Thelia Install{/block} - - {images file='../admin/default/assets/img/favicon.ico'}{/images} - - - - {stylesheets file='../admin/default/assets/bootstrap/css/bootstrap.css' filters='cssembed'} - - {/stylesheets} - - {stylesheets file='../admin/default/assets/bootstrap/css/bootstrap-responsive.css' filters='cssembed'} - - {/stylesheets} - - - {stylesheets file='../admin/default/assets/css/*' filters='less,cssembed'} - - {/stylesheets} - - - -
-
-
{intl l='Version %ver' ver="{$THELIA_VERSION}"}
-
-
-
- {block name="content"}{/block} -
- -
- - - - \ No newline at end of file diff --git a/templates/install/layout.tpl b/templates/install/layout.tpl new file mode 100644 index 000000000..4539ce32f --- /dev/null +++ b/templates/install/layout.tpl @@ -0,0 +1,62 @@ + + + + {block name="page-title"}Thelia Install{/block} + + {images file='../admin/default/assets/img/favicon.ico'}{/images} + + + + {stylesheets file='../admin/default/assets/less/*' filters='less,cssembed'} + + {/stylesheets} + + + +
+
+ +
+
+
{intl l='Version %ver' ver="{$THELIA_VERSION}"}
+
+
+ +
+
+ + {* -- Main page content section ----------------------------------------- *} + + {block name="main-content"}Put here the content of the template{/block} + + {* -- Footer section ---------------------------------------------------- *} + +
+ + + {* -- Javascript section ------------------------------------------------ *} + + + + {block name="after-javascript-include"}{/block} + + {javascripts file='../admin/default/assets/js/bootstrap/bootstrap.js'} + + {/javascripts} + + {block name="javascript-initialization"}{/block} + + + \ No newline at end of file diff --git a/templates/install/step-2.html b/templates/install/step-2.html new file mode 100644 index 000000000..fc24d25cb --- /dev/null +++ b/templates/install/step-2.html @@ -0,0 +1,51 @@ +{extends file="layout.tpl"} + +{block name="page-title"}{intl l='Installation step 2'}{/block} + +{block name="main-content"} +
+
+ +
+
+
+ +

{intl l="Thelia installation wizard"}

+ +
+
    +
  • 1{intl l="Welcome"}
  • +
  • 2{intl l="Checking permissions"}
  • +
  • 3{intl l="Database connection"}
  • +
  • 4{intl l="Database selection"}
  • +
  • 5{intl l="General information"}
  • +
  • 6{intl l="Thanks"}
  • +
+
+ +
+

We will check some rights to files and directories...

+
    +
  • Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
  • +
  • Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
  • +
  • Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
  • +
  • Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
  • +
  • Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
  • +
  • Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
  • +
  • Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
  • +
+ +
+ + + +
+
+
+ +
+
+{/block} \ No newline at end of file diff --git a/templates/install/step-3.html b/templates/install/step-3.html new file mode 100644 index 000000000..cb4157dd7 --- /dev/null +++ b/templates/install/step-3.html @@ -0,0 +1,56 @@ +{extends file="layout.tpl"} + +{block name="page-title"}{intl l='Installation step 3'}{/block} + +{block name="main-content"} +
+
+ +
+
+
+ +

{intl l="Thelia installation wizard"}

+ +
+ +
+ +
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ + + +
+
+
+ +
+
+{/block} \ No newline at end of file diff --git a/templates/install/step-4.html b/templates/install/step-4.html new file mode 100644 index 000000000..981be34bb --- /dev/null +++ b/templates/install/step-4.html @@ -0,0 +1,77 @@ +{extends file="layout.tpl"} + +{block name="page-title"}{intl l='Installation step 4'}{/block} + +{block name="main-content"} +
+
+ +
+
+
+ +

{intl l="Thelia installation wizard"}

+ +
+ +
+ +
+
+
+ {intl l="Choose your database"} +

+ The SQL server contains multiple databases.
+ Select below the one you want to use. +

+ +
+ +
+
+ +
+ +

+ {intl l="or"} +

+ +
+ +
+ +
+ +
+
+
+
+ + + +
+
+
+ +
+
+{/block} \ No newline at end of file diff --git a/templates/install/step-5.html b/templates/install/step-5.html new file mode 100644 index 000000000..611a86a20 --- /dev/null +++ b/templates/install/step-5.html @@ -0,0 +1,72 @@ +{extends file="layout.tpl"} + +{block name="page-title"}{intl l='Installation step 4'}{/block} + +{block name="main-content"} +
+
+ +
+
+
+ +

{intl l="Thelia installation wizard"}

+ + + +
+
+ +

+ The system will now you create a custom site access. +

+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+ + + +
+
+
+ +
+
+{/block} \ No newline at end of file diff --git a/templates/install/thanks.html b/templates/install/thanks.html new file mode 100644 index 000000000..b6ed27065 --- /dev/null +++ b/templates/install/thanks.html @@ -0,0 +1,42 @@ +{extends file="layout.tpl"} + +{block name="page-title"}{intl l='Thanks'}{/block} + +{block name="main-content"} +
+
+ +
+
+
+ +

{intl l="Thelia installation wizard"}

+ + + +
+

+ {intl l="Thank you have installed Thelia"}. +

+

+ {intl l="You will be redirected to your personal space in order to manage your store now."} +

+ +
+ +
+
+
+ +
+
+{/block} \ No newline at end of file