Giter VIP home page Giter VIP logo

sleepingowladmin's People

Contributors

aglok avatar alexdanielyan avatar alexrosenfeld avatar asvae avatar atmden avatar butochnikov avatar butschster avatar chancezeus avatar chrisnew avatar daaner avatar davidnadejdin avatar dependabot[bot] avatar everestmx avatar falur avatar heiswald avatar isrkar avatar lunatig avatar mediaceh avatar moisespsena avatar osbre avatar pal9yni4bi avatar sleeping-owl avatar sngrl avatar spamarmy avatar stylecibot avatar theardent avatar unquaiz avatar vaiil avatar vladislavtkachenko avatar xcaptain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sleepingowladmin's Issues

Checkbox column

Hi, I am moving from sleeping-owl/admin to this package. I have a question, or a feature request, about the checkbox column. Is it possible to use it to show and modify a model attribute? For example in the demo there is the "news" model with a "published" attribute. In the display table (http://demo.sleepingowladmin.ru/admin/news/v5 ) this attribute is a custom column, I would like to use the checkbox column to show and change this field value. I am able to change the _published _value using the checkbox column and a custom display action, but with this approach when the table is loaded all the checkboxes are unchecked, they are not linked to a model attribute.

Thanks, Carlo

Policies

Необходимо дать возможность настраивать Policy для каждого раздела

Как правильно организовать в sleeping-owl Multi-Language

Как правильно организовать в sleeping-owl, Multi-Language Content?
Я начинала это с помощью tabbed, для каждого языка отдельный таб.

my project

есть tabel category_description для меняешься content и tabel prso_categories для поля которые не нужно переводить.
FormItem::text('description["name"][]', 'Category Name'),
description["..."][]
правильно такой подход?
как правильно связать эти два таблица?
и как его правильно реализовать в sleeping-owl?

Буду рад если кто-то сможет помочь.

Restore not working

Hi all,

I was experimenting around with soft-deletable models and found the following issues:

  1. You have to manually add $display->setApply(function(Builder $query) { $query->withTrashed(); });, otherwise the soft deleted records won't be visible (in my opinion this should be enabled by default when the user is allowed to restore records and the model is soft-deletable (check on withTrashed/onlyTrashed as used in BaseRepository findMany))...
  2. In AdminController the postRestore function does a find on the model, but the find method in the repository doesn't include trashed records, so it always returns false (I fixed it by copying findMany and instead of whereIn use find)...
  3. In BaseRepository the restore function calls $this->query() which doesn't exist (you either have to call $this->getQuery() or $this->getModel()->query() (I used the 2nd one, since the first one also includes relations in the query))...

After these fixes soft-deleting works as expected...

Command not available in the "admin" namespace

I am using the old documentation for the new development branch. This is the error i get for the commands, did the commands change?(if they did do you have any docs of the new code) or ?

Awesome project btw guys :)

Model works in local, but not in server

I have implemented the latest version of Sleeping Owl Admin. In my local environment it works perfectly. But on my server there are models that do not look at the menu, and you can not see when you click on an empty space. Is there a mod php or something you have to activate?
And the menu order is reversed. (If I put the "priority" works).

My Local
local

My Server
server

function fullEdit()

use sleeping-owl V3.

I want to add two more parameters to this function $catagory_id, $lang_id:

I added these two parameters to the function, which is in ModelConfiguration.php.

public function fullEdit($id, $catagory_id, $lang_id)
{
    $edit = $this->edit($id);
    if ($edit instanceof FormInterface)
    {
        $edit->setAction($this->updateUrl($id));
        $edit->setId($id);
    }
    return $edit;
}

function does not see

Error:
Missing argument 2 for SleepingOwl\Admin\Model\ModelConfiguration::fullEdit(), called in

can someone help me?

Generate slug from Form

Hi there

I have a little question ATM i have a form working well but i need to save a slug for the slug value. But i cant fint how can i do that with this package and in a auto way.

Set Parameters SleepingOwl

I want to send another 2 parameters
use tabs

$description = Admin::model(Ecommerce\Productso\Models\CategoryDescription::class)->fullEdit($editId);

$description->parameters(['category_id' => $category_id, 'language_id' => $item->language_id]);

Error: Call to undefined method SleepingOwl\Admin\Form\FormDefault::parameters()

please help me.
Thanks.

Manage Multi-Language contents on CRUD

Hello @butschster,
on a multi language site there's no a native way to manage contents on laravel.
One of this is to install dimsav/laravel-translatable that modify the model in a way where you can save translatable fields for each model, like:

//Filling multiple translations

  $data = [
    'code' => 'gr',
    'en'  => ['name' => 'Greece'],
    'fr'  => ['name' => 'Grèce'],
  ];

  $greece = Country::create($data);

 echo $greece->translate('fr')->name; // Grèce

Here an article: https://laravel-news.com/2015/09/how-to-add-multilingual-support-to-eloquent/
Here the lib: https://github.com/dimsav/laravel-translatable

The target is to build a CRUD with a form with all translation as described by #20.

I think it's not needed to build something "out of the box", but a sort of guide to implement it because in this way SleepingOwlAdmin become a full featured cms or sort of.

What I think to implement is sort of this (many crud works in this way):
http://screenpresso.com/=QBdBg

thank you!
Denis

push two items in form please help me

$description = Admin::model(Ecommerce\Productso\Models\CategoryDescription::class)->fullEdit($editId);

$description->items([
    FormItem::hidden('language_id')->defaultValue($id),
    FormItem::hidden('language_id')->defaultValue($item->language_id)
 ]);

$tabs[] = AdminDisplay::tab($description)->label($item->name);

I want to add two fields in imported form

New method Display::setHeaderClass

By default TableColumn use SleepingOwl\Admin\Display\TableHeaderColumn class for header.
But sometimes need to change to custom header class.

it would be great if we could do this:

// Created custom header class instanced of SleepingOwl\Admin\Contracts\Display\TableHeaderColumnInterface
$header = new App\Custom\TableHeader;

// Setting default class for all table headers
$header->setAttribute('class', 'bg-primary'); 

$table = AdminDisplay::table();

$table->setHeaderClass($header);

$table->setColumns([
    ...
    AdminColumn::string()
    ...
]);

Routes SleepingOwlAdmin

I also add two parameters {category_id?}/{lang_id?}
if instead this route. Error 404

Route::get('{adminModel}/{adminModelId}/{category_id?}/{lang_id?}/edit', [
            'as'   => 'admin.model.edit',
            'uses' => 'AdminController@getEdit',
        ]);

can someone help me?

navigation.php and single pages (without a model)

Hello,
in the previous version (v3) there was the configuration for manage static navigation menu, I mean adding for example Dashboard link to menu or a static page (with a static controller) in this way:

Admin::menu()->url('/')->label('Dashboard')->icon('fa-dashboard');

Admin::menu(\App\Models\Customer::class)->icon('fa-user')->label('Customers');

Admin::menu()->url('/stats')->label('Stats')->icon('fa-trello');

There's a way to manage it with the new configuration using navigation.php?
I only see that you can manage groups of pages, but not single page, eg:

    [
        'title' => 'Permissions',
        'icon' => 'fa fa-group',
        'pages' => [
            (new Page(\App\User::class))
                ->setIcon('fa fa-user')
                ->setPriority(0),
            (new Page(\App\Role::class))
                ->setIcon('fa fa-group')
                ->setPriority(100)
        ]
    ]

but, something like this is not working:

    [
        'title' => 'Permissions',
        'icon' => 'fa fa-group',
        'pages' =>
            (new Page(null))
                ->setIcon('fa fa-user')
                ->setPriority(0),
               -->setUrl("/stats")
    ]

Any suggestion?
bye!

two admin panel with different user role

Здравствуйте, возможно ли создать 2 админки (admin и user) - где админ имеет все права, а юсер - редактирует только всю информацию?

Update field value if it is no empty

Sometimes, form has field (for example: password), which should not update if empty.

Example

User model App\User has field password

// Create And Edit
$model->onCreate(function() {
    return AdminForm::panel()->addBody([
        ...
        AdminFormElement::password('password', 'Password')->required()->addValidationRule('min:6'),
       ...
    ]);
});


$model->onEdit(function() {
    return AdminForm::panel()->addBody([
        ...
        AdminFormElement::password('password', 'Password')->updateIfFilled(), // or updateIfNotEmpty()
       ...
    ]);
});

Column filters not working

Hi all,

I really like the look and feel of this admin package, I just have one problem. I'm trying to implement the column filters and it seems they are not working. They display fine, but it seems there is no way to actually apply the filter (no response when pressing enter, nor a search or apply button anywhere)...
It appears this is also the case on the demo site (http://demo.sleepingowladmin.ru/admin/contacts4)

Laravel: 5.2.*
SleepingOwl: ~4.17@dev
Browser: Chrome 49.0.2623.87

Set Custom Controller for each Model configuration on "Display" and "Create and Edit"

Hello,
there's a way to set a specific controller that override the standard controller for a specific model?
I mean something like this:

// /app/Admin/Contact3.php

$model->onDisplay(function () {
    $display = AdminDisplay::table();
    ...
    $display->setController("/App/Http/Controller/MyCustomContact3Controller@list");
   ...
}

$model->onCreateAndEdit(function($id = null) {
    $display = AdminDisplay::tabbed();
    ...
    $display->setController("/App/Http/Controller/MyCustomContact3Controller@save");
}

I think it's very useful for making custom behaviour on list or save (IE: elaborate data before save or call background shell commands etc..).

Link to V4 documentation not woking

The link to the docs for v4 is not working , also do you have a forum where i can follow the development process in english

Great project

function fullEdit()

I want to add two more parameters to this function $catagory_id, $lang_id:

I made changes
ModelConfiguration Function:

public function fullEdit($id, $catagory_id=null, $lang_id=null)
{
$edit = $this->edit($id);
if ($edit instanceof FormInterface)
{
$edit->setAction($this->updateUrl($id));
$edit->setId($id);
}
return $edit;
}

Route:

Route::get('{adminModel}/{adminModelId}/edit/{category_id?}/{lang_id?}', [
'as' => 'admin.model.edit',
'uses' => 'AdminController@getEdit',
]);

AdminController Function

public function getEdit($model, $id, $catagory_id=null, $lang_id=null)
{
$edit = $model->fullEdit($id);
if (is_null($edit)) {
abort(404);
}
return $this->render($model->title(), $edit);
}

and nothing, something escapes me.

error 404

help me please?

Questions about SleepingOwlAdmin

Hi,
I want to try and use this product, I have some questions if I may.

  1. Can I write my own functionality (interceptions) in Before/After crud operations? for example, I want to send an email when a row was been deleted.
  2. Can I intercept and write client side functionality?
  3. Can I add custom operation in the grid near "update" and "delete" icons? such as disable and run my own functionality?
  4. Can custom filters be saved for later use?

Thanks!

route wrong redirect .

my env:

        "php": ">=5.5.9",
        "laravel/framework": "5.2.*",
        "dingo/api": "1.0.x@dev",
        "tymon/jwt-auth": "^0.5.9",
        "laravelrus/sleepingowl": "4.*@dev"

After composer update , artisan route:list

---------------------------------------------+------------+
| Domain | Method   | URI                                          | Name                                 | Action                                                           | Middleware |
+--------+----------+----------------------------------------------+--------------------------------------+------------------------------------------------------------------+------------+
|        | GET|HEAD | /                                            |                                      | Closure                                                          |            |
|        | GET|HEAD | admin                                        | admin.dashboard                      | Closure                                                          | web,auth   |
|        | POST     | admin/FormElements/image/uploadFile          | admin.form.element.image.uploadFile  | Closure                                                          | web,auth   |
|        | POST     | admin/FormElements/image/uploadImage         | admin.form.element.image.uploadImage | Closure                                                          | web,auth   |
|        | GET|HEAD | admin/assets/admin.scripts                   | admin.scripts                        | SleepingOwl\Admin\Http\Controllers\AdminController@getScripts    | web,auth   |
|        | GET|HEAD | admin/assets/images/all                      |                                      | Closure                                                          | web,auth   |
|        | POST     | admin/assets/images/upload                   |                                      | Closure                                                          | web,auth   |
|        | GET|HEAD | admin/information                            | admin.information                    | Closure                                                          | web,auth   |
|        | GET|HEAD | admin/{adminModel}                           | admin.model                          | SleepingOwl\Admin\Http\Controllers\AdminController@getDisplay    | web,auth   |
|        | GET|HEAD | admin/{adminModel}/async/{adminDisplayName?} | admin.model.async                    | Closure                                                          | web,auth   |
|        | GET|HEAD | admin/{adminModel}/create                    | admin.model.create                   | SleepingOwl\Admin\Http\Controllers\AdminController@getCreate     | web,auth   |
|        | POST     | admin/{adminModel}/create                    | admin.model.store                    | SleepingOwl\Admin\Http\Controllers\AdminController@postStore     | web,auth   |
|        | POST     | admin/{adminModel}/reorder                   |                                      | Closure                                                          | web,auth   |
|        | DELETE   | admin/{adminModel}/{adminModelId}/delete     | admin.model.destroy                  | SleepingOwl\Admin\Http\Controllers\AdminController@deleteDestroy | web,auth   |
|        | POST     | admin/{adminModel}/{adminModelId}/down       | admin.model.move-down                | Closure                                                          | web,auth   |
|        | POST     | admin/{adminModel}/{adminModelId}/edit       | admin.model.update                   | SleepingOwl\Admin\Http\Controllers\AdminController@postUpdate    | web,auth   |
|        | GET|HEAD | admin/{adminModel}/{adminModelId}/edit       | admin.model.edit                     | SleepingOwl\Admin\Http\Controllers\AdminController@getEdit       | web,auth   |
|        | POST     | admin/{adminModel}/{adminModelId}/restore    | admin.model.restore                  | SleepingOwl\Admin\Http\Controllers\AdminController@postRestore   | web,auth   |
|        | POST     | admin/{adminModel}/{adminModelId}/up         | admin.model.move-up                  | Closure                                                          | web,auth   |
|        | GET|HEAD | admin/{adminWildcard}                        | admin.wildcard                       | SleepingOwl\Admin\Http\Controllers\AdminController@getWildcard   | web,auth   |
+--------+----------+----------------------------------------------+--------------------------------------+------------------------------------------------------------------+------------+

when i visit: http://xx/admin , then it jump to http://xx/login and say

Sorry, the page you are looking for could not be found.

what's wrong ?

Текст кнопок

Добавить возможность изменять текст кнопок для форм

V2 :: Custom Form Elements

Hello.

i created some Custom Form (and Column) Elements.

When i run this at localhost everything is fine.

Problem is when i upload this. I cant get those Classes running.

I Know i should use those files outside /vendor but i cant understand the logic on those errors so im using all files inside the default FormItem and Column, @vendor/sleeping-owl

2 questions:

  1. how can i use those custom files, per example, inside /app/admin;

  2. at this moment i have this Custom Form Element:

<?php 

namespace SleepingOwl\Admin\Models\Form\FormItem;
use SleepingOwl\Admin\Models\Form\Interfaces\FormItemInterface;
use SleepingOwl\Admin\Models\Form\FormItem\BaseFormItem;
use \Admin;

class FixedHidden extends BaseFormItem implements FormItemInterface
{
    protected $label;
    public function render()
    {
      $instance = Admin::instance()->formBuilder->getModel();
      if ($instance->exists)
      {
        return $this->formBuilder->hidden($this->name, $this->getValueFromForm(), $this->attributes);
    } else
    {
       return $this->formBuilder->hidden($this->name, $this->label, $this->attributes);
   }    
}

}

and @ app/admin/bootstrap.php:

FormItem::register('FixedHidden', 'SleepingOwl\Admin\Models\Form\FormItem\FixedHidden');

LOCALHOST is ok. online i get this error:

Class 'SleepingOwl\Admin\Models\Form\FormItem\Fixedhidden' not found

How can i fix this ?

_ Laravel 4.2
_ Admin V2

Thanks,

  • Brito

Feature Request: Vue.js

Мне кажется будет лучше использовать vue.js и semantic-ui

Копирование записей (Items copy)

Клиентам часто требуется быстрое клонирование/копирование записей внутри одной модели с изменением нескольких значений.

V2 :: ROUTE - public_html/admin

hello.

another issue: i cant use /admin

when i try to access /admin (remote) i get a 404 error...

any idea why is this happening?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.