Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hoaaah committed Nov 23, 2019
1 parent a221de7 commit 46d91fa
Show file tree
Hide file tree
Showing 21 changed files with 1,859 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

nbproject
vendor
composer.phar
composer.lock

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

.idea/
34 changes: 34 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "hoaaah/yii2-ajaxcrud-bs4",
"description": "Gii CRUD template for Single Page Ajax Administration for yii2",
"type": "yii2-extension",
"keywords": ["yii2","extension","ajax","crud","gii","template","database"],
"license": "Apache-2.0",
"authors": [
{
"name": "John Martin",
"email": "[email protected]",
"homepage": "https://github.com/johnitvn?tab=repositories"
}
],
"support": {
"issues": "https://github.com/johnitvn/yii2-ajaxcrud/issues?state=open",
"source": "https://github.com/johnitvn/yii2-ajaxcrud"
},
"require": {
"yiisoft/yii2": "*",
"yiisoft/yii2-gii": "*",
"yiisoft/yii2-bootstrap": "*",
"kartik-v/yii2-grid": "^3.0.4",
"kartik-v/yii2-mpdf": "^1.0.0",
"kartik-v/yii2-editable": "^1.7.3"
},
"autoload": {
"psr-4": {
"hoaaah\\ajaxcrud\\": "src/"
}
},
"extra": {
"bootstrap": "hoaaah\\ajaxcrud\\Bootstrap"
}
}
30 changes: 30 additions & 0 deletions src/Bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace hoaaah\ajaxcrud;

use Yii;
use yii\base\Application;
use yii\base\BootstrapInterface;

/**
* @author John Martin <[email protected]>
* @since 1.0
*/
class Bootstrap implements BootstrapInterface {

/**
* Bootstrap method to be called during application bootstrap stage.
*
* @param Application $app the application currently running
*/
public function bootstrap($app) {
Yii::setAlias("@ajaxcrud", __DIR__);
Yii::setAlias("@hoaaah/ajaxcrud", __DIR__);
if ($app->hasModule('gii')) {
if (!isset($app->getModule('gii')->generators['ajaxcrud'])) {
$app->getModule('gii')->generators['ajaxcrud'] = 'hoaaah\ajaxcrud\generators\Generator';
}
}
}

}
24 changes: 24 additions & 0 deletions src/BulkButtonWidget.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
namespace hoaaah\ajaxcrud;

use yii\base\Widget;
use yii\helpers\Html;

class BulkButtonWidget extends Widget{

public $buttons;

public function init(){
parent::init();

}

public function run(){
$content = '<div class="pull-left">'.
'<span class="glyphicon glyphicon-arrow-right"></span>&nbsp;&nbsp;With selected&nbsp;&nbsp;'.
$this->buttons.
'</div>';
return $content;
}
}
?>
42 changes: 42 additions & 0 deletions src/CrudAsset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

namespace hoaaah\ajaxcrud;

use yii\web\AssetBundle;

/**
* @author John Martin <[email protected]>
* @since 1.0
*/
class CrudAsset extends AssetBundle
{
public $sourcePath = '@ajaxcrud/assets';

// public $publishOptions = [
// 'forceCopy' => true,
// ];

public $css = [
'ajaxcrud.css'
];

public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
'yii\bootstrap\BootstrapPluginAsset',
'kartik\grid\GridViewAsset',
];

public function init() {
// In dev mode use non-minified javascripts
$this->js = YII_DEBUG ? [
'ModalRemote.js',
'ajaxcrud.js',
]:[
'ModalRemote.min.js',
'ajaxcrud.min.js',
];

parent::init();
}
}
Loading

0 comments on commit 46d91fa

Please sign in to comment.