loldesign_publisher 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +21 -0
  5. data/app/assets/images/grid.png +0 -0
  6. data/app/assets/images/loldesign_publisher/logo.png +0 -0
  7. data/app/assets/images/loldesign_publisher/logo.svg +81 -0
  8. data/app/assets/images/loldesign_publisher/nav_active_link.svg +8 -0
  9. data/app/assets/javascripts/loldesign_publisher/activable.js +51 -0
  10. data/app/assets/javascripts/loldesign_publisher/libs/datepicker-pt-BR.js +37 -0
  11. data/app/assets/javascripts/loldesign_publisher/libs/gumby.init.js +47 -0
  12. data/app/assets/javascripts/loldesign_publisher/libs/gumby.js +258 -0
  13. data/app/assets/javascripts/loldesign_publisher/libs/gumby.min.js +1 -0
  14. data/app/assets/javascripts/loldesign_publisher/libs/jquery-1.10.1.min.js +6 -0
  15. data/app/assets/javascripts/loldesign_publisher/libs/jquery-1.10.1.min.map +1 -0
  16. data/app/assets/javascripts/loldesign_publisher/libs/jquery-2.0.2.min.js +6 -0
  17. data/app/assets/javascripts/loldesign_publisher/libs/jquery-2.0.2.min.map +1 -0
  18. data/app/assets/javascripts/loldesign_publisher/libs/jquery.mask.min.js +7 -0
  19. data/app/assets/javascripts/loldesign_publisher/libs/jquery.mobile.custom.min.js +3 -0
  20. data/app/assets/javascripts/loldesign_publisher/libs/modernizr-2.6.2.min.js +4 -0
  21. data/app/assets/javascripts/loldesign_publisher/libs/ui/gumby.checkbox.js +101 -0
  22. data/app/assets/javascripts/loldesign_publisher/libs/ui/gumby.fixed.js +240 -0
  23. data/app/assets/javascripts/loldesign_publisher/libs/ui/gumby.navbar.js +115 -0
  24. data/app/assets/javascripts/loldesign_publisher/libs/ui/gumby.radiobtn.js +90 -0
  25. data/app/assets/javascripts/loldesign_publisher/libs/ui/gumby.retina.js +81 -0
  26. data/app/assets/javascripts/loldesign_publisher/libs/ui/gumby.skiplink.js +157 -0
  27. data/app/assets/javascripts/loldesign_publisher/libs/ui/gumby.tabs.js +80 -0
  28. data/app/assets/javascripts/loldesign_publisher/libs/ui/gumby.toggleswitch.js +264 -0
  29. data/app/assets/javascripts/loldesign_publisher/libs/ui/jquery.validation.js +142 -0
  30. data/app/assets/javascripts/loldesign_publisher/main.js +23 -0
  31. data/app/assets/javascripts/loldesign_publisher/plugins.js +4 -0
  32. data/app/assets/javascripts/loldesign_publisher/publisher.js +65 -0
  33. data/app/assets/stylesheets/loldesign_publisher/_base.css.scss +62 -0
  34. data/app/assets/stylesheets/loldesign_publisher/gumby.css +1683 -0
  35. data/app/assets/stylesheets/loldesign_publisher/layouts/_default.html.css.scss +15 -0
  36. data/app/assets/stylesheets/loldesign_publisher/layouts/_form.css.scss +101 -0
  37. data/app/assets/stylesheets/loldesign_publisher/layouts/_header_main.css.scss +20 -0
  38. data/app/assets/stylesheets/loldesign_publisher/layouts/_nav_main.css.scss +30 -0
  39. data/app/assets/stylesheets/loldesign_publisher/layouts/_resource_info.css.scss +40 -0
  40. data/app/assets/stylesheets/loldesign_publisher/modules/_add_resource.css.scss +12 -0
  41. data/app/assets/stylesheets/loldesign_publisher/modules/_btn_cancel.css.scss +13 -0
  42. data/app/assets/stylesheets/loldesign_publisher/modules/_btn_remove.css.scss +13 -0
  43. data/app/assets/stylesheets/loldesign_publisher/modules/_btn_save.css.scss +16 -0
  44. data/app/assets/stylesheets/loldesign_publisher/modules/_btn_show.css.scss +12 -0
  45. data/app/assets/stylesheets/loldesign_publisher/modules/_filter_box.css.scss +35 -0
  46. data/app/assets/stylesheets/loldesign_publisher/modules/_messages.css.scss +20 -0
  47. data/app/assets/stylesheets/loldesign_publisher/modules/_pagination.css.scss +65 -0
  48. data/app/assets/stylesheets/loldesign_publisher/modules/_table_page.css.scss +37 -0
  49. data/app/assets/stylesheets/loldesign_publisher/modules/_title_page.css.scss +54 -0
  50. data/app/assets/stylesheets/loldesign_publisher/publisher.css +7 -0
  51. data/app/controllers/loldesign_publisher/activables_controller.rb +26 -0
  52. data/app/controllers/loldesign_publisher/publisher_controller.rb +4 -0
  53. data/app/helpers/loldesign_publisher/publisher_helper.rb +101 -0
  54. data/app/views/layouts/loldesign_publisher/_header_main.html.erb +8 -0
  55. data/app/views/layouts/loldesign_publisher/_nav_main.html.erb +12 -0
  56. data/app/views/layouts/loldesign_publisher/modules/_add_resource.html.erb +3 -0
  57. data/app/views/layouts/loldesign_publisher/modules/_messages.html.erb +5 -0
  58. data/app/views/layouts/loldesign_publisher/modules/_td_not_found.html.erb +1 -0
  59. data/app/views/layouts/loldesign_publisher/modules/_title_page.html.erb +9 -0
  60. data/app/views/layouts/loldesign_publisher/publisher.html.erb +24 -0
  61. data/config/routes.rb +7 -0
  62. data/lib/generators/loldesign_publisher/install_generator.rb +26 -0
  63. data/lib/generators/loldesign_publisher/templates/loldesign_publisher.yml +12 -0
  64. data/lib/generators/loldesign_publisher/templates/override_publisher.css.scss +5 -0
  65. data/lib/generators/loldesign_publisher/templates/publisher_rails_app.js +3 -0
  66. data/lib/generators/loldesign_publisher/views_generator.rb +16 -0
  67. data/lib/loldesign_publisher.rb +28 -0
  68. data/lib/loldesign_publisher/engine.rb +28 -0
  69. data/lib/loldesign_publisher/version.rb +3 -0
  70. data/lib/tasks/loldesign_publisher_tasks.rake +4 -0
  71. data/public/fonts/icons/entypo.eot +0 -0
  72. data/public/fonts/icons/entypo.ttf +0 -0
  73. data/public/fonts/icons/entypo.woff +0 -0
  74. data/public/grid.js +68 -0
  75. data/spec/controllers/loldesign_publisher/activables_controller_spec.rb +21 -0
  76. data/spec/dummy/README.rdoc +28 -0
  77. data/spec/dummy/Rakefile +6 -0
  78. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  79. data/spec/dummy/app/assets/javascripts/loldesign_publisher/publisher_rails_app.js +3 -0
  80. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  81. data/spec/dummy/app/assets/stylesheets/loldesign_publisher/override_publisher.css.scss +5 -0
  82. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  83. data/spec/dummy/app/controllers/users_controller.rb +10 -0
  84. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  85. data/spec/dummy/app/models/user.rb +2 -0
  86. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  87. data/spec/dummy/app/views/users/_filters_by_from_to.html.erb +8 -0
  88. data/spec/dummy/app/views/users/_user.html.erb +9 -0
  89. data/spec/dummy/app/views/users/index.html.erb +26 -0
  90. data/spec/dummy/app/views/users/new.html.erb +23 -0
  91. data/spec/dummy/bin/bundle +3 -0
  92. data/spec/dummy/bin/rails +4 -0
  93. data/spec/dummy/bin/rake +4 -0
  94. data/spec/dummy/config.ru +4 -0
  95. data/spec/dummy/config/application.rb +29 -0
  96. data/spec/dummy/config/boot.rb +5 -0
  97. data/spec/dummy/config/database.yml +25 -0
  98. data/spec/dummy/config/environment.rb +5 -0
  99. data/spec/dummy/config/environments/development.rb +37 -0
  100. data/spec/dummy/config/environments/production.rb +78 -0
  101. data/spec/dummy/config/environments/test.rb +39 -0
  102. data/spec/dummy/config/initializers/assets.rb +8 -0
  103. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  104. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  105. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  106. data/spec/dummy/config/initializers/inflections.rb +16 -0
  107. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  108. data/spec/dummy/config/initializers/session_store.rb +3 -0
  109. data/spec/dummy/config/initializers/simple_form.rb +145 -0
  110. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  111. data/spec/dummy/config/locales/en.yml +23 -0
  112. data/spec/dummy/config/locales/simple_form.en.yml +26 -0
  113. data/spec/dummy/config/loldesign_publisher.yml +12 -0
  114. data/spec/dummy/config/routes.rb +59 -0
  115. data/spec/dummy/config/secrets.yml +22 -0
  116. data/spec/dummy/db/development.sqlite3 +0 -0
  117. data/spec/dummy/db/migrate/20141126120426_create_users.rb +13 -0
  118. data/spec/dummy/db/schema.rb +26 -0
  119. data/spec/dummy/db/test.sqlite3 +0 -0
  120. data/spec/dummy/lib/templates/erb/scaffold/_form.html.erb +13 -0
  121. data/spec/dummy/log/development.log +16 -0
  122. data/spec/dummy/log/test.log +158 -0
  123. data/spec/dummy/public/404.html +67 -0
  124. data/spec/dummy/public/422.html +67 -0
  125. data/spec/dummy/public/500.html +66 -0
  126. data/spec/dummy/public/favicon.ico +0 -0
  127. data/spec/factories/user_factory.rb +10 -0
  128. data/spec/spec_helper.rb +18 -0
  129. metadata +383 -0
@@ -0,0 +1,54 @@
1
+ @import "loldesign_publisher/base";
2
+
3
+ header.title-page{
4
+ @include clearfix;
5
+ border-bottom: 1px dotted #000;
6
+
7
+ h2{
8
+ font-size: 30px;
9
+ @include grid(13);
10
+ @include alpha;
11
+ }
12
+
13
+ .btn{
14
+ display: none;
15
+
16
+ &:last-child{
17
+ @include omega;
18
+ }
19
+ }
20
+
21
+ .btn.show{
22
+ margin-top: 13px;
23
+ }
24
+
25
+ .btn.save{
26
+ margin-top: 10px;
27
+ }
28
+
29
+ &[data-show=true]{
30
+ .btn.show{
31
+ display: block;
32
+ }
33
+ }
34
+
35
+ &[data-save=true]{
36
+ .btn.save{
37
+ display: block;
38
+ }
39
+ }
40
+
41
+ &[data-show=true][data-save=false]{
42
+ .btn.show{
43
+ display: block;
44
+ @include push(2);
45
+ }
46
+ }
47
+
48
+ &[data-show=false][data-save=true]{
49
+ .btn.save{
50
+ display: block;
51
+ @include push(2);
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,7 @@
1
+ /*
2
+ *= require ./gumby.css
3
+ *= require jquery-ui/datepicker
4
+ *= require_tree ./layouts
5
+ *= require_tree ./modules
6
+ *= require loldesign_publisher/override_publisher
7
+ */
@@ -0,0 +1,26 @@
1
+ class LoldesignPublisher::ActivablesController < LoldesignPublisher::PublisherController
2
+ respond_to :html, :json
3
+
4
+ before_filter :load_resource
5
+
6
+ def create
7
+ if @resource.update_attribute(:active, true)
8
+ render json: {message: "#{@resource.class.to_s} - #{@resource.id} activated."}
9
+ else
10
+ head :error
11
+ end
12
+ end
13
+
14
+ def destroy
15
+ if @resource.update_attribute(:active, false)
16
+ render json: {message: "#{@resource.class.to_s} - #{@resource.id} inactivated."}
17
+ else
18
+ head :error
19
+ end
20
+ end
21
+
22
+ private
23
+ def load_resource
24
+ @resource = params[:resource_name].classify.constantize.find params[:id]
25
+ end
26
+ end
@@ -0,0 +1,4 @@
1
+ module LoldesignPublisher
2
+ class PublisherController < ActionController::Base
3
+ end
4
+ end
@@ -0,0 +1,101 @@
1
+ #encoding: utf-8
2
+
3
+ module LoldesignPublisher
4
+ module PublisherHelper
5
+ def title_page(title, options={})
6
+ save_options = {display: options[:save].present? , path: options[:save] || 'javascript://'}
7
+ show_options = {display: options[:show].present? , path: options[:show] || 'javascript://'}
8
+ subtitle_options = {display: options[:subtitle].present?, text: options[:subtitle] || '' }
9
+
10
+ render partial: '/layouts/loldesign_publisher/modules/title_page', locals: {title: title,
11
+ show_options: show_options,
12
+ save_options: save_options,
13
+ subtitle_options: subtitle_options
14
+ }
15
+ end
16
+
17
+ def add_resource(text, path)
18
+ render partial: '/layouts/loldesign_publisher/modules/add_resource', locals: {text: text, path: path}
19
+ end
20
+
21
+ def edit_resource(path)
22
+ link_to(path) { gumby_icon 'pencil' }
23
+ end
24
+
25
+ def show_resource_with_icon(path)
26
+ link_to(path){ gumby_icon 'info-circled' }
27
+ end
28
+
29
+ def remove_resource(path, options)
30
+ message = options[:message] || 'Você tem certeza que deseja remover?'
31
+ type = options[:type] || :link
32
+ text = options[:text] || 'Remover'
33
+
34
+ if type == :link
35
+ link_to(path, method: :delete, data: {confirm: message}) { gumby_icon 'cancel-circled' }
36
+ else
37
+ content_tag :div, class: 'pretty medium danger btn remove' do
38
+ link_to text, path, method: :delete, data: {confirm: message}
39
+ end
40
+ end
41
+ end
42
+
43
+ def cancel_action(path='javascript://')
44
+ default_button('Cancelar', path)
45
+ end
46
+
47
+ def default_button(text, path='javascript://')
48
+ content_tag :div, class: 'pretty medium info btn cancel' do
49
+ link_to text, path
50
+ end
51
+ end
52
+
53
+ def save_resource(text, path)
54
+ content_tag :div, class: 'pretty medium secondary btn save' do
55
+ link_to text, path, data: {disable_with: '...'}
56
+ end
57
+ end
58
+
59
+ def submit_button(form, text='Salvar')
60
+ content_tag :div, class: 'pretty medium secondary btn save' do
61
+ form.submit 'Salvar', data: {'disable-with' => '...'}
62
+ end
63
+ end
64
+
65
+ def show_resource(text, path)
66
+ content_tag :div, class: 'pretty medium default btn show' do
67
+ link_to text, path
68
+ end
69
+ end
70
+
71
+ def nav_main_link(key)
72
+ link_name = LoldesignPublisher.config[:menu_links][key]['name']
73
+
74
+ if LoldesignPublisher.config[:menu_links][key]['path'].present?
75
+ link_path = send(LoldesignPublisher.config[:menu_links][key]['path'])
76
+ options = {data: {active: controller_name == key}}
77
+ else
78
+ link_path = 'javascript://'
79
+ options = {}
80
+ end
81
+
82
+ link_to link_name, link_path, options
83
+ end
84
+
85
+ def display_list_for(resources, options={})
86
+ total_fields = options[:fields] || 2
87
+
88
+ render(resources) || render(partial: '/layouts/loldesign_publisher/modules/td_not_found', locals: {colspan: total_fields})
89
+ end
90
+
91
+ def activable_field_for(resource, options={})
92
+ klass = options[:klass] || resource.class.to_s
93
+ check_box_tag resource, :active, resource.active, data: {resource: klass, id: resource.id}, class: 'activable'
94
+ end
95
+
96
+ private
97
+ def gumby_icon(icon_name)
98
+ content_tag :i, '', class: "icon-#{icon_name}"
99
+ end
100
+ end
101
+ end
@@ -0,0 +1,8 @@
1
+ <header class="main">
2
+ <section class='container-main'>
3
+ <%= link_to LoldesignPublisher.config[:logout], method: :delete, class: 'logout' do%>
4
+ <span>Sair</span>
5
+ <i class="icon-logout"></i>
6
+ <% end -%>
7
+ </section>
8
+ </header>
@@ -0,0 +1,12 @@
1
+ <nav class='main'>
2
+ <figure>
3
+ <%= image_tag LoldesignPublisher.config[:logo] %>
4
+ </figure>
5
+ <ul>
6
+ <% LoldesignPublisher.config[:menu_links].each_key do |key|%>
7
+ <li>
8
+ <%= nav_main_link key %>
9
+ </li>
10
+ <% end -%>
11
+ </ul>
12
+ </nav>
@@ -0,0 +1,3 @@
1
+ <div class="medium default btn icon-left icon-plus-circled add-resource">
2
+ <%= link_to text, path %>
3
+ </div>
@@ -0,0 +1,5 @@
1
+ <% flash.each do |name, msg| %>
2
+ <% if msg.is_a?(String) %>
3
+ <%= content_tag :div, msg, class: "messages #{name}" %>
4
+ <% end %>
5
+ <% end %>
@@ -0,0 +1 @@
1
+ <td class='not-found' colspan="<%= colspan %>">Nenhum registro encontrado</td>
@@ -0,0 +1,9 @@
1
+ <header class="title-page" data-show=<%= show_options[:display] %> data-save=<%= save_options[:display] %>>
2
+ <h2>
3
+ <%= title %>
4
+ <%= content_tag(:small, subtitle_options[:text]) if subtitle_options[:display]%>
5
+ </h2>
6
+
7
+ <%= show_resource 'Visualizar', show_options[:path] %>
8
+ <%= save_resource 'Salvar' , save_options[:path] %>
9
+ </header>
@@ -0,0 +1,24 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Loldesign Publisher</title>
5
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
6
+ <%= stylesheet_link_tag 'loldesign_publisher/publisher', media: 'all', 'data-turbolinks-track' => true %>
7
+ <%= javascript_include_tag :modernizr %>
8
+ <%= csrf_meta_tags %>
9
+ </head>
10
+ <body>
11
+ <%= render partial: '/layouts/loldesign_publisher/header_main' %>
12
+
13
+ <section class='container-main'>
14
+ <%= render partial: '/layouts/loldesign_publisher/nav_main' %>
15
+ <section class='content'>
16
+ <%= render partial: '/layouts/loldesign_publisher/modules/messages' %>
17
+
18
+ <%= yield %>
19
+ </section>
20
+ </section>
21
+ <%= javascript_include_tag 'loldesign_publisher/publisher', 'data-turbolinks-track' => true %>
22
+ <%= javascript_include_tag '/grid.js' if Rails.env.development? %>
23
+ </body>
24
+ </html>
data/config/routes.rb ADDED
@@ -0,0 +1,7 @@
1
+ Rails.application.routes.draw do
2
+ namespace :loldesign_publisher do
3
+ #activables
4
+ post '/activables/:resource_name/:id' => 'activables#create'
5
+ delete '/activables/:resource_name/:id' => 'activables#destroy'
6
+ end
7
+ end
@@ -0,0 +1,26 @@
1
+ #encoding: utf-8
2
+ module LoldesignPublisher
3
+ class InstallGenerator < ::Rails::Generators::Base
4
+ source_root File.expand_path('../templates', __FILE__)
5
+
6
+ def create_initializer_file
7
+ copy_file "loldesign_publisher.yml", "config/loldesign_publisher.yml"
8
+ end
9
+
10
+ def create_simple_form
11
+ run 'bundle exec rails generate simple_form:install'
12
+ end
13
+
14
+ def copy_override_css
15
+ copy_file 'override_publisher.css.scss', 'app/assets/stylesheets/loldesign_publisher/override_publisher.css.scss'
16
+ end
17
+
18
+ def copy_publisher_js
19
+ copy_file 'publisher_rails_app.js', 'app/assets/javascripts/loldesign_publisher/publisher_rails_app.js'
20
+ end
21
+
22
+ def add_route
23
+ route "mount LoldesignPublisher::Rails::Engine => '/'"
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,12 @@
1
+ paths:
2
+ logo: 'loldesign_publisher/logo.svg'
3
+ logout: 'javascript://'
4
+
5
+ menu_links:
6
+ banners:
7
+ name: 'Banner Home'
8
+ path: users_path
9
+ recipes:
10
+ name: 'Receitas'
11
+ schedules:
12
+ name: 'Agenda / Cursos'
@@ -0,0 +1,5 @@
1
+ // --------------------------
2
+ // override css from loldesign_publisher
3
+ // --------------------------
4
+
5
+ @import "loldesign_publisher/base";
@@ -0,0 +1,3 @@
1
+ // --------------------------
2
+ // you can add your own js for publisher here.
3
+ // --------------------------
@@ -0,0 +1,16 @@
1
+ #encoding: utf-8
2
+ module LoldesignPublisher
3
+ class ViewsGenerator < ::Rails::Generators::Base
4
+ source_root File.expand_path('../../../../app/views/layouts/loldesign_publisher', __FILE__)
5
+
6
+ def copy_layouts
7
+ copy_file 'publisher.html.erb' , 'app/views/layouts/loldesign_publisher/publisher.html.erb'
8
+ copy_file '_header_main.html.erb' , 'app/views/layouts/loldesign_publisher/_header_main.html.erb'
9
+ copy_file '_nav_main.html.erb' , 'app/views/layouts/loldesign_publisher/_nav_main.html.erb'
10
+ copy_file 'modules/_add_resource.html.erb' , 'app/views/layouts/loldesign_publisher/modules/_add_resource.html.erb'
11
+ copy_file 'modules/_messages.html.erb' , 'app/views/layouts/loldesign_publisher/modules/_messages.html.erb'
12
+ copy_file 'modules/_td_not_found.html.erb' , 'app/views/layouts/loldesign_publisher/modules/_td_not_found.html.erb'
13
+ copy_file 'modules/_title_page.html.erb' , 'app/views/layouts/loldesign_publisher/modules/_title_page.html.erb'
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,28 @@
1
+ require 'loldesign_publisher/version'
2
+ require 'jquery-rails'
3
+ require 'jquery-ui-rails'
4
+ require 'sass-rails'
5
+ require 'modernizr-rails'
6
+ require 'simple_form'
7
+ require 'loldesign_publisher/engine'
8
+
9
+ module LoldesignPublisher
10
+ class << self
11
+ attr_accessor :config, :root_path
12
+ end
13
+
14
+ def self.read_config
15
+ config = YAML.load_file("#{LoldesignPublisher.root_path}/config/loldesign_publisher.yml")
16
+ config.symbolize_keys!
17
+
18
+ self.config = {
19
+ logo: config[:paths]['logo'],
20
+ logout: config[:paths]['logout'],
21
+ menu_links: config[:paths]['menu_links']
22
+ }
23
+
24
+ rescue Exception
25
+ puts '[WARNING] run: bundle exec rails g initializer'
26
+ end
27
+ end
28
+
@@ -0,0 +1,28 @@
1
+ module LoldesignPublisher
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ initializer "static assets" do |app|
5
+ app.middleware.use ::ActionDispatch::Static, "#{root}/public"
6
+ end
7
+
8
+ initializer 'config' do |app|
9
+ LoldesignPublisher.root_path = app.root
10
+
11
+ LoldesignPublisher.read_config()
12
+
13
+ app.config.assets.precompile += %w(loldesign_publisher/publisher.css loldesign_publisher/publisher.js)
14
+ end
15
+
16
+ config.to_prepare do
17
+ ApplicationController.helper(LoldesignPublisher::PublisherHelper)
18
+ end
19
+
20
+ config.generators do |g|
21
+ g.test_framework :rspec, :fixture => false
22
+ g.fixture_replacement :factory_girl, :dir => 'spec/factories'
23
+ g.assets false
24
+ g.helper false
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,3 @@
1
+ module LoldesignPublisher
2
+ VERSION = "1.1.0"
3
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :loldesign_publisher do
3
+ # # Task goes here
4
+ # end
Binary file
Binary file
Binary file
data/public/grid.js ADDED
@@ -0,0 +1,68 @@
1
+ var Grid = function(){
2
+ var button_grid = Grid.elements().button_grid.on('click', Grid.toggle);
3
+ var grid_container = Grid.elements().grid_container.append(Grid.elements().grid_element);
4
+
5
+ $('body').prepend(button_grid);
6
+ $('body').prepend(grid_container);
7
+ }
8
+
9
+ Grid.elements = function(){
10
+ var grid_container = $('<div>', {
11
+ id: 'grid_container'
12
+ }).css({
13
+ marginLeft: 'auto',
14
+ marginRight: 'auto',
15
+ width: '1056px'
16
+ });
17
+
18
+ var grid_element = $('<div>', {
19
+ id: 'grid_back'
20
+ }).css({
21
+ display: 'none',
22
+ position: 'absolute',
23
+ background: 'url("/assets/grid.png") repeat-y scroll 0 0 transparent',
24
+ height: '3000px',
25
+ opacity: 0.5,
26
+ width: 'inherit',
27
+ zIndex: 1000,
28
+ top: '1px'
29
+ });
30
+
31
+ var button_grid = $('<a>', {
32
+ id: 'grid_on_off',
33
+ text: '#',
34
+ href: "#"
35
+ }).css({
36
+ position: 'absolute',
37
+ color: '#333',
38
+ fontSize: '13px',
39
+ top: '0px',
40
+ right: '20px',
41
+ zIndex: 2000
42
+ });
43
+
44
+ return {
45
+ grid_container: grid_container,
46
+ grid_element: grid_element,
47
+ button_grid: button_grid
48
+ }
49
+ }
50
+
51
+ Grid.toggle = function(event){
52
+ event.preventDefault();
53
+ $('#grid_back').toggle();
54
+ }
55
+
56
+ $(document).ready(function(){
57
+ Grid();
58
+ });
59
+
60
+ $(document).ready(function(){
61
+ $('#contact a').last().click(function(){
62
+ $(this).parent().hide();
63
+ })
64
+
65
+ $(document).keydown(function(e) {
66
+ if (e.keyCode == 27) { Grid.toggle(e) }
67
+ })
68
+ });