padrino-admin 0.10.7 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +22 -1
- data/lib/padrino-admin.rb +8 -1
- data/lib/padrino-admin/access_control.rb +6 -4
- data/lib/padrino-admin/bootstrap-less/accordion.less +34 -0
- data/lib/padrino-admin/bootstrap-less/alerts.less +98 -0
- data/lib/padrino-admin/bootstrap-less/badges.less +58 -0
- data/lib/padrino-admin/bootstrap-less/bootstrap.less +62 -0
- data/lib/padrino-admin/bootstrap-less/breadcrumbs.less +25 -0
- data/lib/padrino-admin/bootstrap-less/button-groups.less +166 -0
- data/lib/padrino-admin/bootstrap-less/buttons.less +175 -0
- data/lib/padrino-admin/bootstrap-less/carousel.less +192 -0
- data/lib/padrino-admin/bootstrap-less/close.less +32 -0
- data/lib/padrino-admin/bootstrap-less/code.less +61 -0
- data/lib/padrino-admin/bootstrap-less/component-animations.less +32 -0
- data/lib/padrino-admin/bootstrap-less/dropdowns.less +223 -0
- data/lib/padrino-admin/bootstrap-less/font-awesome-ie7.less +350 -0
- data/lib/padrino-admin/bootstrap-less/font-awesome.less +537 -0
- data/lib/padrino-admin/bootstrap-less/forms.less +543 -0
- data/lib/padrino-admin/bootstrap-less/glyphicons.less +200 -0
- data/lib/padrino-admin/bootstrap-less/grid.less +49 -0
- data/lib/padrino-admin/bootstrap-less/jumbotron.less +32 -0
- data/lib/padrino-admin/bootstrap-less/labels.less +46 -0
- data/lib/padrino-admin/bootstrap-less/media.less +54 -0
- data/lib/padrino-admin/bootstrap-less/mixins.less +530 -0
- data/lib/padrino-admin/bootstrap-less/modals.less +136 -0
- data/lib/padrino-admin/bootstrap-less/navbar.less +379 -0
- data/lib/padrino-admin/bootstrap-less/navs.less +277 -0
- data/lib/padrino-admin/bootstrap-less/normalize.less +396 -0
- data/lib/padrino-admin/bootstrap-less/padrino-admin.less +16 -0
- data/lib/padrino-admin/bootstrap-less/pager.less +43 -0
- data/lib/padrino-admin/bootstrap-less/pagination.less +100 -0
- data/lib/padrino-admin/bootstrap-less/popovers.less +133 -0
- data/lib/padrino-admin/bootstrap-less/print.less +74 -0
- data/lib/padrino-admin/bootstrap-less/progress-bars.less +118 -0
- data/lib/padrino-admin/bootstrap-less/responsive-utilities.less +59 -0
- data/lib/padrino-admin/bootstrap-less/scaffolding.less +90 -0
- data/lib/padrino-admin/bootstrap-less/tables.less +231 -0
- data/lib/padrino-admin/bootstrap-less/thumbnails.less +42 -0
- data/lib/padrino-admin/bootstrap-less/tooltip.less +71 -0
- data/lib/padrino-admin/bootstrap-less/type.less +252 -0
- data/lib/padrino-admin/bootstrap-less/utilities.less +42 -0
- data/lib/padrino-admin/bootstrap-less/variables.less +316 -0
- data/lib/padrino-admin/bootstrap-less/wells.less +29 -0
- data/lib/padrino-admin/generators/actions.rb +18 -2
- data/lib/padrino-admin/generators/admin_app.rb +38 -26
- data/lib/padrino-admin/generators/admin_page.rb +8 -1
- data/lib/padrino-admin/generators/orm.rb +58 -11
- data/lib/padrino-admin/generators/templates/account/couchrest.rb.tt +1 -1
- data/lib/padrino-admin/generators/templates/account/{mini_record.rb.tt → minirecord.rb.tt} +0 -0
- data/lib/padrino-admin/generators/templates/account/mongoid.rb.tt +1 -1
- data/lib/padrino-admin/generators/templates/account/ohm.rb.tt +61 -0
- data/lib/padrino-admin/generators/templates/account/sequel.rb.tt +1 -1
- data/lib/padrino-admin/generators/templates/app.rb.tt +36 -29
- data/lib/padrino-admin/generators/templates/app/controllers/{base.rb → base.rb.tt} +1 -2
- data/lib/padrino-admin/generators/templates/app/controllers/sessions.rb.tt +6 -3
- data/lib/padrino-admin/generators/templates/assets/images/favicon.ico +0 -0
- data/lib/padrino-admin/generators/templates/assets/images/font/FontAwesome.otf +0 -0
- data/lib/padrino-admin/generators/templates/assets/images/font/fontawesome-webfont.eot +0 -0
- data/lib/padrino-admin/generators/templates/assets/images/font/fontawesome-webfont.svg +284 -0
- data/lib/padrino-admin/generators/templates/assets/images/font/fontawesome-webfont.ttf +0 -0
- data/lib/padrino-admin/generators/templates/assets/images/font/fontawesome-webfont.woff +0 -0
- data/lib/padrino-admin/generators/templates/assets/images/logo.png +0 -0
- data/lib/padrino-admin/generators/templates/assets/javascripts/application.js +117 -0
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-affix.js +117 -0
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-alert.js +99 -0
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-button.js +105 -0
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-carousel.js +207 -0
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-collapse.js +167 -0
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-dropdown.js +165 -0
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-modal.js +251 -0
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-popover.js +114 -0
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-scrollspy.js +162 -0
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-tab.js +144 -0
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-tooltip.js +361 -0
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-transition.js +60 -0
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-typeahead.js +335 -0
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap.min.js +6 -0
- data/lib/padrino-admin/generators/templates/assets/javascripts/jquery-1.9.0.min.js +4 -0
- data/lib/padrino-admin/generators/templates/assets/stylesheets/application.css +346 -0
- data/lib/padrino-admin/generators/templates/assets/stylesheets/bootstrap.css +952 -0
- data/lib/padrino-admin/generators/templates/erb/app/base/index.erb.tt +13 -15
- data/lib/padrino-admin/generators/templates/erb/app/errors/403.erb.tt +3 -0
- data/lib/padrino-admin/generators/templates/erb/app/errors/404.erb.tt +3 -0
- data/lib/padrino-admin/generators/templates/erb/app/errors/500.erb.tt +3 -0
- data/lib/padrino-admin/generators/templates/erb/app/layouts/application.erb.tt +59 -39
- data/lib/padrino-admin/generators/templates/erb/app/layouts/error.erb.tt +23 -0
- data/lib/padrino-admin/generators/templates/erb/app/sessions/new.erb.tt +41 -53
- data/lib/padrino-admin/generators/templates/erb/page/_form.erb.tt +16 -9
- data/lib/padrino-admin/generators/templates/erb/page/edit.erb.tt +9 -17
- data/lib/padrino-admin/generators/templates/erb/page/index.erb.tt +73 -31
- data/lib/padrino-admin/generators/templates/erb/page/new.erb.tt +8 -16
- data/lib/padrino-admin/generators/templates/haml/app/base/index.haml.tt +11 -24
- data/lib/padrino-admin/generators/templates/haml/app/errors/403.haml.tt +3 -0
- data/lib/padrino-admin/generators/templates/haml/app/errors/404.haml.tt +3 -0
- data/lib/padrino-admin/generators/templates/haml/app/errors/500.haml.tt +3 -0
- data/lib/padrino-admin/generators/templates/haml/app/layouts/application.haml.tt +47 -29
- data/lib/padrino-admin/generators/templates/haml/app/layouts/error.haml.tt +18 -0
- data/lib/padrino-admin/generators/templates/haml/app/sessions/new.haml.tt +33 -28
- data/lib/padrino-admin/generators/templates/haml/page/_form.haml.tt +13 -9
- data/lib/padrino-admin/generators/templates/haml/page/edit.haml.tt +7 -14
- data/lib/padrino-admin/generators/templates/haml/page/index.haml.tt +56 -27
- data/lib/padrino-admin/generators/templates/haml/page/new.haml.tt +6 -13
- data/lib/padrino-admin/generators/templates/page/controller.rb.tt +57 -12
- data/lib/padrino-admin/generators/templates/slim/app/base/index.slim.tt +11 -24
- data/lib/padrino-admin/generators/templates/slim/app/errors/403.slim.tt +3 -0
- data/lib/padrino-admin/generators/templates/slim/app/errors/404.slim.tt +3 -0
- data/lib/padrino-admin/generators/templates/slim/app/errors/500.slim.tt +3 -0
- data/lib/padrino-admin/generators/templates/slim/app/layouts/application.slim.tt +43 -26
- data/lib/padrino-admin/generators/templates/slim/app/layouts/error.slim.tt +19 -0
- data/lib/padrino-admin/generators/templates/slim/app/sessions/new.slim.tt +31 -27
- data/lib/padrino-admin/generators/templates/slim/page/_form.slim.tt +13 -11
- data/lib/padrino-admin/generators/templates/slim/page/edit.slim.tt +7 -15
- data/lib/padrino-admin/generators/templates/slim/page/index.slim.tt +54 -28
- data/lib/padrino-admin/generators/templates/slim/page/new.slim.tt +6 -14
- data/lib/padrino-admin/helpers/authentication_helpers.rb +6 -4
- data/lib/padrino-admin/helpers/view_helpers.rb +27 -5
- data/lib/padrino-admin/locale/admin/cs.yml +53 -13
- data/lib/padrino-admin/locale/admin/da.yml +53 -13
- data/lib/padrino-admin/locale/admin/de.yml +53 -13
- data/lib/padrino-admin/locale/admin/en.yml +53 -13
- data/lib/padrino-admin/locale/admin/es.yml +53 -13
- data/lib/padrino-admin/locale/admin/fr.yml +53 -13
- data/lib/padrino-admin/locale/admin/hu.yml +53 -13
- data/lib/padrino-admin/locale/admin/it.yml +53 -13
- data/lib/padrino-admin/locale/admin/ja.yml +54 -13
- data/lib/padrino-admin/locale/admin/lv.yml +53 -13
- data/lib/padrino-admin/locale/admin/nl.yml +53 -13
- data/lib/padrino-admin/locale/admin/no.yml +53 -13
- data/lib/padrino-admin/locale/admin/pl.yml +53 -13
- data/lib/padrino-admin/locale/admin/pt_br.yml +53 -13
- data/lib/padrino-admin/locale/admin/ro.yml +53 -13
- data/lib/padrino-admin/locale/admin/ru.yml +54 -13
- data/lib/padrino-admin/locale/admin/sv.yml +53 -13
- data/lib/padrino-admin/locale/admin/tr.yml +53 -13
- data/lib/padrino-admin/locale/admin/uk.yml +53 -13
- data/lib/padrino-admin/locale/admin/zh_cn.yml +53 -13
- data/lib/padrino-admin/locale/admin/zh_tw.yml +53 -13
- data/lib/padrino-admin/locale/orm/fr.yml +8 -8
- data/padrino-admin.gemspec +2 -0
- data/test/fixtures/data_mapper.rb +0 -4
- data/test/generators/test_account_model_generator.rb +88 -18
- data/test/generators/test_admin_app_generator.rb +120 -165
- data/test/generators/test_admin_page_generator.rb +53 -56
- data/test/helper.rb +4 -0
- data/test/test_admin_application.rb +5 -5
- data/test/test_locale.rb +3 -3
- metadata +119 -35
- data/lib/padrino-admin/generators/templates/assets/stylesheets/base.css +0 -95
- data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/amro/style.css +0 -364
- data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/bec-green/style.css +0 -290
- data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/bec/style.css +0 -301
- data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/blue/style.css +0 -287
- data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/default/style.css +0 -373
- data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/djime-cerulean/style.css +0 -305
- data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/kathleene/style.css +0 -279
- data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/olive/style.css +0 -345
- data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/orange/style.css +0 -269
- data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/reidb-greenish/style.css +0 -302
- data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/ruby/style.css +0 -281
- data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/warehouse/style.css +0 -391
- data/lib/padrino-admin/generators/templates/erb/app/base/_sidebar.erb.tt +0 -13
- data/lib/padrino-admin/generators/templates/haml/app/base/_sidebar.haml.tt +0 -11
- data/lib/padrino-admin/generators/templates/slim/app/base/_sidebar.slim.tt +0 -11
@@ -1,25 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
p.first
|
6
|
-
' Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
7
|
-
' Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
8
|
-
' Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
9
|
-
span.hightlight
|
10
|
-
| Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
11
|
-
p
|
12
|
-
span.small
|
13
|
-
| Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore
|
14
|
-
p
|
15
|
-
span.gray
|
16
|
-
| Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore
|
17
|
-
hr
|
18
|
-
p
|
19
|
-
' Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
20
|
-
' Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
21
|
-
' Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
22
|
-
span.hightlight
|
23
|
-
| Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
1
|
+
div class="base-text"
|
2
|
+
p Padrino is a ruby framework built upon the Sinatra web library
|
3
|
+
p It was created to make it fun and easy to code more advanced web applications while still adhering to the spirit that makes Sinatra great!
|
4
|
+
p Padrino comes shipped with a slick and beautiful Admin Interface, with the following features:
|
24
5
|
|
25
|
-
|
6
|
+
div class="base-icons"
|
7
|
+
div class="btn-group"
|
8
|
+
div class="btn btn-primary" title="Adapters for datamapper, sequel, activerecord, mongomapper, mongoid, couchrest" = tag_icon("cogs icon-2x", "Orm Agnostic")
|
9
|
+
div class="btn btn-success" title="User Authentication Support, User Authorization Management" = tag_icon("group icon-2x", "Authentication")
|
10
|
+
div class="btn btn-info" title="Erb, Haml, Slim Rendering Support" = tag_icon("tasks icon-2x", "Template Agnostic")
|
11
|
+
div class="btn btn-warning" title="English, German, Russian, Danish, French, Brazilian and Italian localizations" = tag_icon("flag icon-2x", "Multi Language")
|
12
|
+
div class="btn btn-danger" title="You can create a new 'admin interface' by providing a single Model" = tag_icon("magic icon-2x", "Scaffold")
|
@@ -1,31 +1,48 @@
|
|
1
|
-
doctype
|
2
|
-
html lang='en'
|
1
|
+
doctype 5
|
2
|
+
html lang='en'
|
3
3
|
head
|
4
|
+
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
|
5
|
+
<!--[if lt IE 9]>
|
6
|
+
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
7
|
+
<![endif]-->
|
4
8
|
meta content='text/html; charset=utf-8' http-equiv='Content-Type'
|
5
|
-
|
6
|
-
|
9
|
+
meta name='viewport' content='width=device-width,initial-scale=1'
|
10
|
+
title = @title.present? ? "#{@title} | Padrino Admin" : "Padrino Admin"
|
11
|
+
= favicon_tag 'favicon.ico'
|
12
|
+
link href='http://fonts.googleapis.com/css?family=Varela' rel='stylesheet'
|
13
|
+
= stylesheet_link_tag 'bootstrap', 'application'
|
7
14
|
|
8
15
|
body
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
li
|
16
|
-
|
17
|
-
|
16
|
+
div class='navbar navbar-fixed-top'
|
17
|
+
div class='navbar-inner'
|
18
|
+
div class='container'
|
19
|
+
= link_to 'Padrino', url(:base_index), :class => 'navbar-brand', :title => 'Padrino Admin'
|
20
|
+
|
21
|
+
ul class='nav pull-right'
|
22
|
+
li class='navbar-edit-account' = link_to tag_icon(:user), url(:<%= @model_plural %>, :edit, :id => current_account.id), :title => pat(:profile), :class => 'navbar-nav-link'
|
23
|
+
li class='navbar-logout' = button_to(pat(:logout), url(:sessions, :destroy), :method => :delete, :class => 'navbar-nav-form') do
|
24
|
+
= content_tag :button, tag_icon(:off), :type => :submit, :title => pat(:logout), :class => 'navbar-nav-form-link'
|
25
|
+
|
26
|
+
ul class='nav pull-left'
|
18
27
|
- project_modules.each do |project_module|
|
19
|
-
li class=
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
li class={"navbar-module #{'active' if request.path_info =~ /^#{project_module.path}/}"}
|
29
|
+
= link_to project_module.human_name, project_module.path('/admin')
|
30
|
+
|
31
|
+
div class='container main'
|
32
|
+
div class='main-wrapper'
|
33
|
+
= [:error, :warning, :success, :notice].map { |type| flash_tag(type, :class => "alert alert-#{type} fade in", :bootstrap => true) }.join.html_safe
|
34
|
+
div class='row' = yield
|
35
|
+
div class='main-wrapper-push'
|
36
|
+
|
37
|
+
footer
|
38
|
+
div class='footer-wrapper container'
|
39
|
+
p class='pull-left'
|
40
|
+
' Copyright © #{Time.now.year} Your Site -
|
41
|
+
b Powered by Padrino v.#{Padrino.version}
|
42
|
+
ul class='pull-right footer-links'
|
43
|
+
li = link_to tag_icon(:home, 'web'), 'http://www.padrinorb.com', :target => :_blank, :class => 'footer-links-link'
|
44
|
+
li = link_to tag_icon(:heart, 'blog'), 'http://www.padrinorb.com/blog', :target => :_blank, :class => 'footer-links-link'
|
45
|
+
li = link_to tag_icon(:github, 'code'), 'https://github.com/padrino/padrino-framework', :target => :_blank, :class => 'footer-links-link'
|
46
|
+
li = link_to tag_icon(:twitter, 'twitter'), 'http://twitter.com/padrinorb', :target => :_blank, :class => 'footer-links-link'
|
47
|
+
|
48
|
+
=javascript_include_tag 'jquery-1.9.0.min', (Padrino.env == :production ? 'bootstrap.min' : %w[bootstrap/bootstrap-affix bootstrap/bootstrap-alert bootstrap/bootstrap-button bootstrap/bootstrap-carousel bootstrap/bootstrap-collapse bootstrap/bootstrap-dropdown bootstrap/bootstrap-tooltip bootstrap/bootstrap-transition bootstrap/bootstrap-typeahead bootstrap/bootstrap-modal bootstrap/bootstrap-popover bootstrap/bootstrap-scrollspy bootstrap/bootstrap-tab]), :application
|
@@ -0,0 +1,19 @@
|
|
1
|
+
doctype 5
|
2
|
+
html lang="en" xmlns="http://www.w3.org/1999/xhtml"
|
3
|
+
head
|
4
|
+
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
|
5
|
+
<!--[if lt IE 9]>
|
6
|
+
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
7
|
+
<![endif]-->
|
8
|
+
meta content='text/html; charset=utf-8' http-equiv='Content-Type'
|
9
|
+
meta name='viewport' content='width=device-width,initial-scale=1'
|
10
|
+
title = @title.present? ? "#{@title} | Padrino Admin" : "#{pat(:custom_errors.title)} | Padrino Admin"
|
11
|
+
= favicon_tag 'favicon.ico'
|
12
|
+
link href='http://fonts.googleapis.com/css?family=Varela' rel='stylesheet'
|
13
|
+
= stylesheet_link_tag 'bootstrap', 'application'
|
14
|
+
|
15
|
+
body
|
16
|
+
div class="custom-error text-center"
|
17
|
+
div class="custom-error-body muted" = yield
|
18
|
+
div class="custom-error-footer"
|
19
|
+
= link_to tag_icon('arrow-left'),"#", :onclick => "history.go(-1);return false;", :class =>"custom-error-go-back btn pull-left", :title => "Go Back"
|
@@ -1,31 +1,35 @@
|
|
1
|
-
doctype
|
2
|
-
html lang=
|
1
|
+
doctype 5
|
2
|
+
html lang="en" xmlns="http://www.w3.org/1999/xhtml"
|
3
3
|
head
|
4
|
+
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
|
5
|
+
<!--[if lt IE 9]>
|
6
|
+
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
7
|
+
<![endif]-->
|
4
8
|
meta content='text/html; charset=utf-8' http-equiv='Content-Type'
|
5
|
-
|
6
|
-
|
9
|
+
meta name='viewport' content='width=device-width,initial-scale=1'
|
10
|
+
title = @title.present? ? "#{@title} | Padrino Admin" : "#{pat('login.title')} | Padrino Admin"
|
11
|
+
= favicon_tag 'favicon.ico'
|
12
|
+
= stylesheet_link_tag 'bootstrap', 'application'
|
7
13
|
|
8
14
|
body
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
.group.navform.wat-cf
|
31
|
-
.right == submit_tag 'Sign In', :class => :button
|
15
|
+
- form_tag url(:sessions, :create), :class=>'login form-horizontal' do
|
16
|
+
div class="login-header modal-header"
|
17
|
+
div class="login-logo" = image_tag('logo.png', :alt => "Padrino's logo", :height => 250, :width => 193)
|
18
|
+
div class="login-body modal-body"
|
19
|
+
= [:error, :warning, :notice].map { |type| flash_tag(type, :class => "alert alert-#{type} fade in", :bootstrap => true) }.join.html_safe
|
20
|
+
|
21
|
+
fieldset class='control-group'
|
22
|
+
label for="email" class='login-input-label control-label' = pat('login.email')
|
23
|
+
div class='login-controls controls' = email_field_tag :email, :value => params[:email], :autofocus => true
|
24
|
+
fieldset class='control-group'
|
25
|
+
label for='password' class='login-input-label control-label' = pat('login.password')
|
26
|
+
div class='login-controls controls' = password_field_tag :password, :value => params[:password]
|
27
|
+
fieldset class='login-control-group-last control-group'
|
28
|
+
div class='login-controls controls'
|
29
|
+
label class="login-bypass-label checkbox"
|
30
|
+
= check_box_tag :bypass
|
31
|
+
| #{pat('login.bypass')}
|
32
|
+
|
33
|
+
div class="login-footer modal-footer"
|
34
|
+
= submit_tag(pat('login.sign_in'), :class => 'btn btn-primary pull-right')
|
35
|
+
= javascript_include_tag 'jquery-1.9.0.min', (Padrino.env == :production ? 'bootstrap.min' : %w[bootstrap/bootstrap-affix bootstrap/bootstrap-alert bootstrap/bootstrap-button bootstrap/bootstrap-carousel bootstrap/bootstrap-collapse bootstrap/bootstrap-dropdown bootstrap/bootstrap-tooltip bootstrap/bootstrap-transition bootstrap/bootstrap-typeahead bootstrap/bootstrap-modal bootstrap/bootstrap-popover bootstrap/bootstrap-scrollspy bootstrap/bootstrap-tab]), :application
|
@@ -1,14 +1,16 @@
|
|
1
|
-
<%- @orm.column_fields.
|
2
|
-
.
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
span.description Ex: a simple text
|
1
|
+
<%- @orm.column_fields.each_with_index do |column, index| -%>
|
2
|
+
- error = <%= @orm.has_error(column[:name]) %>
|
3
|
+
fieldset class='control-group#{error ? ' has-error' : ''}'
|
4
|
+
= f.label :<%= column[:name] %>, :class => 'control-label'
|
5
|
+
div class='controls'
|
6
|
+
= f.<%= column[:field_type] %> :<%= column[:name] %>, :class => 'input-xlarge input-with-feedback'<%- if (index == 0) -%>, :autofocus => true<%- end -%>
|
8
7
|
|
8
|
+
span class='help-inline' = error ? f.error_message_on(:<%= column[:name] %>, :class => 'text-error') : pat(:example)
|
9
9
|
<%- end -%>
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
div class="form-actions"
|
12
|
+
= f.submit pat(:save), :class => 'btn btn-primary'
|
13
|
+
|
|
14
|
+
= f.submit pat(:save_and_continue), :class => 'btn btn-info', :name => 'save_and_continue'
|
15
|
+
|
|
16
|
+
= link_to pat(:cancel), url(:<%= @orm.name_plural %>, :index), :class => 'btn'
|
@@ -1,16 +1,8 @@
|
|
1
|
-
|
2
|
-
.
|
3
|
-
|
4
|
-
|
5
|
-
li == link_to pat(:new), url(:<%= @orm.name_plural %>, :new)
|
6
|
-
li.active == link_to pat(:edit), url(:<%= @orm.name_plural %>, :edit, :id => @<%= @orm.name_singular %>.id)
|
7
|
-
.content
|
8
|
-
h2.title
|
9
|
-
= pat(:edit)
|
10
|
-
== " "
|
11
|
-
= mt(:<%= @orm.name_singular %>)
|
12
|
-
.inner
|
13
|
-
== form_for :<%= @orm.name_singular %>, url(:<%= @orm.name_plural %>, :update, :id => @<%= @orm.name_singular %>.id), :method => :put, :class => :form do |f|
|
14
|
-
== partial '<%= @orm.name_plural %>/form', :locals => { :f => f }
|
1
|
+
ul class="nav nav-tabs"
|
2
|
+
li = link_to tag_icon(:list, pat(:list)), url(:<%= @orm.name_plural %>, :index)
|
3
|
+
li = link_to tag_icon(:plus, pat(:new)), url(:<%= @orm.name_plural %>, :new)
|
4
|
+
li class="active" = link_to tag_icon(:edit, pat(:edit)), url(:<%= @orm.name_plural %>, :edit, :id => @<%= @orm.name_singular %>.id)
|
15
5
|
|
16
|
-
|
6
|
+
div class="tabs-content"
|
7
|
+
- form_for :<%= @orm.name_singular %>, url(:<%= @orm.name_plural %>, :update, :id => @<%= @orm.name_singular %>.id), :method => :put, :class => 'form-horizontal' do |f|
|
8
|
+
= partial '<%= @orm.name_plural %>/form', :locals => { :f => f }
|
@@ -1,30 +1,56 @@
|
|
1
|
-
|
2
|
-
.
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
1
|
+
ul class="nav nav-tabs"
|
2
|
+
li class="active" = link_to tag_icon(:list, pat(:list)), url(:<%= @orm.name_plural %>, :index)
|
3
|
+
li = link_to tag_icon(:plus, pat(:new)), url(:<%= @orm.name_plural %>, :new)
|
4
|
+
|
5
|
+
div class="tabs-content"
|
6
|
+
table class="table table-striped table-hover table-condensed" id="list"
|
7
|
+
thead
|
8
|
+
tr
|
9
|
+
th class='header list-menu'
|
10
|
+
div class='dropdown'
|
11
|
+
a href='#' class='list-menu-toggle.dropdown-toggle dropdown-toggle' data-toggle='dropdown'
|
12
|
+
= tag_icon :magic
|
13
|
+
span class='caret'
|
14
|
+
ul class='list-menu dropdown-menu' role='dropdown'
|
15
|
+
li class='list-menu-wrapper' = link_to tag_icon(:check, pat(:select_all)), '#', :id => 'select-all', :class => 'list-menu-link'
|
16
|
+
li class='list-menu-wrapper list-menu-wrapper-disabled' = link_to tag_icon('check-empty', pat(:deselect_all)), '#', :id => 'deselect-all', :class => 'list-menu-link list-menu-link-disabled'
|
17
|
+
li class='list-menu-divider divider'
|
18
|
+
li class='list-menu-wrapper list-menu-wrapper-disabled'
|
19
|
+
= link_to tag_icon(:trash, pat(:delete_selected)), '#', :id => 'delete-selected', :class => 'list-menu-link list-menu-link-disabled'
|
20
|
+
div class='list-menu-popover-delete-selected popover right'
|
21
|
+
div class='arrow'
|
22
|
+
h3 class='popover-title' = pat(:delete_selected_title)
|
23
|
+
div class='popover-content'
|
24
|
+
- form_tag url(:<%= @orm.name_plural %>, :destroy_many), :method => :delete do
|
25
|
+
= hidden_field_tag :<%= @orm.name_singular %>_ids, :'data-delete-many-ids' => true
|
26
|
+
= submit_tag pat(:delete), :class =>'list-menu-popover-delete-selected-btn btn btn-danger btn-small'
|
27
|
+
div class='btn btn-small cancel' = pat(:cancel)
|
28
|
+
<%- @orm.columns.each_with_index do |column, i| -%>
|
29
|
+
th class='header' = :<%= column.name %>
|
30
|
+
<%- end -%>
|
31
|
+
th class='header list-row-action-header'
|
32
|
+
|
33
|
+
tbody
|
34
|
+
-@<%= @orm.name_plural %>.each do |<%= @orm.name_singular %>|
|
35
|
+
tr class='list-row'
|
36
|
+
td class='list-column list-selectable' = check_box_tag '<%= @orm.name_singular %>_ids[]', :value => <%= @orm.name_singular %>.id, :class => 'list-selectable-checkbox'
|
14
37
|
<%- @orm.columns.each_with_index do |column, i| -%>
|
15
|
-
|
38
|
+
<%- if column.name == 'created_at' || column.name == 'updated_at' -%>
|
39
|
+
td class='list-column' = time_ago_in_words <%= @orm.name_singular %>.<%= column.name %>
|
40
|
+
<%- elsif column.type == :boolean -%>
|
41
|
+
td class='list-column' = <%= @orm.name_singular %>.<%= column.name %> ? tag_icon(:ok) : tag_icon(:remove)
|
42
|
+
<%- else -%>
|
43
|
+
td class='list-column' = <%= @orm.name_singular %>.<%= column.name %>
|
16
44
|
<%- end -%>
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
-content_for :sidebar, partial("base/sidebar")
|
45
|
+
<%- end -%>
|
46
|
+
td class='list-column list-row-action'
|
47
|
+
div class='list-row-action-wrapper'
|
48
|
+
= link_to tag_icon(:edit), :href => url(:<%= @orm.name_plural %>, :edit, :id => <%= @orm.name_singular %>.id), :rel => :tooltip, :title => "#{pat(:edit)} <%= @orm.name_singular %>", :class => 'list-row-action-wrapper-link'
|
49
|
+
= link_to tag_icon(:trash), :rel => :tooltip, :title => "#{pat(:delete)} <%= @orm.name_singular %>", :class => 'list-row-action-delete-one list-row-action-wrapper-link'
|
50
|
+
div class='popover list-row-action-popover-delete-one left'
|
51
|
+
div class='arrow'
|
52
|
+
h3 class='popover-title' = pat(:delete, :model => "<%= @orm.name_singular %>")
|
53
|
+
div class='popover-content'
|
54
|
+
- form_tag url(:<%= @orm.name_plural %>, :destroy, :id => <%= @orm.name_singular %>.id), :method => :delete do
|
55
|
+
= submit_tag pat(:delete), :class =>'list-row-action-popover-delete-one-btn btn btn-danger btn-small'
|
56
|
+
div class='btn btn-small cancel' = pat(:cancel)
|
@@ -1,15 +1,7 @@
|
|
1
|
-
|
2
|
-
.
|
3
|
-
|
4
|
-
li.first == link_to pat(:list), url(:<%= @orm.name_plural %>, :index)
|
5
|
-
li.active == link_to pat(:new), url(:<%= @orm.name_plural %>, :new)
|
6
|
-
.content
|
7
|
-
h2.title
|
8
|
-
= pat(:new)
|
9
|
-
== ' '
|
10
|
-
= mt(:<%= @orm.name_singular %>)
|
11
|
-
.inner
|
12
|
-
- form_for :<%= @orm.name_singular %>, url(:<%= @orm.name_plural %>, :create), :class => :form do |f|
|
13
|
-
== partial "<%= @orm.name_plural %>/form", :locals => { :f => f }
|
1
|
+
ul class="nav nav-tabs"
|
2
|
+
li = link_to tag_icon(:list, pat(:list)), url(:<%= @orm.name_plural %>, :index)
|
3
|
+
li class="active" = link_to tag_icon(:plus, pat(:new)), url(:<%= @orm.name_plural %>, :new)
|
14
4
|
|
15
|
-
|
5
|
+
div class="tabs-content"
|
6
|
+
- form_for :<%= @orm.name_singular %>, url(:<%= @orm.name_plural %>, :create), :class => 'form-horizontal' do |f|
|
7
|
+
= partial '<%= @orm.name_plural %>/form', :locals => { :f => f }
|
@@ -53,15 +53,17 @@ module Padrino
|
|
53
53
|
# By default this method is used in Admin Apps.
|
54
54
|
#
|
55
55
|
def login_required
|
56
|
-
|
57
|
-
|
56
|
+
unless allowed?
|
57
|
+
store_location! if store_location
|
58
|
+
access_denied
|
59
|
+
end
|
58
60
|
end
|
59
61
|
|
60
62
|
##
|
61
|
-
# Store in session[:return_to] the env['
|
63
|
+
# Store in session[:return_to] the env['REQUEST_URI']
|
62
64
|
#
|
63
65
|
def store_location!
|
64
|
-
session[:return_to] = env['
|
66
|
+
session[:return_to] = env['REQUEST_URI']
|
65
67
|
end
|
66
68
|
|
67
69
|
##
|
@@ -5,9 +5,28 @@ module Padrino
|
|
5
5
|
#
|
6
6
|
module Helpers
|
7
7
|
##
|
8
|
-
#
|
8
|
+
# Admin helpers
|
9
9
|
#
|
10
10
|
module ViewHelpers
|
11
|
+
##
|
12
|
+
# Icon's Bootstrap helper
|
13
|
+
#
|
14
|
+
# @param [Symbol] icon
|
15
|
+
# The specified icon type
|
16
|
+
#
|
17
|
+
# @param [Symbol] tag
|
18
|
+
# The HTML tag.
|
19
|
+
#
|
20
|
+
# @return [String] html tag with prepend icon
|
21
|
+
#
|
22
|
+
# @example
|
23
|
+
# tag_icon(:edit, :list)
|
24
|
+
#
|
25
|
+
def tag_icon(icon, tag = nil)
|
26
|
+
content = content_tag(:i, '', :class=> "icon-#{icon.to_s}")
|
27
|
+
content << " #{tag.to_s}"
|
28
|
+
end
|
29
|
+
|
11
30
|
##
|
12
31
|
# Translates a given word for padrino admin
|
13
32
|
#
|
@@ -25,8 +44,10 @@ module Padrino
|
|
25
44
|
# # => t("padrino.admin.profile", :default => "My Profile")
|
26
45
|
# pat(:profile, "My Profile")
|
27
46
|
#
|
28
|
-
def padrino_admin_translate(word
|
29
|
-
|
47
|
+
def padrino_admin_translate(word,*args)
|
48
|
+
options = args.extract_options!
|
49
|
+
options[:default] ||= word.to_s.humanize
|
50
|
+
t("padrino.admin.#{word}", options)
|
30
51
|
end
|
31
52
|
alias :pat :padrino_admin_translate
|
32
53
|
|
@@ -45,9 +66,10 @@ module Padrino
|
|
45
66
|
# mat(:account, :email)
|
46
67
|
#
|
47
68
|
def model_attribute_translate(model, attribute)
|
48
|
-
t("models
|
69
|
+
t("models.\#{model}.attributes.\#{attribute}", :default => attribute.to_s.humanize)
|
49
70
|
end
|
50
|
-
alias :
|
71
|
+
alias :t_attr :model_attribute_translate
|
72
|
+
alias :mat :t_attr
|
51
73
|
|
52
74
|
##
|
53
75
|
# Translates model name
|