Upgraded bootstrap to 3.0RC1.

This commit is contained in:
Qiang Xue 2013-08-08 20:00:48 -04:00
parent 2285c83fb8
commit f6c54739ff
6 changed files with 144 additions and 132 deletions

View File

@ -24,6 +24,6 @@ class AppAsset extends AssetBundle
); );
public $depends = array( public $depends = array(
'yii\web\YiiAsset', 'yii\web\YiiAsset',
'yii\bootstrap\ResponsiveAsset', 'yii\bootstrap\BootstrapAsset',
); );
} }

View File

@ -21,26 +21,19 @@ app\config\AppAsset::register($this);
<?php $this->beginBody(); ?> <?php $this->beginBody(); ?>
<div class="container"> <div class="container">
<div class="masthead"> <div class="masthead">
<h3 class="muted">My Company</h3> <h3 class="text-muted">My Company</h3>
<div class="navbar fullwidth"> <?php echo Menu::widget(array(
<div class="navbar-inner"> 'options' => array('class' => 'nav navbar-nav nav-justified'),
<div class="container"> 'items' => array(
<?php echo Menu::widget(array( array('label' => 'Home', 'url' => array('/site/index')),
'options' => array('class' => 'nav'), array('label' => 'About', 'url' => array('/site/about')),
'items' => array( array('label' => 'Contact', 'url' => array('/site/contact')),
array('label' => 'Home', 'url' => array('/site/index')), Yii::$app->user->isGuest ?
array('label' => 'About', 'url' => array('/site/about')), array('label' => 'Login', 'url' => array('/site/login')) :
array('label' => 'Contact', 'url' => array('/site/contact')), array('label' => 'Logout (' . Yii::$app->user->identity->username .')' , 'url' => array('/site/logout')),
Yii::$app->user->isGuest ? ),
array('label' => 'Login', 'url' => array('/site/login')) : )); ?>
array('label' => 'Logout (' . Yii::$app->user->identity->username .')' , 'url' => array('/site/logout')),
),
)); ?>
</div>
</div>
</div>
<!-- /.navbar -->
</div> </div>
<?php echo Breadcrumbs::widget(array( <?php echo Breadcrumbs::widget(array(
@ -48,8 +41,6 @@ app\config\AppAsset::register($this);
)); ?> )); ?>
<?php echo $content; ?> <?php echo $content; ?>
<hr>
<div class="footer"> <div class="footer">
<p>&copy; My Company <?php echo date('Y'); ?></p> <p>&copy; My Company <?php echo date('Y'); ?></p>
<p> <p>

View File

@ -23,18 +23,20 @@ $this->params['breadcrumbs'][] = $this->title;
If you have business inquiries or other questions, please fill out the following form to contact us. Thank you. If you have business inquiries or other questions, please fill out the following form to contact us. Thank you.
</p> </p>
<?php $form = ActiveForm::begin(array( <div class="row">
'options' => array('class' => 'form-horizontal', 'id' => 'contact-form'), <div class="col-lg-5">
'fieldConfig' => array('inputOptions' => array('class' => 'input-xlarge')), <?php $form = ActiveForm::begin(array('id' => 'contact-form')); ?>
)); ?> <?php echo $form->field($model, 'name')->textInput(); ?>
<?php echo $form->field($model, 'name')->textInput(); ?> <?php echo $form->field($model, 'email')->textInput(); ?>
<?php echo $form->field($model, 'email')->textInput(); ?> <?php echo $form->field($model, 'subject')->textInput(); ?>
<?php echo $form->field($model, 'subject')->textInput(); ?> <?php echo $form->field($model, 'body')->textArea(array('rows' => 6)); ?>
<?php echo $form->field($model, 'body')->textArea(array('rows' => 6)); ?> <?php echo $form->field($model, 'verifyCode')->widget(Captcha::className(), array(
<?php echo $form->field($model, 'verifyCode')->widget(Captcha::className(), array( 'options' => array('class' => 'form-control'),
'options' => array('class' => 'input-medium'), 'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-6">{input}</div></div>',
)); ?> )); ?>
<div class="form-actions"> <div class="form-actions">
<?php echo Html::submitButton('Submit', array('class' => 'btn btn-primary')); ?> <?php echo Html::submitButton('Submit', array('class' => 'btn btn-primary')); ?>
</div>
<?php ActiveForm::end(); ?>
</div> </div>
<?php ActiveForm::end(); ?> </div>

View File

@ -8,40 +8,43 @@ $this->title = 'Welcome';
<h1>Welcome!</h1> <h1>Welcome!</h1>
<p class="lead">Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus <p class="lead">Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus
commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p> commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet.</p>
<a class="btn btn-large btn-success" href="http://www.yiiframework.com">Get started with Yii</a>
<p><a class="btn btn-large btn-success" href="http://www.yiiframework.com">Get started with Yii</a></p>
</div> </div>
<hr> <div class="body-content">
<!-- Example row of columns --> <!-- Example row of columns -->
<div class="row-fluid"> <div class="row">
<div class="span4"> <div class="col-lg-4">
<h2>Heading</h2> <h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris
condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis
Donec sed odio dui. </p> euismod. Donec sed odio dui. </p>
<p><a class="btn" href="#">View details &raquo;</a></p> <p><a class="btn btn-default" href="#">View details &raquo;</a></p>
</div>
<div class="col-lg-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris
condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis
euismod. Donec sed odio dui. </p>
<p><a class="btn btn-default" href="#">View details &raquo;</a></p>
</div>
<div class="col-lg-4">
<h2>Heading</h2>
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula
porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut
fermentum massa.</p>
<p><a class="btn btn-default" href="#">View details &raquo;</a></p>
</div>
</div> </div>
<div class="span4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris
condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod.
Donec sed odio dui. </p>
<p><a class="btn" href="#">View details &raquo;</a></p>
</div>
<div class="span4">
<h2>Heading</h2>
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta
felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum
massa.</p>
<p><a class="btn" href="#">View details &raquo;</a></p>
</div>
</div> </div>

View File

@ -14,11 +14,15 @@ $this->params['breadcrumbs'][] = $this->title;
<p>Please fill out the following fields to login:</p> <p>Please fill out the following fields to login:</p>
<?php $form = ActiveForm::begin(array('options' => array('class' => 'form-horizontal', 'id' => 'login-form'))); ?> <div class="row">
<?php echo $form->field($model, 'username')->textInput(); ?> <div class="col-lg-3">
<?php echo $form->field($model, 'password')->passwordInput(); ?> <?php $form = ActiveForm::begin(array('id' => 'login-form')); ?>
<?php echo $form->field($model, 'rememberMe')->checkbox(); ?> <?php echo $form->field($model, 'username')->textInput(); ?>
<div class="form-actions"> <?php echo $form->field($model, 'password')->passwordInput(); ?>
<?php echo Html::submitButton('Login', array('class' => 'btn btn-primary')); ?> <?php echo $form->field($model, 'rememberMe', array('options' => array('class' => 'checkbox')))->checkbox(); ?>
<div class="form-actions">
<?php echo Html::submitButton('Login', array('class' => 'btn btn-primary')); ?>
</div>
<?php ActiveForm::end(); ?>
</div> </div>
<?php ActiveForm::end(); ?> </div>

View File

@ -1,78 +1,90 @@
body { body {
padding-top: 20px; padding-top: 20px;
padding-bottom: 60px;
} }
/* Custom container */ /* Everything but the jumbotron gets side spacing for mobile-first views */
.container { .masthead,
margin: 0 auto; .body-content,
max-width: 1000px; .footer {
padding-left: 15px;
padding-right: 15px;
} }
.container > hr { .masthead:before,
margin: 60px 0; .masthead:after {
display: table;
content: " ";
}
.masthead:after {
clear: both;
}
.footer {
border-top: 1px solid #ddd;
margin-top: 30px;
padding-top: 29px;
padding-bottom: 30px;
} }
/* Main marketing message and sign up button */ /* Main marketing message and sign up button */
.jumbotron { .jumbotron {
margin: 80px 0; text-align: center;
text-align: center; background-color: transparent;
} }
.jumbotron h1 {
font-size: 100px;
line-height: 1;
}
.jumbotron .lead {
font-size: 24px;
line-height: 1.25;
}
.jumbotron .btn { .jumbotron .btn {
font-size: 21px; font-size: 21px;
padding: 14px 24px; padding: 14px 24px;
} }
/* Supporting marketing content */ /* Customize the nav-justified links to be fill the entire space of the .navbar */
.marketing { .nav-justified {
margin: 60px 0; max-height: 50px;
background-color: #eee;
border-radius: 5px;
border: 1px solid #ccc;
}
.nav-justified > li > a {
padding-top: 15px;
padding-bottom: 15px;
color: #777;
font-weight: bold;
text-align: center;
border-left: 1px solid rgba(255,255,255,.75);
border-right: 1px solid rgba(0,0,0,.1);
background-color: #e5e5e5; /* Old browsers */
background-repeat: repeat-x; /* Repeat the gradient */
background-image: -moz-linear-gradient(top, #f5f5f5 0%, #e5e5e5 100%); /* FF3.6+ */
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(100%,#e5e5e5)); /* Chrome,Safari4+ */
background-image: -webkit-linear-gradient(top, #f5f5f5 0%,#e5e5e5 100%); /* Chrome 10+,Safari 5.1+ */
background-image: -ms-linear-gradient(top, #f5f5f5 0%,#e5e5e5 100%); /* IE10+ */
background-image: -o-linear-gradient(top, #f5f5f5 0%,#e5e5e5 100%); /* Opera 11.10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#e5e5e5',GradientType=0 ); /* IE6-9 */
background-image: linear-gradient(top, #f5f5f5 0%,#e5e5e5 100%); /* W3C */
}
.nav-justified > .active > a {
background-color: #ddd;
background-image: none;
box-shadow: inset 0 3px 7px rgba(0,0,0,.15);
}
.nav-justified > li:first-child > a {
border-left: 0;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
}
.nav-justified > li:last-child > a {
border-right: 0;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
} }
.marketing p + h4 {
margin-top: 28px;
}
/* Customize the navbar links to be fill the entire space of the .navbar */ /* Responsive: Portrait tablets and up */
.navbar.fullwidth .navbar-inner { @media screen and (min-width: 768px) {
padding: 0; /* Remove the padding we set earlier */
} .masthead,
.marketing,
.navbar.fullwidth .nav { .footer {
margin: 0; padding-left: 0;
display: table; padding-right: 0;
width: 100%; }
}
.navbar.fullwidth .nav li {
display: table-cell;
width: 1%;
float: none;
}
.navbar.fullwidth .nav li a {
font-weight: bold;
text-align: center;
border-left: 1px solid rgba(255, 255, 255, .75);
border-right: 1px solid rgba(0, 0, 0, .1);
}
.navbar.fullwidth .nav li:first-child a {
border-left: 0;
border-radius: 3px 0 0 3px;
}
.navbar.fullwidth .nav li:last-child a {
border-right: 0;
border-radius: 0 3px 3px 0;
} }