lipsiadmin 3.0 → 3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. data/CHANGELOG +13 -0
  2. data/README +1 -0
  3. data/Rakefile +1 -1
  4. data/lib/access_control/authentication.rb +4 -4
  5. data/lib/lipsiadmin.rb +1 -0
  6. data/lib/view/helpers/frontend_helper.rb +19 -0
  7. data/lipsiadmin_generators/backend/REMEMBER +1 -0
  8. data/lipsiadmin_generators/backend/backend_generator.rb +1 -5
  9. data/lipsiadmin_generators/backend/templates/controllers/backend/sessions_controller.rb +0 -1
  10. data/lipsiadmin_generators/backend/templates/views/backend/accounts/index.rjs +1 -1
  11. data/lipsiadmin_generators/frontend/REMEMBER +10 -0
  12. data/lipsiadmin_generators/frontend/frontend_generator.rb +20 -0
  13. data/lipsiadmin_generators/frontend/templates/config/locales/frontend/en.yml +5 -0
  14. data/lipsiadmin_generators/frontend/templates/config/locales/frontend/it.yml +5 -0
  15. data/lipsiadmin_generators/frontend/templates/controllers/frontend/base_controller.rb +7 -0
  16. data/lipsiadmin_generators/frontend/templates/controllers/frontend/sessions_controller.rb +20 -0
  17. data/lipsiadmin_generators/frontend/templates/controllers/frontend_controller.rb +5 -0
  18. data/lipsiadmin_generators/{backend → frontend}/templates/helpers/frontend_helper.rb +0 -0
  19. data/lipsiadmin_generators/frontend/templates/layouts/frontend.html.haml +9 -0
  20. data/lipsiadmin_generators/frontend/templates/stylesheets/frontend.css +7 -0
  21. data/lipsiadmin_generators/frontend/templates/views/frontend/base/index.html.haml +4 -0
  22. data/lipsiadmin_generators/frontend/templates/views/frontend/sessions/new.html.haml +14 -0
  23. metadata +29 -6
  24. data/lipsiadmin_generators/backend/templates/controllers/frontend_controller.rb +0 -4
  25. data/lipsiadmin_generators/backend/templates/layouts/frontend.html.haml +0 -7
data/CHANGELOG CHANGED
@@ -1,3 +1,16 @@
1
+ 2009-03-05
2
+ * Bump to version 3.1
3
+ * Added a base login page for frontend
4
+ * Added a new generator for frontend
5
+ * Fixed a Typo in Authentication
6
+ * Fixed an issue with frontend_login_required
7
+ * Removed from backend generator frontend stuff
8
+ * Small Fix in Backend Controller
9
+ * Fixed Spelling Issue
10
+
11
+ 2009-03-02
12
+ * Release the stable version 3.0
13
+
1
14
  2009-02-28
2
15
  * Fixed a small js error on dblclick on grids
3
16
  * Added for Ext::Component a new method for remove listener, remove_listener
data/README CHANGED
@@ -51,6 +51,7 @@ So you can do:
51
51
 
52
52
  $ script/generate backend # Generate the base admin
53
53
  $ script/generate backend_page yourmodel # Generate a "scaffold" for your model
54
+ $ script/generate frontend # Generate the base frontend
54
55
  $ script/generate attachment # Generate the an attachments
55
56
  $ script/generate pdf PdfName # Generate a new pdf document
56
57
 
data/Rakefile CHANGED
@@ -7,7 +7,7 @@ require 'rake/gempackagetask'
7
7
  require 'rake/contrib/sshpublisher'
8
8
 
9
9
  PKG_NAME = 'lipsiadmin'
10
- PKG_VERSION = "3.0"
10
+ PKG_VERSION = "3.1"
11
11
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
12
12
 
13
13
  $LOAD_PATH << File.join(File.dirname(__FILE__), 'lib')
@@ -7,7 +7,7 @@ module Lipsiadmin
7
7
  # Examples:
8
8
  #
9
9
  # class FrontendController < ApplicationController
10
- # before_filter :login_frontend_required, :except => [:login]
10
+ # before_filter :frontend_login_required, :except => [:login]
11
11
  # end
12
12
  #
13
13
  module Authentication
@@ -68,10 +68,10 @@ module Lipsiadmin
68
68
  #
69
69
  # Examples:
70
70
  #
71
- # before_filter :login_frontend_required, :except => [:login]
71
+ # before_filter :frontend_login_required, :except => [:some]
72
72
  #
73
- def fronted_login_required
74
- logged_in? && allowed? || access_denied(:backend)
73
+ def frontend_login_required
74
+ logged_in? && allowed? || access_denied(:frontend)
75
75
  end
76
76
 
77
77
  def access_denied(where)#:nodoc:
data/lib/lipsiadmin.rb CHANGED
@@ -6,6 +6,7 @@ require 'mailer/pdf_builder'
6
6
  require 'mailer/exception_notifier'
7
7
  require 'view/helpers/active_record_helper'
8
8
  require 'view/helpers/backend_helper'
9
+ require 'view/helpers/frontend_helper'
9
10
  require 'view/helpers/view_helper'
10
11
  require 'view/helpers/ext_helper'
11
12
  require 'controller/ext'
@@ -0,0 +1,19 @@
1
+ module Lipsiadmin
2
+ module View
3
+ module Helpers
4
+ module FrontendHelper
5
+ # Set the title of the page and append at the end the name of the project
6
+ # Usefull for google & c.
7
+ def title(text)
8
+ content_for(:title) { text + " - #{AppConfig.project}" }
9
+ end
10
+
11
+ # Set the meta description of the page
12
+ # Usefull for google & c.
13
+ def description(text)
14
+ content_for(:description) { text }
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -8,6 +8,7 @@ Please remember to:
8
8
  - Edit Account Migration (setting your username and password)
9
9
  - Run rake db:create && rake db:migrate
10
10
  - Set your default locale I18n in environment.rb (IT||EN)
11
+ - Point to http://localhost:3000/backend
11
12
 
12
13
  Extra:
13
14
  in config/environment.rb
@@ -1,9 +1,5 @@
1
1
  class BackendGenerator < Rails::Generator::Base
2
- def initialize(runtime_args, runtime_options = {})
3
- runtime_args = ["none"].concat(runtime_args) # Skip usage
4
- super
5
- end
6
-
2
+
7
3
  def manifest
8
4
  # Initial routes
9
5
  routes = <<-ROUTES
@@ -1,6 +1,5 @@
1
1
  # This controller handles the login/logout function of the site.
2
2
  class Backend::SessionsController < ApplicationController
3
- layout false
4
3
  layout "backend"
5
4
 
6
5
  def create
@@ -1,6 +1,6 @@
1
1
  page.grid do |grid|
2
2
  grid.id "grid-accounts"
3
- grid.title "Elenco Accounts"
3
+ grid.title "List All Accounts"
4
4
  grid.base_path "/backend/accounts"
5
5
  grid.forgery_protection_token request_forgery_protection_token
6
6
  grid.authenticity_token form_authenticity_token
@@ -0,0 +1,10 @@
1
+
2
+ ================================================================
3
+
4
+ Please remember to:
5
+
6
+ - Remove /public/index.html
7
+ - Add a route map.connect '', :controller => 'frontend/base',
8
+ :action => 'index'
9
+
10
+ ================================================================
@@ -0,0 +1,20 @@
1
+ class FrontendGenerator < Rails::Generator::Base
2
+
3
+ def manifest
4
+
5
+ record do |m|
6
+ m.create_all("controllers", "app/controllers")
7
+ m.create_all("helpers", "app/helpers")
8
+ m.create_all("layouts", "app/views/layouts")
9
+ m.create_all("stylesheets", "public/stylesheets")
10
+ m.create_all("views", "app/views")
11
+
12
+ m.readme "../REMEMBER"
13
+ end
14
+ end
15
+
16
+ protected
17
+ def banner
18
+ "Usage: #{$0} frontend"
19
+ end
20
+ end
@@ -0,0 +1,5 @@
1
+ # This file is used for translate the frontend
2
+ # We remind you that in Backend was introduced a simple method in style gibberish for translations
3
+ # So you can write "Translate Me in English"[] will be I18n.t("translate_me_in_english", :default => "Translate Me in English")
4
+ en:
5
+ translate_me_in_english: Traslate me English
@@ -0,0 +1,5 @@
1
+ # Questo file è generalmente utilizzato per tradurre il frontend
2
+ # Ti ricordiamo che in Backend è stato introdotto un metodo semplice in stile gibberish per le traduzioni
3
+ # Infatti puoi scrivere "Translate Me in Italian"[] e verrà convertito in I18n.t("translate_me_in_italian", :default => "Translate Me in Italian")
4
+ it:
5
+ translate_me_in_italian: Traducimi in Italiano
@@ -0,0 +1,7 @@
1
+ class Frontend::BaseController < FrontendController
2
+
3
+ def index
4
+ # Edit This
5
+ end
6
+
7
+ end
@@ -0,0 +1,20 @@
1
+ # This controller handles the login/logout function of the site.
2
+ class Frontend::SessionsController < ApplicationController
3
+ layout "frontend"
4
+
5
+ def create
6
+ self.current_account = Account.authenticate(params[:email], params[:password])
7
+ if logged_in?
8
+ redirect_back_or_default("/")
9
+ else
10
+ flash[:notice] = I18n.t("backend.sessions.wrong")
11
+ redirect_to :action => :new
12
+ end
13
+ end
14
+
15
+ def destroy
16
+ reset_session
17
+ flash[:notice] = I18n.t("backend.sessions.logout")
18
+ redirect_back_or_default("/")
19
+ end
20
+ end
@@ -0,0 +1,5 @@
1
+ class FrontendController < ApplicationController
2
+ layout "frontend"
3
+ helper Lipsiadmin::View::Helpers::FrontendHelper
4
+ #before_filter :frontend_login_required
5
+ end
@@ -0,0 +1,9 @@
1
+ !!!
2
+ %html{ :xmlns=>"http://www.w3.org/1999/xhtml" }
3
+ %head
4
+ %title=yield(:title) || "#{AppConfig.project}"
5
+ %meta{'http-equiv' => 'Content-Type', :content => 'text/html', :name => "description", :content => "#{yield(:description) || "#{AppConfig.project}"}"}
6
+ =stylesheet_link_tag "standard", "frontend"
7
+ =javascript_include_tag :defaults
8
+ %body
9
+ =yield
@@ -0,0 +1,7 @@
1
+ /*
2
+ * Lipsiasadmin
3
+ * Copyright(c) 2008-2009,LipsiaSoft s.r.l.
4
+ * info@lipsiasoft.com
5
+ *
6
+ * http://www.lipsiasoft.com
7
+ */
@@ -0,0 +1,4 @@
1
+ -title "Index Page"
2
+ -description "This is the index page"
3
+
4
+ %h1 Add you content here
@@ -0,0 +1,14 @@
1
+ .padding{ :style => "width:300px" }
2
+
3
+ %h1 Reserved Area
4
+ %h2=flash[:notice]
5
+
6
+ -form_tag :action => :create do
7
+ %p
8
+ %label Email
9
+ =text_field_tag :email
10
+ %p
11
+ %label Password
12
+ =password_field_tag :password
13
+ %p
14
+ =submit_tag "Login Now"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lipsiadmin
3
3
  version: !ruby/object:Gem::Version
4
- version: "3.0"
4
+ version: "3.1"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Davide D'Agostino
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-02 00:00:00 +01:00
12
+ date: 2009-03-05 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -62,13 +62,11 @@ files:
62
62
  - lipsiadmin_generators/backend/templates/controllers/backend/base_controller.rb
63
63
  - lipsiadmin_generators/backend/templates/controllers/backend/sessions_controller.rb
64
64
  - lipsiadmin_generators/backend/templates/controllers/backend_controller.rb
65
- - lipsiadmin_generators/backend/templates/controllers/frontend_controller.rb
66
65
  - lipsiadmin_generators/backend/templates/controllers/javascripts_controller.rb
67
66
  - lipsiadmin_generators/backend/templates/exceptions
68
67
  - lipsiadmin_generators/backend/templates/exceptions/template.html.haml
69
68
  - lipsiadmin_generators/backend/templates/helpers
70
69
  - lipsiadmin_generators/backend/templates/helpers/backend_helper.rb
71
- - lipsiadmin_generators/backend/templates/helpers/frontend_helper.rb
72
70
  - lipsiadmin_generators/backend/templates/images
73
71
  - lipsiadmin_generators/backend/templates/images/backend
74
72
  - lipsiadmin_generators/backend/templates/images/backend/back.gif
@@ -458,7 +456,6 @@ files:
458
456
  - lipsiadmin_generators/backend/templates/javascripts/prototype.js
459
457
  - lipsiadmin_generators/backend/templates/layouts
460
458
  - lipsiadmin_generators/backend/templates/layouts/backend.html.haml
461
- - lipsiadmin_generators/backend/templates/layouts/frontend.html.haml
462
459
  - lipsiadmin_generators/backend/templates/migrations
463
460
  - lipsiadmin_generators/backend/templates/migrations/create_accounts.rb
464
461
  - lipsiadmin_generators/backend/templates/models
@@ -485,7 +482,6 @@ files:
485
482
  - lipsiadmin_generators/backend/templates/views/backend/base/welcome.html.haml
486
483
  - lipsiadmin_generators/backend/templates/views/backend/sessions
487
484
  - lipsiadmin_generators/backend/templates/views/backend/sessions/new.html.haml
488
- - lipsiadmin_generators/backend/templates/views/frontend
489
485
  - lipsiadmin_generators/backend/templates/views/javascripts
490
486
  - lipsiadmin_generators/backend/templates/views/javascripts/backend.js.erb
491
487
  - lipsiadmin_generators/backend/templates/views/javascripts/locale.js.erb
@@ -504,6 +500,32 @@ files:
504
500
  - lipsiadmin_generators/backend_page/templates/view_edit.html.haml
505
501
  - lipsiadmin_generators/backend_page/templates/view_index.rjs.erb
506
502
  - lipsiadmin_generators/backend_page/templates/view_new.html.haml
503
+ - lipsiadmin_generators/frontend
504
+ - lipsiadmin_generators/frontend/frontend_generator.rb
505
+ - lipsiadmin_generators/frontend/REMEMBER
506
+ - lipsiadmin_generators/frontend/templates
507
+ - lipsiadmin_generators/frontend/templates/config
508
+ - lipsiadmin_generators/frontend/templates/config/locales
509
+ - lipsiadmin_generators/frontend/templates/config/locales/frontend
510
+ - lipsiadmin_generators/frontend/templates/config/locales/frontend/en.yml
511
+ - lipsiadmin_generators/frontend/templates/config/locales/frontend/it.yml
512
+ - lipsiadmin_generators/frontend/templates/controllers
513
+ - lipsiadmin_generators/frontend/templates/controllers/frontend
514
+ - lipsiadmin_generators/frontend/templates/controllers/frontend/base_controller.rb
515
+ - lipsiadmin_generators/frontend/templates/controllers/frontend/sessions_controller.rb
516
+ - lipsiadmin_generators/frontend/templates/controllers/frontend_controller.rb
517
+ - lipsiadmin_generators/frontend/templates/helpers
518
+ - lipsiadmin_generators/frontend/templates/helpers/frontend_helper.rb
519
+ - lipsiadmin_generators/frontend/templates/layouts
520
+ - lipsiadmin_generators/frontend/templates/layouts/frontend.html.haml
521
+ - lipsiadmin_generators/frontend/templates/stylesheets
522
+ - lipsiadmin_generators/frontend/templates/stylesheets/frontend.css
523
+ - lipsiadmin_generators/frontend/templates/views
524
+ - lipsiadmin_generators/frontend/templates/views/frontend
525
+ - lipsiadmin_generators/frontend/templates/views/frontend/base
526
+ - lipsiadmin_generators/frontend/templates/views/frontend/base/index.html.haml
527
+ - lipsiadmin_generators/frontend/templates/views/frontend/sessions
528
+ - lipsiadmin_generators/frontend/templates/views/frontend/sessions/new.html.haml
507
529
  - lipsiadmin_generators/pdf
508
530
  - lipsiadmin_generators/pdf/pdf_generator.rb
509
531
  - lipsiadmin_generators/pdf/templates
@@ -563,6 +585,7 @@ files:
563
585
  - lib/view/helpers/ext/templates/grid_functions.js.erb
564
586
  - lib/view/helpers/ext/tool_bar.rb
565
587
  - lib/view/helpers/ext_helper.rb
588
+ - lib/view/helpers/frontend_helper.rb
566
589
  - lib/view/helpers/view_helper.rb
567
590
  - resources/javascripts
568
591
  - resources/javascripts/ux.js
@@ -1,4 +0,0 @@
1
- class FrontendController < ApplicationController
2
- layout "frontend"
3
- before_filter :login_frontend_required, :except => [:login]
4
- end
@@ -1,7 +0,0 @@
1
- !!!
2
- %html
3
- %head
4
- %title="#{AppConfig.project} v.#{Lipsiadmin::VERSION::STRING}"
5
- =stylesheet_link_tag "standard", "login"
6
- %body
7
- #wrapper