adminpanel 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/app/assets/stylesheets/adminpanel/theme.css +46 -41
  2. data/app/controllers/adminpanel/categories_controller.rb +71 -0
  3. data/app/controllers/adminpanel/users_controller.rb +69 -69
  4. data/app/helpers/adminpanel/application_helper.rb +2 -1
  5. data/app/helpers/adminpanel/class_definitions_helper.rb +10 -0
  6. data/app/helpers/adminpanel/custom_form_builder.rb +23 -24
  7. data/app/helpers/adminpanel/pluralizations_helper.rb +21 -0
  8. data/app/helpers/adminpanel/rest_actions_helper.rb +42 -34
  9. data/app/helpers/adminpanel/router_helper.rb +30 -26
  10. data/app/models/adminpanel/gallery.rb +6 -2
  11. data/app/models/adminpanel/image.rb +1 -1
  12. data/app/models/adminpanel/user.rb +15 -1
  13. data/app/views/adminpanel/categories/_categories_table.html.erb +48 -0
  14. data/app/views/adminpanel/categories/_category_form.html.erb +14 -0
  15. data/app/views/adminpanel/categories/index.html.erb +55 -0
  16. data/app/views/adminpanel/categories/new.js.erb +1 -0
  17. data/app/views/layouts/_side_menu.html.erb +91 -22
  18. data/app/views/shared/_error_messages.html.erb +3 -3
  19. data/app/views/shared/_form_fields.html.erb +14 -13
  20. data/app/views/shared/index.html.erb +1 -1
  21. data/config/locales/es.yml +5 -10
  22. data/config/routes.rb +20 -9
  23. data/lib/adminpanel/active_record_extension.rb +52 -8
  24. data/lib/adminpanel/engine.rb +4 -2
  25. data/lib/adminpanel/version.rb +1 -1
  26. data/lib/generators/adminpanel/initialize/initialize_generator.rb +20 -6
  27. data/lib/generators/adminpanel/initialize/templates/adminpanel_setup.rb +16 -0
  28. data/lib/generators/adminpanel/initialize/templates/category_template.rb +32 -0
  29. data/lib/generators/adminpanel/initialize/templates/create_adminpanel_categories_table.rb +11 -0
  30. data/lib/generators/adminpanel/resource/resource_generator.rb +1 -1
  31. data/lib/tasks/adminpanel/adminpanel.rake +4 -4
  32. data/spec/dummy/app/controllers/adminpanel/categories_controller.rb +1 -1
  33. data/spec/dummy/app/models/adminpanel/categorization.rb +5 -5
  34. data/spec/dummy/app/models/adminpanel/category.rb +9 -9
  35. data/spec/generators/initialize_generator_spec.rb +34 -0
  36. data/spec/generators/{resource_spec.rb → resource_generator_spec.rb} +0 -0
  37. data/spec/models/user_spec.rb +3 -3
  38. metadata +18 -19
  39. data/app/helpers/adminpanel/images_helper.rb +0 -10
  40. data/app/views/adminpanel/users/_user_form.html.erb +0 -21
  41. data/app/views/adminpanel/users/edit.html.erb +0 -6
  42. data/app/views/adminpanel/users/index.html.erb +0 -49
  43. data/app/views/adminpanel/users/new.html.erb +0 -6
  44. data/app/views/adminpanel/users/show.html.erb +0 -21
  45. data/config/locales/en.yml +0 -5
  46. data/spec/dummy/config/initializers/inflections.rb +0 -15
  47. data/spec/features/user_pages_spec.rb +0 -48
  48. data/spec/generators/initialize_spec.rb +0 -9
@@ -1,49 +0,0 @@
1
- <%= provide(:page_title, t("model.Adminpanel::User")) %>
2
- <div class="row-fluid">
3
- <%=
4
- link_to(
5
- content_tag(:div,
6
- content_tag(:i, nil, :class => 'icon-plus-sign icon-2x') + content_tag(:span, t("user.new"), nil),
7
- :class => "btn btn-box span2"),
8
- new_user_path
9
- )
10
- %>
11
- </div>
12
-
13
- <div class="row-fluid">
14
- <div class="widget widget-padding span12">
15
- <div class="widget-header">
16
- <i class="icon-user"></i>
17
- <h5>Usuarios</h5>
18
- </div>
19
- <div class="widget-body">
20
- <div class="dataTables_wrapper form-inline">
21
- <table id="information-table" class="table table-striped table-bordered dataTable">
22
- <thead>
23
- <tr>
24
- <th>Nombre</th>
25
- <th>Acción</th>
26
- </tr>
27
- </thead>
28
- <tbody>
29
- <% @users.each do |user| %>
30
- <tr>
31
- <td><%= link_to user.name, user_path(user) %></td>
32
- <td>
33
- <%= link_to content_tag(:i, nil, :class => 'icon-pencil'), edit_user_path(user), :title => "Editar"%>
34
- <%= link_to content_tag(:i, nil, :class => 'icon-remove'), user_path(user), :title => "Borrar", :method => :delete,
35
- :data => { :confirm => "Seguro?" }
36
- %>
37
- </td>
38
- </tr>
39
- <% end %>
40
- </tbody>
41
- </table>
42
- <div class="row-fluid">
43
- <div class="span6"></div>
44
- <div class="span6"></div>
45
- </div>
46
- </div>
47
- </div>
48
- </div>
49
- </div>
@@ -1,6 +0,0 @@
1
- <% provide(:page_title, t("user.new")) %>
2
- <% breadcrumb_add('Usuarios', users_path) %>
3
-
4
- <div class="row-fluid">
5
- <%= render 'user_form' %>
6
- </div>
@@ -1,21 +0,0 @@
1
- <% provide(:page_title, @user.name.humanize) %>
2
- <% breadcrumb_add('Usuarios', users_path) %>
3
-
4
- <div class="row-fluid">
5
- <div class="widget widget-padding span12">
6
- <div class="widget-header">
7
- <i class="icon-user"></i>
8
- <h5><%= @user.name.humanize %>&nbsp;
9
- <%= link_to content_tag(:i, nil, :class => 'icon-pencil'), edit_user_path(@user), :title => "Editar Usuario" %>
10
- </h5>
11
- </div>
12
- <div class="widget-body row-fluid">
13
- <div class="span1">
14
- <b>Correo Electrónico</b>
15
- </div>
16
- <div class="span11">
17
- <%= @user.email %>
18
- </div>
19
- </div>
20
- </div>
21
- </div>
@@ -1,5 +0,0 @@
1
- # Sample localization file for English. Add more files in this directory for other locales.
2
- # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
-
4
- en:
5
- hello: "Hello world"
@@ -1,15 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new inflection rules using the following format
4
- # (all these examples are active by default):
5
- # ActiveSupport::Inflector.inflections do |inflect|
6
- # inflect.plural /^(ox)$/i, '\1en'
7
- # inflect.singular /^(ox)en/i, '\1'
8
- # inflect.irregular 'person', 'people'
9
- # inflect.uncountable %w( fish sheep )
10
- # end
11
- #
12
- # These inflection rules are supported but not enabled by default:
13
- # ActiveSupport::Inflector.inflections do |inflect|
14
- # inflect.acronym 'RESTful'
15
- # end
@@ -1,48 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe "User pages" do
4
- subject {page}
5
-
6
- let(:user) { Factory(:user) }
7
- before do
8
- visit adminpanel.signin_path
9
- valid_signin(user)
10
- end
11
-
12
- describe "index" do
13
- before do
14
- visit adminpanel.users_path
15
- end
16
-
17
- it { should have_link(I18n.t("user.new"), adminpanel.new_user_path)}
18
- it { should have_link("i", adminpanel.user_path(user)) }
19
- it { should have_link("i", adminpanel.edit_user_path(user)) }
20
- end
21
-
22
- describe "new" do
23
- before do
24
- visit adminpanel.new_user_path
25
- end
26
-
27
- it { should have_title(I18n.t("user.new")) }
28
-
29
- describe "with invalid information" do
30
- before { find("form#new_user").submit_form! }
31
-
32
- it { should have_title(I18n.t("user.new")) }
33
- it { should have_selector("div#alerts") }
34
- end
35
-
36
- describe "with valid information" do
37
- before do
38
- fill_in "user_name", :with => "user_name"
39
- fill_in "user_email", :with => "user@example.com"
40
- fill_in "user_password", :with => "123456"
41
- fill_in "user_password_confirmation", :with => "123456"
42
- find("form#new_user").submit_form!
43
- end
44
-
45
- it { should have_content(I18n.t("user.success"))}
46
- end
47
- end
48
- end
@@ -1,9 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "adminpanel:initialize" do
4
- context "with no arguments or options" do
5
- it "should generate a migration" do
6
- subject.should generate("db/migrate/#{Time.now.utc.strftime("%Y%m%d%H%M%S")}_create_adminpanel_tables.rb")
7
- end
8
- end
9
- end