Commits

Anonymous committed ee531ea

Add bootstrap theme

Comments (0)

Files changed (7)

theme/css/styles.css

+#page {
+    padding-top: 60px;
+}

theme/views/.htaccess

+deny from all

theme/views/layouts/column2.php

+<?php /* @var $this Controller */ ?>
+<?php $this->beginContent('//layouts/main'); ?>
+<div class="row">
+    <div class="span9">
+        <div id="content">
+            <?php echo $content; ?>
+        </div><!-- content -->
+    </div>
+    <div class="span3">
+        <div id="sidebar">
+        <?php
+            $this->beginWidget('zii.widgets.CPortlet', array(
+                'title'=>'Operations',
+            ));
+            $this->widget('bootstrap.widgets.TbMenu', array(
+                'items'=>$this->menu,
+                'htmlOptions'=>array('class'=>'operations'),
+            ));
+            $this->endWidget();
+        ?>
+        </div><!-- sidebar -->
+    </div>
+</div>
+<?php $this->endContent(); ?>

theme/views/layouts/main.php

+<?php /* @var $this Controller */ ?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+	<meta name="language" content="en" />
+
+    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/styles.css" />
+
+	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
+</head>
+
+<body>
+
+<?php $this->widget('bootstrap.widgets.TbNavbar',array(
+    'items'=>array(
+        array(
+            'class'=>'bootstrap.widgets.TbMenu',
+            'items'=>array(
+                array('label'=>'Home', 'url'=>array('/site/index')),
+                array('label'=>'About', 'url'=>array('/site/page', 'view'=>'about')),
+                array('label'=>'Contact', 'url'=>array('/site/contact')),
+                array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
+                array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)
+            ),
+        ),
+    ),
+)); ?>
+
+<div class="container" id="page">
+
+	<?php if(isset($this->breadcrumbs)):?>
+		<?php $this->widget('bootstrap.widgets.TbBreadcrumbs', array(
+			'links'=>$this->breadcrumbs,
+		)); ?><!-- breadcrumbs -->
+	<?php endif?>
+
+	<?php echo $content; ?>
+
+	<div class="clear"></div>
+
+	<div id="footer">
+		Copyright &copy; <?php echo date('Y'); ?> by My Company.<br/>
+		All Rights Reserved.<br/>
+		<?php echo Yii::powered(); ?>
+	</div><!-- footer -->
+
+</div><!-- page -->
+
+</body>
+</html>

theme/views/site/contact.php

+<?php
+/* @var $this SiteController */
+/* @var $model ContactForm */
+/* @var $form TbActiveForm */
+
+$this->pageTitle=Yii::app()->name . ' - Contact Us';
+$this->breadcrumbs=array(
+	'Contact',
+);
+?>
+
+<h1>Contact Us</h1>
+
+<?php if(Yii::app()->user->hasFlash('contact')): ?>
+
+    <?php $this->widget('bootstrap.widgets.TbAlert', array(
+        'alerts'=>array('contact'),
+    )); ?>
+
+<?php else: ?>
+
+<p>
+If you have business inquiries or other questions, please fill out the following form to contact us. Thank you.
+</p>
+
+<div class="form">
+
+<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(
+	'id'=>'contact-form',
+    'type'=>'horizontal',
+	'enableClientValidation'=>true,
+	'clientOptions'=>array(
+		'validateOnSubmit'=>true,
+	),
+)); ?>
+
+	<p class="note">Fields with <span class="required">*</span> are required.</p>
+
+	<?php echo $form->errorSummary($model); ?>
+
+    <?php echo $form->textFieldRow($model,'name'); ?>
+
+    <?php echo $form->textFieldRow($model,'email'); ?>
+
+    <?php echo $form->textFieldRow($model,'subject',array('size'=>60,'maxlength'=>128)); ?>
+
+    <?php echo $form->textAreaRow($model,'body',array('rows'=>6, 'class'=>'span8')); ?>
+
+	<?php if(CCaptcha::checkRequirements()): ?>
+		<?php echo $form->captchaRow($model,'verifyCode',array(
+            'hint'=>'Please enter the letters as they are shown in the image above.<br/>Letters are not case-sensitive.',
+        )); ?>
+	<?php endif; ?>
+
+	<div class="form-actions">
+		<?php $this->widget('bootstrap.widgets.TbButton',array(
+            'buttonType'=>'submit',
+            'type'=>'primary',
+            'label'=>'Submit',
+        )); ?>
+	</div>
+
+<?php $this->endWidget(); ?>
+
+</div><!-- form -->
+
+<?php endif; ?>

theme/views/site/index.php

+<?php
+/* @var $this SiteController */
+
+$this->pageTitle=Yii::app()->name;
+?>
+
+<?php $this->beginWidget('bootstrap.widgets.TbHeroUnit',array(
+    'heading'=>'Welcome to '.CHtml::encode(Yii::app()->name),
+)); ?>
+
+<p>Congratulations! You have successfully created your Yii application.</p>
+
+<?php $this->endWidget(); ?>
+
+<p>You may change the content of this page by modifying the following two files:</p>
+
+<ul>
+    <li>View file: <code><?php echo __FILE__; ?></code></li>
+    <li>Layout file: <code><?php echo $this->getLayoutFile('main'); ?></code></li>
+</ul>
+
+<p>For more details on how to further develop this application, please read
+    the <a href="http://www.yiiframework.com/doc/">documentation</a>.
+    Feel free to ask in the <a href="http://www.yiiframework.com/forum/">forum</a>,
+    should you have any questions.</p>

theme/views/site/login.php

+<?php
+/* @var $this SiteController */
+/* @var $model LoginForm */
+/* @var $form CActiveForm  */
+
+$this->pageTitle=Yii::app()->name . ' - Login';
+$this->breadcrumbs=array(
+	'Login',
+);
+?>
+
+<h1>Login</h1>
+
+<p>Please fill out the following form with your login credentials:</p>
+
+<div class="form">
+
+<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(
+	'id'=>'login-form',
+    'type'=>'horizontal',
+	'enableClientValidation'=>true,
+	'clientOptions'=>array(
+		'validateOnSubmit'=>true,
+	),
+)); ?>
+
+	<p class="note">Fields with <span class="required">*</span> are required.</p>
+
+	<?php echo $form->textFieldRow($model,'username'); ?>
+
+	<?php echo $form->passwordFieldRow($model,'password',array(
+        'hint'=>'Hint: You may login with <kbd>demo</kbd>/<kbd>demo</kbd> or <kbd>admin</kbd>/<kbd>admin</kbd>',
+    )); ?>
+
+	<?php echo $form->checkBoxRow($model,'rememberMe'); ?>
+
+	<div class="form-actions">
+		<?php $this->widget('bootstrap.widgets.TbButton', array(
+            'buttonType'=>'submit',
+            'type'=>'primary',
+            'label'=>'Login',
+        )); ?>
+	</div>
+
+<?php $this->endWidget(); ?>
+
+</div><!-- form -->