From 35872c34c00dcfce9197a38bbdfa6da0672ddfa8 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 6 May 2014 20:49:15 +1200 Subject: [PATCH] UNFINISHED Bootstrap theme --- code/TestSessionController.php | 12 ++++--- templates/Layout/TestSession_end.ss | 9 +++++ templates/Layout/TestSession_inprogress.ss | 19 +++++++++++ templates/Layout/TestSession_start.ss | 2 ++ templates/TestSession.ss | 14 ++++++++ templates/TestSession_end.ss | 26 --------------- templates/TestSession_inprogress.ss | 38 ---------------------- templates/TestSession_start.ss | 19 ----------- 8 files changed, 52 insertions(+), 87 deletions(-) create mode 100644 templates/Layout/TestSession_end.ss create mode 100644 templates/Layout/TestSession_inprogress.ss create mode 100644 templates/Layout/TestSession_start.ss create mode 100644 templates/TestSession.ss delete mode 100644 templates/TestSession_end.ss delete mode 100644 templates/TestSession_inprogress.ss delete mode 100644 templates/TestSession_start.ss diff --git a/code/TestSessionController.php b/code/TestSessionController.php index 275a94d..e3650b0 100644 --- a/code/TestSessionController.php +++ b/code/TestSessionController.php @@ -44,7 +44,10 @@ class TestSessionController extends Controller { ); if(!$canAccess) return Security::permissionFailure($this); + Requirements::css('//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css'); + Requirements::css('//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css'); Requirements::javascript('framework/thirdparty/jquery/jquery.js'); + Requirements::javascript('//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js'); Requirements::javascript('testsession/javascript/testsession.js'); } @@ -54,9 +57,9 @@ class TestSessionController extends Controller { public function index() { if($this->environment->isRunningTests()) { - return $this->renderWith('TestSession_inprogress'); + return $this->renderWith('TestSession', 'TestSession_inprogress'); } else { - return $this->renderWith('TestSession_start'); + return $this->renderWith(array('TestSession', 'TestSession_start')); } } @@ -109,7 +112,7 @@ class TestSessionController extends Controller { $this->environment->loadFixtureIntoDb($fixtureFile); } - return $this->renderWith('TestSession_inprogress'); + return $this->renderWith('TestSession', 'TestSession_inprogress'); } /** @@ -161,7 +164,8 @@ class TestSessionController extends Controller { 'StartForm', $fields, new FieldList( - new FormAction('start', 'Start Session') + FormAction::create('start', 'Start Session') + ->addExtraClass('btn btn-primary btn-lg') ) ); diff --git a/templates/Layout/TestSession_end.ss b/templates/Layout/TestSession_end.ss new file mode 100644 index 0000000..b35c842 --- /dev/null +++ b/templates/Layout/TestSession_end.ss @@ -0,0 +1,9 @@ +

Test session ended.

+ \ No newline at end of file diff --git a/templates/Layout/TestSession_inprogress.ss b/templates/Layout/TestSession_inprogress.ss new file mode 100644 index 0000000..9bb8f08 --- /dev/null +++ b/templates/Layout/TestSession_inprogress.ss @@ -0,0 +1,19 @@ + +

+ Test session in progress. + Click here to end it. +

+

Where would you like to start?

+ +<% include TestSession_State %> +$ProgressForm \ No newline at end of file diff --git a/templates/Layout/TestSession_start.ss b/templates/Layout/TestSession_start.ss new file mode 100644 index 0000000..f4c6aa0 --- /dev/null +++ b/templates/Layout/TestSession_start.ss @@ -0,0 +1,2 @@ +

A test session will create a "blank slate" that you can run manual acceptance tests against

+$StartForm \ No newline at end of file diff --git a/templates/TestSession.ss b/templates/TestSession.ss new file mode 100644 index 0000000..fc7ba7f --- /dev/null +++ b/templates/TestSession.ss @@ -0,0 +1,14 @@ + + + + + <% base_tag %> + $MetaTags + + +
+

SilverStripe TestSession

+ $Layout +
+ + \ No newline at end of file diff --git a/templates/TestSession_end.ss b/templates/TestSession_end.ss deleted file mode 100644 index 85df4fd..0000000 --- a/templates/TestSession_end.ss +++ /dev/null @@ -1,26 +0,0 @@ - - - - - <% base_tag %> - $MetaTags - <% require css('framework/css/debug.css') %> - <% require css('testsession/css/styles.css') %> - - -
-

SilverStripe TestSession

-
-
-

Test session ended.

- -
- - \ No newline at end of file diff --git a/templates/TestSession_inprogress.ss b/templates/TestSession_inprogress.ss deleted file mode 100644 index 4c343a7..0000000 --- a/templates/TestSession_inprogress.ss +++ /dev/null @@ -1,38 +0,0 @@ - - - - - <% base_tag %> - $MetaTags - <% require css('framework/css/debug.css') %> - <% require css('testsession/css/styles.css') %> - - -
-

SilverStripe TestSession

-
-
- -

- Test session in progress. - Click here to end it. -

-

Where would you like to start?

- - <% include TestSession_State %> - $ProgressForm -
- - - - diff --git a/templates/TestSession_start.ss b/templates/TestSession_start.ss deleted file mode 100644 index fde3206..0000000 --- a/templates/TestSession_start.ss +++ /dev/null @@ -1,19 +0,0 @@ - - - - - <% base_tag %> - $MetaTags - <% require css('framework/css/debug.css') %> - <% require css('testsession/css/styles.css') %> - - -
-

SilverStripe TestSession

-
-
-

Start a new test session

- $StartForm -
- - \ No newline at end of file