Skip to content

Commit

Permalink
Adding WYSIWYG field in NgRest (#230)
Browse files Browse the repository at this point in the history
* Update Wig css

* Update Wig display

* Add Wig Ngrest Plugin

* Update and rename Wig.php to Wysiwyg.php

* Update CHANGELOG.md

* Update Wysiwyg.php

* Update _ng-wig.scss
  • Loading branch information
djbuch authored and nadar committed Oct 12, 2018
1 parent 272e36d commit 6f0c879
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. This projec

## 1.2.3 (in progress)

### Added

+ [#230](https://github.com/luyadev/luya-module-admin/pull/230) Add WYSIWYG NgRest plugin.

## 1.2.2.1 (8. October 2018)

+ [#211](https://github.com/luyadev/luya-module-admin/issues/211) Try to load all images in crud list in one request and access them trough images service afterwards.
Expand Down
43 changes: 43 additions & 0 deletions src/ngrest/plugins/Wysiwyg.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

namespace luya\admin\ngrest\plugins;

use luya\admin\ngrest\base\Plugin;

/**
* Create a WYSIWYG input for a given field.
*
*
* ```php
* ['mytext' => ['wysiwyg']]
* ```
*
* @author David-Julian Buch <david@web-premiere.fr>
* @since 1.2.3
*/
class Wysiwyg extends Plugin
{
/**
* @inheritdoc
*/
public function renderList($id, $ngModel)
{
return $this->createListTag($ngModel);
}

/**
* @inheritdoc
*/
public function renderCreate($id, $ngModel)
{
return $this->createFormTag('zaa-wysiwyg', $id, $ngModel);
}

/**
* @inheritdoc
*/
public function renderUpdate($id, $ngModel)
{
return $this->renderCreate($id, $ngModel);
}
}
2 changes: 1 addition & 1 deletion src/resources/dist/css/admin.css

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/resources/scss/components/_ng-wig.scss
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@
-moz-appearance: none;

appearance: none;

overflow: hidden;
}

.nw-button:before {
Expand Down Expand Up @@ -274,4 +276,4 @@
color: grey;
content: attr(placeholder);
display: inline-block;
}
}

0 comments on commit 6f0c879

Please sign in to comment.