adminpanel 2.4.2 → 2.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +1 -1
  3. data/adminpanel.gemspec +3 -3
  4. data/app/assets/javascripts/adminpanel/images_form_add_remove_fields.js.coffee +2 -0
  5. data/app/assets/javascripts/adminpanel/sections.js.coffee +5 -3
  6. data/app/assets/javascripts/adminpanel/shortcuts.js.coffee +1 -0
  7. data/app/controllers/adminpanel/categories_controller.rb +4 -4
  8. data/app/controllers/adminpanel/sessions_controller.rb +0 -1
  9. data/app/controllers/concerns/adminpanel/facebook_actions.rb +1 -1
  10. data/app/controllers/concerns/adminpanel/galleryzable_actions.rb +1 -2
  11. data/app/controllers/concerns/adminpanel/rest_actions.rb +8 -8
  12. data/app/controllers/concerns/adminpanel/sortable_actions.rb +1 -1
  13. data/app/models/adminpanel/section.rb +2 -3
  14. data/app/models/concerns/adminpanel/base.rb +3 -3
  15. data/app/models/concerns/adminpanel/galleryzation.rb +0 -1
  16. data/app/views/adminpanel/form/_belongs_to.html.erb +5 -8
  17. data/app/views/adminpanel/icons/_delete.html.erb +2 -2
  18. data/app/views/adminpanel/icons/_edit.html.erb +1 -1
  19. data/app/views/adminpanel/icons/_move_to_better.html.erb +1 -0
  20. data/app/views/adminpanel/icons/_move_to_worst.html.erb +1 -0
  21. data/app/views/adminpanel/icons/_show.html.erb +1 -1
  22. data/app/views/adminpanel/shared/_new_resource_button.html.erb +4 -3
  23. data/app/views/adminpanel/{shared → templates}/create_belongs_to.js.erb +0 -0
  24. data/app/views/adminpanel/{shared → templates}/create_has_many.js.erb +0 -0
  25. data/app/views/adminpanel/{shared → templates}/edit.html.erb +3 -3
  26. data/app/views/adminpanel/{shared → templates}/fb_choose_page.html.erb +0 -0
  27. data/app/views/adminpanel/{shared → templates}/gallery_entries.js.erb +0 -0
  28. data/app/views/adminpanel/{shared → templates}/index.html.erb +0 -0
  29. data/app/views/adminpanel/{shared → templates}/index_records.js.erb +0 -0
  30. data/app/views/adminpanel/{shared → templates}/new.html.erb +0 -0
  31. data/app/views/adminpanel/{shared → templates}/new.js.erb +0 -0
  32. data/app/views/adminpanel/templates/show.html.erb +79 -0
  33. data/config/locales/es.yml +5 -3
  34. data/config/routes.rb +8 -6
  35. data/lib/adminpanel/version.rb +1 -1
  36. metadata +20 -20
  37. data/app/views/adminpanel/shared/show.html.erb +0 -80
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 48fd9769e9edc538718f44d81230a2be7e90e414
4
- data.tar.gz: 9a9a63d4562dff6dec6f4db8e0a37aa5aa8bdb64
3
+ metadata.gz: 1650330680de365d6b011038bc783035919bd79f
4
+ data.tar.gz: 880a805a5ffac7e6148fdadff69a3cffacb84a4f
5
5
  SHA512:
6
- metadata.gz: e831bfd434a90b36cd687dbdf1f60afddb17317fba695691ad83bfbbc3fc3e5aa4d1ef9f317eb547f7c47afa933459f6c8e6f2ab774f4d1c50a58550c8af5108
7
- data.tar.gz: 6b061e0114fc778fd1a66133356c38abf5a6dd7d7e2817988f6478fee19d4632d5aa230c2d623ded51829867ba655182609ea6e7f50177a9971c32ba0ee01672
6
+ metadata.gz: 180259d6586a62b39581914961587ce8f19090a81fa2302c5abde0010c09ab2349aebce132ce227c05a3c5deb168a11bccd83341a80df56c776df744c12b3927
7
+ data.tar.gz: 8994ef9ade494de2983c6c27eb99a4c83be63e598e2eb2208f457dcde2b5d9de58205826681b27c792ae1af8978215cbe5d092b98e056dc35e8af469370e2c12
data/CONTRIBUTING.md CHANGED
@@ -1,6 +1,6 @@
1
1
  Consider starting the commit message with an applicable emoji:
2
2
 
3
- * :lipstick: `:lipstick:` when improving the format/structure of the code
3
+ * :art: `:art:` when improving the format/structure of the code
4
4
  * :racehorse:`:racehorse:` when improving performance
5
5
  * :memo:`:memo:` when writing docs
6
6
  * :bug:`:bug:` when fixing a bug
data/adminpanel.gemspec CHANGED
@@ -24,13 +24,13 @@ Gem::Specification.new do |spec|
24
24
  spec.requirements << 'imagemagick installed'
25
25
 
26
26
  spec.add_runtime_dependency 'rails', '>= 4.2.0', '< 5.0.0'
27
- spec.add_runtime_dependency 'mini_magick', '4.0.1'
27
+ spec.add_runtime_dependency 'mini_magick', '4.0.2'
28
28
  spec.add_runtime_dependency 'bcrypt', '~> 3.1', '>= 3.1.7'
29
29
  spec.add_runtime_dependency 'carrierwave', '~> 0.10', '>= 0.10.0'
30
- spec.add_runtime_dependency 'cancancan', '~> 1.9.2', '>= 1.9.2'
30
+ spec.add_runtime_dependency 'cancancan', '~> 1.10.1', '>= 1.10.1'
31
31
 
32
32
  # Implemented APIs
33
- spec.add_runtime_dependency 'google-api-client', '0.7.1' # Google analytics
33
+ spec.add_runtime_dependency 'google-api-client', '0.8.2' # Google analytics
34
34
  spec.add_runtime_dependency 'koala', '1.10.1' # Facebook
35
35
  spec.add_runtime_dependency 'twitter', '5.13.0' # Twitter
36
36
  spec.add_runtime_dependency 'omniauth-twitter', '1.1.0' # login Twitter
@@ -1,4 +1,5 @@
1
1
  $(document).on 'click', '.add-fields', (e) ->
2
+ # add image inside a form click
2
3
  e.preventDefault()
3
4
 
4
5
  time = new Date().getTime()
@@ -6,6 +7,7 @@ $(document).on 'click', '.add-fields', (e) ->
6
7
  $(@).before($(@).data('fields').replace(regexp, time))
7
8
 
8
9
  $(document).on 'click', '.remove-fields', (e) ->
10
+ # remove image inside a form click
9
11
  e.preventDefault()
10
12
  $(@).prev('input[type=hidden]').val('1')
11
13
  $(@).parent().parent().parent().addClass('hidden')
@@ -1,9 +1,11 @@
1
- $(document).on 'click', '.btn.btn-danger.remove-fields', ->
2
- $('a.add-fields').removeClass 'hidden'
3
-
4
1
  $(document).on 'click', 'a.add-fields', ->
2
+ # add image on sections form
5
3
  $collectionContainer = $(@).closest('.file-collection-container')
6
4
  maxFiles = $collectionContainer.data('max')
7
5
  numberOfFiles = $collectionContainer.find('.product-image:not(.hidden)').length + 1
8
6
  if maxFiles != 0 && numberOfFiles > maxFiles
9
7
  $(@).addClass('hidden')
8
+
9
+ $(document).on 'click', '.btn.btn-danger.remove-fields', ->
10
+ # remove image on sectiosn form
11
+ $('a.add-fields').removeClass 'hidden'
@@ -1,3 +1,4 @@
1
+ # keypress for enter key inside of a modal form.
1
2
  $(document).on 'keypress', '#remote-form-modal', 'input', (e) ->
2
3
  if e.keyCode is 13
3
4
  # enter keypress
@@ -9,7 +9,7 @@ module Adminpanel
9
9
  def new
10
10
  @resource_instance = @model.new
11
11
  respond_to do |format|
12
- format.html { render 'adminpanel/shared/new' }
12
+ format.html { render 'adminpanel/templates/new' }
13
13
  format.js { render }
14
14
  end
15
15
  end
@@ -26,14 +26,14 @@ module Adminpanel
26
26
  render 'create', locals: { category: @resource_instance }
27
27
  elsif params[:belongs_request].present?
28
28
  # we are in other controller as a belongs_to, add option to select
29
- render 'adminpanel/shared/create_belongs_to', locals: { resource: @resource_instance }
29
+ render 'adminpanel/templates/create_belongs_to', locals: { resource: @resource_instance }
30
30
  else
31
31
  # we are in other controller as a has_many, add checkbox
32
- render 'adminpanel/shared/create_has_many', locals: { resource: @resource_instance }
32
+ render 'adminpanel/templates/create_has_many', locals: { resource: @resource_instance }
33
33
  end
34
34
  end
35
35
  else
36
- format.html { render 'adminpanel/shared/new' }
36
+ format.html { render 'adminpanel/templates/new' }
37
37
  format.js { render 'new' }
38
38
  end
39
39
  end
@@ -3,7 +3,6 @@ module Adminpanel
3
3
  include SessionsHelper
4
4
  include ApplicationHelper
5
5
 
6
- protect_from_forgery
7
6
  layout 'adminpanel/application-login'
8
7
  before_action :configure_instagram, only:[:instagram_login, :instagram_callback]
9
8
 
@@ -21,7 +21,7 @@ module Adminpanel
21
21
  @pages = user.get_connections('me', 'accounts')
22
22
  @name = user.get_object('me')['name']
23
23
  @pages << { 'name' => @name, 'access_token' => access_token } # to permit posts on own wall
24
- render 'adminpanel/shared/fb_choose_page'
24
+ render 'adminpanel/templates/fb_choose_page'
25
25
  end
26
26
 
27
27
  def fb_save_token
@@ -10,7 +10,6 @@ module Adminpanel
10
10
  @resource_instance = @model.find(params[:id])
11
11
  @resource_instance.move_to_better_position
12
12
  respond
13
-
14
13
  end
15
14
 
16
15
  def move_gallery_worst
@@ -23,7 +22,7 @@ module Adminpanel
23
22
  def respond
24
23
  respond_to do |format|
25
24
  format.js do
26
- render 'adminpanel/shared/gallery_entries', locals: {
25
+ render 'adminpanel/templates/gallery_entries', locals: {
27
26
  collection: @model.ordered.where(
28
27
  @model.relation_field.to_sym => @resource_instance.send(@model.relation_field)
29
28
  )
@@ -19,11 +19,11 @@ module Adminpanel
19
19
  end
20
20
 
21
21
  def index
22
- render 'adminpanel/shared/index'
22
+ render 'adminpanel/templates/index'
23
23
  end
24
24
 
25
25
  def show
26
- render 'adminpanel/shared/show' if stale?(@resource_instance, public: true)
26
+ render 'adminpanel/templates/show' if stale?(@resource_instance, public: true)
27
27
  end
28
28
 
29
29
  def new
@@ -42,9 +42,9 @@ module Adminpanel
42
42
  format.js do
43
43
  # if format js, request is from another controller's form
44
44
  if params[:belongs_request]
45
- render 'adminpanel/shared/create_belongs_to', locals: { resource: @resource_instance }
45
+ render 'adminpanel/templates/create_belongs_to', locals: { resource: @resource_instance }
46
46
  else
47
- render 'adminpanel/shared/create_has_many', locals: { resource: @resource_instance }
47
+ render 'adminpanel/templates/create_has_many', locals: { resource: @resource_instance }
48
48
  end
49
49
  end
50
50
  else
@@ -55,14 +55,14 @@ module Adminpanel
55
55
 
56
56
 
57
57
  def edit
58
- render 'adminpanel/shared/edit'
58
+ render 'adminpanel/templates/edit'
59
59
  end
60
60
 
61
61
  def update
62
62
  if @resource_instance.update(send(whitelisted_params))
63
63
  redirect_to @resource_instance
64
64
  else
65
- render 'adminpanel/shared/edit'
65
+ render 'adminpanel/templates/edit'
66
66
  end
67
67
  end
68
68
 
@@ -121,10 +121,10 @@ module Adminpanel
121
121
 
122
122
  def render_new format
123
123
  format.html do
124
- render 'adminpanel/shared/new'
124
+ render 'adminpanel/templates/new'
125
125
  end
126
126
  format.js do
127
- render 'adminpanel/shared/new', locals: { resource: @resource_instance }
127
+ render 'adminpanel/templates/new', locals: { resource: @resource_instance }
128
128
  end
129
129
  end
130
130
  end
@@ -19,7 +19,7 @@ module Adminpanel
19
19
  def update_index_table
20
20
  respond_to do |format|
21
21
  format.js do
22
- render 'adminpanel/shared/index_records', locals: {
22
+ render 'adminpanel/templates/index_records', locals: {
23
23
  collection: @model.all
24
24
  }
25
25
  end
@@ -1,5 +1,3 @@
1
- require 'carrierwave'
2
- require 'carrierwave/orm/activerecord'
3
1
  module Adminpanel
4
2
  class Section < ActiveRecord::Base
5
3
  include Adminpanel::Base
@@ -45,11 +43,12 @@ module Adminpanel
45
43
  {'name' => {'name' => 'name', 'label' => 'Seccion'}},
46
44
  {'key' => {'name' => 'key', 'label' => 'Llave'}},
47
45
  {'page' => {'name' => 'page'}},
46
+ {'sectionfiles' => {'type' => 'adminpanel_file_field', 'show' => false}},
48
47
  ]
49
48
  end
50
49
 
51
50
  def self.icon
52
- 'tasks'
51
+ 'tasks'
53
52
  end
54
53
 
55
54
  def self.display_name
@@ -1,9 +1,8 @@
1
1
  module Adminpanel
2
2
  module Base
3
3
  extend ActiveSupport::Concern
4
- #instance methods
5
- # static(class) methods
6
4
 
5
+ # static(class) methods
7
6
  module ClassMethods
8
7
  def mount_images(relation)
9
8
  has_many relation, dependent: :destroy
@@ -136,7 +135,8 @@ module Adminpanel
136
135
  false
137
136
  end
138
137
 
139
- private
138
+ private
139
+
140
140
  def exclude?(route)
141
141
  if routes_options[:except].nil?
142
142
  false
@@ -8,7 +8,6 @@ module Adminpanel
8
8
 
9
9
  scope :ordered, -> do
10
10
  order('position ASC')
11
- # where(position: 1)
12
11
  end
13
12
 
14
13
  end
@@ -9,14 +9,11 @@
9
9
  args
10
10
  ) %>
11
11
 
12
-
13
- <% if (
14
- !is_modal &&
15
- (
16
- properties['remote_resource'].nil? ||
17
- properties['remote_resource']
18
- )
19
- ) %>
12
+ <% if !is_modal &&
13
+ (
14
+ properties['remote_resource'].nil? ||
15
+ properties['remote_resource']
16
+ ) %>
20
17
  <!-- if rendering the form inside a modal, so we don't have to
21
18
  manage infinited nested forms -->
22
19
 
@@ -7,11 +7,11 @@
7
7
  class: 'fa fa-trash-o'
8
8
  ),
9
9
  [resource],
10
- title: 'Eliminar',
10
+ title: I18n.t('action.delete', resource: resource.name),
11
11
  id: 'resource-delete',
12
12
  method: :delete,
13
13
  data: {
14
- confirm: "Eliminar #{resource.name}?"
14
+ confirm: I18n.t('action.delete_confirmation', resource: resource.name)
15
15
  }
16
16
  )
17
17
  %>
@@ -7,7 +7,7 @@
7
7
  class: 'fa fa-pencil'
8
8
  ),
9
9
  [:edit, resource],
10
- title: I18n.t('action.update', name: resource.name),
10
+ title: I18n.t('action.update', resource: resource.name),
11
11
  class: 'spinner-link'
12
12
  )
13
13
  %>
@@ -10,6 +10,7 @@
10
10
  class: 'fa fa-chevron-up'
11
11
  ),
12
12
  path,
13
+ title: I18n.t('action.move_to_better', resource: member.name),
13
14
  method: :put,
14
15
  remote: true
15
16
  ) %>
@@ -11,6 +11,7 @@
11
11
  class: 'fa fa-chevron-down'
12
12
  ),
13
13
  path,
14
+ title: I18n.t('action.move_to_worst', resource: member.name),
14
15
  method: :put,
15
16
  remote: true
16
17
  ) %>
@@ -8,7 +8,7 @@
8
8
  ),
9
9
  [resource],
10
10
  class: 'spinner-link',
11
- title: I18n.t('action.show'),
11
+ title: I18n.t('action.show', resource: resource.name),
12
12
  id: 'show-resource-icon'
13
13
  )
14
14
  %>
@@ -1,10 +1,11 @@
1
1
  <% if @model.has_route?(:new) && can?(:create, @model) %>
2
2
  <%= link_to(
3
- content_tag(:div,
4
- content_tag(:i, nil, :class => 'fa fa-plus-circle fa-2x') +
3
+ content_tag(
4
+ :div,
5
+ content_tag(:i, nil, class: 'fa fa-plus-circle fa-2x') +
5
6
  content_tag(
6
7
  :span,
7
- I18n.t("action.create", resource: @model.display_name)
8
+ I18n.t('action.create', resource: @model.display_name)
8
9
  ),
9
10
  class: 'btn btn-box span2'
10
11
  ),
@@ -1,6 +1,6 @@
1
1
  <% provide(
2
2
  :page_title,
3
- I18n.t('action.update', name: @resource_instance.name)
3
+ I18n.t('action.update', resource: @resource_instance.name)
4
4
  ) -%>
5
5
  <% breadcrumb_add(
6
6
  @model.collection_name,
@@ -14,7 +14,7 @@
14
14
  <div class = "widget widget-padding span12">
15
15
  <div class = "widget-header">
16
16
  <%= content_tag(:i, nil, class: "fa fa-#{@model.icon}") %>
17
- <h5><%= I18n.t('action.update', name: @resource_instance.name) %></h5>
17
+ <h5><%= I18n.t('action.update', resource: @resource_instance.name) %></h5>
18
18
  </div>
19
19
  <%= adminpanel_form_for(
20
20
  @resource_instance,
@@ -31,7 +31,7 @@
31
31
 
32
32
  <%= f.footer do %>
33
33
  <%= f.submit(
34
- I18n.t('action.update', name: @resource_instance.name),
34
+ I18n.t('action.update', resource: @resource_instance.name),
35
35
  id: "edit-#{@model.name.demodulize}-button"
36
36
  ) %>
37
37
  <% end %>
@@ -0,0 +1,79 @@
1
+ <% provide(:page_title, I18n.t('action.view', resource: @model.display_name.capitalize)) -%>
2
+ <% breadcrumb_add(
3
+ @model.collection_name,
4
+ {
5
+ controller: params[:controller],
6
+ action: 'index'
7
+ }
8
+ ) %>
9
+
10
+ <div class="row-fluid">
11
+ <div class="widget span6">
12
+ <div class="widget-header">
13
+ <%= content_tag(:i, nil, class: "fa fa-#{@model.icon}") %>
14
+ <h5>
15
+ <%= @model.display_name.humanize %>
16
+ </h5>
17
+ <div class="widget-buttons">
18
+ <%= render 'adminpanel/icons/new' %>
19
+
20
+ <%= render 'adminpanel/icons/edit', resource: @resource_instance %>
21
+
22
+ <%= render 'adminpanel/icons/facebook', resource: @resource_instance %>
23
+
24
+ <%= render 'adminpanel/icons/twitter', resource: @resource_instance %>
25
+ </div>
26
+ </div>
27
+ <div class="widget-body">
28
+ <div class="widget-tickets widget-tickets-large clearfix">
29
+ <ul>
30
+ <% @model.display_attributes('show').each do |fields| %>
31
+ <% fields.each do |attribute, properties| %>
32
+ <li class="priority-high">
33
+ <div class="span3">
34
+ <h6><%= properties['label'] %></h6>
35
+ </div>
36
+ <div class="span8">
37
+ <%= field_value(properties, attribute, @resource_instance) %>
38
+ </div>
39
+ </li>
40
+ <% end %>
41
+ <% end %>
42
+ </ul>
43
+ </div>
44
+ </div>
45
+ </div>
46
+
47
+ <% if @model.has_images? %>
48
+ <div class="widget widget-padding span6">
49
+ <div class="widget-header">
50
+ <%= content_tag(:i, nil, class: "fa fa-#{@model.icon}") %>
51
+ <h5><%= I18n.t('gallery.container') %>: <%= @model.display_name.humanize %>
52
+ <%= render 'adminpanel/icons/edit', resource: @resource_instance %>
53
+ </h5>
54
+ </div>
55
+ <% if @model.gallery_children %>
56
+ <div class="widget-body widget-tasks-assigned clearfix">
57
+ <ul id="gallery-entries">
58
+ <%= render(
59
+ 'adminpanel/shared/gallery_entries',
60
+ images: @resource_instance.send(
61
+ @model.get_image_relationship
62
+ ).ordered
63
+ ) %>
64
+ </ul>
65
+ </div>
66
+ <% else %>
67
+ <div class="widget-body row-fluid">
68
+ <% @resource_instance.send(@model.get_image_relationship).each do |image|%>
69
+ <%= link_to(
70
+ image_tag( image.file_url(:thumb) ),
71
+ image.file_url.to_s,
72
+ rel: 'group', name: @model.display_name
73
+ ) %>
74
+ <% end %>
75
+ </div>
76
+ <% end %>
77
+ </div>
78
+ <% end %>
79
+ </div>
@@ -70,9 +70,11 @@ es:
70
70
  add: 'Agregar %{resource}'
71
71
  close: 'Cerrar'
72
72
  create: 'Crear %{resource}'
73
- delete confirmation: 'Estás seguro que desea eliminar?'
73
+ delete_confirmation: 'Estás seguro que desea eliminar %{resource}?'
74
74
  delete: 'Eliminar'
75
75
  details: 'Detalles de la foto'
76
+ move_to_better: 'Mejorar %{resource} de posición'
77
+ move_to_worst: 'Bajar %{resource} de posición'
76
78
  is_false: 'No'
77
79
  is_true: 'Sí'
78
80
  publish: 'Publicar'
@@ -81,9 +83,9 @@ es:
81
83
  save_account: 'Seleccionar cuenta'
82
84
  save_success: 'Se ha guardado con éxito'
83
85
  share: 'Compartir %{model} en Facebook'
84
- show: 'Ver'
86
+ show: 'Ver %{resource}'
85
87
  submitting: 'Enviando...'
86
- update: 'Actualizar %{name}'
88
+ update: 'Actualizar %{resource}'
87
89
  view: 'Ver %{resource}'
88
90
  authentication:
89
91
  welcome: 'Bienvenido! Inicia Sesión'
data/config/routes.rb CHANGED
@@ -22,12 +22,11 @@ Adminpanel::Engine.routes.draw do
22
22
  end
23
23
  else
24
24
  if get_gallery_children(resource)
25
- # make the resource's gallery routes
26
-
25
+ # include galleryzation concern
27
26
  resources get_gallery_children(resource).to_sym, only: [:index] do
28
27
  member do
29
28
  put :move_gallery_better, as: 'move_gallery_to_better', path: I18n.t('routes.move_gallery_to_better')
30
- put :move_gallery_worst, as: 'move_gallery_to_worst', path: I18n.t('routes.move_gallery_to_worst')
29
+ put :move_gallery_worst, as: 'move_gallery_to_worst', path: I18n.t('routes.move_gallery_to_worst')
31
30
  end
32
31
  end
33
32
  end
@@ -42,23 +41,26 @@ Adminpanel::Engine.routes.draw do
42
41
  end
43
42
 
44
43
  if is_sortable?(resource)
44
+ # include sortable concern
45
45
  put :move_to_better, as: 'move_to_better', path: I18n.t('routes.move_to_better')
46
46
  put :move_to_worst, as: 'move_to_worst', path: I18n.t('routes.move_to_worst')
47
47
  end
48
48
 
49
49
  if has_fb_share?(resource)
50
- # if resource is going to be shared on facebook
50
+ # include facebook concern
51
51
  get :fb_choose_page, as: 'fb_choose_page', path: I18n.t('routes.publish', location: I18n.t('routes.facebook_page'))
52
52
  post :fb_save_token, as: 'fb_save_token', path: 'guardar-token-fb'
53
53
  post :fb_publish, to: "#{resource}#fb_publish", as: 'fb_publish', path: I18n.t('routes.publish', location: 'facebook')
54
54
  end
55
+
55
56
  if has_twitter_share?(resource)
57
+ # include twitter concern
56
58
  post :twitter_publish, to: "#{resource}#twitter_publish", as: 'twitter_publish', path: I18n.t('routes.publish', location: 'twitter')
57
59
  end
58
60
  end
61
+
59
62
  collection do
60
63
  # add custom collection routes of the resource
61
-
62
64
  collection_routes(resource).each do |route|
63
65
  route.each do |request_type, args|
64
66
  send(request_type, args['path'].to_sym, args['args'])
@@ -77,7 +79,7 @@ Adminpanel::Engine.routes.draw do
77
79
  end
78
80
  end
79
81
  delete '/signout', to: 'sessions#destroy', as: 'signout', path: I18n.t('routes.signout')
80
- get '/signin', to: 'sessions#new', as: 'signin', path: I18n.t('routes.signin')
82
+ get '/signin', to: 'sessions#new', as: 'signin', path: I18n.t('routes.signin')
81
83
 
82
84
  end
83
85
 
@@ -1,3 +1,3 @@
1
1
  module Adminpanel
2
- VERSION = '2.4.2'
2
+ VERSION = '2.4.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adminpanel
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.2
4
+ version: 2.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jose Ramon Camacho
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-14 00:00:00.000000000 Z
12
+ date: 2015-01-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -37,14 +37,14 @@ dependencies:
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 4.0.1
40
+ version: 4.0.2
41
41
  type: :runtime
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 4.0.1
47
+ version: 4.0.2
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: bcrypt
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -91,34 +91,34 @@ dependencies:
91
91
  requirements:
92
92
  - - "~>"
93
93
  - !ruby/object:Gem::Version
94
- version: 1.9.2
94
+ version: 1.10.1
95
95
  - - ">="
96
96
  - !ruby/object:Gem::Version
97
- version: 1.9.2
97
+ version: 1.10.1
98
98
  type: :runtime
99
99
  prerelease: false
100
100
  version_requirements: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: 1.9.2
104
+ version: 1.10.1
105
105
  - - ">="
106
106
  - !ruby/object:Gem::Version
107
- version: 1.9.2
107
+ version: 1.10.1
108
108
  - !ruby/object:Gem::Dependency
109
109
  name: google-api-client
110
110
  requirement: !ruby/object:Gem::Requirement
111
111
  requirements:
112
112
  - - '='
113
113
  - !ruby/object:Gem::Version
114
- version: 0.7.1
114
+ version: 0.8.2
115
115
  type: :runtime
116
116
  prerelease: false
117
117
  version_requirements: !ruby/object:Gem::Requirement
118
118
  requirements:
119
119
  - - '='
120
120
  - !ruby/object:Gem::Version
121
- version: 0.7.1
121
+ version: 0.8.2
122
122
  - !ruby/object:Gem::Dependency
123
123
  name: koala
124
124
  requirement: !ruby/object:Gem::Requirement
@@ -558,16 +558,16 @@ files:
558
558
  - app/views/adminpanel/shared/_new_resource_button.html.erb
559
559
  - app/views/adminpanel/shared/_remote_form_fields.html.erb
560
560
  - app/views/adminpanel/shared/_twitter_publish_modal.html.erb
561
- - app/views/adminpanel/shared/create_belongs_to.js.erb
562
- - app/views/adminpanel/shared/create_has_many.js.erb
563
- - app/views/adminpanel/shared/edit.html.erb
564
- - app/views/adminpanel/shared/fb_choose_page.html.erb
565
- - app/views/adminpanel/shared/gallery_entries.js.erb
566
- - app/views/adminpanel/shared/index.html.erb
567
- - app/views/adminpanel/shared/index_records.js.erb
568
- - app/views/adminpanel/shared/new.html.erb
569
- - app/views/adminpanel/shared/new.js.erb
570
- - app/views/adminpanel/shared/show.html.erb
561
+ - app/views/adminpanel/templates/create_belongs_to.js.erb
562
+ - app/views/adminpanel/templates/create_has_many.js.erb
563
+ - app/views/adminpanel/templates/edit.html.erb
564
+ - app/views/adminpanel/templates/fb_choose_page.html.erb
565
+ - app/views/adminpanel/templates/gallery_entries.js.erb
566
+ - app/views/adminpanel/templates/index.html.erb
567
+ - app/views/adminpanel/templates/index_records.js.erb
568
+ - app/views/adminpanel/templates/new.html.erb
569
+ - app/views/adminpanel/templates/new.js.erb
570
+ - app/views/adminpanel/templates/show.html.erb
571
571
  - app/views/layouts/adminpanel/_shim.html.erb
572
572
  - app/views/layouts/adminpanel/_side_menu.html.erb
573
573
  - app/views/layouts/adminpanel/_top_bar.html.erb
@@ -1,80 +0,0 @@
1
- <% provide(:page_title, I18n.t('action.view', resource: @model.display_name.capitalize)) -%>
2
- <% breadcrumb_add(
3
- @model.collection_name,
4
- {
5
- controller: params[:controller],
6
- action: 'index'
7
- }
8
- ) %>
9
-
10
- <div class="row-fluid">
11
- <div class="widget span6">
12
- <div class="widget-header">
13
- <%= content_tag(:i, nil, class: "fa fa-#{@model.icon}") %>
14
- <h5>
15
- <%= @model.display_name.humanize %>
16
- </h5>
17
- <div class="widget-buttons">
18
- <%= render 'adminpanel/icons/new' %>
19
-
20
- <%= render 'adminpanel/icons/edit', resource: @resource_instance %>
21
-
22
- <%= render 'adminpanel/icons/facebook', resource: @resource_instance %>
23
-
24
- <%= render 'adminpanel/icons/twitter', resource: @resource_instance %>
25
- </div>
26
- </div>
27
- <div class="widget-body">
28
- <div class="widget-tickets widget-tickets-large clearfix">
29
- <ul>
30
- <% @model.display_attributes('show').each do |fields| %>
31
- <% fields.each do |attribute, properties| %>
32
- <li class="priority-high">
33
- <div class="span3">
34
- <h6><%= properties['label'] %></h6>
35
- </div>
36
- <div class="span8">
37
- <%= field_value(properties, attribute, @resource_instance) %>
38
- </div>
39
- </li>
40
- <% end %>
41
- <% end %>
42
- </ul>
43
- </div>
44
- </div>
45
- </div>
46
-
47
- <% if @model.has_images? %>
48
- <div class="widget widget-padding span6">
49
- <div class="widget-header">
50
- <%= content_tag(:i, nil, class: "fa fa-#{@model.icon}") %>
51
- <h5><%= I18n.t('gallery.container') %>: <%= @model.display_name.humanize %>
52
- <%= render 'adminpanel/icons/edit', resource: @resource_instance %>
53
- </h5>
54
- </div>
55
- <% if @model.gallery_children %>
56
- <div class="widget-body widget-tasks-assigned clearfix">
57
- <ul id="gallery-entries">
58
- <%= render(
59
- 'adminpanel/shared/gallery_entries',
60
- images: @resource_instance.send(
61
- @model.get_image_relationship
62
- ).ordered
63
- ) %>
64
- </ul>
65
- </div>
66
- <% else %>
67
- <div class="widget-body row-fluid">
68
- <% @resource_instance.send(@model.get_image_relationship).each do |image|%>
69
- <%= link_to(
70
- image_tag( image.file_url(:thumb) ),
71
- image.file_url.to_s,
72
- rel: 'group', name: @model.display_name
73
- ) %>
74
- <% end %>
75
- </div>
76
- <% end %>
77
- </div>
78
- <% end %>
79
- </div>
80
- </div>