{"action":"created","issue":{"url":"https://api.github.com/repos/Sylius/Sylius/issues/3646","labels_url":"https://api.github.com/repos/Sylius/Sylius/issues/3646/labels{/name}","comments_url":"https://api.github.com/repos/Sylius/Sylius/issues/3646/comments","events_url":"https://api.github.com/repos/Sylius/Sylius/issues/3646/events","html_url":"https://github.com/Sylius/Sylius/pull/3646","id":119262729,"number":3646,"title":"[POC] UiBundle and AdminBundle","user":{"login":"pjedrzejewski","id":614970,"avatar_url":"https://avatars.githubusercontent.com/u/614970?v=3","gravatar_id":"","url":"https://api.github.com/users/pjedrzejewski","html_url":"https://github.com/pjedrzejewski","followers_url":"https://api.github.com/users/pjedrzejewski/followers","following_url":"https://api.github.com/users/pjedrzejewski/following{/other_user}","gists_url":"https://api.github.com/users/pjedrzejewski/gists{/gist_id}","starred_url":"https://api.github.com/users/pjedrzejewski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjedrzejewski/subscriptions","organizations_url":"https://api.github.com/users/pjedrzejewski/orgs","repos_url":"https://api.github.com/users/pjedrzejewski/repos","events_url":"https://api.github.com/users/pjedrzejewski/events{/privacy}","received_events_url":"https://api.github.com/users/pjedrzejewski/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Sylius/Sylius/labels/New%20Feature","name":"New Feature","color":"64CF1D"},{"url":"https://api.github.com/repos/Sylius/Sylius/labels/RFC","name":"RFC","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":38,"created_at":"2015-11-28T01:22:37Z","updated_at":"2016-01-18T23:32:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Sylius/Sylius/pulls/3646","html_url":"https://github.com/Sylius/Sylius/pull/3646","diff_url":"https://github.com/Sylius/Sylius/pull/3646.diff","patch_url":"https://github.com/Sylius/Sylius/pull/3646.patch"},"body":"Hello folks!\r\n\r\nI'd like to start a discussion about the required changes to SyliusWebBundle. This PR shows the direction I want to move towards. Let me know what do you think. This is a result of plenty thoughts and discussion but I will try to summarize the most important reasons:\r\n\r\n* We don't have time and don't want to maintain a very custom admin interface\r\n\r\nYeah. We need to be realistic about how much work it is to build a nice theme. I don't think we have that many frontend devs in the community and definitely not enough time. So I want to avoid as much as possible work here. **AdminLTE** sounds like a perfect solution here.\r\n\r\n* AdminLTE is MIT licensed, based on Bootstrap and available via Bower.\r\n\r\nMIT license - perfect. Based on Bootstrap - perfect, easy to use and everyone knows it, even for backend developers, who don't enjoy fighting with html/css too much. Available via Bower - awesome, we don't have to commit it to the repository.\r\n\r\n* AdminLTE has plenty of components/widgets ready - My POC is super, super simple, but the package has plenty of examples and ready to use templates - just have a look here - https://almsaeedstudio.com/preview. It will be very easily customizable!\r\n\r\n* Fully responsive backend out-of-the-box. Yeps, pretty much without any effort, the backend will be really responsive and mobile friendly. What we have now is far from perfect and would require great deal of work.\r\n\r\nOK, this is about AdminLTE - I hope everyone is convinced that this is the right choice. I was considering Materialize, but tried it and it requires much more work, pretty much the same as our current custom Bootstrap backend. AdminLTE has more out-of-the-box than we could implement in next 3-6 months.\r\n\r\n---\r\n\r\nWhat's up with the AdminBundle and UiBundle? Goals:\r\n\r\n* Decouple Administration panel from the shop frontend\r\n\r\nThere are projects already which use Sylius as API and backend. We don't want to force anyone to include whole bundle with the frontend if he is not using it. Also, it allows for a nice and clean separation of Admin panel and Shop frontend. (yes, next step is ShopBundle and removing WebBundle :D)\r\n\r\n* Allow to reuse Sylius UI and simpler installation of standalone bundles\r\n\r\nThere is plenty of projects which use just selected bundles. Would be great if they could benefit from using Sylius UI. Also, some macros/buttons/widgets/menus/forms could be shared between bundles. Right now there is no easy way to do that, that's why I come up with the idea of SyliusUiBundle. It will contain all the AdminLTE integration stuff and common templating tools.\r\n\r\nThis will also ease the setup of individual bundles. There is no easy way now to try out some bundles. You need to copy templates or write them from scratch. With Grids (see next point) and UiBundle - that will be much much easier. In few lines, you will get a basic admin panel with nice ui in few lines of yml.\r\n\r\n* Grids and maintenance of templates\r\n\r\nNot many of you know this, but we have http://docs.sylius.org/en/latest/bundles/SyliusGridBundle/index.html in works. It has been tested in a quite big project and works really well. It is not an admin generator, but follow the path that I took with ResourceBundle - having simple, configurable/resuable Crud controllers. This bundle basically adds a system of filters and grid rendering on top of SyliusResourceBundle.\r\n\r\nThe problem we have right now that there is huuuge duplication of templates in our backend. With grids, combined with SyliusUiBundle, we could remove 80% of our templates and make it much easier to customize Sylius backend. Adding new columns and filters will not require any html/css.\r\n\r\n* Opportunity to clean up things\r\n\r\nReducing amount of templates - big plus. It is also an opportunity to rework some stuff (like menu builders in this PR and translation keys).\r\n\r\nI know that ``sylius_backend_tax_category_index`` and ``sylius_admin_tax_category_index`` are very similar, but I think that using Admin in all templates, routes etc. will make it easier for us to maintain everything admin and super simple for newcomers to understand. We got used to this \"backend\" thing, but Admin is more obvious.\r\n\r\nWoah, this got pretty long. Let me hear your thoughts.\r\n\r\nLast important note - the battle plan:\r\n\r\nI learned the hard way to not rework everything at once. :) Idea for implementing that is to merge AdminBundle and UiBundle in the form I am proposing here (after review) and then wait for the Resource+Grids improvements to continue working on it. We would migrate resources one by one to the new backend with grids, filters and generated templates/routing. At one point, we would be left with only shop frontend in WebBundle. This would allow us to remove it in favor of new ShopBundle, which would contain the shop itself. (here there is much more work)\r\n\r\nSorry for any typos and rambling, it was late. ;)"},"comment":{"url":"https://api.github.com/repos/Sylius/Sylius/issues/comments/172681395","html_url":"https://github.com/Sylius/Sylius/pull/3646#issuecomment-172681395","issue_url":"https://api.github.com/repos/Sylius/Sylius/issues/3646","id":172681395,"user":{"login":"pjedrzejewski","id":614970,"avatar_url":"https://avatars.githubusercontent.com/u/614970?v=3","gravatar_id":"","url":"https://api.github.com/users/pjedrzejewski","html_url":"https://github.com/pjedrzejewski","followers_url":"https://api.github.com/users/pjedrzejewski/followers","following_url":"https://api.github.com/users/pjedrzejewski/following{/other_user}","gists_url":"https://api.github.com/users/pjedrzejewski/gists{/gist_id}","starred_url":"https://api.github.com/users/pjedrzejewski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjedrzejewski/subscriptions","organizations_url":"https://api.github.com/users/pjedrzejewski/orgs","repos_url":"https://api.github.com/users/pjedrzejewski/repos","events_url":"https://api.github.com/users/pjedrzejewski/events{/privacy}","received_events_url":"https://api.github.com/users/pjedrzejewski/received_events","type":"User","site_admin":false},"created_at":"2016-01-18T23:32:30Z","updated_at":"2016-01-18T23:32:30Z","body":"Update:\r\n\r\n* Added login page for the new admin and secured it with a firewall;\r\n* Removed Bower in favor of NPM for our frontend deps;\r\n* Improved the gulp file with some handy stuff, like live reload, watch etc.\r\n* We are using LESS now.\r\n\r\nI'd say this is it for now, I'd like to get this merged ASAP, so any review is appreciated! But please allow me to polish any details in further PRs, we will be definitely working a lot on this and this holds up few other things (like grids).\r\n\r\nThanks for all the feedback guys! Was very helpful. :)"}}