Commit 4b008ae0 by Alexander Makarov

Updated bootstrap to release version including wrappers and views

parent 8ea5858d
......@@ -11,7 +11,7 @@ $this->title = 'My Yii Application';
<p class="lead">You have successfully created your Yii-powered application.</p>
<p><a class="btn btn-large btn-success" href="http://www.yiiframework.com">Get started with Yii</a></p>
<p><a class="btn btn-lg btn-success" href="http://www.yiiframework.com">Get started with Yii</a></p>
</div>
<div class="body-content">
......
......@@ -11,7 +11,7 @@ $this->title = 'My Yii Application';
<p class="lead">You have successfully created your Yii-powered application.</p>
<p><a class="btn btn-large btn-success" href="http://www.yiiframework.com">Get started with Yii</a></p>
<p><a class="btn btn-lg btn-success" href="http://www.yiiframework.com">Get started with Yii</a></p>
</div>
<div class="body-content">
......
......@@ -11,7 +11,7 @@ $this->title = 'My Yii Application';
<p class="lead">You have successfully created your Yii-powered application.</p>
<p><a class="btn btn-large btn-success" href="http://www.yiiframework.com">Get started with Yii</a></p>
<p><a class="btn btn-lg btn-success" href="http://www.yiiframework.com">Get started with Yii</a></p>
</div>
<div class="body-content">
......
......@@ -18,6 +18,5 @@ class BootstrapAsset extends AssetBundle
public $sourcePath = '@yii/bootstrap/assets';
public $css = array(
'css/bootstrap.css',
'css/bootstrap-glyphicons.css',
);
}
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace yii\bootstrap;
use yii\web\AssetBundle;
/**
* Bootstrap 2 theme for Bootstrap 3
*
* @author Alexander Makarov <sam@rmcreative.ru>
* @since 2.0
*/
class BootstrapThemeAsset extends AssetBundle
{
public $sourcePath = '@yii/bootstrap/assets';
public $css = array(
'js/bootstrap-theme.css',
);
public $depends = array(
'yii\bootstrap\BootstrapAsset',
);
}
......@@ -17,7 +17,7 @@ use yii\helpers\Html;
* ```php
* echo Button::widget(array(
* 'label' => 'Action',
* 'options' => array('class' => 'btn-large'),
* 'options' => array('class' => 'btn-lg'),
* ));
* ```
* @see http://twitter.github.io/bootstrap/javascript.html#buttons
......
......@@ -28,10 +28,6 @@ class Dropdown extends Widget
* - url: string, optional, the url of the item link. Defaults to "#".
* - linkOptions: array, optional, the HTML attributes of the item link.
* - options: array, optional, the HTML attributes of the item.
* - items: array, optional, the dropdown items configuration array. if `items` is set, then `url` of the parent
* item will be ignored and automatically set to "#"
*
* @see https://github.com/twitter/bootstrap/issues/5050#issuecomment-11741727
*/
public $items = array();
/**
......@@ -80,13 +76,7 @@ class Dropdown extends Widget
$options = ArrayHelper::getValue($item, 'options', array());
$linkOptions = ArrayHelper::getValue($item, 'linkOptions', array());
$linkOptions['tabindex'] = '-1';
if (isset($item['items'])) {
Html::addCssClass($options, 'dropdown-submenu');
$content = Html::a($label, '#', $linkOptions) . $this->renderItems($item['items']);
} else {
$content = Html::a($label, ArrayHelper::getValue($item, 'url', '#'), $linkOptions);
}
$content = Html::a($label, ArrayHelper::getValue($item, 'url', '#'), $linkOptions);
$lines[] = Html::tag('li', $content, $options);
}
......
......@@ -199,7 +199,9 @@ class Modal extends Widget
protected function initOptions()
{
$this->options = array_merge(array(
'class' => 'modal fade',
'class' => 'fade',
'role' => 'dialog',
'tabindex' => -1,
), $this->options);
Html::addCssClass($this->options, 'modal');
......
......@@ -37,10 +37,6 @@ use yii\helpers\Html;
class NavBar extends Widget
{
/**
* @var boolean whether to enable a collapsing responsive navbar.
*/
public $responsive = true;
/**
* @var string the text of the brand. Note that this is not HTML-encoded.
* @see http://twitter.github.io/bootstrap/components.html#navbar
*/
......@@ -55,6 +51,7 @@ class NavBar extends Widget
*/
public $brandOptions = array();
public $screenReaderToggleText = 'Toggle navigation';
/**
* Initializes the widget.
......@@ -63,23 +60,23 @@ class NavBar extends Widget
{
parent::init();
$this->clientOptions = false;
Html::addCssClass($this->options, 'navbar');
Html::addCssClass($this->options, 'navbar navbar-default');
Html::addCssClass($this->brandOptions, 'navbar-brand');
if (empty($this->options['role'])) {
$this->options['role'] = 'navigation';
}
echo Html::beginTag('nav', $this->options);
if ($this->responsive) {
echo Html::beginTag('div', array('class' => 'container'));
echo $this->renderToggleButton();
}
echo Html::beginTag('div', array('class' => 'container'));
echo Html::beginTag('div', array('class' => 'navbar-header'));
echo $this->renderToggleButton();
if ($this->brandLabel !== null) {
echo Html::a($this->brandLabel, $this->brandUrl, $this->brandOptions);
}
if ($this->responsive) {
echo Html::beginTag('div', array('class' => 'nav-collapse collapse navbar-responsive-collapse'));
}
echo Html::endTag('div');
echo Html::beginTag('div', array('class' => 'collapse navbar-collapse navbar-ex1-collapse'));
}
/**
......@@ -87,10 +84,9 @@ class NavBar extends Widget
*/
public function run()
{
if ($this->responsive) {
echo Html::endTag('div');
echo Html::endTag('div');
}
echo Html::endTag('div');
echo Html::endTag('div');
echo Html::endTag('nav');
BootstrapPluginAsset::register($this->getView());
}
......@@ -102,10 +98,11 @@ class NavBar extends Widget
protected function renderToggleButton()
{
$bar = Html::tag('span', '', array('class' => 'icon-bar'));
return Html::button("{$bar}\n{$bar}\n{$bar}", array(
$screenReader = '<span class="sr-only">'.$this->screenReaderToggleText.'</span>';
return Html::button("{$screenReader}\n{$bar}\n{$bar}\n{$bar}", array(
'class' => 'navbar-toggle',
'data-toggle' => 'collapse',
'data-target' => '.navbar-responsive-collapse',
'data-target' => '.navbar-ex1-collapse',
));
}
}
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace yii\bootstrap;
use Yii;
use yii\base\InvalidConfigException;
use yii\base\Model;
use yii\helpers\Html;
/**
* Typeahead renders a typehead bootstrap javascript component.
*
* For example,
*
* ```php
* echo TypeAhead::widget(array(
* 'model' => $model,
* 'attribute' => 'country',
* 'clientOptions' => array(
* 'source' => array('USA', 'ESP'),
* ),
* ));
* ```
*
* The following example will use the name property instead
*
* ```php
* echo TypeAhead::widget(array(
* 'name' => 'country',
* 'clientOptions' => array(
* 'source' => array('USA', 'ESP'),
* ),
* ));
*```
*
* @see http://twitter.github.io/bootstrap/javascript.html#typeahead
* @author Antonio Ramirez <amigo.cobos@gmail.com>
* @since 2.0
*/
class Typeahead extends Widget
{
/**
* @var \yii\base\Model the data model that this widget is associated with
*/
public $model;
/**
* @var string the model attribute that this widget is associated with
*/
public $attribute;
/**
* @var string the input name. This must be set if [[model]] and [[attribute]] are not set.
*/
public $name;
/**
* @var string the input value.
*/
public $value;
/**
* Renders the widget
*/
public function run()
{
echo $this->renderField();
$this->registerPlugin('typeahead');
}
/**
* Renders the TypeAhead field. If [[model]] has been specified then it will render an active field.
* If [[model]] is null or not from an [[Model]] instance, then the field will be rendered according to
* the [[name]] attribute.
* @return string the rendering result
* @throws InvalidConfigException when none of the required attributes are set to render the textInput.
* That is, if [[model]] and [[attribute]] are not set, then [[name]] is required.
*/
public function renderField()
{
if ($this->model instanceof Model && $this->attribute !== null) {
return Html::activeTextInput($this->model, $this->attribute, $this->options);
} elseif ($this->name !== null) {
return Html::textInput($this->name, $this->value, $this->options);
} else {
throw new InvalidConfigException("Either 'name' or 'model' and 'attribute' properties must be specified.");
}
}
}
@font-face{font-family:'Glyphicons Halflings';src:url('../fonts/glyphiconshalflings-regular.eot');src:url('../fonts/glyphiconshalflings-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/glyphiconshalflings-regular.woff') format('woff'),url('../fonts/glyphiconshalflings-regular.ttf') format('truetype'),url('../fonts/glyphiconshalflings-regular.svg#glyphicons_halflingsregular') format('svg')}.glyphicon:before{font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-plus:before{content:"\002b"}.glyphicon-minus:before{content:"\2212"}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-euro:before{content:"\20ac"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse:before{content:"\e159"}.glyphicon-collapse-top:before{content:"\e160"}
/* This beautiful CSS-File has been crafted with LESS (lesscss.org) and compiled by simpLESS (wearekiss.com/simpless) */
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -30,7 +30,6 @@ body {
.list-group .glyphicon {
float: right;
margin-right: -15px;
}
.popover {
......
......@@ -63,7 +63,7 @@ use yii\gii\CodeFile;
</tbody>
</table>
<div class="modal fade" id="preview-modal">
<div class="modal fade" id="preview-modal" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment