adminpanel 0.0.5 → 0.0.6
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.
- checksums.yaml +7 -0
- data/.travis.yml +7 -0
- data/Gemfile +16 -9
- data/README.md +12 -1
- data/Rakefile +3 -0
- data/adminpanel.gemspec +13 -9
- data/app/assets/stylesheets/adminpanel/theme.css +11 -3
- data/app/controllers/adminpanel/categories_controller.rb +1 -1
- data/app/controllers/adminpanel/products_controller.rb +1 -1
- data/app/controllers/adminpanel/sessions_controller.rb +5 -3
- data/app/helpers/adminpanel/application_helper.rb +1 -1
- data/app/models/adminpanel/section.rb +1 -0
- data/app/views/adminpanel/categories/index.html.erb +9 -9
- data/app/views/adminpanel/categories/new.html.erb +2 -2
- data/app/views/adminpanel/products/_image_fields.html.erb +1 -1
- data/app/views/adminpanel/products/_product_form.html.erb +4 -4
- data/app/views/adminpanel/products/edit.html.erb +1 -1
- data/app/views/adminpanel/products/index.html.erb +2 -6
- data/app/views/adminpanel/products/new.html.erb +1 -1
- data/app/views/adminpanel/sections/_image_fields.html.erb +1 -1
- data/app/views/adminpanel/sessions/new.html.erb +4 -4
- data/app/views/adminpanel/users/_user_form.html.erb +21 -0
- data/app/views/adminpanel/users/edit.html.erb +1 -17
- data/app/views/adminpanel/users/new.html.erb +1 -17
- data/app/views/layouts/_side_menu.html.erb +10 -11
- data/app/views/layouts/_top_bar.html.erb +2 -3
- data/app/views/layouts/admin-login.html.erb +27 -0
- data/app/views/layouts/admin.html.erb +2 -7
- data/app/views/shared/_error_messages.html.erb +2 -2
- data/config/database.yml +24 -0
- data/config/locales/es.yml +81 -181
- data/lib/adminpanel/version.rb +1 -1
- data/spec/dummy/.gitignore +0 -2
- data/spec/dummy/config/application.rb +2 -1
- data/spec/dummy/config/database.yml +24 -0
- data/spec/dummy/config/routes.rb +1 -1
- data/spec/features/authentication_pages_spec.rb +44 -0
- data/spec/features/categories_pages_spec.rb +44 -0
- data/spec/features/product_pages_spec.rb +53 -0
- data/spec/models/{adminpanel/category_spec.rb → category_spec.rb} +0 -1
- data/spec/models/{adminpanel/gallery_spec.rb → gallery_spec.rb} +0 -1
- data/spec/models/{adminpanel/image_uploader.rb → image_uploader.rb} +0 -1
- data/spec/models/{adminpanel/product_spec.rb → product_spec.rb} +0 -1
- data/spec/models/{adminpanel/section_spec.rb → section_spec.rb} +0 -1
- data/spec/models/{adminpanel/user_spec.rb → user_spec.rb} +0 -1
- data/spec/spec_helper.rb +7 -4
- data/spec/support/define_factory_models.rb +17 -0
- data/spec/support/helper_methods.rb +11 -0
- data/spec/support/submit_forms_without_button.rb +17 -0
- data/spec/uploaders/{adminpanel/gallery_uploader_spec.rb → gallery_uploader_spec.rb} +0 -0
- data/spec/uploaders/{adminpanel/image_uploader_spec.rb → image_uploader_spec.rb} +0 -0
- data/spec/uploaders/{adminpanel/section_uploader_spec.rb → section_uploader_spec.rb} +0 -0
- metadata +119 -149
- data/app/views/adminpanel/users/_form.html.erb +0 -33
@@ -2,39 +2,38 @@
|
|
2
2
|
<div class="sidebar-nav nav-collapse collapse">
|
3
3
|
<% if signed_in? %>
|
4
4
|
<div class="user_side clearfix">
|
5
|
-
<h5
|
6
|
-
|
5
|
+
<h5>
|
6
|
+
<%= @current_user.name.humanize %>
|
7
|
+
</h5>
|
8
|
+
<%= link_to (content_tag(:i, nil, :class => 'icon-cog') + ' Editar'), edit_user_path(@current_user) %>
|
7
9
|
</div>
|
8
10
|
<% end %>
|
9
11
|
<div class="accordion" id="accordion2">
|
10
|
-
|
12
|
+
|
11
13
|
<div class="accordion-group">
|
12
14
|
<div class="accordion-heading">
|
13
15
|
<%= link_to content_tag(:i, nil, :class => 'icon-truck') + content_tag(:span, ' Productos'), products_path, :class => "accordion-toggle b_F79999 #{is_current_section?('products')}" %>
|
14
16
|
</div>
|
15
17
|
</div>
|
16
|
-
|
17
|
-
<% #if can? :index, User %>
|
18
|
+
|
18
19
|
<div class="accordion-group">
|
19
20
|
<div class="accordion-heading">
|
20
21
|
<%= link_to content_tag(:i, nil, :class => 'icon-user') + content_tag(:span, ' Usuarios'), users_path, :class => "accordion-toggle b_9FDDF6 #{is_current_section?('users')}" %>
|
21
22
|
</div>
|
22
23
|
</div>
|
23
|
-
|
24
|
-
<% #if can? :index, Gallery %>
|
24
|
+
|
25
25
|
<div class="accordion-group">
|
26
26
|
<div class="accordion-heading">
|
27
|
-
<%= link_to content_tag(:i, nil, :class => 'icon-picture') + content_tag(:span, " #{t("Gallery")}"), galleries_path, :class => "accordion-toggle b_C3F7A7 #{is_current_section?('galleries')}" %>
|
27
|
+
<%= link_to content_tag(:i, nil, :class => 'icon-picture') + content_tag(:span, " #{t("model.Adminpanel::Gallery")}"), galleries_path, :class => "accordion-toggle b_C3F7A7 #{is_current_section?('galleries')}" %>
|
28
28
|
</div>
|
29
29
|
</div>
|
30
|
-
|
31
|
-
<% #if can? :index, Section %>
|
30
|
+
|
32
31
|
<div class="accordion-group">
|
33
32
|
<div class="accordion-heading">
|
34
33
|
<%= link_to content_tag(:i, nil, :class => 'icon-tasks') + content_tag(:span, ' Secciones'), sections_path, :class => "accordion-toggle b_F6F1A2 #{is_current_section?('sections')}" %>
|
35
34
|
</div>
|
36
35
|
</div>
|
37
|
-
|
36
|
+
|
38
37
|
<div class="accordion-group">
|
39
38
|
<div class="accordion-heading">
|
40
39
|
<%= link_to content_tag(:i, nil, :class => 'icon-bookmark') + content_tag(:span, ' Categorias'), categories_path, :class => "accordion-toggle b_F79999 #{is_current_section?('products')}" %>
|
@@ -31,13 +31,12 @@
|
|
31
31
|
<ul class="pull-right">
|
32
32
|
<li>
|
33
33
|
<% if signed_in? %>
|
34
|
-
<%= link_to content_tag('i', nil, :class => 'icon-off'), signout_path, :method => "delete", :title => 'Logout'%>
|
35
|
-
<% else %>
|
36
|
-
<%= link_to content_tag('i', nil, :class => 'icon-off'), signin_path, :title => 'Login' %>
|
34
|
+
<%= link_to content_tag('i', nil, :class => 'icon-off'), signout_path, :method => "delete", :title => 'Logout', :id => "signout-button" %>
|
37
35
|
<% end %>
|
38
36
|
</li>
|
39
37
|
</ul>
|
40
38
|
</div>
|
39
|
+
|
41
40
|
</div>
|
42
41
|
</div>
|
43
42
|
</div>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title><%= full_title(yield(:page_title)) %></title>
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7
|
+
<meta name="author" content="Bluth Company">
|
8
|
+
<%= stylesheet_link_tag "application-admin", :media => "all" %>
|
9
|
+
<%= javascript_include_tag "application-admin" %>
|
10
|
+
<%= csrf_meta_tags %>
|
11
|
+
<link rel="shortcut icon" href="favicon.ico">
|
12
|
+
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,700" rel="stylesheet" type="text/css">
|
13
|
+
<link rel="Favicon Icon" href="favicon.ico">
|
14
|
+
<%= render 'layouts/shim' %>
|
15
|
+
</head>
|
16
|
+
|
17
|
+
<body>
|
18
|
+
<div id="wrap">
|
19
|
+
<div class="container-fluid">
|
20
|
+
<%= yield %>
|
21
|
+
<%= debug(params) if Rails.env.development? %>
|
22
|
+
</div>
|
23
|
+
<!--/.fluid-container-->
|
24
|
+
</div>
|
25
|
+
<!-- wrap ends-->
|
26
|
+
</body>
|
27
|
+
</html>
|
@@ -16,11 +16,9 @@
|
|
16
16
|
|
17
17
|
<body>
|
18
18
|
<div id="wrap">
|
19
|
-
<%= render 'layouts/top_bar'
|
19
|
+
<%= render 'layouts/top_bar' %>
|
20
20
|
<div class="container-fluid">
|
21
|
-
<%= render 'layouts/side_menu'
|
22
|
-
|
23
|
-
<% content_for :dashboard do %>
|
21
|
+
<%= render 'layouts/side_menu' %>
|
24
22
|
<!-- Main window -->
|
25
23
|
<div class="main_container" id="dashboard_page">
|
26
24
|
<div class = "row-fluid">
|
@@ -34,9 +32,6 @@
|
|
34
32
|
<%= debug(params) if Rails.env.development? %>
|
35
33
|
</div>
|
36
34
|
<!-- /Main window -->
|
37
|
-
<% end %>
|
38
|
-
|
39
|
-
<%= content_for?(:login) ? yield(:login) : yield(:dashboard) %>
|
40
35
|
</div>
|
41
36
|
<!--/.fluid-container-->
|
42
37
|
</div>
|
@@ -6,8 +6,8 @@
|
|
6
6
|
<% object.errors.messages.keys.each do |field| %>
|
7
7
|
<% object.errors.messages[field].each do |value| %>
|
8
8
|
<li>
|
9
|
-
<%= t(field) %>
|
10
|
-
<%=
|
9
|
+
<%= t("model.attributes.#{object.class.model_name}.#{field}") %>
|
10
|
+
<%= value %>
|
11
11
|
</li>
|
12
12
|
<% end %>
|
13
13
|
<% end %>
|
data/config/database.yml
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# SQLite version 3.x
|
2
|
+
# gem install sqlite3
|
3
|
+
#
|
4
|
+
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
+
# gem 'sqlite3'
|
6
|
+
development:
|
7
|
+
adapter: sqlite3
|
8
|
+
database: db/development.sqlite3
|
9
|
+
pool: 5
|
10
|
+
timeout: 5000
|
11
|
+
|
12
|
+
# Warning: The database defined as "test" will be erased and
|
13
|
+
# re-generated from your development database when you run "rake".
|
14
|
+
# Do not set this db to the same as development or production.
|
15
|
+
test:
|
16
|
+
adapter: sqlite3
|
17
|
+
database: ":memory:"
|
18
|
+
timeout: 500
|
19
|
+
|
20
|
+
production:
|
21
|
+
adapter: sqlite3
|
22
|
+
database: db/production.sqlite3
|
23
|
+
pool: 5
|
24
|
+
timeout: 5000
|
data/config/locales/es.yml
CHANGED
@@ -1,204 +1,104 @@
|
|
1
1
|
es:
|
2
2
|
model:
|
3
|
-
Product: "Producto"
|
4
|
-
Products: "Productos"
|
5
3
|
Adminpanel::User: "Usuario"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
Client: "Cliente"
|
10
|
-
Movement: "Variación"
|
11
|
-
Investor: "Inversionista"
|
12
|
-
Project: "Proyecto"
|
13
|
-
Deposit: "Depósito"
|
14
|
-
Admin::User: "Usuario"
|
15
|
-
Adminpanel::Product: "Proucto"
|
16
|
-
Gallery: "Galería de Inicio"
|
17
|
-
Section: "Sección"
|
4
|
+
Adminpanel::Product: "Producto"
|
5
|
+
Adminpanel::Gallery: "Galería de Inicio"
|
6
|
+
Adminpanel::Section: "Sección"
|
18
7
|
Adminpanel::Category: "Categoría"
|
19
8
|
attributes:
|
20
|
-
|
21
|
-
name: "Nombre"
|
22
|
-
description: "Descripción"
|
23
|
-
user:
|
9
|
+
Adminpanel::User:
|
24
10
|
email: "Correo electrónico"
|
25
11
|
password_digest: "Confirmar contraseña"
|
26
12
|
name: "Nombre"
|
27
13
|
password: "Contraseña"
|
28
14
|
password_confirmation: "Confirmar contraseña"
|
29
|
-
|
30
|
-
name: "Nombre"
|
31
|
-
email: "Correo electrónico"
|
32
|
-
subject: "Asunto"
|
33
|
-
body: "Cuerpo"
|
34
|
-
admin/user:
|
35
|
-
email: "Correo electrónico"
|
36
|
-
password_digest: "Confirmar contraseña"
|
37
|
-
name: "Nombre"
|
38
|
-
password: "Contraseña"
|
39
|
-
password_confirmation: "Confirmar contraseña"
|
40
|
-
client:
|
41
|
-
name: "Nombre"
|
42
|
-
movement:
|
43
|
-
reason: "Motivo"
|
44
|
-
price: "Precio"
|
45
|
-
investor:
|
46
|
-
name: "Nombre"
|
47
|
-
email: "Correo electrónico"
|
48
|
-
project:
|
49
|
-
name: "Nombre"
|
50
|
-
description: "Descripción"
|
51
|
-
estimate_total: "Cantidad a invertir"
|
52
|
-
participants: "Inversionista"
|
53
|
-
deposit:
|
54
|
-
mount: "Monto"
|
55
|
-
concept: "Concepto"
|
56
|
-
section:
|
15
|
+
Adminpanel::Section:
|
57
16
|
description: "Descripción"
|
58
17
|
file: "Imagen"
|
59
|
-
|
60
|
-
description: "Descripción"
|
61
|
-
name: "Nombre"
|
18
|
+
Adminpanel::Gallery:
|
62
19
|
file: "Imagen"
|
20
|
+
Adminpanel::Category:
|
21
|
+
name: "Nombre"
|
22
|
+
Adminpanel::Product:
|
23
|
+
name: "Nombre"
|
24
|
+
brief: "Pequeña descripción"
|
25
|
+
category_id: "Categoría"
|
63
26
|
errors:
|
64
|
-
|
65
|
-
investor:
|
66
|
-
attributes:
|
67
|
-
name:
|
68
|
-
blank: "no puede estar vacío"
|
69
|
-
email:
|
70
|
-
blank: "no puede estar vacío"
|
71
|
-
user:
|
72
|
-
attributes:
|
73
|
-
password_digest:
|
74
|
-
blank: "no puede estar vacío"
|
75
|
-
name:
|
76
|
-
blank: "no puede estar vacío"
|
77
|
-
password:
|
78
|
-
blank: "no puede estar vacío"
|
79
|
-
too_short: "es muy corta, mínimo 6 caracteres"
|
80
|
-
confirmation: "Deben ser iguales"
|
81
|
-
password_confirmation:
|
82
|
-
blank: "no puede estar vacío"
|
83
|
-
email:
|
84
|
-
blank: "no puede estar vacío"
|
85
|
-
invalid: "no es un correo"
|
86
|
-
taken: "ya está en uso"
|
87
|
-
contact:
|
88
|
-
attributes:
|
89
|
-
subject:
|
90
|
-
blank: "no puede estar vacío"
|
91
|
-
name:
|
92
|
-
blank: "no puede estar vacío"
|
93
|
-
body:
|
94
|
-
blank: "no puede estar vacío"
|
95
|
-
email:
|
96
|
-
blank: "no puede estar vacío"
|
97
|
-
invalid: "no es un correo"
|
98
|
-
project:
|
99
|
-
attributes:
|
100
|
-
name:
|
101
|
-
blank: "no puede estar vacío"
|
102
|
-
taken: "ya ha sido usado para otro proyecto"
|
103
|
-
description:
|
104
|
-
blank: "no puede estar vacío"
|
105
|
-
participants:
|
106
|
-
invalid: "no puede estar vacío"
|
107
|
-
estimate_total:
|
108
|
-
blank: "no puede estar vacío"
|
109
|
-
item:
|
110
|
-
attributes:
|
111
|
-
quantity:
|
112
|
-
not_a_number: "no es un número"
|
113
|
-
blank: "no puede estar vacío"
|
114
|
-
product_name:
|
115
|
-
blank: "no puede estar vacío"
|
116
|
-
project_name:
|
117
|
-
blank: "no puede estar vacío"
|
118
|
-
deposit:
|
119
|
-
attributes:
|
120
|
-
mount:
|
121
|
-
blank: "no puede estar vacío"
|
122
|
-
not_a_number: "debe ser un número"
|
123
|
-
concept:
|
124
|
-
blank: "no puede estar vacío"
|
125
|
-
section:
|
126
|
-
attributes:
|
127
|
-
description:
|
128
|
-
blank: "no puede estar vacía"
|
129
|
-
file:
|
130
|
-
blank: "no puede estar vacía"
|
131
|
-
gallery:
|
132
|
-
attributes:
|
133
|
-
description:
|
134
|
-
blank: "no puede estar vacía"
|
135
|
-
file:
|
136
|
-
blank: "no puede estar vacía"
|
137
|
-
name:
|
138
|
-
blank: "no puede estar vacío"
|
139
|
-
one: "%{model} no pudo guardarse debido a 1 error"
|
27
|
+
one: "%{model} no pudo guardarse debido a 1 error"
|
140
28
|
other: "%{model} no pudo guardarse debido a %{count} errores"
|
141
|
-
|
29
|
+
activerecord:
|
30
|
+
errors:
|
31
|
+
models:
|
32
|
+
adminpanel/category:
|
33
|
+
attributes:
|
34
|
+
name:
|
35
|
+
blank: "no puede estar vacío"
|
36
|
+
adminpanel/user:
|
37
|
+
attributes:
|
38
|
+
password_digest:
|
39
|
+
blank: "no puede estar vacío"
|
40
|
+
name:
|
41
|
+
blank: "no puede estar vacío"
|
42
|
+
password:
|
43
|
+
blank: "no puede estar vacío"
|
44
|
+
too_short: "es muy corta, mínimo 6 caracteres"
|
45
|
+
confirmation: "Deben ser iguales"
|
46
|
+
password_confirmation:
|
47
|
+
blank: "no puede estar vacío"
|
48
|
+
email:
|
49
|
+
blank: "no puede estar vacío"
|
50
|
+
invalid: "no es un correo"
|
51
|
+
taken: "ya está en uso"
|
52
|
+
adminpanel/gallery:
|
53
|
+
attributes:
|
54
|
+
file:
|
55
|
+
blank: "no puede estar vacía"
|
56
|
+
adminpanel/section:
|
57
|
+
attributes:
|
58
|
+
description:
|
59
|
+
blank: "no puede estar vacía"
|
60
|
+
too_long: "es muy larga"
|
61
|
+
too_short: "es muy corta"
|
62
|
+
not_a_number: "tienen que ser sólo números"
|
63
|
+
file:
|
64
|
+
blank: "no puede estar vacía"
|
65
|
+
adminpanel/product:
|
66
|
+
attributes:
|
67
|
+
name:
|
68
|
+
blank: "no puede estar vacío"
|
69
|
+
category_id:
|
70
|
+
blank: "no puede estar vacía"
|
71
|
+
brief:
|
72
|
+
blank: "no puede estar vacía"
|
73
|
+
gallery:
|
74
|
+
attributes:
|
75
|
+
description:
|
76
|
+
blank: "no puede estar vacía"
|
77
|
+
file:
|
78
|
+
blank: "no puede estar vacía"
|
79
|
+
name:
|
80
|
+
blank: "no puede estar vacío"
|
142
81
|
time:
|
143
82
|
formats:
|
144
83
|
graphic: "%Y-%m-%d %H:%M:%S"
|
145
84
|
long: "%d/%m/%Y %l:%M:%S %p"
|
146
85
|
short: "%d de %B de %Y"
|
147
86
|
estimate: "%Y-%m-%d"
|
148
|
-
date:
|
149
|
-
formats:
|
150
|
-
short: '%d de %B de %Y'
|
151
|
-
month_names:
|
152
|
-
-
|
153
|
-
- enero
|
154
|
-
- febrero
|
155
|
-
- marzo
|
156
|
-
- abril
|
157
|
-
- mayo
|
158
|
-
- junio
|
159
|
-
- julio
|
160
|
-
- agosto
|
161
|
-
- septiembre
|
162
|
-
- octubre
|
163
|
-
- noviembre
|
164
|
-
- diciembre
|
165
|
-
abbr_month_names:
|
166
|
-
-
|
167
|
-
- ene
|
168
|
-
- feb
|
169
|
-
- mar
|
170
|
-
- abr
|
171
|
-
- may
|
172
|
-
- jun
|
173
|
-
- jul
|
174
|
-
- ago
|
175
|
-
- sep
|
176
|
-
- oct
|
177
|
-
- nov
|
178
|
-
- dic
|
179
|
-
description: "Descripción"
|
180
|
-
Description: "Descripción"
|
181
|
-
password: "Contraseña"
|
182
|
-
Password: "Contraseña"
|
183
|
-
Section: "Sección"
|
184
|
-
section: "sección"
|
185
|
-
name: "Nombre"
|
186
|
-
Gallery: "Galería de Inicio"
|
187
|
-
gallery: "Galería de inicio"
|
188
|
-
Email: "Correo Electrónico"
|
189
|
-
email: "Correo electrónico"
|
190
|
-
password_digest: "Confirmación de Contraseña"
|
191
|
-
password_confirmation: "Confirmación de Contraseña"
|
192
|
-
is too short (minimum is 6 characters): "es muy corto (mínimo 6 caracteres)"
|
193
|
-
is invalid: "es inválido"
|
194
|
-
can't be blank: "no puede estar vacío"
|
195
|
-
New: "Nuevo"
|
196
87
|
Add Image: "Agregar Imagen"
|
197
|
-
Save: "Guardar"
|
198
|
-
Edit: "Editar"
|
199
|
-
Delete: "Eliminar"
|
200
|
-
Name of product: "Nombre del product"
|
201
|
-
Short description : "Breve descripción"
|
202
|
-
Short description of product: "Breve descripción del producto"
|
203
88
|
Write description here: "Escriba la descripción aquí"
|
204
|
-
|
89
|
+
Panel title: "Panel Administrativo"
|
90
|
+
New: "Nuevo"
|
91
|
+
action:
|
92
|
+
save: "Guardar"
|
93
|
+
edit: "Editar"
|
94
|
+
delete: "Eliminar"
|
95
|
+
authentication:
|
96
|
+
welcome: "Bienvenido! Inicia Sesión"
|
97
|
+
signin error: "Contraseña incorrecta"
|
98
|
+
signin success: "Bienvenido!"
|
99
|
+
category:
|
100
|
+
new: "Agregar Categoría"
|
101
|
+
success: "La categoría ha sido guardada"
|
102
|
+
product:
|
103
|
+
new: "Agregar Producto"
|
104
|
+
success: "El producto ha sido guardado"
|
data/lib/adminpanel/version.rb
CHANGED