lipsiadmin 5.1.6 → 5.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. data/lib/access_control/authentication.rb +20 -20
  2. data/lib/access_control/base.rb +40 -40
  3. data/lib/controller/ext.rb +27 -27
  4. data/lib/controller/lipsiadmin_controller.rb +3 -3
  5. data/lib/controller/pdf_builder.rb +33 -31
  6. data/lib/controller/rescue.rb +12 -12
  7. data/lib/controller/responds_to_parent.rb +5 -5
  8. data/lib/data_base/attachment.rb +60 -60
  9. data/lib/data_base/attachment/attach.rb +18 -18
  10. data/lib/data_base/attachment/geometry.rb +7 -7
  11. data/lib/data_base/attachment/iostream.rb +1 -1
  12. data/lib/data_base/attachment/processor.rb +2 -2
  13. data/lib/data_base/attachment/storage.rb +11 -11
  14. data/lib/data_base/attachment/thumbnail.rb +2 -2
  15. data/lib/data_base/attachment_table.rb +27 -27
  16. data/lib/data_base/translate_attributes.rb +9 -9
  17. data/lib/data_base/utility_scopes.rb +7 -7
  18. data/lib/data_base/without_table.rb +10 -10
  19. data/lib/generator.rb +4 -4
  20. data/lib/loops.rb +77 -77
  21. data/lib/loops/base.rb +2 -2
  22. data/lib/loops/daemonize.rb +5 -5
  23. data/lib/loops/process_manager.rb +3 -3
  24. data/lib/loops/worker.rb +1 -1
  25. data/lib/loops/worker_pool.rb +1 -1
  26. data/lib/mailer/exception_notifier.rb +5 -5
  27. data/lib/mailer/pdf_builder.rb +20 -18
  28. data/lib/utils/literal.rb +6 -6
  29. data/lib/utils/pdf_builder.rb +10 -10
  30. data/lib/version.rb +1 -1
  31. data/lib/view/helpers/backend_helper.rb +123 -123
  32. data/lib/view/helpers/ext/button.rb +7 -7
  33. data/lib/view/helpers/ext/column_model.rb +18 -18
  34. data/lib/view/helpers/ext/component.rb +50 -50
  35. data/lib/view/helpers/ext/configuration.rb +5 -5
  36. data/lib/view/helpers/ext/grid.rb +46 -46
  37. data/lib/view/helpers/ext/store.rb +14 -14
  38. data/lib/view/helpers/ext/tool_bar.rb +6 -6
  39. data/lib/view/helpers/ext_helper.rb +21 -21
  40. data/lib/view/helpers/frontend_helper.rb +5 -5
  41. data/lib/view/helpers/pdf_helper.rb +7 -7
  42. data/lib/view/helpers/view_helper.rb +28 -28
  43. data/lipsiadmin_generators/attachment/attachment_generator.rb +7 -7
  44. data/lipsiadmin_generators/attachment/templates/controller.rb +13 -13
  45. data/lipsiadmin_generators/attachment/templates/migration.rb +1 -1
  46. data/lipsiadmin_generators/backend/backend_generator.rb +9 -9
  47. data/lipsiadmin_generators/backend/templates/controllers/backend/accounts_controller.rb +10 -10
  48. data/lipsiadmin_generators/backend/templates/controllers/backend/sessions_controller.rb +2 -2
  49. data/lipsiadmin_generators/backend/templates/controllers/javascripts_controller.rb +2 -2
  50. data/lipsiadmin_generators/backend/templates/migrations/create_accounts.rb +5 -5
  51. data/lipsiadmin_generators/backend/templates/models/account.rb +16 -16
  52. data/lipsiadmin_generators/backend/templates/models/account_access.rb +11 -11
  53. data/lipsiadmin_generators/backend/templates/models/notifier.rb +2 -2
  54. data/lipsiadmin_generators/backend_page/backend_page_generator.rb +22 -22
  55. data/lipsiadmin_generators/backend_page/templates/controller.rb +9 -9
  56. data/lipsiadmin_generators/backend_page/templates/functional_test.rb +10 -10
  57. data/lipsiadmin_generators/frontend/frontend_generator.rb +5 -5
  58. data/lipsiadmin_generators/frontend/templates/controllers/frontend/sessions_controller.rb +3 -3
  59. data/lipsiadmin_generators/loops/loops_generator.rb +2 -2
  60. data/lipsiadmin_generators/pdf/pdf_generator.rb +7 -7
  61. data/lipsiadmin_generators/state_session/state_session_generator.rb +9 -9
  62. data/lipsiadmin_generators/state_session/templates/controller.rb +2 -2
  63. data/lipsiadmin_generators/state_session/templates/migration.rb +2 -2
  64. data/resources/rdoc/horo.rb +3 -3
  65. metadata +4 -4
@@ -2,15 +2,15 @@ class Backend::<%= controller_class_name %>Controller < BackendController
2
2
 
3
3
  def index
4
4
  params[:limit] ||= 50
5
-
5
+
6
6
  @column_store = column_store_for <%= model_name %> do |cm|
7
7
  <%- model_instance.class.content_columns.collect do |column| -%>
8
8
  cm.add :<%= column.name.downcase %><% if column.type == :date %>, :renderer => :date <% elsif column.type == :datetime %>, :renderer => :datetime <% end %>
9
9
  <%- end -%>
10
10
  end
11
-
11
+
12
12
  respond_to do |format|
13
- format.js
13
+ format.js
14
14
  format.json do
15
15
  render :json => @column_store.store_data(params)
16
16
  end
@@ -41,8 +41,8 @@ class Backend::<%= controller_class_name %>Controller < BackendController
41
41
  end
42
42
 
43
43
  def update
44
- @<%= singular_name %> = <%= model_name %>.find(params[:id])
45
-
44
+ @<%= singular_name %> = <%= model_name %>.find(params[:id])
45
+
46
46
  if @<%= singular_name %>.update_attributes(params[:<%= singular_name %>])
47
47
  respond_to do |format|
48
48
  format.html { redirect_parent_to(:action => "edit", :id => @<%= singular_name %>) }
@@ -55,14 +55,14 @@ class Backend::<%= controller_class_name %>Controller < BackendController
55
55
  end
56
56
  end
57
57
  end
58
-
59
- # Add in your model before_destroy and if the callback returns false,
58
+
59
+ # Add in your model before_destroy and if the callback returns false,
60
60
  # all the later callbacks and the associated action are cancelled.
61
61
  def destroy<%= suffix %>
62
62
  if <%= model_name %>.find(params[:id]).destroy
63
- render :json => { :success => true }
63
+ render :json => { :success => true }
64
64
  else
65
65
  render :json => { :success => false, :msg => I18n.t("backend.general.cantDelete") }
66
66
  end
67
67
  end
68
- end
68
+ end
@@ -1,45 +1,45 @@
1
1
  require 'test_helper'
2
-
2
+
3
3
  class Backend::<%= controller_class_name %>ControllerTest < ActionController::TestCase
4
4
  test "should get index" do
5
5
  get :index
6
6
  assert_response :success
7
7
  assert_not_nil assigns(:<%= table_name %>)
8
8
  end
9
-
9
+
10
10
  test "should get new" do
11
11
  get :new
12
12
  assert_response :success
13
13
  end
14
-
14
+
15
15
  test "should create <%= file_name %>" do
16
16
  assert_difference('<%= class_name %>.count') do
17
17
  post :create, :<%= file_name %> => { }
18
18
  end
19
-
19
+
20
20
  assert_redirected_to <%= file_name %>_path(assigns(:<%= file_name %>))
21
21
  end
22
-
22
+
23
23
  test "should show <%= file_name %>" do
24
24
  get :show, :id => <%= table_name %>(:one).id
25
25
  assert_response :success
26
26
  end
27
-
27
+
28
28
  test "should get edit" do
29
29
  get :edit, :id => <%= table_name %>(:one).id
30
30
  assert_response :success
31
31
  end
32
-
32
+
33
33
  test "should update <%= file_name %>" do
34
34
  put :update, :id => <%= table_name %>(:one).id, :<%= file_name %> => { }
35
35
  assert_redirected_to <%= file_name %>_path(assigns(:<%= file_name %>))
36
36
  end
37
-
37
+
38
38
  test "should destroy <%= file_name %>" do
39
39
  assert_difference('<%= class_name %>.count', -1) do
40
40
  delete :destroy, :id => <%= table_name %>(:one).id
41
41
  end
42
-
42
+
43
43
  assert_redirected_to <%= table_name %>_path
44
44
  end
45
- end
45
+ end
@@ -1,5 +1,5 @@
1
1
  class FrontendGenerator < Rails::Generator::Base
2
-
2
+
3
3
  def manifest
4
4
 
5
5
  record do |m|
@@ -8,13 +8,13 @@ class FrontendGenerator < Rails::Generator::Base
8
8
  m.create_all("layouts", "app/views/layouts")
9
9
  m.create_all("stylesheets", "public/stylesheets")
10
10
  m.create_all("views", "app/views")
11
-
12
- m.readme "../REMEMBER"
11
+
12
+ m.readme "../REMEMBER"
13
13
  end
14
14
  end
15
-
15
+
16
16
  protected
17
17
  def banner
18
18
  "Usage: #{$0} frontend"
19
19
  end
20
- end
20
+ end
@@ -1,7 +1,7 @@
1
- # This controller handles the login/logout function of the site.
1
+ # This controller handles the login/logout function of the site.
2
2
  class Frontend::SessionsController < ApplicationController
3
3
  layout "frontend"
4
-
4
+
5
5
  def create
6
6
  self.current_account = Account.authenticate(params[:email], params[:password])
7
7
  if logged_in?
@@ -17,4 +17,4 @@ class Frontend::SessionsController < ApplicationController
17
17
  flash[:notice] = I18n.t("backend.sessions.logout")
18
18
  redirect_back_or_default("/")
19
19
  end
20
- end
20
+ end
@@ -7,11 +7,11 @@ class LoopsGenerator < Rails::Generator::Base
7
7
  m.directory 'app/loops'
8
8
  m.file 'app/loops/APP_README', 'app/loops/README'
9
9
  m.file 'app/loops/simple_loop.rb', 'app/loops/simple_loop.rb'
10
-
10
+
11
11
  # Generate script/loops file
12
12
  m.directory 'script'
13
13
  m.file 'script/loops', 'script/loops', :chmod => 0755
14
-
14
+
15
15
  # Generate config/loops.yml file
16
16
  m.directory 'config'
17
17
  m.file 'config/loops.yml', 'config/loops.yml'
@@ -4,7 +4,7 @@ class PdfGenerator < Rails::Generator::NamedBase
4
4
  super
5
5
  usage if runtime_args.size == 1
6
6
  end
7
-
7
+
8
8
  def manifest
9
9
  record do |m|
10
10
  # Copy Stylesheets
@@ -18,7 +18,7 @@ class PdfGenerator < Rails::Generator::NamedBase
18
18
  m.template 'view.html.haml', "app/views/pdf/#{action}.html.haml",
19
19
  :assigns => { :action => action }
20
20
  end
21
-
21
+
22
22
  m.puts remember
23
23
  end
24
24
  end
@@ -28,20 +28,20 @@ class PdfGenerator < Rails::Generator::NamedBase
28
28
  def banner
29
29
  "Usage: #{$0} pdf action"
30
30
  end
31
-
31
+
32
32
  def remember
33
33
  <<-MESSAGE
34
34
 
35
35
  ==============================================================================================
36
36
 
37
37
  Please remember to add in your controller(s) some like:
38
-
39
- #{actions.collect { |a|
38
+
39
+ #{actions.collect { |a|
40
40
  " def generate_pdf_#{a}
41
41
  render_pdf :#{a}, '#{a}_file.pdf'
42
42
  end" }.join("\n\n")}
43
43
 
44
44
  ==============================================================================================
45
45
  MESSAGE
46
- end
47
- end
46
+ end
47
+ end
@@ -1,36 +1,36 @@
1
1
  class StateSessionGenerator < Rails::Generator::Base
2
2
  default_options :skip_migration => false
3
-
4
- def manifest
3
+
4
+ def manifest
5
5
  record do |m|
6
6
  # Controller class, functional test, helper, and views.
7
7
  m.directory 'app/controllers/backend'
8
8
  m.directory 'test/functional/backend'
9
9
  m.template 'controller.rb', 'app/controllers/backend/state_sessions_controller.rb'
10
10
  m.template 'functional_test.rb', 'test/functional/backend/state_sessions_controller_test.rb'
11
-
11
+
12
12
  unless options[:skip_migration]
13
13
  m.migration_template("migration.rb", "db/migrate", :migration_file_name => "create_state_sessions")
14
14
  end
15
-
15
+
16
16
  m.template('model.rb', 'app/models/state_session.rb')
17
17
  # Adding a new route
18
18
  m.append("config/routes.rb", " backend.resources :state_sessions", "map.namespace(:backend) do |backend|")
19
- m.readme "../REMEMBER"
19
+ m.readme "../REMEMBER"
20
20
  end
21
- end
21
+ end
22
22
 
23
23
 
24
24
  protected
25
25
  def banner
26
26
  "Usage: #{$0} state_session_migration [--skip-migration]"
27
27
  end
28
-
28
+
29
29
  def add_options!(opt)
30
30
  opt.separator ''
31
31
  opt.separator 'Options:'
32
32
  opt.on("--skip-migration",
33
33
  "Don't generate a migration file for this model") { |v| options[:skip_migration] = v }
34
34
  end
35
-
36
- end
35
+
36
+ end
@@ -1,5 +1,5 @@
1
1
  class Backend::StateSessionsController < BackendController
2
-
2
+
3
3
  def index
4
4
  render :json => current_account.state_sessions
5
5
  end
@@ -14,4 +14,4 @@ class Backend::StateSessionsController < BackendController
14
14
  state_session.destroy if state_session
15
15
  render :nothing => true
16
16
  end
17
- end
17
+ end
@@ -5,7 +5,7 @@ class CreateStateSessions < ActiveRecord::Migration
5
5
  t.string :component, :null => false
6
6
  t.text :data
7
7
  end
8
-
8
+
9
9
  add_index :state_sessions, :component
10
10
  end
11
11
 
@@ -13,4 +13,4 @@ class CreateStateSessions < ActiveRecord::Migration
13
13
  remove_index :state_sessions, :component
14
14
  drop_table :state_sessions
15
15
  end
16
- end
16
+ end
@@ -207,7 +207,7 @@ dd {
207
207
  CSS
208
208
 
209
209
  XHTML_PREAMBLE = %{<?xml version="1.0" encoding="%charset%"?>
210
- <!DOCTYPE html
210
+ <!DOCTYPE html
211
211
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
212
212
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
213
213
  }
@@ -215,7 +215,7 @@ XHTML_PREAMBLE = %{<?xml version="1.0" encoding="%charset%"?>
215
215
  XHTML_FRAMESET_PREAMBLE = %{
216
216
  <!DOCTYPE html
217
217
  PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
218
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
218
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
219
219
  }
220
220
 
221
221
  HEADER = XHTML_PREAMBLE + <<ENDHEADER
@@ -541,7 +541,7 @@ FILE_INDEX = XHTML_PREAMBLE + <<HTML
541
541
  <!--
542
542
  body {
543
543
  background-color: #EEE;
544
- font-family: #{FONTS};
544
+ font-family: #{FONTS};
545
545
  color: #000;
546
546
  margin: 0px;
547
547
  }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lipsiadmin
3
3
  version: !ruby/object:Gem::Version
4
- hash: 63
4
+ hash: 61
5
5
  prerelease:
6
6
  segments:
7
7
  - 5
8
8
  - 1
9
- - 6
10
- version: 5.1.6
9
+ - 7
10
+ version: 5.1.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Davide D'Agostino
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-01 00:00:00 +02:00
18
+ date: 2011-10-05 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency