flexi_generators 0.2.10 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +29 -0
- data/Rakefile +2 -16
- data/flexi_generators.gemspec +17 -114
- data/lib/flexi_generators.rb +11 -0
- data/lib/generators/flexi/config/config_generator.rb +25 -0
- data/lib/generators/flexi/config/templates/field_error.rb +9 -0
- data/lib/generators/flexi/config/templates/inflector_portuguese.rb +62 -0
- data/lib/generators/flexi/config/templates/pt-BR.yml +224 -0
- data/lib/generators/flexi/config/templates/will_paginate.rb +26 -0
- data/lib/generators/flexi/install/install_generator.rb +28 -0
- data/lib/generators/flexi/install/templates/application.css +15 -0
- data/lib/generators/flexi/install/templates/application.js +16 -0
- data/lib/generators/flexi/layout/layout_generator.rb +46 -0
- data/lib/generators/flexi/layout/templates/_flash.html.erb +4 -0
- data/lib/generators/flexi/layout/templates/_navbar.html.erb +6 -0
- data/lib/generators/flexi/layout/templates/_sidebar.html.erb +16 -0
- data/lib/generators/flexi/layout/templates/_user_dropdown.html.erb +11 -0
- data/lib/generators/flexi/layout/templates/application.css +16 -0
- data/lib/generators/flexi/layout/templates/dashboard.html.erb +49 -0
- data/lib/generators/flexi/layout/templates/error_messages_helper.rb +33 -0
- data/lib/generators/flexi/layout/templates/layout.css +8 -0
- data/lib/generators/flexi/layout/templates/layout.html.erb +76 -0
- data/lib/generators/flexi/layout/templates/layout_helper.rb +47 -0
- data/lib/generators/flexi/scaffold/scaffold_generator.rb +24 -109
- data/lib/generators/flexi/scaffold/templates/_form.html.erb +22 -0
- data/lib/generators/flexi/scaffold/templates/edit.html.erb +1 -0
- data/lib/generators/flexi/scaffold/templates/index.html.erb +36 -0
- data/lib/generators/flexi/scaffold/templates/new.html.erb +1 -0
- data/lib/generators/flexi/scaffold/templates/show.html.erb +21 -0
- data/lib/twitter-bootstrap/engine.rb +6 -0
- data/lib/twitter-bootstrap/railtie.rb +6 -0
- data/lib/twitter-bootstrap/version.rb +5 -0
- data/lib/version.rb +3 -0
- data/vendor/assets/images/glyphicons-halflings-white.png +0 -0
- data/vendor/assets/images/glyphicons-halflings.png +0 -0
- data/vendor/assets/javascripts/bootstrap.js +1825 -0
- data/vendor/assets/stylesheets/bootstrap-responsive.css +815 -0
- data/vendor/assets/stylesheets/bootstrap.css +4983 -0
- metadata +51 -89
- data/README.textile +0 -64
- data/VERSION +0 -1
- data/lib/generators/flexi.rb +0 -16
- data/lib/generators/flexi/auth/USAGE +0 -5
- data/lib/generators/flexi/auth/auth_generator.rb +0 -122
- data/lib/generators/flexi/auth/templates/authentication.rb +0 -55
- data/lib/generators/flexi/auth/templates/authlogic_session.rb +0 -2
- data/lib/generators/flexi/auth/templates/fixtures.yml +0 -24
- data/lib/generators/flexi/auth/templates/migration.rb +0 -16
- data/lib/generators/flexi/auth/templates/sessions_controller.rb +0 -26
- data/lib/generators/flexi/auth/templates/sessions_helper.rb +0 -2
- data/lib/generators/flexi/auth/templates/tests/testunit/sessions_controller.rb +0 -20
- data/lib/generators/flexi/auth/templates/tests/testunit/user.rb +0 -4
- data/lib/generators/flexi/auth/templates/tests/testunit/users_controller.rb +0 -23
- data/lib/generators/flexi/auth/templates/user.rb +0 -3
- data/lib/generators/flexi/auth/templates/users_controller.rb +0 -43
- data/lib/generators/flexi/auth/templates/users_helper.rb +0 -2
- data/lib/generators/flexi/auth/templates/views/erb/_error_messages.html.erb +0 -11
- data/lib/generators/flexi/auth/templates/views/erb/_menu.html.erb +0 -16
- data/lib/generators/flexi/auth/templates/views/erb/application.html.erb +0 -39
- data/lib/generators/flexi/auth/templates/views/erb/edit.html.erb +0 -24
- data/lib/generators/flexi/auth/templates/views/erb/index.html.erb +0 -27
- data/lib/generators/flexi/auth/templates/views/erb/login.html.erb +0 -22
- data/lib/generators/flexi/auth/templates/views/erb/new.html.erb +0 -24
- data/lib/generators/flexi/auth/templates/views/erb/show.html.erb +0 -16
- data/lib/generators/flexi/prepare/USAGE +0 -6
- data/lib/generators/flexi/prepare/prepare_generator.rb +0 -68
- data/lib/generators/flexi/prepare/templates/add.png +0 -0
- data/lib/generators/flexi/prepare/templates/admin_home_controller.rb +0 -6
- data/lib/generators/flexi/prepare/templates/admin_home_index.html.erb +0 -16
- data/lib/generators/flexi/prepare/templates/application.css +0 -279
- data/lib/generators/flexi/prepare/templates/application_helper.rb +0 -44
- data/lib/generators/flexi/prepare/templates/back.png +0 -0
- data/lib/generators/flexi/prepare/templates/bg.png +0 -0
- data/lib/generators/flexi/prepare/templates/bg2.png +0 -0
- data/lib/generators/flexi/prepare/templates/boxheader.gif +0 -0
- data/lib/generators/flexi/prepare/templates/btn-bg-hover.png +0 -0
- data/lib/generators/flexi/prepare/templates/btn-bg.png +0 -0
- data/lib/generators/flexi/prepare/templates/custom_field_error.rb +0 -12
- data/lib/generators/flexi/prepare/templates/delete.png +0 -0
- data/lib/generators/flexi/prepare/templates/edit.png +0 -0
- data/lib/generators/flexi/prepare/templates/inflector_portuguese.rb +0 -60
- data/lib/generators/flexi/prepare/templates/login.css +0 -142
- data/lib/generators/flexi/prepare/templates/login.html.erb +0 -26
- data/lib/generators/flexi/prepare/templates/logo.png +0 -0
- data/lib/generators/flexi/prepare/templates/menu.png +0 -0
- data/lib/generators/flexi/prepare/templates/messages/Thumbs.db +0 -0
- data/lib/generators/flexi/prepare/templates/messages/error.png +0 -0
- data/lib/generators/flexi/prepare/templates/messages/info.png +0 -0
- data/lib/generators/flexi/prepare/templates/messages/success.png +0 -0
- data/lib/generators/flexi/prepare/templates/messages/tip.png +0 -0
- data/lib/generators/flexi/prepare/templates/messages/warning.png +0 -0
- data/lib/generators/flexi/prepare/templates/pt-BR.yml +0 -206
- data/lib/generators/flexi/prepare/templates/routes.rb +0 -3
- data/lib/generators/flexi/prepare/templates/show.png +0 -0
- data/lib/generators/flexi/prepare/templates/site.css +0 -72
- data/lib/generators/flexi/prepare/templates/site.html.erb +0 -20
- data/lib/generators/flexi/prepare/templates/site_controller.rb +0 -9
- data/lib/generators/flexi/prepare/templates/site_helper.rb +0 -2
- data/lib/generators/flexi/prepare/templates/site_index.html.erb +0 -27
- data/lib/generators/flexi/prepare/templates/users.png +0 -0
- data/lib/generators/flexi/scaffold/USAGE +0 -5
- data/lib/generators/flexi/scaffold/templates/controller.rb +0 -43
- data/lib/generators/flexi/scaffold/templates/fixtures.yml +0 -9
- data/lib/generators/flexi/scaffold/templates/helper.rb +0 -2
- data/lib/generators/flexi/scaffold/templates/migration.rb +0 -14
- data/lib/generators/flexi/scaffold/templates/model.rb +0 -3
- data/lib/generators/flexi/scaffold/templates/tests/controller.rb +0 -50
- data/lib/generators/flexi/scaffold/templates/tests/helper.rb +0 -4
- data/lib/generators/flexi/scaffold/templates/tests/model.rb +0 -8
- data/lib/generators/flexi/scaffold/templates/views/erb/_error_messages.html.erb +0 -11
- data/lib/generators/flexi/scaffold/templates/views/erb/_form.html.erb +0 -13
- data/lib/generators/flexi/scaffold/templates/views/erb/edit.html.erb +0 -3
- data/lib/generators/flexi/scaffold/templates/views/erb/index.html.erb +0 -29
- data/lib/generators/flexi/scaffold/templates/views/erb/new.html.erb +0 -3
- data/lib/generators/flexi/scaffold/templates/views/erb/show.html.erb +0 -15
- data/template.rb +0 -15
@@ -1,24 +0,0 @@
|
|
1
|
-
# password: "secret"
|
2
|
-
foo:
|
3
|
-
username: foo
|
4
|
-
email: foo@example.com
|
5
|
-
<%- if options[:authlogic] -%>
|
6
|
-
persistence_token: d5ddba13ed4408ea2b0a12ab18ed2d2eda086279736bdc121ca726a11f1e4b99217d9c534c2cc4ebb22729349c8c5fdbe1529e1f2c3c5859c62ef4dd9feea25c
|
7
|
-
crypted_password: 3d16c326648cccafe3d4b4cb024475c381dda92f430dfedf6f933e1f61203bacb6bae2437849bdb43b06be335e23790e4aa03902b3c28c3bbbbe27d501e521f3
|
8
|
-
password_salt: n6z_wtpWoIsHgQb5IcFd
|
9
|
-
<%- else -%>
|
10
|
-
password_hash: 3488f5f7efecab14b91eb96169e5e1ee518a569f
|
11
|
-
password_salt: bef65e058905c379436d80d1a32e7374b139e7b0
|
12
|
-
<%- end -%>
|
13
|
-
|
14
|
-
bar:
|
15
|
-
username: bar
|
16
|
-
email: bar@example.com
|
17
|
-
<%- if options[:authlogic] -%>
|
18
|
-
persistence_token: 19e074bd7cb506ab3e7e53e41f24f0ab3221c8cb68111f4c1aa43965114ad734233979a50a9463537487cdca18c279ac91c4bc83693d589625d446493322394c
|
19
|
-
crypted_password: 3bc9f4113ca645a186765df3d31a9352d0067bf2304ba0cdd6b08a7f3d58c6668ab1762fa3e76aef466ea2ff188399d8e6c40244fa59312bb4112292dac9f7f0
|
20
|
-
password_salt: UiAh9ejabnKRxqsiK0xO
|
21
|
-
<%- else -%>
|
22
|
-
password_hash: 3488f5f7efecab14b91eb96169e5e1ee518a569f
|
23
|
-
password_salt: bef65e058905c379436d80d1a32e7374b139e7b0
|
24
|
-
<%- end -%>
|
@@ -1,16 +0,0 @@
|
|
1
|
-
class Create<%= user_plural_class_name %> < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
create_table :<%= user_plural_name %> do |t|
|
4
|
-
t.string :username
|
5
|
-
t.string :email
|
6
|
-
t.string :persistence_token
|
7
|
-
t.string :crypted_password
|
8
|
-
t.string :password_salt
|
9
|
-
t.timestamps
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.down
|
14
|
-
drop_table :<%= user_plural_name %>
|
15
|
-
end
|
16
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
class <%= session_plural_class_name %>Controller < ApplicationController
|
3
|
-
skip_before_filter :login_required
|
4
|
-
|
5
|
-
layout 'login'
|
6
|
-
|
7
|
-
def new
|
8
|
-
@<%= session_singular_name %> = <%= session_class_name %>.new
|
9
|
-
end
|
10
|
-
|
11
|
-
def create
|
12
|
-
@<%= session_singular_name %> = <%= session_class_name %>.new(params[:<%= session_singular_name %>])
|
13
|
-
if @<%= session_singular_name %>.save
|
14
|
-
flash[:notice] = "Bem-vindo!"
|
15
|
-
redirect_to_target_or_default(admin_home_url)
|
16
|
-
else
|
17
|
-
flash.now[:error] = "Usuário/E-mail ou senha inválidos."
|
18
|
-
render :action => 'new'
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def destroy
|
23
|
-
current_<%= session_singular_name %>.destroy
|
24
|
-
redirect_to login_url
|
25
|
-
end
|
26
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class <%= session_plural_class_name %>ControllerTest < ActionController::TestCase
|
4
|
-
def test_new
|
5
|
-
get :new
|
6
|
-
assert_template 'new'
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_create_invalid
|
10
|
-
post :create, :<%= session_singular_name %> => { :username => "foo", :password => "badpassword" }
|
11
|
-
assert_template 'new'
|
12
|
-
assert_nil <%= session_class_name %>.find
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_create_valid
|
16
|
-
post :create, :<%= session_singular_name %> => { :username => "foo", :password => "secret" }
|
17
|
-
assert_redirected_to "/"
|
18
|
-
assert_equal <%= user_plural_name %>(:foo), <%= session_class_name %>.find.<%= user_singular_name %>
|
19
|
-
end
|
20
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class <%= user_plural_class_name %>ControllerTest < ActionController::TestCase
|
4
|
-
def test_new
|
5
|
-
get :new
|
6
|
-
assert_template 'new'
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_create_invalid
|
10
|
-
<%= user_class_name %>.any_instance.stubs(:valid?).returns(false)
|
11
|
-
post :create
|
12
|
-
assert_template 'new'
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_create_valid
|
16
|
-
<%= user_class_name %>.any_instance.stubs(:valid?).returns(true)
|
17
|
-
post :create
|
18
|
-
assert_redirected_to "/"
|
19
|
-
<%- unless options[:authlogic] -%>
|
20
|
-
assert_equal assigns['<%= user_singular_name %>'].id, session['<%= user_singular_name %>_id']
|
21
|
-
<%- end -%>
|
22
|
-
end
|
23
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
class Admin::<%= user_plural_class_name %>Controller < ApplicationController
|
3
|
-
menu_item :<%= user_plural_name %>
|
4
|
-
respond_to :html
|
5
|
-
|
6
|
-
def index
|
7
|
-
@<%= user_plural_name %> = <%= user_class_name %>.paginate :page => params[:page],
|
8
|
-
:per_page => 15
|
9
|
-
respond_with(:admin, @<%= user_plural_name %>)
|
10
|
-
end
|
11
|
-
|
12
|
-
def show
|
13
|
-
@<%= user_singular_name %> = <%= user_class_name %>.find(params[:id])
|
14
|
-
respond_with(:admin, @<%= user_singular_name %>)
|
15
|
-
end
|
16
|
-
|
17
|
-
def new
|
18
|
-
@<%= user_singular_name %> = <%= user_class_name %>.new
|
19
|
-
respond_with(:admin, @<%= user_singular_name %>)
|
20
|
-
end
|
21
|
-
|
22
|
-
def edit
|
23
|
-
@<%= user_singular_name %> = <%= user_class_name %>.find(params[:id])
|
24
|
-
end
|
25
|
-
|
26
|
-
def create
|
27
|
-
@<%= user_singular_name %> = <%= user_class_name %>.new(params[:<%= user_singular_name %>])
|
28
|
-
flash[:notice] = '<%= user_class_name %> foi criado com sucesso.' if @<%= user_singular_name %>.save
|
29
|
-
respond_with(:admin, @<%= user_singular_name %>)
|
30
|
-
end
|
31
|
-
|
32
|
-
def update
|
33
|
-
@<%= user_singular_name %> = <%= user_class_name %>.find(params[:id])
|
34
|
-
flash[:notice] = '<%= user_class_name %> foi alterado com sucesso.' if @<%= user_singular_name %>.update_attributes(params[:<%= user_singular_name %>])
|
35
|
-
respond_with(:admin, @<%= user_singular_name %>)
|
36
|
-
end
|
37
|
-
|
38
|
-
def destroy
|
39
|
-
@<%= user_singular_name %> = <%= user_class_name %>.find(params[:id])
|
40
|
-
flash[:notice] = '<%= user_class_name %> foi excluído com sucesso.' if @<%= user_singular_name %>.destroy
|
41
|
-
respond_with(:admin, @<%= user_singular_name %>)
|
42
|
-
end
|
43
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
<%% if resource.errors.any? %>
|
2
|
-
<div class="flash_messages error_explanation">
|
3
|
-
<h2>Não foi possível gravar: <%%= pluralize(resource.errors.count, "erro") %></h2>
|
4
|
-
|
5
|
-
<ul>
|
6
|
-
<%% resource.errors.full_messages.each do |msg| %>
|
7
|
-
<li><%%= msg %></li>
|
8
|
-
<%% end %>
|
9
|
-
</ul>
|
10
|
-
</div>
|
11
|
-
<%% end %>
|
@@ -1,16 +0,0 @@
|
|
1
|
-
<div class="menu">
|
2
|
-
<%%= menu do |m| %>
|
3
|
-
<%%= m.<%= user_plural_name %> admin_<%= user_plural_name %>_path do %>
|
4
|
-
<%%= image_tag 'users.png' %> <%= user_plural_class_name %>
|
5
|
-
<%% end %>
|
6
|
-
<%%= m.menu1 "#menu" do %>
|
7
|
-
<%%= image_tag 'menu.png' %> Menu 1
|
8
|
-
<%% end %>
|
9
|
-
<%%= m.menu2 "#menu" do %>
|
10
|
-
<%%= image_tag 'menu.png' %> Menu 2
|
11
|
-
<%% end %>
|
12
|
-
<%%= m.menu3 "#menu" do %>
|
13
|
-
<%%= image_tag 'menu.png' %> Menu 3
|
14
|
-
<%% end %>
|
15
|
-
<%% end %>
|
16
|
-
</div>
|
@@ -1,39 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
|
5
|
-
<title><%%= "Área administrativa - #{ yield(:title) }" %></title>
|
6
|
-
<%%= stylesheet_link_tag 'application' %>
|
7
|
-
<%%= javascript_include_tag :defaults %>
|
8
|
-
<%%= yield(:head) %>
|
9
|
-
<%%= csrf_meta_tag %>
|
10
|
-
</head>
|
11
|
-
<body>
|
12
|
-
<div class="top_nav">
|
13
|
-
<%% if logged_in? %>
|
14
|
-
<%%= current_<%= user_singular_name %>.username %> | <%%= current_<%= user_singular_name %>.email %> | <%%= link_to "» Sair", logout_path, :class => 'logout' %>
|
15
|
-
<%% else %>
|
16
|
-
<%%= link_to "» Entrar", login_path, :class => 'login' %>
|
17
|
-
<%% end %>
|
18
|
-
</div>
|
19
|
-
<div id="header">
|
20
|
-
<%%= link_to image_tag("logo.png"), admin_home_url %>
|
21
|
-
</div>
|
22
|
-
<div id="container">
|
23
|
-
<div id="sidenav">
|
24
|
-
<%%= render "layouts/menu" %>
|
25
|
-
</div>
|
26
|
-
<div id="main">
|
27
|
-
<div class="box-header">
|
28
|
-
<%% if show_title? %>
|
29
|
-
<h2><%%= yield(:title) %></h2>
|
30
|
-
<%% end %>
|
31
|
-
</div>
|
32
|
-
<div class="box">
|
33
|
-
<%%= raw flash_messages %>
|
34
|
-
<%%= yield %>
|
35
|
-
</div>
|
36
|
-
</div>
|
37
|
-
</div>
|
38
|
-
</body>
|
39
|
-
</html>
|
@@ -1,24 +0,0 @@
|
|
1
|
-
<%% title "Editando <%= user_singular_name.titleize %>" %>
|
2
|
-
|
3
|
-
<%%= form_for([:admin, @<%= user_singular_name %>]) do |f| %>
|
4
|
-
<%%= render "shared/error_messages", :resource => @<%= user_singular_name %> %>
|
5
|
-
<div class="field">
|
6
|
-
<%%= f.label :username %><br />
|
7
|
-
<%%= f.text_field :username, :readonly => true %>
|
8
|
-
</div>
|
9
|
-
<div class="field">
|
10
|
-
<%%= f.label :email %><br />
|
11
|
-
<%%= f.text_field :email %>
|
12
|
-
</div>
|
13
|
-
<div class="field">
|
14
|
-
<%%= f.label :password %><br />
|
15
|
-
<%%= f.password_field :password %>
|
16
|
-
</div>
|
17
|
-
<div class="field">
|
18
|
-
<%%= f.label :password_confirmation %><br />
|
19
|
-
<%%= f.password_field :password_confirmation %>
|
20
|
-
</div>
|
21
|
-
<div id="control_box">
|
22
|
-
<%%= f.submit "Salvar", :class => "button medium blue" %> | <%%= link_to("Cancelar", admin_<%= user_plural_name %>_path, :class => "button medium red") %>
|
23
|
-
</div>
|
24
|
-
<%% end %>
|
@@ -1,27 +0,0 @@
|
|
1
|
-
<%% title("<%= user_plural_name.titleize %>") %>
|
2
|
-
|
3
|
-
<div id="new_box">
|
4
|
-
<%%= link_to 'Adicionar', new_admin_<%= user_singular_name %>_path, :class => 'button medium green' %>
|
5
|
-
</div>
|
6
|
-
|
7
|
-
<table cellspacing="0" cellpadding="2">
|
8
|
-
<tr>
|
9
|
-
<th>Usuário</th>
|
10
|
-
<th>E-mail</th>
|
11
|
-
<th></th>
|
12
|
-
</tr>
|
13
|
-
<%% @<%= user_plural_name %>.each do |<%= user_singular_name %>| %>
|
14
|
-
<tr>
|
15
|
-
<td><%%= <%= user_singular_name %>.username %></td>
|
16
|
-
<td><%%= <%= user_singular_name %>.email %></td>
|
17
|
-
<td width="11%">
|
18
|
-
<ul class="actions">
|
19
|
-
<li><%%= link_to( image_tag("show.png"), [:admin, <%= user_singular_name %>], :title => "Mostrar" ) %></li>
|
20
|
-
<li><%%= link_to( image_tag("edit.png"), edit_admin_<%= user_singular_name %>_path(<%= user_singular_name %>), :title => "Editar" ) %></li>
|
21
|
-
<li><%%= link_to( image_tag("delete.png"), [:admin, <%= user_singular_name %>], :confirm => 'Tem certeza que deseja excluir?', :method => :delete, :title => "Excluir" ) %></li>
|
22
|
-
</ul>
|
23
|
-
</td>
|
24
|
-
</tr>
|
25
|
-
<%% end %>
|
26
|
-
</table>
|
27
|
-
<%%= will_paginate @<%= user_plural_name %>, :previous_label=>'« Anterior', :next_label=>'Próximo »' %>
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<%% title "Autenticação" %>
|
2
|
-
|
3
|
-
<%%= form_for @<%= session_singular_name %> do |f| %>
|
4
|
-
<table width="100%" cellspacing="1" cellpadding="2" align="center" class="login_box">
|
5
|
-
<tr>
|
6
|
-
<td><%%= f.label :username, "Usuário ou E-mail:" %></td>
|
7
|
-
<td><%%= f.text_field :username %></td>
|
8
|
-
</tr>
|
9
|
-
<tr>
|
10
|
-
<td><%%= f.label :password, "Senha:" %></td>
|
11
|
-
<td><%%= f.password_field :password %></td>
|
12
|
-
</tr>
|
13
|
-
<tr>
|
14
|
-
<td></td>
|
15
|
-
<td><%%= f.check_box :remember_me %><%%= f.label :remember_me, "Lembrar-me" %></td>
|
16
|
-
</tr>
|
17
|
-
</table>
|
18
|
-
|
19
|
-
<div id="control_box">
|
20
|
-
<%%= submit_tag "Acessar", :class => "button grey" %>
|
21
|
-
</div>
|
22
|
-
<%% end %>
|
@@ -1,24 +0,0 @@
|
|
1
|
-
<%% title "Novo <%= user_singular_name.titleize %>" %>
|
2
|
-
|
3
|
-
<%%= form_for([:admin, @<%= user_singular_name %>]) do |f| %>
|
4
|
-
<%%= render "shared/error_messages", :resource => @<%= user_singular_name %> %>
|
5
|
-
<div class="field">
|
6
|
-
<%%= f.label :username %><br />
|
7
|
-
<%%= f.text_field :username %>
|
8
|
-
</div>
|
9
|
-
<div class="field">
|
10
|
-
<%%= f.label :email %><br />
|
11
|
-
<%%= f.text_field :email %>
|
12
|
-
</div>
|
13
|
-
<div class="field">
|
14
|
-
<%%= f.label :password %><br />
|
15
|
-
<%%= f.password_field :password %>
|
16
|
-
</div>
|
17
|
-
<div class="field">
|
18
|
-
<%%= f.label :password_confirmation %><br />
|
19
|
-
<%%= f.password_field :password_confirmation %>
|
20
|
-
</div>
|
21
|
-
<div id="control_box">
|
22
|
-
<%%= f.submit "Salvar", :class => "button medium blue" %> | <%%= link_to("Cancelar", admin_<%= user_plural_name %>_path, :class => "button medium red") %>
|
23
|
-
</div>
|
24
|
-
<%% end %>
|
@@ -1,16 +0,0 @@
|
|
1
|
-
<%% title "<%= user_singular_name.titleize %>" %>
|
2
|
-
<p>
|
3
|
-
<b>Usuário:</b>
|
4
|
-
<%%= @<%= user_singular_name %>.username %>
|
5
|
-
</p>
|
6
|
-
<p>
|
7
|
-
<b>E-mail:</b>
|
8
|
-
<%%= @<%= user_singular_name %>.email %>
|
9
|
-
</p>
|
10
|
-
|
11
|
-
<div id="control_box">
|
12
|
-
<%%= link_to( image_tag("back.png"), admin_<%= user_plural_name %>_path, :title => "Voltar" ) %> |
|
13
|
-
<%%= link_to( image_tag("edit.png"), edit_admin_<%= user_singular_name %>_path(@<%= user_singular_name %>), :title => "Editar" ) %> |
|
14
|
-
<%%= link_to( image_tag("delete.png"), [:admin, @<%= user_singular_name %>], :confirm => 'Tem certeza que deseja excluir?', :method => :delete, :title => "Exlcuir" ) %>
|
15
|
-
</div>
|
16
|
-
|
@@ -1,68 +0,0 @@
|
|
1
|
-
require 'generators/flexi'
|
2
|
-
|
3
|
-
module Flexi
|
4
|
-
module Generators
|
5
|
-
class PrepareGenerator < Base
|
6
|
-
|
7
|
-
def generate_prepare
|
8
|
-
remove_file "app/views/layouts/application.html.erb"
|
9
|
-
remove_file "app/helpers/application_helper.rb"
|
10
|
-
remove_file "public/index.html"
|
11
|
-
remove_file "config/routes.rb"
|
12
|
-
|
13
|
-
copy_file "pt-BR.yml", "config/locales/pt-BR.yml"
|
14
|
-
copy_file "inflector_portuguese.rb", "config/initializers/inflector_portuguese.rb"
|
15
|
-
copy_file "custom_field_error.rb", "config/initializers/custom_field_error.rb"
|
16
|
-
copy_file "application.css", "public/stylesheets/application.css"
|
17
|
-
copy_file "login.css", "public/stylesheets/login.css"
|
18
|
-
copy_file "site.css", "public/stylesheets/site.css"
|
19
|
-
copy_file "logo.png", "public/images/logo.png"
|
20
|
-
copy_file "add.png", "public/images/add.png"
|
21
|
-
copy_file "bg.png", "public/images/bg.png"
|
22
|
-
copy_file "bg2.png", "public/images/bg2.png"
|
23
|
-
copy_file "users.png", "public/images/users.png"
|
24
|
-
copy_file "boxheader.gif", "public/images/boxheader.gif"
|
25
|
-
copy_file "menu.png", "public/images/menu.png"
|
26
|
-
copy_file "btn-bg.png", "public/images/btn-bg.png"
|
27
|
-
copy_file "btn-bg-hover.png", "public/images/btn-bg-hover.png"
|
28
|
-
copy_file "edit.png", "public/images/edit.png"
|
29
|
-
copy_file "show.png", "public/images/show.png"
|
30
|
-
copy_file "delete.png", "public/images/delete.png"
|
31
|
-
copy_file "back.png", "public/images/back.png"
|
32
|
-
copy_file "messages/error.png", "public/images/messages/error.png"
|
33
|
-
copy_file "messages/info.png", "public/images/messages/info.png"
|
34
|
-
copy_file "messages/success.png", "public/images/messages/success.png"
|
35
|
-
copy_file "messages/tip.png", "public/images/messages/tip.png"
|
36
|
-
copy_file "messages/warning.png", "public/images/messages/warning.png"
|
37
|
-
copy_file "admin_home_controller.rb", "app/controllers/admin/home_controller.rb"
|
38
|
-
copy_file "site_controller.rb", "app/controllers/site_controller.rb"
|
39
|
-
copy_file "site_helper.rb", "app/helpers/site_helper.rb"
|
40
|
-
copy_file "application_helper.rb", "app/helpers/application_helper.rb"
|
41
|
-
|
42
|
-
template "routes.rb", "config/routes.rb"
|
43
|
-
template "login.html.erb", "app/views/layouts/login.html.erb"
|
44
|
-
template "site.html.erb", "app/views/layouts/site.html.erb"
|
45
|
-
template "site_index.html.erb", "app/views/site/index.html.erb"
|
46
|
-
template "admin_home_index.html.erb", "app/views/admin/home/index.html.erb"
|
47
|
-
|
48
|
-
gem 'menu_builder', '=0.3.3'
|
49
|
-
gem 'will_paginate', '~> 3.0.pre2'
|
50
|
-
|
51
|
-
route 'root :to => "site#index"'
|
52
|
-
route 'namespace :admin do
|
53
|
-
match "home" => "home#index"
|
54
|
-
end'
|
55
|
-
|
56
|
-
inject_into_file "config/application.rb", "\tconfig.i18n.default_locale = 'pt-BR'\n", :after => "class Application < Rails::Application\n"
|
57
|
-
inject_into_file "config/application.rb", "\tconfig.time_zone = 'Brasilia'\n", :after => "class Application < Rails::Application\n"
|
58
|
-
end
|
59
|
-
|
60
|
-
private
|
61
|
-
|
62
|
-
def app_name
|
63
|
-
File.basename(Rails.root).camelize
|
64
|
-
end
|
65
|
-
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|