refinerycms-dashboard 2.0.10 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dceff109499632b1464d65b28a5d9f58703e4db5
4
- data.tar.gz: 12386e5e5986b0ef8bbe999aa482cfb7aa777084
3
+ metadata.gz: 405d4152889811e11625a5fadbb092e709785ae7
4
+ data.tar.gz: c1a6da62aec1fbc11f289a3b5aa5df14dd16ed12
5
5
  SHA512:
6
- metadata.gz: 6018b649e24fba403eb13f26494771e6cca7f6edbbd9492c122496eb4d1baf7fc500413f70e2c00a7a88c06f73e236cff81f44090304e91c19501786d58cbaa6
7
- data.tar.gz: b80405ed70f30cc62089088d7c6252e66456a081b11e81c70f1fb3d96eeb67933c5433c9641792d1c62b3d7d7d1083c68b1178fca8f20faf0c39c0ba6777c42d
6
+ metadata.gz: 0fe22ddc076ec10906a315a341967ae56ac70fea8481ec7ffc30d3616400e6c68047abc355503b361aa3b9accded4f00f312c09e17673ce3b561a662568f41ea
7
+ data.tar.gz: f74a046e207659724c97d1cd55ebd207bbe346ae2dabb276d29d73b89e33e29fcbab2c71e78f842fd611983f91613889a2fe53b7bfe499caeb9230895b0c350a
@@ -8,7 +8,7 @@ module Refinery
8
8
  ::Refinery::Plugins.active.each do |plugin|
9
9
  begin
10
10
  plugin.activity.each do |activity|
11
- @recent_activity << activity.klass.where(activity.conditions).
11
+ @recent_activity += activity.klass.where(activity.conditions).
12
12
  order(activity.order).
13
13
  limit(activity.limit)
14
14
  end
@@ -19,9 +19,8 @@ module Refinery
19
19
  end
20
20
  end
21
21
 
22
- @recent_activity = @recent_activity.flatten.compact.sort { |x,y|
23
- y.updated_at <=> x.updated_at
24
- }.first(Refinery::Dashboard.activity_show_limit)
22
+ @recent_activity = @recent_activity.sort_by(&:updated_at).reverse.
23
+ first(Refinery::Dashboard.activity_show_limit)
25
24
 
26
25
  @recent_inquiries = if Refinery::Plugins.active.find_by_name("refinerycms_inquiries")
27
26
  Refinery::Inquiries::Inquiry.latest(Refinery::Dashboard.activity_show_limit)
@@ -30,11 +29,6 @@ module Refinery
30
29
  end
31
30
  end
32
31
 
33
- def disable_upgrade_message
34
- Refinery::Core.show_internet_explorer_upgrade_message = false
35
- render :nothing => true
36
- end
37
-
38
32
  end
39
33
  end
40
34
  end
@@ -3,21 +3,34 @@ module Refinery
3
3
  module DashboardHelper
4
4
 
5
5
  def activity_message_for(record)
6
- if (plugin = Refinery::Plugins.active.find_by_model(record.class)) &&
7
- (activity = plugin.activity_by_class_name(record.class.name).first)
8
- # work out which action occured
9
- action = record.updated_at.eql?(record.created_at) ? 'created' : 'updated'
10
-
11
- # get article to define gender of model name, some languages require this for proper grammar
12
- article = t('article', :scope => "refinery.plugins.#{plugin.name}.", :default => 'the')
13
-
14
- # now create a link to the notification's corresponding record.
15
- link_to t('.latest_activity_message',
16
- :what => record.send(activity.title),
17
- :kind => record.class.model_name.human,
18
- :action => t("with_article \"#{article}\"", :scope => "refinery.#{action}")
19
- ).downcase.capitalize, eval("#{activity.url}(#{activity.nesting("record")})")
20
- end
6
+ return if (plugin = find_plugin(record)).blank? || (activity = find_activity(record, plugin)).blank?
7
+
8
+ link_to t('.latest_activity_message',
9
+ :what => record.send(activity.title),
10
+ :kind => record.class.model_name.human,
11
+ :action => t("with_article \"#{plugin_article(plugin)}\"",
12
+ :scope => "refinery.#{record_action(record)}")
13
+ ).downcase.capitalize, eval("#{activity.url}(#{activity.nesting('record')})")
14
+ end
15
+
16
+ private
17
+
18
+ def find_plugin(record)
19
+ Refinery::Plugins.active.find_by_model record.class
20
+ end
21
+
22
+ def find_activity(record, plugin = nil)
23
+ plugin ||= find_plugin(record) # avoid double lookup if we already have it
24
+ plugin.activity_by_class_name(record.class.name).first
25
+ end
26
+
27
+ def record_action(record)
28
+ record.updated_at.eql?(record.created_at) ? 'created' : 'updated'
29
+ end
30
+
31
+ # get article to define gender of model name, some languages require this for proper grammar
32
+ def plugin_article(plugin)
33
+ article = t('article', :scope => "refinery.plugins.#{plugin.name}.", :default => 'the')
21
34
  end
22
35
 
23
36
  end
@@ -32,26 +32,24 @@
32
32
  <%= render 'additional_dashboard_menu_items' %>
33
33
  </ul>
34
34
 
35
- <% if ::Refinery.i18n_enabled? %>
36
- <% locales = Refinery::I18n.locales.clone %>
37
- <% current_locale = ::I18n.locale %>
38
- <% current_locale_title = locales.delete(current_locale) %>
39
- <ul id='current_locale'>
35
+ <% locales = Refinery::I18n.locales.clone %>
36
+ <% current_locale = ::I18n.locale %>
37
+ <% current_locale_title = locales.delete(current_locale) %>
38
+ <ul id='current_locale'>
39
+ <li>
40
+ <%= link_to "#", :style => "background-image: url('#{asset_path "refinery/icons/flags/#{current_locale}.png"}');" do %>
41
+ <%= current_locale_title.respond_to?(:force_encoding) ? current_locale_title.force_encoding('utf-8') : current_locale_title %>
42
+ <span><%= t('.change_language') %></span>
43
+ <span style='display:none;'><%= t('cancel', :scope => 'refinery.admin.form_actions') %></span>
44
+ <% end %>
45
+ </li>
46
+ </ul>
47
+ <ul id='other_locales' style='display: none'>
48
+ <% locales.sort_by{|key, value| value}.each do |locale, locale_title| %>
40
49
  <li>
41
- <%= link_to "#", :style => "background-image: url('#{asset_path "refinery/icons/flags/#{current_locale}.png"}');" do %>
42
- <%= current_locale_title.respond_to?(:force_encoding) ? current_locale_title.force_encoding('utf-8') : current_locale_title %>
43
- <span><%= t('.change_language') %></span>
44
- <span style='display:none;'><%= t('cancel', :scope => 'refinery.admin.form_actions') %></span>
45
- <% end %>
50
+ <%= link_to locale_title.respond_to?(:force_encoding) ? locale_title.force_encoding('utf-8') : locale_title,
51
+ refinery.admin_dashboard_path(:set_locale => locale),
52
+ :style => "background-image: url('#{asset_path "refinery/icons/flags/#{locale}.png"}');" %>
46
53
  </li>
47
- </ul>
48
- <ul id='other_locales' style='display: none'>
49
- <% locales.sort_by{|key, value| value}.each do |locale, locale_title| %>
50
- <li>
51
- <%= link_to locale_title.respond_to?(:force_encoding) ? locale_title.force_encoding('utf-8') : locale_title,
52
- refinery.admin_dashboard_path(:set_locale => locale),
53
- :style => "background-image: url('#{asset_path "refinery/icons/flags/#{locale}.png"}');" %>
54
- </li>
55
- <% end %>
56
- </ul>
57
- <% end %>
54
+ <% end %>
55
+ </ul>
@@ -7,7 +7,3 @@
7
7
  <%= render 'actions' %>
8
8
  </aside>
9
9
  </div>
10
- <% if request.env["HTTP_USER_AGENT"] =~ /MSIE/ and
11
- Refinery::Core.show_internet_explorer_upgrade_message %>
12
- <% flash.now[:message] = render(:partial => "/refinery/ie6check") %>
13
- <% end %>
@@ -0,0 +1,27 @@
1
+ hu:
2
+ refinery:
3
+ plugins:
4
+ refinery_dashboard:
5
+ title: Műszerfal
6
+ description: Összefoglalót kapsz a Refinery-ben történt tevékenységekről
7
+ admin:
8
+ dashboard:
9
+ index:
10
+ quick_tasks: Gyors Feladatok
11
+ actions:
12
+ add_a_new_page: Új oldal hozzáadása
13
+ update_a_page: Oldal frissítése
14
+ upload_a_image: Kép feltöltése
15
+ upload_a_file: Fájl feltöltése
16
+ change_language: Nyelvváltás
17
+ see_home_page: Nyitóoldal megtekintése
18
+ recent_activity:
19
+ empty: Mostanában nem történt semmilyen tevékenység.
20
+ latest_activity: Legutóbbi Tevékenységek
21
+ latest_activity_message: '%{what} %{kind} lett %{action}'
22
+ recent_inquiries:
23
+ latest_inquiries: Legfrissebb megkeresések
24
+ updated:
25
+ 'with_article "the"': frissítve
26
+ created:
27
+ 'with_article "the"': hozzáadva
@@ -3,25 +3,25 @@ nl:
3
3
  plugins:
4
4
  refinery_dashboard:
5
5
  title: Overzicht
6
- description: Gives an overview of activity in Refinery
6
+ description: Een overzicht van activiteit binnen Refinery
7
7
  admin:
8
8
  dashboard:
9
9
  index:
10
- quick_tasks: Algemene taken
10
+ quick_tasks: Algemene Taken
11
11
  actions:
12
- add_a_new_page: Voeg een nieuwe pagina toe
13
- update_a_page: Bewerk een pagina
14
- upload_a_image: Upload een afbeelding
15
- upload_a_file: Upload een bestand
16
- change_language: Verander de taal
17
- see_home_page: Bezoek de homepage
12
+ add_a_new_page: Een nieuwe pagina toevoegen
13
+ update_a_page: Een pagina bewerken
14
+ upload_a_image: Een afbeelding uploaden
15
+ upload_a_file: Een bestand uploaden
16
+ change_language: De taal veranderen
17
+ see_home_page: De homepage bezoeken
18
18
  recent_activity:
19
19
  empty: Er hebben zich recentelijk geen activiteiten voorgedaan.
20
- latest_activity: Laatste Wijzigingen
20
+ latest_activity: Laatste activiteit
21
21
  latest_activity_message: '%{what} %{kind} is %{action}'
22
22
  recent_inquiries:
23
- latest_inquiries: Latest Inquiries
23
+ latest_inquiries: Laatste contactaanvragen
24
24
  updated:
25
- 'with_article "the"': bewerkt
25
+ 'with_article "the"': bewerkt
26
26
  created:
27
- 'with_article "the"': aangemaakt
27
+ 'with_article "the"': toegevoegd
@@ -0,0 +1,27 @@
1
+ pt:
2
+ refinery:
3
+ plugins:
4
+ refinery_dashboard:
5
+ title: Dashboard
6
+ description: "Apresenta uma visão geral da actividade no Refinery"
7
+ admin:
8
+ dashboard:
9
+ index:
10
+ quick_tasks: "Tarefas Rápidas"
11
+ actions:
12
+ add_a_new_page: "Adicionar nova página"
13
+ update_a_page: "Actualizar uma página"
14
+ upload_a_image: "Carregar uma imagem"
15
+ upload_a_file: "Carregar um ficheiro"
16
+ change_language: "Mudar de Língua"
17
+ see_home_page: "Ver página inicial"
18
+ recent_activity:
19
+ empty: "Não houve qualquer actividade recentemente."
20
+ latest_activity: "Últimas actividades"
21
+ latest_activity_message: '%{what} %{kind} foi %{action}'
22
+ recent_inquiries:
23
+ latest_inquiries: "Últimas consultas"
24
+ updated:
25
+ 'with_article "the"': 'Actualizado'
26
+ created:
27
+ 'with_article "the"': 'Adicionado'
@@ -20,7 +20,7 @@ sk:
20
20
  latest_activity: Najnovšie Akcie
21
21
  latest_activity_message: '%{what} %{kind} bol/a %{action}'
22
22
  recent_inquiries:
23
- latest_inquiries: Najnovšie Otázky Z Webu
23
+ latest_inquiries: Najnovšie otázky z webu
24
24
  updated:
25
25
  'with_article "the"': upravený/á
26
26
  created:
@@ -0,0 +1,27 @@
1
+ tr:
2
+ refinery:
3
+ plugins:
4
+ refinery_dashboard:
5
+ title: Kontrol Paneli
6
+ description: RefineryCMS aktivite ekrani
7
+ admin:
8
+ dashboard:
9
+ index:
10
+ quick_tasks: Hizli Gorev
11
+ actions:
12
+ add_a_new_page: Yeni bir sayfa ekle
13
+ update_a_page: Yeni bir sayfa guncelle
14
+ upload_a_image: Fotograf ekle
15
+ upload_a_file: Dosya ekle
16
+ change_language: Dil'i Degistir
17
+ see_home_page: Ana Sayfayi Gor
18
+ recent_activity:
19
+ empty: Son zamanlarda herhangi bir aktivite yok
20
+ latest_activity: Son Aktivite
21
+ latest_activity_message: '%{what} %{kind} was %{action}'
22
+ recent_inquiries:
23
+ latest_inquiries: En Son Talepler
24
+ updated:
25
+ 'with_article "the"': guncellendi
26
+ created:
27
+ 'with_article "the"': eklendi
@@ -0,0 +1,32 @@
1
+ uk:
2
+ refinery:
3
+ plugins:
4
+ refinery_dashboard:
5
+ title: Зведення
6
+ description: Огляд останніх дій у Refinery
7
+ admin:
8
+ dashboard:
9
+ index:
10
+ quick_tasks: Швидкі завдання
11
+ actions:
12
+ add_a_new_page: Додати нову сторінку
13
+ update_a_page: Змінити сторінку
14
+ upload_a_image: Завантажити зображення
15
+ upload_a_file: Завантажити файл
16
+ change_language: Змінити мову
17
+ see_home_page: Переглянути домашню сторінку
18
+ recent_activity:
19
+ empty: Останнім часом не було активності.
20
+ latest_activity: Останні дії
21
+ latest_activity_message: "%{action} %{kind} «%{what}»"
22
+ recent_inquiries:
23
+ latest_inquiries: Останні запити
24
+ updated:
25
+ 'with_article "masculine"': Оновлений
26
+ 'with_article "feminine"': Оновлена
27
+ 'with_article "neuter"': Оновлено
28
+ created:
29
+ 'with_article "masculine"': Доданий
30
+ 'with_article "feminine"': Додана
31
+ 'with_article "neuter"': Додано
32
+
@@ -1,9 +1,5 @@
1
- Refinery::Core::Engine.routes.prepend do
2
- namespace :admin, :path => 'refinery' do
1
+ Refinery::Core::Engine.routes.draw do
2
+ namespace :admin, :path => Refinery::Core.backend_route do
3
3
  get 'dashboard', :to => 'dashboard#index', :as => :dashboard
4
-
5
- match 'disable_upgrade_message',
6
- :to => 'dashboard#disable_upgrade_message',
7
- :as => :disable_upgrade_message
8
4
  end
9
5
  end
@@ -1,7 +1,7 @@
1
1
  module Refinery
2
2
  module Dashboard
3
3
  class Engine < ::Rails::Engine
4
- include Refinery::Engine
4
+ extend Refinery::Engine
5
5
 
6
6
  isolate_namespace Refinery
7
7
  engine_name :refinery_dashboard
@@ -13,7 +13,6 @@ module Refinery
13
13
  plugin.pathname = root
14
14
  plugin.name = 'refinery_dashboard'
15
15
  plugin.menu_match = %r{refinery/(refinery_)?dashboard$}
16
- plugin.version = %q{2.0.0}
17
16
  plugin.always_allow_access = true
18
17
  plugin.dashboard = true
19
18
  plugin.url = proc { Refinery::Core::Engine.routes.url_helpers.admin_dashboard_path }
@@ -1,6 +1,5 @@
1
1
  # Encoding: UTF-8
2
- $:.push File.expand_path('../../core/lib', __FILE__)
3
- require 'refinery/version'
2
+ require File.expand_path('../../core/lib/refinery/version', __FILE__)
4
3
 
5
4
  version = Refinery::Version.to_s
6
5
 
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe "dashboard" do
4
- login_refinery_user
4
+ refinery_login_with :refinery_user
5
5
 
6
6
  describe "quick tasks" do
7
7
  specify "buttons" do
@@ -37,12 +37,10 @@ describe "dashboard" do
37
37
  3.times { |n| FactoryGirl.create :page, :title => "Refinery CMS #{n}" }
38
38
  end
39
39
 
40
- it "shows 7 recent actions" do
40
+ it "shows created tracked objects" do
41
41
  visit refinery.admin_dashboard_path
42
42
 
43
43
  page.should have_content("Latest Activity")
44
- # This comes from login_refinery_user
45
- page.should have_content("Refinerycms user was")
46
44
  3.times { |n| page.should have_content("Ugisozols#{n} user was added") }
47
45
  3.times { |n| page.should have_content("Refinery cms #{n} page was added") }
48
46
  end
@@ -56,7 +54,7 @@ describe "dashboard" do
56
54
 
57
55
  visit refinery.admin_dashboard_path
58
56
 
59
- page.should have_selector("a[href='#{refinery.edit_admin_page_path(nested.uncached_nested_url)}']")
57
+ page.should have_selector("a[href='#{refinery.edit_admin_page_path(nested.nested_url)}']")
60
58
  end
61
59
  end
62
60
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-dashboard
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.10
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Arndt
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-03-14 00:00:00.000000000 Z
13
+ date: 2013-08-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: refinerycms-core
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 2.0.10
21
+ version: 2.1.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 2.0.10
28
+ version: 2.1.0
29
29
  description: The dashboard is usually the first extension the user sees in the backend
30
30
  of Refinery CMS. It displays useful information and contains links to common functionality.
31
31
  email: info@refinerycms.com
@@ -51,6 +51,7 @@ files:
51
51
  - config/locales/es.yml
52
52
  - config/locales/fi.yml
53
53
  - config/locales/fr.yml
54
+ - config/locales/hu.yml
54
55
  - config/locales/it.yml
55
56
  - config/locales/ja.yml
56
57
  - config/locales/ko.yml
@@ -60,11 +61,14 @@ files:
60
61
  - config/locales/nl.yml
61
62
  - config/locales/pl.yml
62
63
  - config/locales/pt-BR.yml
64
+ - config/locales/pt.yml
63
65
  - config/locales/rs.yml
64
66
  - config/locales/ru.yml
65
67
  - config/locales/sk.yml
66
68
  - config/locales/sl.yml
67
69
  - config/locales/sv.yml
70
+ - config/locales/tr.yml
71
+ - config/locales/uk.yml
68
72
  - config/locales/vi.yml
69
73
  - config/locales/zh-CN.yml
70
74
  - config/locales/zh-TW.yml
@@ -75,7 +79,7 @@ files:
75
79
  - lib/refinerycms-dashboard.rb
76
80
  - license.md
77
81
  - refinerycms-dashboard.gemspec
78
- - spec/requests/refinery/admin/dashboard_spec.rb
82
+ - spec/features/refinery/admin/dashboard_spec.rb
79
83
  homepage: http://refinerycms.com
80
84
  licenses:
81
85
  - MIT
@@ -101,4 +105,4 @@ signing_key:
101
105
  specification_version: 4
102
106
  summary: Dashboard extension for Refinery CMS
103
107
  test_files:
104
- - spec/requests/refinery/admin/dashboard_spec.rb
108
+ - spec/features/refinery/admin/dashboard_spec.rb