refinerycms-dashboard 1.0.11 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/refinery/admin/dashboard_controller.rb +40 -0
- data/app/helpers/refinery/admin/dashboard_helper.rb +25 -0
- data/app/views/{admin → refinery/admin}/dashboard/_actions.html.erb +13 -13
- data/app/views/{admin → refinery/admin}/dashboard/_additional_dashboard_menu_items.html.erb +0 -0
- data/app/views/{admin → refinery/admin}/dashboard/_recent_activity.html.erb +3 -1
- data/app/views/{admin → refinery/admin}/dashboard/_recent_inquiries.html.erb +1 -1
- data/app/views/refinery/admin/dashboard/_records.html.erb +2 -0
- data/app/views/{admin → refinery/admin}/dashboard/index.html.erb +4 -4
- data/app/views/{admin → refinery/admin}/dashboard/index.rss.builder +2 -2
- data/config/locales/bg.yml +26 -25
- data/config/locales/cs.yml +26 -25
- data/config/locales/da.yml +26 -25
- data/config/locales/de.yml +26 -25
- data/config/locales/el.yml +26 -25
- data/config/locales/en.yml +26 -25
- data/config/locales/es.yml +30 -29
- data/config/locales/fi.yml +26 -25
- data/config/locales/fr.yml +26 -25
- data/config/locales/it.yml +25 -27
- data/config/locales/ja.yml +27 -0
- data/config/locales/ko.yml +27 -0
- data/config/locales/lt.yml +26 -25
- data/config/locales/lv.yml +28 -27
- data/config/locales/nb.yml +26 -25
- data/config/locales/nl.yml +26 -25
- data/config/locales/pl.yml +30 -29
- data/config/locales/pt-BR.yml +30 -29
- data/config/locales/rs.yml +26 -25
- data/config/locales/ru.yml +30 -28
- data/config/locales/sk.yml +26 -25
- data/config/locales/sl.yml +26 -25
- data/config/locales/sv.yml +26 -25
- data/config/locales/vi.yml +26 -25
- data/config/locales/zh-CN.yml +26 -25
- data/config/locales/zh-TW.yml +26 -25
- data/config/routes.rb +5 -5
- data/lib/refinery/dashboard.rb +14 -0
- data/lib/refinery/dashboard/configuration.rb +9 -0
- data/lib/refinery/dashboard/engine.rb +28 -0
- data/lib/refinerycms-dashboard.rb +1 -33
- data/refinerycms-dashboard.gemspec +14 -67
- data/spec/requests/refinery/admin/dashboard_spec.rb +50 -0
- metadata +71 -55
- data/app/controllers/admin/dashboard_controller.rb +0 -38
- data/app/helpers/admin/dashboard_helper.rb +0 -24
- data/app/views/admin/dashboard/_records.html.erb +0 -2
- data/config/locales/jp.yml +0 -26
- data/config/locales/lolcat.yml +0 -25
- data/features/dashboard.feature +0 -35
- data/features/support/paths.rb +0 -14
- data/lib/gemspec.rb +0 -35
@@ -0,0 +1,40 @@
|
|
1
|
+
module Refinery
|
2
|
+
module Admin
|
3
|
+
class DashboardController < Refinery::AdminController
|
4
|
+
|
5
|
+
def index
|
6
|
+
@recent_activity = []
|
7
|
+
|
8
|
+
::Refinery::Plugins.active.each do |plugin|
|
9
|
+
begin
|
10
|
+
plugin.activity.each do |activity|
|
11
|
+
@recent_activity << activity.klass.where(activity.conditions).
|
12
|
+
order(activity.order).
|
13
|
+
limit(activity.limit)
|
14
|
+
end
|
15
|
+
rescue
|
16
|
+
logger.warn "#{$!.class.name} raised while getting recent activity for dashboard."
|
17
|
+
logger.warn $!.message
|
18
|
+
logger.warn $!.backtrace.collect { |b| " > #{b}" }.join("\n")
|
19
|
+
end
|
20
|
+
end
|
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)
|
25
|
+
|
26
|
+
@recent_inquiries = if Refinery::Plugins.active.find_by_name("refinery_inquiries")
|
27
|
+
Inquiry.latest(Refinery::Dashboard.activity_show_limit)
|
28
|
+
else
|
29
|
+
[]
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def disable_upgrade_message
|
34
|
+
Refinery::Core.show_internet_explorer_upgrade_message = false
|
35
|
+
render :nothing => true
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Refinery
|
2
|
+
module Admin
|
3
|
+
module DashboardHelper
|
4
|
+
|
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")}record)")
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -1,47 +1,47 @@
|
|
1
1
|
<ul>
|
2
|
-
<% if Refinery::Plugins.active.names.include?("refinery_pages") %>
|
2
|
+
<% if ::Refinery::Plugins.active.names.include?("refinery_pages") %>
|
3
3
|
<li>
|
4
4
|
<%= link_to t('.add_a_new_page'),
|
5
|
-
new_admin_page_path,
|
5
|
+
refinery.new_admin_page_path,
|
6
6
|
:class => "add_icon" %>
|
7
7
|
</li>
|
8
8
|
<li>
|
9
9
|
<%= link_to t('.update_a_page'),
|
10
|
-
admin_pages_path,
|
10
|
+
refinery.admin_pages_path,
|
11
11
|
:class => "edit_icon" %>
|
12
12
|
</li>
|
13
13
|
<% end %>
|
14
|
-
<% if Refinery::Plugins.active.names.include?("refinery_files") %>
|
14
|
+
<% if ::Refinery::Plugins.active.names.include?("refinery_files") %>
|
15
15
|
<li>
|
16
16
|
<%= link_to t('.upload_a_file'),
|
17
|
-
new_admin_resource_path(:dialog => true,
|
17
|
+
refinery.new_admin_resource_path(:dialog => true,
|
18
18
|
:width => 600,
|
19
19
|
:height => 300),
|
20
20
|
:class => "add_icon" %>
|
21
21
|
</li>
|
22
22
|
<% end %>
|
23
|
-
<% if Refinery::Plugins.active.names.include?("refinery_images") %>
|
23
|
+
<% if ::Refinery::Plugins.active.names.include?("refinery_images") %>
|
24
24
|
<li>
|
25
25
|
<%= link_to t('.upload_a_image'),
|
26
|
-
new_admin_image_path(:dialog => true,
|
26
|
+
refinery.new_admin_image_path(:dialog => true,
|
27
27
|
:width => 600,
|
28
28
|
:height => 300),
|
29
29
|
:class => "add_icon" %>
|
30
30
|
</li>
|
31
31
|
<% end %>
|
32
|
-
<%= render
|
32
|
+
<%= render 'additional_dashboard_menu_items' %>
|
33
33
|
</ul>
|
34
34
|
|
35
35
|
<% if ::Refinery.i18n_enabled? %>
|
36
|
-
<% locales =
|
36
|
+
<% locales = Refinery::I18n.locales.clone %>
|
37
37
|
<% current_locale = ::I18n.locale %>
|
38
38
|
<% current_locale_title = locales.delete(current_locale) %>
|
39
39
|
<ul id='current_locale'>
|
40
40
|
<li>
|
41
|
-
<%= link_to "#", :style => "background-image: url('
|
41
|
+
<%= link_to "#", :style => "background-image: url('#{asset_path "refinery/icons/flags/#{current_locale}.png"}');" do %>
|
42
42
|
<%= current_locale_title.respond_to?(:force_encoding) ? current_locale_title.force_encoding('utf-8') : current_locale_title %>
|
43
43
|
<span><%= t('.change_language') %></span>
|
44
|
-
<span style='display:none;'><%= t('cancel', :scope => '
|
44
|
+
<span style='display:none;'><%= t('cancel', :scope => 'refinery.admin.form_actions') %></span>
|
45
45
|
<% end %>
|
46
46
|
</li>
|
47
47
|
</ul>
|
@@ -49,8 +49,8 @@
|
|
49
49
|
<% locales.sort_by{|key, value| value}.each do |locale, locale_title| %>
|
50
50
|
<li>
|
51
51
|
<%= link_to locale_title.respond_to?(:force_encoding) ? locale_title.force_encoding('utf-8') : locale_title,
|
52
|
-
|
53
|
-
:style => "background-image: url('
|
52
|
+
refinery.admin_dashboard_path(:set_locale => locale),
|
53
|
+
:style => "background-image: url('#{asset_path "refinery/icons/flags/#{locale}.png"}');" %>
|
54
54
|
</li>
|
55
55
|
<% end %>
|
56
56
|
</ul>
|
File without changes
|
@@ -1,6 +1,8 @@
|
|
1
1
|
<div id='recent_activity'>
|
2
2
|
<h2><%= t('.latest_activity') %></h2>
|
3
|
-
<% if (activity = @recent_activity.collect{|a|
|
3
|
+
<% if (activity = @recent_activity.collect { |a|
|
4
|
+
activity_message_for(a)
|
5
|
+
}.reject(&:blank?)).present? %>
|
4
6
|
<ul class='clickable'>
|
5
7
|
<% activity.each do |message| %>
|
6
8
|
<li class='<%= cycle("on", "on-hover", :name => 'recent_activity_cycle') %>'>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<% @recent_inquiries.each do |inquiry| %>
|
5
5
|
<li class='<%= cycle("on", "on-hover", :name => 'recent_inquiries_cycle') %>'>
|
6
6
|
<%= link_to truncate("#{inquiry.name} - #{inquiry.message}", :length => 100),
|
7
|
-
|
7
|
+
refinery.admin_inquiry_path(inquiry) %>
|
8
8
|
</li>
|
9
9
|
<% end %>
|
10
10
|
</ul>
|
@@ -1,13 +1,13 @@
|
|
1
1
|
<div class='clearfix'>
|
2
2
|
<section id='records' class='clearfix<%= ' one_list' if @recent_activity.empty? or @recent_inquiries.empty? %>'>
|
3
|
-
<%= render
|
3
|
+
<%= render 'records' %>
|
4
4
|
</section>
|
5
5
|
<aside id='actions'>
|
6
6
|
<h2><%= t('.quick_tasks') %></h2>
|
7
|
-
<%= render
|
7
|
+
<%= render 'actions' %>
|
8
8
|
</aside>
|
9
9
|
</div>
|
10
10
|
<% if request.env["HTTP_USER_AGENT"] =~ /MSIE/ and
|
11
|
-
|
12
|
-
<% flash.now[:message] = render(:partial => "/
|
11
|
+
Refinery::Core.show_internet_explorer_upgrade_message %>
|
12
|
+
<% flash.now[:message] = render(:partial => "/refinery/ie6check") %>
|
13
13
|
<% end %>
|
@@ -3,14 +3,14 @@ xml.rss :version => "2.0", "xmlns:atom" => "http://www.w3.org/2005/Atom" do
|
|
3
3
|
xml.channel do
|
4
4
|
# Required to pass W3C validation.
|
5
5
|
xml.atom :link, nil, {
|
6
|
-
:href => admin_dashboard_index_path(:format => 'rss'),
|
6
|
+
:href => refinery.admin_dashboard_index_path(:format => 'rss'),
|
7
7
|
:rel => 'self', :type => 'application/rss+xml'
|
8
8
|
}
|
9
9
|
|
10
10
|
# Feed basics.
|
11
11
|
xml.title "Refinery Updates"
|
12
12
|
xml.description "See the recent activity on your Refinery site."
|
13
|
-
xml.link admin_dashboard_index_path(:format => 'rss')
|
13
|
+
xml.link refinery.admin_dashboard_index_path(:format => 'rss')
|
14
14
|
|
15
15
|
# Recent activity.
|
16
16
|
@recent_activity.each do |change|
|
data/config/locales/bg.yml
CHANGED
@@ -1,26 +1,27 @@
|
|
1
1
|
bg:
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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: 'Елемента "%{what}(%{kind})" бе %{action}'
|
22
|
+
recent_inquiries:
|
23
|
+
latest_inquiries: Последни запитвания
|
24
|
+
updated:
|
25
|
+
'with_article "the"': актуализиран
|
26
|
+
created:
|
27
|
+
'with_article "the"': добавен
|
data/config/locales/cs.yml
CHANGED
@@ -1,26 +1,27 @@
|
|
1
1
|
cs:
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
2
|
+
refinery:
|
3
|
+
plugins:
|
4
|
+
refinery_dashboard:
|
5
|
+
title: Nástěnka
|
6
|
+
description: Přehled akcí provedených v administraci
|
7
|
+
admin:
|
8
|
+
dashboard:
|
9
|
+
index:
|
10
|
+
quick_tasks: Rychlé příkazy
|
11
|
+
actions:
|
12
|
+
add_a_new_page: Přidat novou stránku
|
13
|
+
update_a_page: Upravit stránku
|
14
|
+
upload_a_image: Nahrát obrázek
|
15
|
+
upload_a_file: Nahrát soubor
|
16
|
+
change_language: Změnit jazyk
|
17
|
+
see_home_page: Zobrazit titulní stránku
|
18
|
+
recent_activity:
|
19
|
+
empty: V poslední době nebyla provedena žádná akce.
|
20
|
+
latest_activity: Nejnovější akce
|
21
|
+
latest_activity_message: '%{what} %{kind} byla %{action}'
|
22
|
+
recent_inquiries:
|
23
|
+
latest_inquiries: Nejnovější dotazy z webu
|
24
|
+
updated:
|
25
|
+
'with_article "the"': upraven
|
26
|
+
created:
|
27
|
+
'with_article "the"': přidán
|
data/config/locales/da.yml
CHANGED
@@ -1,26 +1,27 @@
|
|
1
1
|
da:
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
2
|
+
refinery:
|
3
|
+
plugins:
|
4
|
+
refinery_dashboard:
|
5
|
+
title: Overblik
|
6
|
+
description: Giver et overblik over aktiviteterne i Refinery
|
7
|
+
admin:
|
8
|
+
dashboard:
|
9
|
+
index:
|
10
|
+
quick_tasks: Handlinger
|
11
|
+
actions:
|
12
|
+
add_a_new_page: Tilføj en ny side
|
13
|
+
update_a_page: Redigér en side
|
14
|
+
upload_a_image: Upload et billede
|
15
|
+
upload_a_file: Upload en fil
|
16
|
+
change_language: Skift sprog
|
17
|
+
see_home_page: Vis forside
|
18
|
+
recent_activity:
|
19
|
+
empty: Der her ingen aktititeter været for nylig.
|
20
|
+
latest_activity: Seneste Aktiviteter
|
21
|
+
latest_activity_message: '%{what} %{kind} blev %{action}'
|
22
|
+
recent_inquiries:
|
23
|
+
latest_inquiries: Seneste Henvendelser
|
24
|
+
updated:
|
25
|
+
'with_article "the"': opdateret
|
26
|
+
created:
|
27
|
+
'with_article "the"': oprettet
|
data/config/locales/de.yml
CHANGED
@@ -1,26 +1,27 @@
|
|
1
1
|
de:
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
2
|
+
refinery:
|
3
|
+
plugins:
|
4
|
+
refinery_dashboard:
|
5
|
+
title: Übersicht
|
6
|
+
description: Gibt eine Übersicht über Aktivitäten in Refinery
|
7
|
+
admin:
|
8
|
+
dashboard:
|
9
|
+
index:
|
10
|
+
quick_tasks: Allgemeine Aufgaben
|
11
|
+
actions:
|
12
|
+
add_a_new_page: Neue Seite erstellen
|
13
|
+
update_a_page: Eine Seite aktualisieren
|
14
|
+
upload_a_image: Ein Bild hochladen
|
15
|
+
upload_a_file: Eine Datei hochladen
|
16
|
+
change_language: Sprache wechseln
|
17
|
+
see_home_page: Homepage ansehen
|
18
|
+
recent_activity:
|
19
|
+
empty: Zuletzt gab es keine Aktivitäten.
|
20
|
+
latest_activity: Letzte Aktivität
|
21
|
+
latest_activity_message: '%{what} %{kind} wurde %{action}'
|
22
|
+
recent_inquiries:
|
23
|
+
latest_inquiries: Letzte Anfragen
|
24
|
+
updated:
|
25
|
+
'with_article "the"': aktualisiert
|
26
|
+
created:
|
27
|
+
'with_article "the"': erstellt
|
data/config/locales/el.yml
CHANGED
@@ -1,26 +1,27 @@
|
|
1
1
|
el:
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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: '%{what} %{kind} ήταν %{action}'
|
22
|
+
recent_inquiries:
|
23
|
+
latest_inquiries: Τελευταία μηνύματα
|
24
|
+
updated:
|
25
|
+
'with_article "the"': ενημερώθηκε
|
26
|
+
created:
|
27
|
+
'with_article "the"': προστέθηκε
|