Skip to content

Commit

Permalink
updated to latest booster library
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Ramirez committed Oct 2, 2012
1 parent 8010c11 commit b0b6ebd
Show file tree
Hide file tree
Showing 20 changed files with 748 additions and 29 deletions.
64 changes: 64 additions & 0 deletions common/extensions/bootstrap/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
YiiBooster
==========

YiiBooster is a collection of widgets and utilities that will easy the task of developing Yii applications with the beauty of [Twitter Bootstrap](http://twitter.github.com/bootstrap/). It is developed over the excellent job of [Christoffer Niska](https://twitter.com/Crisu83): ***[Yii-Bootstrap](http://www.cniska.net/yii-bootstrap/)***.

We included his library into our own Yii project startup library, [YiiBoilerplate](http://github.com/clevertech/yiiboilerplate), and started improving it in order to satisfy some of our customers' project requirements. The end result was a highly complete library, full of great widgets and plugins that not only allow developers to use Bootstrap with Yii but to solve programming challenges with easy.

To get started, checkout [http://yii-booster.clevertech.biz](http://yii-booster.clevertech.biz)!

###Quick Start
Clone the repo, `git clone git://github.com/clevertech/yiibooster.git`, or [download the latest release](https://github.com/clevertech/YiiBooster/zipball/master).

###Widgets

The YiiBooster library includes:

* Buttons
* Buttons Groups
* Buttons DropDowns
* Navigational Tabs, Pills and Lists
* Navigation Toolbars
* Labels
* Badges
* Page headers and hero units
* Thumbnails
* Alerts
* Progress Bars
* Modals
* Dropdowns
* Tooltips
* Popovers
* Accordion
* Carousel
* Typeahead
* WYSIWYG HTML Editors
* Boxes
* Google Charts
* HighCharts
* JSON Grid
* JSON Button Column
* JSON Data Column
* JSON Pager
* Extended Grid
* Extended Summary
* Inline Column Edition
* Grid/Chart Switcher
* Image Column
* Picker Column
* Total Sum Column
* Grouping Grid
* Merge cells or columns

###Bug tracker
If you find any bugs, please create an issue at [https://github.com/clevertech/YiiBooster/issues](https://github.com/clevertech/YiiBooster/issues)

###License
[![License](http://i.creativecommons.org/l/by-sa/3.0/88x31.png)](http://creativecommons.org/licenses/by-sa/3.0/)
This work is licensed under a [Creative Commons Attribution-ShareAlike 3.0 Unported License](http://creativecommons.org/licenses/by-sa/3.0/)

====

> [![Clevertech](http://clevertech.biz/images/slir/w54-h36-c54:36/images/site/index/home/clevertech-logo.png)](http://www.clevertech.biz)
well-built beautifully designed web applications
[www.clevertech.biz](http://www.clevertech.biz)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.tbrelational-column {
text-decoration: none;
border-bottom: dashed 1px #08C;
cursor: pointer;
color: #08C;
}
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@
},
parseDate: function(date, format) {
var parts = date.split(format.separator),
date = new Date(1970, 1, 1, 0, 0, 0),
//date = new Date(1970, 1, 1, 0, 0, 0),
date = new Date(), // current date
val;
if (parts.length == format.parts.length) {
for (var i=0, cnt = format.parts.length; i < cnt; i++) {
Expand Down
56 changes: 56 additions & 0 deletions common/extensions/bootstrap/assets/js/jquery.sortable.gridview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
(function($){
var originalPos = null;

var fixHelperDimensions = function(e, tr) {
originalPos = tr.prevAll().length;
var $originals = tr.children();
var $helper = tr.clone();
$helper.children().each(function(index)
{
$(this).width($originals.eq(index).width()+1).height($originals.eq(index).height())
.css({
"border-bottom":"1px solid #ddd"
});
});
return $helper.css("border-right","1px solid #ddd");
};

/**
* Returns the key values of the currently checked rows.
* @param id string the ID of the grid view container
* @param column_id string the ID of the column
* @return array the key values of the currently checked rows.
*/
$.fn.yiiGridView.sortable = function (id, callback)
{
var grid = $('#'+id) ;
$("tbody", grid).sortable({
helper: fixHelperDimensions,
update: function(e,ui){
// update keys
var pos = $(ui.item).prevAll().length;
if(originalPos !== null && originalPos != pos)
{
var keys = grid.children(".keys").children("span");
var key = keys.eq(originalPos);

if(originalPos < pos)
{
keys.eq(pos).after(key);
}
if(originalPos > pos)
{
keys.eq(pos).before(key);
}
originalPos = null;
}
if($.isFunction(callback))
{
callback(key.text(),pos);
}
}
}).disableSelection();
};


})(jQuery);
2 changes: 1 addition & 1 deletion common/extensions/bootstrap/components/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ protected function registerPlugin($name, $selector = null, $options = array(), $
* Returns the URL to the published assets folder.
* @return string the URL
*/
protected function getAssetsUrl()
public function getAssetsUrl()
{
if (isset($this->_assetsUrl))
return $this->_assetsUrl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* - $this: the BootCrudCode object
*/
?>
<?php echo "<?php \$form=\$this->beginWidget('bootstrap.widgets.BootActiveForm',array(
<?php echo "<?php \$form=\$this->beginWidget('bootstrap.widgets.TbActiveForm',array(
'id'=>'".$this->class2id($this->modelClass)."-form',
'enableAjaxValidation'=>false,
)); ?>\n"; ?>
Expand All @@ -25,7 +25,7 @@
}
?>
<div class="form-actions">
<?php echo "<?php \$this->widget('bootstrap.widgets.BootButton', array(
<?php echo "<?php \$this->widget('bootstrap.widgets.TbButton', array(
'buttonType'=>'submit',
'type'=>'primary',
'label'=>\$model->isNewRecord ? 'Create' : 'Save',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* - $this: the BootCrudCode object
*/
?>
<?php echo "<?php \$form=\$this->beginWidget('bootstrap.widgets.BootActiveForm',array(
<?php echo "<?php \$form=\$this->beginWidget('bootstrap.widgets.TbActiveForm',array(
'action'=>Yii::app()->createUrl(\$this->route),
'method'=>'get',
)); ?>\n"; ?>
Expand All @@ -19,7 +19,7 @@

<?php endforeach; ?>
<div class="form-actions">
<?php echo "<?php \$this->widget('bootstrap.widgets.BootButton', array(
<?php echo "<?php \$this->widget('bootstrap.widgets.TbButton', array(
'type'=>'primary',
'label'=>'Search',
)); ?>\n"; ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
)); ?>\n"; ?>
</div><!-- search-form -->

<?php echo "<?php"; ?> $this->widget('bootstrap.widgets.BootGridView',array(
<?php echo "<?php"; ?> $this->widget('bootstrap.widgets.TbGridView',array(
'id'=>'<?php echo $this->class2id($this->modelClass); ?>-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
Expand All @@ -64,7 +64,7 @@
echo "\t\t*/\n";
?>
array(
'class'=>'bootstrap.widgets.BootButtonColumn',
'class'=>'bootstrap.widgets.TbButtonColumn',
),
),
)); ?>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<h1><?php echo $label; ?></h1>

<?php echo "<?php"; ?> $this->widget('bootstrap.widgets.BootListView',array(
<?php echo "<?php"; ?> $this->widget('bootstrap.widgets.TbListView',array(
'dataProvider'=>$dataProvider,
'itemView'=>'_view',
)); ?>
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<h1>View <?php echo $this->modelClass." #<?php echo \$model->{$this->tableSchema->primaryKey}; ?>"; ?></h1>

<?php echo "<?php"; ?> $this->widget('bootstrap.widgets.BootDetailView',array(
<?php echo "<?php"; ?> $this->widget('bootstrap.widgets.TbDetailView',array(
'data'=>$model,
'attributes'=>array(
<?php
Expand Down
2 changes: 1 addition & 1 deletion common/extensions/bootstrap/widgets/TbBreadcrumbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function run()

if (!isset($this->homeLink))
{
$content = CHtml::link(Yii::t('zii', 'Home'), Yii::app()->homeUrl);
$content = CHtml::link(Yii::t('booster', 'Home'), Yii::app()->homeUrl);
$links[] = $this->renderItem($content);
}
else if ($this->homeLink !== false)
Expand Down
Loading

0 comments on commit b0b6ebd

Please sign in to comment.