{"action":"created","issue":{"url":"https://api.github.com/repos/almasaeed2010/AdminLTE/issues/316","labels_url":"https://api.github.com/repos/almasaeed2010/AdminLTE/issues/316/labels{/name}","comments_url":"https://api.github.com/repos/almasaeed2010/AdminLTE/issues/316/comments","events_url":"https://api.github.com/repos/almasaeed2010/AdminLTE/issues/316/events","html_url":"https://github.com/almasaeed2010/AdminLTE/pull/316","id":65670456,"number":316,"title":"[WIP] Jade implementation","user":{"login":"Soullivaneuh","id":1698357,"avatar_url":"https://avatars.githubusercontent.com/u/1698357?v=3","gravatar_id":"","url":"https://api.github.com/users/Soullivaneuh","html_url":"https://github.com/Soullivaneuh","followers_url":"https://api.github.com/users/Soullivaneuh/followers","following_url":"https://api.github.com/users/Soullivaneuh/following{/other_user}","gists_url":"https://api.github.com/users/Soullivaneuh/gists{/gist_id}","starred_url":"https://api.github.com/users/Soullivaneuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Soullivaneuh/subscriptions","organizations_url":"https://api.github.com/users/Soullivaneuh/orgs","repos_url":"https://api.github.com/users/Soullivaneuh/repos","events_url":"https://api.github.com/users/Soullivaneuh/events{/privacy}","received_events_url":"https://api.github.com/users/Soullivaneuh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-04-01T12:18:19Z","updated_at":"2015-04-01T20:47:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/almasaeed2010/AdminLTE/pulls/316","html_url":"https://github.com/almasaeed2010/AdminLTE/pull/316","diff_url":"https://github.com/almasaeed2010/AdminLTE/pull/316.diff","patch_url":"https://github.com/almasaeed2010/AdminLTE/pull/316.patch"},"body":"This PR is a dev env proposition.\r\n\r\nPages template are written with [jade-lang](http://jade-lang.com/) and compiled into html with grunt.\r\n\r\n### TODO\r\n\r\n - [ ] Rewrite all pages to jade-lang\r\n - [ ] Add some documentation\r\n\r\n### Why change the template system?\r\n\r\nInitially, I wanted to make a little PR that modify the pages layout (e.g. header, content).\r\n\r\nI cloned my fork, open the `pages` folder and saw my pain: All html files are completely duplicate with no layout refactor!\r\n\r\nSo you would say \"Normal, it's html!\". You are right, it's because I propose to change it to a little more advanced template system.\r\n\r\nUsing a template system with factored code will render this project more accessible for dev contributions.\r\n\r\n### Why Jade?\r\n\r\nGood question. I was looking for a simple html template system just to separate layout logic from content.\r\n\r\nAfter taking a tour on [template-chooser](http://garann.github.io/template-chooser/), I was seduced by Jade.\r\n\r\nBTW, Jade is used by bootstrap too: https://github.com/twbs/bootstrap/blob/master/Gruntfile.js#L320-L333\r\n\r\nAfter all, it's not an imposition. If somebody has a better proposition, feel free to advice it on this PR! :+1: \r\n\r\n### How it works?\r\n\r\nTo check my Jade implementation, do the following commands.\r\n\r\n```sh\r\ngit clone https://github.com/Soullivaneuh/AdminLTE.git\r\ncd AdminLTE\r\ngit checkout jade\r\ngrunt jade watch\r\n```\r\n\r\nAnd go to the `index.html` page.\r\n\r\nIf you want to edit a template or layout, just edit the related `.jade` and grunt will compile it for overwrite  html files.\r\n\r\nIn order be the most strait with the current directory structure, all the jade files are on `pages/_jade` and grunt output them on root directory.\r\n\r\nI don't think is the best and proper solution. Maybe we should do something like this:\r\n```\r\npages/src/**/*.jade\r\npages/dist/**/*.html\r\n```\r\nBut we'll have some problem with css relative links. Maybe a cssrewrite system will be required.\r\n\r\nOr maybe a global directory restructure like this:\r\n```\r\nsrc/less/**/*.less\r\nsrc/views/**/*.jade\r\nsrc/scripts/**/*.js\r\n\r\nsrc/dist/css/*.css\r\nsrc/dist/js/*.js\r\nsrc/dist/pages/*.html\r\nsrc/dist/index.html\r\nsrc/dist/index2.html\r\n```\r\n\r\n### Can we do more with this?\r\n\r\nOf course yes! I make this proposition just for dev env in order to make pages modification easier.\r\n\r\nBut we can make it better with an official jade-lang support by adding some mixins for our AdminLTE widgets. Based on this example for bootstrap: http://webdesign.tutsplus.com/tutorials/baking-bootstrap-snippets-with-jade--cms-22798\r\n\r\nBut I think it's good for another PR. One feature at a time. :+1: \r\n\r\n### Your choice!\r\n\r\nAs I said, it's a proposition. I'll be glad see it accepted. :)\r\n\r\nThis PR is not complete, I just re-factored the layout and index.html to give you an example.\r\n\r\nIf we are agree with this proposition, I'll finish it. :smile: \r\n\r\nThanks for reading.\r\n\r\nRegards."},"comment":{"url":"https://api.github.com/repos/almasaeed2010/AdminLTE/issues/comments/88627070","html_url":"https://github.com/almasaeed2010/AdminLTE/pull/316#issuecomment-88627070","issue_url":"https://api.github.com/repos/almasaeed2010/AdminLTE/issues/316","id":88627070,"user":{"login":"almasaeed2010","id":1512664,"avatar_url":"https://avatars.githubusercontent.com/u/1512664?v=3","gravatar_id":"","url":"https://api.github.com/users/almasaeed2010","html_url":"https://github.com/almasaeed2010","followers_url":"https://api.github.com/users/almasaeed2010/followers","following_url":"https://api.github.com/users/almasaeed2010/following{/other_user}","gists_url":"https://api.github.com/users/almasaeed2010/gists{/gist_id}","starred_url":"https://api.github.com/users/almasaeed2010/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/almasaeed2010/subscriptions","organizations_url":"https://api.github.com/users/almasaeed2010/orgs","repos_url":"https://api.github.com/users/almasaeed2010/repos","events_url":"https://api.github.com/users/almasaeed2010/events{/privacy}","received_events_url":"https://api.github.com/users/almasaeed2010/received_events","type":"User","site_admin":false},"created_at":"2015-04-01T20:47:47Z","updated_at":"2015-04-01T20:47:47Z","body":"The reason I want a template system is to seperate the navigation files such as, sidebar, main-header and right sidebar from the content. I hate having to add a link manually to each and every page that has a sidebar when I create a new features. The template system will eliminate the need to do so over and over again. We will still have the html files, of course, commented and properly organized as we are used to. \r\n\r\nRegarding the structure I believe we should add our template pages in the build directory within a special directory: \r\n```\r\nBuild/\r\n--------Less/\r\n--------Bootstrap-less/\r\n--------Html/\r\n          ------- the template pages will be added here and the compiled version would be where the current html files are.\r\n```\r\nThis way no one not in the development team has to use the template system and our tasks get less hideous."}}