diff --git a/PHPCI/Controller/ProjectController.php b/PHPCI/Controller/ProjectController.php index 47894266..bd11f846 100644 --- a/PHPCI/Controller/ProjectController.php +++ b/PHPCI/Controller/ProjectController.php @@ -262,13 +262,13 @@ class ProjectController extends \PHPCI\Controller $field->setPattern('^(github|bitbucket|remote|local)'); $field->setOptions($options); $field->setLabel('Where is your project hosted?'); - $field->setClass('span4'); + $field->setClass('col-lg-4 form-control'); $form->addField($field); if (isset($_SESSION['github_token'])) { $field = new Form\Element\Select('github'); $field->setLabel('Choose a Github repository:'); - $field->setClass('span4'); + $field->setClass('col-lg-4 form-control'); $field->setOptions($this->getGithubRepositories()); $form->addField($field); } @@ -302,24 +302,25 @@ class ProjectController extends \PHPCI\Controller $field->setRequired(true); $field->setValidator($referenceValidator); $field->setLabel('Repository Name / URL (Remote) or Path (Local)'); - $field->setClass('span4'); + $field->setClass('col-lg-4 form-control'); $form->addField($field); $field = new Form\Element\Text('title'); $field->setRequired(true); $field->setLabel('Project Title'); - $field->setClass('span4'); + $field->setClass('col-lg-4 form-control'); $form->addField($field); $field = new Form\Element\TextArea('key'); $field->setRequired(false); $field->setLabel('Private key to use to access repository (leave blank for local and/or anonymous remotes)'); - $field->setClass('span7'); + $field->setClass('col-lg-7 form-control'); $field->setRows(6); $form->addField($field); $field = new Form\Element\Submit(); $field->setValue('Save Project'); + $field->setContainerClass('form-group'); $field->setClass('btn-success'); $form->addField($field); diff --git a/PHPCI/Controller/SessionController.php b/PHPCI/Controller/SessionController.php index 214f9921..b6fd0a43 100644 --- a/PHPCI/Controller/SessionController.php +++ b/PHPCI/Controller/SessionController.php @@ -47,13 +47,13 @@ class SessionController extends \PHPCI\Controller $email = new b8\Form\Element\Email('email'); $email->setLabel('Email Address'); $email->setRequired(true); - $email->setClass('span3'); + $email->setContainerClass('form-group'); $form->addField($email); $pwd = new b8\Form\Element\Password('password'); $pwd->setLabel('Password'); $pwd->setRequired(true); - $pwd->setClass('span3'); + $pwd->setContainerClass('form-group'); $form->addField($pwd); $pwd = new b8\Form\Element\Submit(); diff --git a/PHPCI/Helper/Build.php b/PHPCI/Helper/Build.php new file mode 100644 index 00000000..3aa7403f --- /dev/null +++ b/PHPCI/Helper/Build.php @@ -0,0 +1,24 @@ + + * @package PHPCI + * @subpackage Web + */ +class Build +{ + public function formatPluginName($name) + { + return str_replace('Php', 'PHP', ucwords(str_replace('_', ' ', $name))); + } +} diff --git a/PHPCI/View/Build/view.phtml b/PHPCI/View/Build/view.phtml index f57a1a45..25ea8809 100644 --- a/PHPCI/View/Build/view.phtml +++ b/PHPCI/View/Build/view.phtml @@ -4,21 +4,20 @@
-
-
-
-
+
diff --git a/PHPCI/View/BuildsTable.phtml b/PHPCI/View/BuildsTable.phtml index 34a5ca72..aa177832 100644 --- a/PHPCI/View/BuildsTable.phtml +++ b/PHPCI/View/BuildsTable.phtml @@ -48,28 +48,20 @@ switch($build->getStatus()) $plugins = array(); } if ( 0 === count($plugins) ) { - ?> - - - - $pluginstatus): $subcls = $pluginstatus?'label label-success':'label label-important'; - ?> - - - - + ?> Build()->formatPluginName($plugin); ?>
- View + View User()->getIsAdmin()): ?> -
-
-
-
-
+ +
+

Project Overview

@@ -49,7 +50,7 @@ - + @@ -66,7 +67,7 @@ - + diff --git a/PHPCI/View/Project/view.phtml b/PHPCI/View/Project/view.phtml index 77d488fc..3067f5ed 100644 --- a/PHPCI/View/Project/view.phtml +++ b/PHPCI/View/Project/view.phtml @@ -3,13 +3,13 @@
-
-
-
-
+
Last Success Last Failure Success/Failures
Commit Branch Status
@@ -49,7 +48,7 @@ - + @@ -59,7 +58,7 @@
    '; + print '
      '; $pages = ceil($total / 10); $pages = $pages == 0 ? 1 : $pages; diff --git a/PHPCI/View/ProjectForm.phtml b/PHPCI/View/ProjectForm.phtml index e52cbd9e..d683bff1 100644 --- a/PHPCI/View/ProjectForm.phtml +++ b/PHPCI/View/ProjectForm.phtml @@ -3,7 +3,7 @@
    -
    +

    To make it easier to get started, we've generated a public / private key pair for you to use for this project. To use it, just add the following public key to the "deploy keys" section of your repository settings on Github / Bitbucket.

    @@ -16,8 +16,8 @@
    -
    - +
    +
    diff --git a/PHPCI/View/SummaryTable.phtml b/PHPCI/View/SummaryTable.phtml index 3db900b2..416f61e0 100644 --- a/PHPCI/View/SummaryTable.phtml +++ b/PHPCI/View/SummaryTable.phtml @@ -109,6 +109,6 @@ foreach($projects as $projectId => $project):
- + \ No newline at end of file diff --git a/PHPCI/View/layout.phtml b/PHPCI/View/layout.phtml index 2db749d3..30d789d5 100644 --- a/PHPCI/View/layout.phtml +++ b/PHPCI/View/layout.phtml @@ -15,19 +15,27 @@ ').addClass(data.plugins[plugin] ? 'success' : 'error'); - var name = $('
Commit Branch Status
/buildbuild now »
').html('' + plugin + ''); + var name = $('').html('' + formatPluginName(plugin) + ''); var status = $('').text(data.plugins[plugin] ? 'OK' : 'Failed'); row.append(name); @@ -168,4 +168,19 @@ function setupProjectForm() $('#element-token').val(''); } }); +} + + +function formatPluginName (name) { + name = name.replace(new RegExp('_', 'g'), ' '); + name = ucwords(name); + name = name.replace(new RegExp('Php', 'g'), 'PHP'); + + return name; +} + +function ucwords (str) { + return (str + '').replace(/^([a-z\u00E0-\u00FC])|\s+([a-z\u00E0-\u00FC])/g, function ($1) { + return $1.toUpperCase(); + }); } \ No newline at end of file diff --git a/index.php b/index.php index b4685c7d..a0b81e9d 100644 --- a/index.php +++ b/index.php @@ -16,3 +16,4 @@ require_once('bootstrap.php'); $fc = new PHPCI\Application($config, new b8\Http\Request()); print $fc->handleRequest(); +