frozennode / laravel-administrator Goto Github PK
View Code? Open in Web Editor NEWAn administrative interface package for Laravel
Home Page: http://administrator.frozennode.com/
License: MIT License
An administrative interface package for Laravel
Home Page: http://administrator.frozennode.com/
License: MIT License
It will be nice to open the feature of photo loader of CKeditor.
I think it will better if we can set display text and value of options by array key,value like this
'options' => array(
'user' => 'Customer',
'owner' => 'Merchant',
'admin' => 'Content Moderator',
'superadmin' => 'System Administrator'
),
... Although not really an issue.
I feel like some in depth example code / tutorials would really help this bundle, and me :D. I tend to learn by doing and the documentation here, while quite lengthy tends to leave people like me in the dark without something to dig through.
I have an error :
SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: ""
SQL: SELECT "resultats"."id" FROM "resultats" WHERE "id" = ? LIMIT 1
Bindings: array (
0 => false,
)
it works with an ugly hack on ModelHelper.php :
$model = $classname::find(intval($id), $columns['includedColumns']);
my migration:
Schema::create('resultats',function($table)
{
$table->increments('id');
$table->string('code');
$table->string('name');
$table->string('description')->nullable();
$table->integer('secteur_id');
$table->timestamps();
$table->foreign('secteur_id')->references('id')->on('secteurs');
});
Guillaume.
the belong to relationship filter should be = not like because the foreignKey is a integer not a string
Line 45:
$query->where($this->foreignKey, '=', $this->value);
NOT
$query->where($this->foreignKey, 'LIKE', '%'.$this->value.'%');
This administrator is great and all, but there are always times when you want to do things differently. Is there a way to add my own subpage (e.g. /admin/complex_user_edit) that I can code myself? Preferably with the same look as the administrator (I know that administrator is coded in Knockout.js, so maybe my page would be standard HTML).
In some cases, like "general webpage settings" like admin pages I use only one database table row, so no listing, filtering, creating function necessary, but the editing.
Is there a way to "hack" the admin model to generate page this way, so only editing function appears in menu?
If not (as i think) can we build this feature?
Great Thanks for Administrator, i just love it!
Kindari (https://github.com/Kindari) brought up a good point about giving users the option to define their models in the config, thus keeping all Administrator code wrapped up in the administrator.php config file. Not a bad idea, I think! This would be an non-breaking feature addition, so nothing would change for users who don't want to use it.
Hello there,
I constantly get the following error:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM contacts
WHERE id
= ? LIMIT 1' at line 1
SQL: SELECT FROM contacts
WHERE id
= ? LIMIT 1
Bindings: array (
0 => false,
)
I simply have installed the bundle, created an 'admin' folder in the models dir, created an file called contact.php in the new dir.
This is the config
'models' => array(
'contact' => array(
'title' => 'Contacten',
'model' => 'Contact',
),
),
The Frontend itself is working properly.
Any idea how this is come?
But I need to figure out how to better position the edit box first :(
Sorry for my confusing description, I don't think my english is good enough for explain complicated thing 555
but I will try this is my code and all of my bool field is store in db with tinyint (1)
public $edit = array(
'role' => array(
'title' => 'Role',
'type' => 'enum',
'options' => array(
'user' => 'User',
'owner' => 'Owner',
'admin' => 'Admin',
'superadmin' => 'Super Admin'
),
),
'account_name' => array(
'title' => 'Account Name',
'type' => 'text'
),
'curator_type' => array(
'title' => 'Curator Type',
'type' => 'enum',
'options' => array(
"00" => 'User',
"01" => 'Normal Curator',
"02" => 'Fetured Curator'
),
),
'email' => array(
'title' => 'Email',
'type' => 'text'
),
'facebook_user' => array(
'title' => 'Facebook',
'type' => 'bool',
),
'is_active' => array(
'title' => 'Active',
'type' => 'bool',
),
'is_verified' => array(
'title' => 'Verified',
'type' => 'bool',
)
);
How to upload a file?
Set up lang files and all that
I have this code in array $edit in users.php:
'profile' => array(
'title' => 'Name',
'type' => 'relationship',
'name_field' => 'name',
),
and it generates only:
<div class="has_one">
<label for="edit_field_profile">
Name:
</label>
</div>
without accompanying input.
How can i fix this?
There are two tables: users and profiles. They have 1 on 1 relationship with user_id column inside profiles table.
Credit to @andrewdworn for coming up with the idea. I might use SoundManager 2 to get this done.
In the $edit property, this determines if the user can edit the field or if it's just for show.
just like Lara Admin they have dropDown and checkbox (and radioButton too but think it can replace with dropDown). I think it'll make FrozenNode more powerful and flexible
and I happy to try to help you write this feature but need some suggestion please :)
When inserting a new record, the enter key doesn't work as expected (submit the form).
I see that the "form" is not a form but a div.edit_form, so maybe you could change that div to a form and then handle everything else in jquery like so:
$(function() {
$(".edit_form").submit(function() {
e.preventDefault();
// do your magic here
});
});
I don't know, it's just a guess.
See question above
When I use CKeditor as textarea editor , table does not update. here are the errors in the developer tools.
Uncaught TypeError: Cannot call method 'unselectable' of null ckeditor.js:255
Uncaught TypeError: Cannot call method 'getSelection' of undefined ckeditor.js:309
Uncaught TypeError: Cannot read property 'frameElement' of undefined ckeditor.js:61
Uncaught TypeError: Cannot call method 'getSelection' of undefined ckeditor.js:309
Uncaught TypeError: Cannot read property 'frameElement' of undefined ckeditor.js:61
Uncaught TypeError: Cannot call method 'setState' of null ckeditor.js:630
I've added everything as you instructed but when i click my models name in the admin panel i get a 404 any suggestions?
When default profiler toolbar is set to true in laravel's applicatin config file, image gets uploaded properly, but image file name fails to update to table. It's because some extra none-whitespace characters are added by the profiler to the end of response object used in knockout.
Not a big deal, but i got hung on for hours figuring it out.
Just turn off the profiler.
Do you have any updated examples for 3.0?
When loading a page for a table in admin (in my case /admin/document), I get an error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'documents.document_type' in 'field list'
SQL: SELECT `documents`.`id`, `documents`.`document_type_id`, `documents`.`company_id`, `documents`.`year`, `documents`.`document_type`, `documents`.`company` FROM `documents` WHERE `id` = ? LIMIT 1
I have a Document model and a DocumentType model and I'm using your preferred method of extending existing models (using admin models).
The strange circumstance, that might cause this error, is: the DocumentType model is in a documenttype.php file and uses the document_types table (public static $table = 'document_types';
).
I've also got a similar error when displaying DocumentType in browser, cause it belongs_to Country. There I get the error Unknown column 'document_types.country'
I am using a has_one belongs_to relationship model. First it works fine, when i create a new row on the belongs_to model side, and i select an item from the other table. I save it, and it saves, in database too. Even when i click on the row (without any browser refresh), the previously selected item shows selected in the select-option area as it should. But if i refresh, or go to an other administrator page, and return back to this menu: edit box fails to show the selected item, instead shows the 'None' option. Also saves it that way afterwords even other fields are edited...
I set
public static $key = 'user_id';
in my model and i got javascript error in console like this
TypeError: $root[$root.primaryKey] is not a function
I have solved this for you :). I'm just not good at github, so read on and maybe you can implement it?
When someone clicks an item on the table, if that item is lower on the page (the page is scrolled down), the view should scroll to the top, cause that's where you can edit that item. To do that, add the following to line 260 of js/admin.js
(inside the clickItem
event handler):
$('html, body').animate({scrollTop: 0}, 400);
Change the last value (400 ms) to whatever you want for the duration of the scroll animation.
And figure out how the nested wheres work
I have downloaded 2.3 version but now the new item (e.g. new company) link doesn't work (nothing happens) and the filters part of the page is empty.
When I load the model page or the new model page, I get this javascript error: Uncaught ReferenceError: loadingOptions is not defined. Unfortunately, it doesn't say in what line it happens, I know it's strange. I'm using Chrome.
There would be an option in the config that would default to true enabling users to change it. The interface would use a chosen select box that gives options from 5 to 100. Maybe store a session var so they don't have to keep setting it on every page load.
http://img839.imageshack.us/img839/2750/adminmozillafirefox006.png
http://img836.imageshack.us/img836/9872/mozillafirefox007.png
this error face me when i press on blogs
so i opend admin.php
and i found use Admin\Libraries\ModelHelper;
i don't knew what seems to be the problem
It should also possibly expand with the size of the marked-up markdown next to it.
I guess an '__toString' method is missing in the modelConfig class. When i manually add:
public function __toString()
{
return $this->name;
}
I don't get the error and Administrator is working (as far as i can see now). I guess this isn't the right way to solve that problem. Any ideas?
I have my app in /localhost/app, so admin is in /localhost/app/public/admin.
All the links to editing tables are correct (e.g. /localhost/app/public/admin/user), but once I click it, I (think I) get redireted to /localhost/admin/user. The page displays correctly (cause it is showing the right URL), but if I refresh, I get a 404. Is the URL changed with javascript or with a PHP redirect?
If it's a bug, can you fix it?
This is going to be a tough one, but the way it should work is:
Morning.
I just tried to create a self-related column (Category) like so:
'parent_category' => array(
'title' => 'Parent Category',
'relationship' => 'parent_category',
'select' => "(:table).name"
)
and the column is blank. Model looks like the following:
class Category extends \Eloquent {
public static $table = 'categories';
public static $timestamps = true;
public function profiles()
{
return $this->has_many_and_belongs_to('Metadata', 'categories_users_metadata');
}
public function parent_category()
{
return $this->belongs_to('Category', 'parent_id');
}
public function child_categories()
{
return $this->has_many('Category','parent_id');
}
}
Am I missing something?
An idea I just had...let a user upload a bunch of images (or whatever) at once. There would be some mechanism of letting the user keep certain fields persistent to the next entry. This would do a lot in the way of making it easier to manage relationships
On issue #33 a fix was made in order to allow self-related models (models related to themselves). However, these fields are not being updated (by using the edit form).
It updates the other fields, but it doesn't update the relation's field.
Hi! I'm loving this bundle! I want to add a Lat&Long type of field. Can anyone point me in the right direction? Thanks a lot!
Hi,
When you use pgsql, the query contains a group by clause, that's raising an exception (SQLSTATE[42803] column "yourcolumn" must appear in the GROUP BY clause or be used in an aggregate function ).
I fixed it by changing the group_by call with order_by, in ModelHelper class, line 233. That seems to work for me.
Extend it from text, do special saving, etc etc
In models this would be a height attribute. Default would be 200 or so.
Just a thought...I'd be interested to hear others opinions on this. Specifically what features/options you'd like.
I store gender as bool (0 = male, 1 = female), how do display this in form
text and bool is not user friendly for this case
I just want to display role name in Roles column in Users index page like this
Approved Shop, Featured Shop
any suggestion?
I'm filling up a table which uses wysiwyg editor fields. It works fine creating the first new item, but (without refreshing the browser) creating the next new item, it holds previous value, like it was the default value.
This would allow people to plug in acl to the administrator bundle. It can work the same way auth check does
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.