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.
- data/CHANGELOG +13 -0
- data/README +1 -0
- data/Rakefile +1 -1
- data/lib/access_control/authentication.rb +4 -4
- data/lib/lipsiadmin.rb +1 -0
- data/lib/view/helpers/frontend_helper.rb +19 -0
- data/lipsiadmin_generators/backend/REMEMBER +1 -0
- data/lipsiadmin_generators/backend/backend_generator.rb +1 -5
- data/lipsiadmin_generators/backend/templates/controllers/backend/sessions_controller.rb +0 -1
- data/lipsiadmin_generators/backend/templates/views/backend/accounts/index.rjs +1 -1
- data/lipsiadmin_generators/frontend/REMEMBER +10 -0
- data/lipsiadmin_generators/frontend/frontend_generator.rb +20 -0
- data/lipsiadmin_generators/frontend/templates/config/locales/frontend/en.yml +5 -0
- data/lipsiadmin_generators/frontend/templates/config/locales/frontend/it.yml +5 -0
- data/lipsiadmin_generators/frontend/templates/controllers/frontend/base_controller.rb +7 -0
- data/lipsiadmin_generators/frontend/templates/controllers/frontend/sessions_controller.rb +20 -0
- data/lipsiadmin_generators/frontend/templates/controllers/frontend_controller.rb +5 -0
- data/lipsiadmin_generators/{backend → frontend}/templates/helpers/frontend_helper.rb +0 -0
- data/lipsiadmin_generators/frontend/templates/layouts/frontend.html.haml +9 -0
- data/lipsiadmin_generators/frontend/templates/stylesheets/frontend.css +7 -0
- data/lipsiadmin_generators/frontend/templates/views/frontend/base/index.html.haml +4 -0
- data/lipsiadmin_generators/frontend/templates/views/frontend/sessions/new.html.haml +14 -0
- metadata +29 -6
- data/lipsiadmin_generators/backend/templates/controllers/frontend_controller.rb +0 -4
- 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 @@ module Lipsiadmin
|
|
7
7
|
# Examples:
|
8
8
|
#
|
9
9
|
# class FrontendController < ApplicationController
|
10
|
-
# before_filter :
|
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 :
|
71
|
+
# before_filter :frontend_login_required, :except => [:some]
|
72
72
|
#
|
73
|
-
def
|
74
|
-
logged_in? && allowed? || access_denied(:
|
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
|
@@ -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,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
|
File without changes
|
@@ -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
|
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.
|
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-
|
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
|