hierapolis-rails 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -0
  3. data/hierapolis-rails.gemspec +8 -2
  4. data/lib/generators/hierapolis/install_generator.rb +24 -0
  5. data/lib/generators/hierapolis/templates/generators/haml/scaffold/scaffold_generator.rb +48 -0
  6. data/lib/generators/hierapolis/templates/generators/haml/scaffold/templates/_blank.html.haml +1 -0
  7. data/lib/generators/hierapolis/templates/generators/haml/scaffold/templates/_filters.html.haml +1 -0
  8. data/lib/generators/hierapolis/templates/generators/haml/scaffold/templates/_list.html.haml +1 -0
  9. data/lib/generators/hierapolis/templates/generators/haml/scaffold/templates/single_entry.html.haml +12 -0
  10. data/lib/generators/hierapolis/templates/haml/scaffold/_blank.html.haml +1 -0
  11. data/lib/generators/hierapolis/templates/haml/scaffold/_filters.html.haml +12 -0
  12. data/lib/generators/hierapolis/templates/haml/scaffold/_form.html.haml +16 -0
  13. data/lib/generators/hierapolis/templates/haml/scaffold/_list.html.haml +27 -0
  14. data/lib/generators/hierapolis/templates/haml/scaffold/edit.html.haml +3 -0
  15. data/lib/generators/hierapolis/templates/haml/scaffold/index.html.haml +10 -0
  16. data/lib/generators/hierapolis/templates/haml/scaffold/new.html.haml +3 -0
  17. data/lib/generators/hierapolis/templates/haml/scaffold/show.html.haml +13 -0
  18. data/lib/generators/hierapolis/templates/haml/scaffold/single_entry.html.haml +12 -0
  19. data/lib/generators/hierapolis/templates/layouts/application.html.haml +26 -0
  20. data/lib/generators/hierapolis/templates/layouts/hq/application.html.haml +54 -0
  21. data/lib/generators/hierapolis/templates/layouts/hq/partials/_breadcrumb.haml +2 -0
  22. data/lib/generators/hierapolis/templates/layouts/hq/partials/_dock.haml +34 -0
  23. data/lib/generators/hierapolis/templates/layouts/hq/partials/_navbar.haml +36 -0
  24. data/lib/generators/hierapolis/templates/layouts/hq/partials/_toolbar.haml +3 -0
  25. data/lib/generators/hierapolis/templates/layouts/login.html.haml +37 -0
  26. data/lib/generators/hierapolis/templates/layouts/partials/_footer.haml +6 -0
  27. data/lib/generators/hierapolis/templates/layouts/partials/_trackers.haml +5 -0
  28. data/lib/generators/hierapolis/templates/rails/responders_controller/controller.rb +56 -0
  29. data/lib/hierapolis/rails/version.rb +1 -1
  30. metadata +97 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 472dc4c8ddfc9b1eaa7af1169178d0dff339b7c4
4
- data.tar.gz: 98f8c9db7311a0af6b52e99904f94e59e8ec0b37
3
+ metadata.gz: 596e8fb333b65d4a5c73f49331416cb2af377175
4
+ data.tar.gz: 60e89ad7996c1b784a5e6d16a8b2e5fe2819c45c
5
5
  SHA512:
6
- metadata.gz: 7773ae9c593cac25e1d88d6dc32e70014bc163e708b0818ed1ff0830aa39e4d4bb738a859a0b8420b59db50e269515efa62b1f3fc4925d9759f42266d3c4be3d
7
- data.tar.gz: d429d3eb9b63f143983e6ad2c50b517bec1aa0fffaa46afdc28eab891e7256ea21dd7e3ebd6808805e9533fa9b1d36d9458ef1038d44029099f5f3cb4faa2ae9
6
+ metadata.gz: 9ff926c08f87d049b3496c73696aacf071a1295d824b46b1aace418b1ae31cc945fc362f73c1e595ced3eccf46fe31191c03ba6b04153532c06c69d16a797127
7
+ data.tar.gz: 64b510660597e43915ee103d216d0b3eee845bbb2da2ef7b335fd0508849ffd5ab15ee1f88c370b29404bfddd75b0cb352f344d3711083063150994754bce90f
data/README.md CHANGED
@@ -16,6 +16,12 @@ Or install it yourself as:
16
16
 
17
17
  $ gem install hierapolis-rails
18
18
 
19
+ Run the generator:
20
+
21
+ ```ruby
22
+ rails g hierapolis:install
23
+ ```
24
+
19
25
  ## Usage
20
26
 
21
27
  Add these lines to application.css
@@ -18,6 +18,12 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_development_dependency "bundler", "~> 1.3"
22
- spec.add_development_dependency "rake"
21
+ spec.add_development_dependency 'bundler', '~> 1.3'
22
+ spec.add_development_dependency 'rake'
23
+ spec.add_development_dependency 'will_paginate', '~> 3.0.3'
24
+ spec.add_development_dependency 'will_paginate-bootstrap', '~> 0.2.3'
25
+ spec.add_development_dependency 'ransack', '~> 1.0.0'
26
+ spec.add_development_dependency 'breadcrumbs_on_rails', '~> 2.3.0'
27
+ spec.add_development_dependency 'blankable', '~> 0.2.0'
28
+
23
29
  end
@@ -0,0 +1,24 @@
1
+ require 'rails/generators'
2
+ require 'rails/generators/base'
3
+ module Hierapolis
4
+ module Generators
5
+ class InstallGenerator < ::Rails::Generators::Base
6
+ desc "Copy hierapolis generators"
7
+ source_root File.expand_path('../templates', __FILE__)
8
+
9
+ def copy_scaffold_template
10
+ directory 'haml', 'lib/templates/haml'
11
+ directory 'rails', 'lib/templates/rails'
12
+ directory 'generators', 'lib/generators'
13
+ end
14
+
15
+ def copy_layouts
16
+ directory 'layouts/hq', 'app/views/layouts/hq'
17
+ directory 'layouts/hq/partials', 'app/views/layouts/hq/partials'
18
+
19
+ directory 'layouts/partials', 'app/views/layouts/partials'
20
+ copy_file 'layouts/login.html.haml', 'app/views/layouts/login.html.haml'
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,48 @@
1
+ require 'rails/generators/erb/scaffold/scaffold_generator'
2
+
3
+ module Haml
4
+ module Generators
5
+ class ScaffoldGenerator < Erb::Generators::ScaffoldGenerator
6
+ source_root File.expand_path("../templates", __FILE__)
7
+
8
+ def copy_view_files
9
+ available_views.each do |view|
10
+ filename = filename_with_extensions(view)
11
+ if filename == "_#{singular_table_name}.html.haml"
12
+ #create_file File.join("app/views", controller_file_path, "_#{singular_table_name}.html.haml") do
13
+ # hostname = ask("What is the virtual hostname I should use?")
14
+ # "vhost.name = #{hostname}"
15
+ #end
16
+
17
+ template 'single_entry.html.haml', File.join("app/views", controller_file_path, filename)
18
+ else
19
+ template "#{view}.html.haml", File.join("app/views", controller_file_path, filename)
20
+ end
21
+ end
22
+ end
23
+
24
+ hook_for :form_builder, :as => :scaffold
25
+
26
+ def copy_form_file
27
+ if options[:form_builder].nil?
28
+ filename = filename_with_extensions("_form")
29
+ template "_form.html.haml", File.join("app/views", controller_file_path, filename)
30
+ end
31
+ end
32
+
33
+ protected
34
+
35
+ def available_views
36
+ file = "_#{singular_table_name}"
37
+ list = %w(index edit show new _list _blank _filters)
38
+ list << file
39
+ list
40
+ end
41
+
42
+ def handler
43
+ :haml
44
+ end
45
+
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,12 @@
1
+ %tr
2
+ %td= <%= singular_table_name %>.id
3
+ <% for attribute in attributes -%>
4
+ %td= <%= singular_table_name %>.<%= attribute.name %>
5
+ <% end -%>
6
+ %td.action
7
+ = link_to(<%= singular_table_name %>, class: 'btn btn-success', toogle: 'tooltip', title: t('tooltips.zoom')) do
8
+ %i.icon-zoom-in
9
+ = link_to(edit_<%= singular_table_name %>_path(<%= singular_table_name %>) , class: 'btn btn-info') do
10
+ %i.icon-edit
11
+ = link_to(<%= singular_table_name %>, class: 'btn btn-danger', method: :delete) do
12
+ %i.icon-trash
@@ -0,0 +1 @@
1
+ %h1 Your blank message here
@@ -0,0 +1,12 @@
1
+ <% @search = "" -%>
2
+ <% attributes.each { |attribute| @search += "_#{attribute.name}_or" } -%>
3
+ .table-header.row
4
+ .col-lg-9
5
+ TODO: Add filters here
6
+ .col-lg-3
7
+ = search_form_for @search, builder: SimpleForm::FormBuilder do |f|
8
+ .input-group
9
+ = f.input_field :<%= @search[1..@search.size-4] %>_cont, label: false, input_html: {class: 'form-control'}, placeholder: 'Quick search...'
10
+ %span.input-group-btn
11
+ = button_tag( class: 'btn') do
12
+ %i.icon-search
@@ -0,0 +1,16 @@
1
+ .panel.panel-default
2
+ .panel-heading
3
+ %i.icon-edit.icon-large
4
+ = yield :form_title
5
+ .panel-body
6
+ = simple_form_for(@<%= singular_table_name %>) do |f|
7
+ = f.error_notification
8
+
9
+ .form-inputs
10
+ <%- attributes.each do |attribute| -%>
11
+ = f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %>
12
+ <%- end -%>
13
+
14
+ .form-actions
15
+ = f.button :submit, class: 'btn btn-default'
16
+ = link_to t('cancel'), <%= index_helper %>_path, class: 'btn'
@@ -0,0 +1,27 @@
1
+ .panel-heading
2
+ %i.icon-table.icon-large
3
+ = t('tt.index', resource_name: <%= singular_table_name.capitalize %>.model_name.human)
4
+ .panel-tools
5
+ .btn-group
6
+ %a.btn{href: '#'}
7
+ %i.icon-wrench
8
+ Settings
9
+ %a.btn{href: '#'}
10
+ %i.icon-filter
11
+ Filters
12
+ %a.btn{href: <%= index_helper %>_path, data: {toggle: 'toolbar-tooltip'}, title: 'Reload'}
13
+ %i.icon-refresh
14
+ .badge= @<%= plural_table_name %>.total_entries
15
+ .panel-body.filters
16
+ = render 'filters'
17
+ %table.table
18
+ %thead
19
+ %tr
20
+ %th #
21
+ <% for attribute in attributes -%>
22
+ %th= sort_link(@search, :<%= attribute.name %>, t('activerecord.attributes.<%= singular_table_name %>.<%= attribute.name %>'))
23
+ <% end -%>
24
+ %th.actions
25
+ Actions
26
+ %tbody
27
+ = render @<%= plural_table_name %>
@@ -0,0 +1,3 @@
1
+ - content_for :form_title do
2
+ = t('tt.edit', resource_name: <%= singular_table_name.capitalize %>.model_name.human)
3
+ = render 'form'
@@ -0,0 +1,10 @@
1
+ - content_for :toolbar do
2
+ = link_to new_<%= singular_table_name %>_path, class: 'btn btn-default' do
3
+ %i.icon-plus
4
+ = t('action_button.new', resource_name: <%= singular_table_name.capitalize %>.model_name.human)
5
+
6
+ .panel.panel-default.grid
7
+ =blankable(@<%= plural_table_name %>)
8
+ .panel-footer
9
+ .pagination.pagination-sm
10
+ = will_paginate @<%= plural_table_name %>, renderer: BootstrapPagination::Rails, bootstrap: 3
@@ -0,0 +1,3 @@
1
+ - content_for :form_title do
2
+ = t('tt.new', resource_name: <%= singular_table_name.capitalize %>.model_name.human)
3
+ = render 'form'
@@ -0,0 +1,13 @@
1
+ - content_for :toolbar do
2
+ = link_to edit_<%= singular_table_name %>_path(@<%= singular_name %> ), class: 'btn btn-default' do
3
+ %i.icon-pencil
4
+ = t('action_button.edit')
5
+ .panel.panel-default
6
+ .panel-heading
7
+ %i.icon-edit.icon-large
8
+ = t('tt.show', resource_name: <%= singular_table_name.capitalize %>.model_name.human)
9
+ .panel-body
10
+ = show_for @<%= singular_name %> do |s|
11
+ <% attributes.each do |attribute| -%>
12
+ = s.<%= attribute.reference? ? :association : :attribute %> :<%= attribute.name %>
13
+ <% end -%>
@@ -0,0 +1,12 @@
1
+ %tr
2
+ %td= <%= singular_table_name %>.id
3
+ <% for attribute in attributes -%>
4
+ %td= <%= singular_table_name %>.<%= attribute.name %>
5
+ <% end -%>
6
+ %td.action
7
+ = link_to(<%= singular_table_name %>, class: 'btn btn-success', toogle: 'tooltip', title: t('tooltips.zoom')) do
8
+ %i.icon-zoom-in
9
+ = link_to(edit_<%= singular_table_name %>_path(<%= singular_table_name %>) , class: 'btn btn-info') do
10
+ %i.icon-edit
11
+ = link_to(<%= singular_table_name %>, class: 'btn btn-danger', method: :delete) do
12
+ %i.icon-trash
@@ -0,0 +1,26 @@
1
+ !!! 5
2
+ /[if IE 8] <html class="no-js lt-ie10 lt-ie9" lang="en-us">
3
+ /[if IE 9] <html class="no-js lt-ie10 lt-ie9" lang="en-us">
4
+ /[if lt IE 10] <html class="no-js lt-ie10" lang="en-us">
5
+ %html{lang: 'en', class: 'no-js'}
6
+ %head
7
+ %title= yield :title
8
+ %meta(http-equiv="content-type" content="text/html" charset="utf-8")
9
+ %meta(http-equiv="x-ua-compatible" content="ie=edge,chrome=1")
10
+ %meta(name="description" content="")
11
+ %meta(name="author" content="")
12
+ %meta{content: 'initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width', name: 'viewport'}
13
+ %meta(name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)")
14
+ %meta(name='apple-mobile-web-app-capable' content='yes')
15
+ %meta(name='apple-mobile-web-app-status-bar-style' content='translucent-black')
16
+
17
+ %link(rel="shortcut icon" href="/assets/images/favicon.ico")
18
+ %link(rel="apple-touch-icon-precomposed" href="/assets/images/apple-touch-icon-precomposed.png")
19
+ %link(rel="apple-touch-icon-precomposed" sizes="57x57" href="/assets/images/apple-touch-icon-57x57-precomposed.png")
20
+ %link(rel="apple-touch-icon-precomposed" sizes="72x72" href="/assets/images/apple-touch-icon-72x72-precomposed.png")
21
+ %link(rel="apple-touch-icon-precomposed" sizes="114x114" href="/assets/images/apple-touch-icon-114x114-precomposed.png")
22
+
23
+ = csrf_meta_tags
24
+
25
+
26
+ %body.main
@@ -0,0 +1,54 @@
1
+ !!! 5
2
+ /[if IE 8] <html class="no-js lt-ie10 lt-ie9" lang="en-us">
3
+ /[if IE 9] <html class="no-js lt-ie10 lt-ie9" lang="en-us">
4
+ /[if lt IE 10] <html class="no-js lt-ie10" lang="en-us">
5
+ %html{lang: 'en', class: 'no-js'}
6
+ %head
7
+ %title= yield :title
8
+ %meta(http-equiv="content-type" content="text/html" charset="utf-8")
9
+ %meta(http-equiv="x-ua-compatible" content="ie=edge,chrome=1")
10
+ %meta(name="description" content="")
11
+ %meta(name="author" content="")
12
+ %meta{content: 'initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width', name: 'viewport'}
13
+ %meta(name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)")
14
+ %meta(name='apple-mobile-web-app-capable' content='yes')
15
+ %meta(name='apple-mobile-web-app-status-bar-style' content='translucent-black')
16
+
17
+ %link(rel="shortcut icon" href="/assets/images/favicon.ico")
18
+ %link(rel="apple-touch-icon-precomposed" href="/assets/images/apple-touch-icon-precomposed.png")
19
+ %link(rel="apple-touch-icon-precomposed" sizes="57x57" href="/assets/images/apple-touch-icon-57x57-precomposed.png")
20
+ %link(rel="apple-touch-icon-precomposed" sizes="72x72" href="/assets/images/apple-touch-icon-72x72-precomposed.png")
21
+ %link(rel="apple-touch-icon-precomposed" sizes="114x114" href="/assets/images/apple-touch-icon-114x114-precomposed.png")
22
+
23
+ = csrf_meta_tags
24
+
25
+ / Stylesheets (Don't change include order)
26
+ = stylesheet_link_tag 'application',
27
+ '//netdna.bootstrapcdn.com/font-awesome/3.2.0/css/font-awesome.min.css'
28
+ = yield :head
29
+
30
+ %body.main
31
+
32
+ / Navbar
33
+ = render partial: 'layouts/hq/partials/navbar'
34
+
35
+ #wrapper
36
+
37
+ / Sidebar
38
+ %section#sidebar
39
+ = render partial: 'layouts/hq/partials/dock'
40
+
41
+ / Tools
42
+ %section#tools
43
+ = render partial: 'layouts/hq/partials/breadcrumb'
44
+ = render partial: 'layouts/hq/partials/toolbar'
45
+
46
+ / Content
47
+ #content
48
+ = yield
49
+
50
+ / Footer
51
+ = render partial: 'layouts/partials/footer'
52
+
53
+ / Google Analytics
54
+ = render partial: 'layouts/partials/trackers'
@@ -0,0 +1,2 @@
1
+ %ul#breadcrumb.breadcrumb
2
+ = render_breadcrumbs :separator => ' / '
@@ -0,0 +1,34 @@
1
+ %i#toggle.icon-align-justify.icon-large
2
+
3
+ %ul#dock
4
+ %li.launcher
5
+ %i.icon-dashboard
6
+ =link_to 'Dashboard', '/hq/dashboard.html'
7
+ %li.launcher
8
+ %i.icon-file-text-alt
9
+ =link_to 'Forms', '/hq/dashboard/form.html'
10
+ %li.launcher
11
+ %i.icon-table
12
+ =link_to 'Tables', '/hq/dashboard/tables.html'
13
+ %li.launcher.dropdown.hover
14
+ %i.icon-flag
15
+ %a{href: '#'} Reports
16
+ %ul.dropdown-menu
17
+ %li.dropdown-header Launcher description
18
+ %li
19
+ %a{:href => '#'} Action
20
+ %li
21
+ %a{:href => '#'} Another action
22
+ %li
23
+ %a{:href => '#'} Something else here
24
+ %li.launcher
25
+ %i.icon-bookmark
26
+ %a{href: '#'} Bookmarks
27
+ %li.launcher
28
+ %i.icon-cloud
29
+ %a{href: '#'} Backup
30
+ %li.launcher
31
+ %i.icon-bug
32
+ %a{href: '#'} Feedback
33
+
34
+ #beaker{data: {toggle: 'tooltip'}, title: 'Made by lab2023'}
@@ -0,0 +1,36 @@
1
+ #navbar.navbar.navbar-default
2
+ %a.navbar-brand{:href => '#'}
3
+ %i.icon-beer
4
+ Hierapolis
5
+ %ul.nav.navbar-nav.pull-right
6
+ %li.dropdown
7
+ %a.dropdown-toggle{data: {toggle: 'dropdown'}, :href => '#'}
8
+ %i.icon-envelope
9
+ Messages
10
+ %span.badge 5
11
+ %b.caret
12
+ %ul.dropdown-menu
13
+ %li
14
+ %a{:href => '#'} New message
15
+ %li
16
+ %a{:href => '#'} Inbox
17
+ %li
18
+ %a{:href => '#'} Out box
19
+ %li
20
+ %a{:href => '#'} Trash
21
+ %li
22
+ %a{href: '#'}
23
+ %i.icon-cog
24
+ Settings
25
+ %li.dropdown.user
26
+ %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => '#'}
27
+ %i.icon-user
28
+ %strong John DOE
29
+ =image_tag 'http://lorempixel.com/output/fashion-q-c-20-20-4.jpg', width: '20px', height: '20px', class: 'img-rounded'
30
+ %b.caret
31
+ %ul.dropdown-menu
32
+ %li
33
+ %a{:href => '#'} Edit Profile
34
+ %li.divider
35
+ %li
36
+ =link_to 'Sign out', 'index.html'
@@ -0,0 +1,3 @@
1
+ #toolbar
2
+ .btn-group
3
+ = yield :toolbar
@@ -0,0 +1,37 @@
1
+ !!! 5
2
+ /[if IE 8] <html class="no-js lt-ie10 lt-ie9" lang="en-us">
3
+ /[if IE 9] <html class="no-js lt-ie10 lt-ie9" lang="en-us">
4
+ /[if lt IE 10] <html class="no-js lt-ie10" lang="en-us">
5
+ %html{lang: 'en', class: 'no-js'}
6
+ %head
7
+ %title= yield :title
8
+ %meta(http-equiv="content-type" content="text/html" charset="utf-8")
9
+ %meta(http-equiv="x-ua-compatible" content="ie=edge,chrome=1")
10
+ %meta(name="description" content="")
11
+ %meta(name="author" content="")
12
+ %meta{content: 'initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width', name: 'viewport'}
13
+ %meta(name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)")
14
+ %meta(name='apple-mobile-web-app-capable' content='yes')
15
+ %meta(name='apple-mobile-web-app-status-bar-style' content='translucent-black')
16
+
17
+ %link(rel="shortcut icon" href="/assets/images/favicon.ico")
18
+ %link(rel="apple-touch-icon-precomposed" href="/assets/images/apple-touch-icon-precomposed.png")
19
+ %link(rel="apple-touch-icon-precomposed" sizes="57x57" href="/assets/images/apple-touch-icon-57x57-precomposed.png")
20
+ %link(rel="apple-touch-icon-precomposed" sizes="72x72" href="/assets/images/apple-touch-icon-72x72-precomposed.png")
21
+ %link(rel="apple-touch-icon-precomposed" sizes="114x114" href="/assets/images/apple-touch-icon-114x114-precomposed.png")
22
+
23
+ / Stylesheets (Don't change include order)
24
+ = stylesheet_link_tag 'application',
25
+ '//netdna.bootstrapcdn.com/font-awesome/3.2.0/css/font-awesome.min.css'
26
+ = yield :head
27
+
28
+ %body.login
29
+
30
+ .wrapper
31
+ = yield
32
+
33
+ / Footer
34
+ = render partial: 'layouts/partials/footer'
35
+
36
+ / Google Analytics
37
+ = render partial: 'layouts/partials/trackers'
@@ -0,0 +1,6 @@
1
+
2
+ / Javascripts
3
+ = javascript_include_tag '//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js',
4
+ '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js',
5
+ '//cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js',
6
+ 'application'
@@ -0,0 +1,5 @@
1
+ :javascript
2
+ var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']];
3
+ (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
4
+ g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
5
+ s.parentNode.insertBefore(g,s)}(document,'script'));
@@ -0,0 +1,56 @@
1
+ # encoding: UTF-8
2
+ <% module_namespacing do -%>
3
+ class <%= controller_class_name %>Controller < ApplicationController
4
+ before_action :<%= "set_#{singular_table_name}" %>, only: [:show, :edit, :update, :destroy]
5
+ add_breadcrumb I18n.t('activerecord.models.<%= table_name %>'), :<%= table_name %>_path
6
+ <% unless options[:singleton] -%>
7
+ def index
8
+ @search = <%= class_name %>.search(params[:q])
9
+ @<%= table_name %> = @search.result(:distinct => true).paginate(:page => params[:page])
10
+ respond_with(@<%= table_name %>)
11
+ end
12
+ <% end -%>
13
+
14
+ def show
15
+ add_breadcrumb @<%= file_name %>.<%= attributes.first.name %>, <%= singular_table_name %>_path(@<%= file_name %>)
16
+ respond_with(@<%= file_name %>)
17
+ end
18
+
19
+ def new
20
+ add_breadcrumb t('tooltips.new'), new_<%= singular_table_name %>_path
21
+ @<%= file_name %> = <%= orm_class.build(class_name) %>
22
+ respond_with(@<%= file_name %>)
23
+ end
24
+
25
+ def edit
26
+ add_breadcrumb @<%= singular_table_name %>.id, <%= singular_table_name %>_path(@<%= singular_table_name %>)
27
+ add_breadcrumb t('tooltips.edit'), edit_<%= singular_table_name %>_path
28
+ end
29
+
30
+ def create
31
+ @<%= file_name %> = <%= orm_class.build(class_name, "#{singular_table_name}_params") %>
32
+ @<%= orm_instance.save %>
33
+ respond_with(@<%= file_name %>)
34
+ end
35
+
36
+ def update
37
+ @<%= orm_instance.update_attributes("#{singular_table_name}_params") %>
38
+ respond_with(@<%= file_name %>)
39
+ end
40
+
41
+ def destroy
42
+ @<%= orm_instance.destroy %>
43
+ respond_with(@<%= file_name %>)
44
+ end
45
+
46
+ private
47
+
48
+ def <%= "set_#{singular_table_name}" %>
49
+ @<%= file_name %> = <%= orm_class.find(class_name, "params[:id]") %>
50
+ end
51
+
52
+ def <%= "#{singular_table_name}_params" %>
53
+ params.require(<%= ":#{singular_table_name}" %>).permit(<%= attributes.map {|a| ":#{a.name}" }.sort.join(', ') %>)
54
+ end
55
+ end
56
+ <% end -%>
@@ -1,5 +1,5 @@
1
1
  module Hierapolis
2
2
  module Rails
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hierapolis-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Muhammet DİLEK
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-18 00:00:00.000000000 Z
11
+ date: 2013-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,6 +38,76 @@ dependencies:
38
38
  - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: will_paginate
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 3.0.3
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 3.0.3
55
+ - !ruby/object:Gem::Dependency
56
+ name: will_paginate-bootstrap
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 0.2.3
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 0.2.3
69
+ - !ruby/object:Gem::Dependency
70
+ name: ransack
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: 1.0.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: 1.0.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: breadcrumbs_on_rails
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: 2.3.0
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: 2.3.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: blankable
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ version: 0.2.0
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ~>
109
+ - !ruby/object:Gem::Version
110
+ version: 0.2.0
41
111
  description: This gem using to  integrate hierapolis theme  on rails project.
42
112
  email:
43
113
  - muhammet.dilek@lab2023.com
@@ -52,6 +122,31 @@ files:
52
122
  - README.md
53
123
  - Rakefile
54
124
  - hierapolis-rails.gemspec
125
+ - lib/generators/hierapolis/install_generator.rb
126
+ - lib/generators/hierapolis/templates/generators/haml/scaffold/scaffold_generator.rb
127
+ - lib/generators/hierapolis/templates/generators/haml/scaffold/templates/_blank.html.haml
128
+ - lib/generators/hierapolis/templates/generators/haml/scaffold/templates/_filters.html.haml
129
+ - lib/generators/hierapolis/templates/generators/haml/scaffold/templates/_list.html.haml
130
+ - lib/generators/hierapolis/templates/generators/haml/scaffold/templates/single_entry.html.haml
131
+ - lib/generators/hierapolis/templates/haml/scaffold/_blank.html.haml
132
+ - lib/generators/hierapolis/templates/haml/scaffold/_filters.html.haml
133
+ - lib/generators/hierapolis/templates/haml/scaffold/_form.html.haml
134
+ - lib/generators/hierapolis/templates/haml/scaffold/_list.html.haml
135
+ - lib/generators/hierapolis/templates/haml/scaffold/edit.html.haml
136
+ - lib/generators/hierapolis/templates/haml/scaffold/index.html.haml
137
+ - lib/generators/hierapolis/templates/haml/scaffold/new.html.haml
138
+ - lib/generators/hierapolis/templates/haml/scaffold/show.html.haml
139
+ - lib/generators/hierapolis/templates/haml/scaffold/single_entry.html.haml
140
+ - lib/generators/hierapolis/templates/layouts/application.html.haml
141
+ - lib/generators/hierapolis/templates/layouts/hq/application.html.haml
142
+ - lib/generators/hierapolis/templates/layouts/hq/partials/_breadcrumb.haml
143
+ - lib/generators/hierapolis/templates/layouts/hq/partials/_dock.haml
144
+ - lib/generators/hierapolis/templates/layouts/hq/partials/_navbar.haml
145
+ - lib/generators/hierapolis/templates/layouts/hq/partials/_toolbar.haml
146
+ - lib/generators/hierapolis/templates/layouts/login.html.haml
147
+ - lib/generators/hierapolis/templates/layouts/partials/_footer.haml
148
+ - lib/generators/hierapolis/templates/layouts/partials/_trackers.haml
149
+ - lib/generators/hierapolis/templates/rails/responders_controller/controller.rb
55
150
  - lib/hierapolis/rails.rb
56
151
  - lib/hierapolis/rails/version.rb
57
152
  - vendor/assets/images/apple-touch-icon-114x114-precomposed.png