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
@@ -1,38 +0,0 @@
|
|
1
|
-
module Admin
|
2
|
-
class DashboardController < Admin::BaseController
|
3
|
-
|
4
|
-
def index
|
5
|
-
@recent_activity = []
|
6
|
-
|
7
|
-
Refinery::Plugins.active.each do |plugin|
|
8
|
-
begin
|
9
|
-
plugin.activity.each do |activity|
|
10
|
-
@recent_activity << activity.class.where(activity.conditions).
|
11
|
-
order(activity.order).
|
12
|
-
limit(activity.limit).
|
13
|
-
all
|
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(activity_show_limit=RefinerySetting.find_or_set(:activity_show_limit, 7))
|
25
|
-
|
26
|
-
@recent_inquiries = defined?(Inquiry) && Refinery::Plugins.active.names.include?('refinery_inquiries') ? Inquiry.latest(activity_show_limit) : []
|
27
|
-
end
|
28
|
-
|
29
|
-
def disable_upgrade_message
|
30
|
-
RefinerySetting.set(:show_internet_explorer_upgrade_message, {
|
31
|
-
:value => false,
|
32
|
-
:scoping => 'refinery'
|
33
|
-
})
|
34
|
-
render :nothing => true
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
38
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module Admin
|
2
|
-
module DashboardHelper
|
3
|
-
|
4
|
-
def activity_message_for(record)
|
5
|
-
plugin = Refinery::Plugins.active.find_by_model(record.class)
|
6
|
-
|
7
|
-
if (activity = plugin.activity.first).present?
|
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 => "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 => action)
|
19
|
-
).downcase.capitalize, eval("#{activity.url}(#{activity.nesting("record")}record)")
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
24
|
-
end
|
data/config/locales/jp.yml
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
jp:
|
2
|
-
plugins:
|
3
|
-
refinery_dashboard:
|
4
|
-
title: ダッシュボード
|
5
|
-
description: Refineryでの活動の記録を俯瞰します。
|
6
|
-
admin:
|
7
|
-
dashboard:
|
8
|
-
index:
|
9
|
-
quick_tasks: クイックタスク
|
10
|
-
actions:
|
11
|
-
add_a_new_page: ページの新規追加
|
12
|
-
update_a_page: ページの更新
|
13
|
-
upload_a_image: 画像をアップロード
|
14
|
-
upload_a_file: ファイルをアップロード
|
15
|
-
change_language: 言語の選択
|
16
|
-
see_home_page: ホームページを見る
|
17
|
-
recent_activity:
|
18
|
-
empty: 最近の更新はありません。
|
19
|
-
latest_activity: 最近の活動記録
|
20
|
-
latest_activity_message: '%{what} %{kind}が%{action}'
|
21
|
-
recent_inquiries:
|
22
|
-
latest_inquiries: 最近の質問
|
23
|
-
updated:
|
24
|
-
'with_article "the"': 更新されました。
|
25
|
-
created:
|
26
|
-
'with_article "the"': 追加されました。
|
data/config/locales/lolcat.yml
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
lolcat:
|
2
|
-
plugins:
|
3
|
-
refinery_dashboard:
|
4
|
-
title: DASHBORD
|
5
|
-
description: GIVEZ AN OVERVIEW OV ACTIVITY IN REFINERY
|
6
|
-
admin:
|
7
|
-
dashboard:
|
8
|
-
index:
|
9
|
-
quick_tasks: QUICK TASKZ
|
10
|
-
actions:
|
11
|
-
add_a_new_page: ADD NEW PAEG
|
12
|
-
update_a_page: UPDATE PAEG
|
13
|
-
upload_a_image: UPLOAD AN IMAGE
|
14
|
-
upload_a_file: UPLOAD FILE
|
15
|
-
change_language: CHANGE LANGUAGE
|
16
|
-
see_home_page: C HOME PAEG
|
17
|
-
recent_activity:
|
18
|
-
latest_activity: LATEST ACTIVITY
|
19
|
-
latest_activity_message: '%{what} %{kind} WUZ %{action}'
|
20
|
-
recent_inquiries:
|
21
|
-
latest_inquiries: LATEST INQUIRIEZ
|
22
|
-
updated:
|
23
|
-
'with_article "the"': UPDATD
|
24
|
-
created:
|
25
|
-
'with_article "the"': ADDD
|
data/features/dashboard.feature
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
@refinerycms @dashboard
|
2
|
-
Feature: Dashboard
|
3
|
-
In order to see recent changes to my website
|
4
|
-
As an administrator
|
5
|
-
I want to use the dashboard
|
6
|
-
|
7
|
-
Background:
|
8
|
-
Given I am a logged in refinery user
|
9
|
-
When I go to the Dashboard
|
10
|
-
|
11
|
-
@dashboard-add
|
12
|
-
Scenario: Add New Page Button
|
13
|
-
Given I have no pages
|
14
|
-
When I follow "Add a new page"
|
15
|
-
Then I should be on the new page form
|
16
|
-
When I fill in "Title" with "Page test from Dashboard"
|
17
|
-
And I press "Save"
|
18
|
-
Then I should be on the Dashboard
|
19
|
-
And I should see "'Page test from Dashboard' was successfully added."
|
20
|
-
And I should have 1 page
|
21
|
-
|
22
|
-
@dashboard-edit
|
23
|
-
Scenario: Update a Page Button
|
24
|
-
When I follow "Update a page"
|
25
|
-
Then I should be on the list of pages
|
26
|
-
|
27
|
-
@dashboard-edit
|
28
|
-
Scenario: Upload a File Button
|
29
|
-
When I follow "Upload a file"
|
30
|
-
Then I should be on the new file form
|
31
|
-
|
32
|
-
@dashboard-edit
|
33
|
-
Scenario: Upload an Image Button
|
34
|
-
When I follow "Upload an image"
|
35
|
-
Then I should be on the new image form
|
data/features/support/paths.rb
DELETED
data/lib/gemspec.rb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
# Encoding: UTF-8
|
2
|
-
require 'pathname'
|
3
|
-
gempath = Pathname.new(File.expand_path('../../', __FILE__))
|
4
|
-
require gempath.join('..', 'base', 'lib', 'base', 'refinery')
|
5
|
-
|
6
|
-
gemspec = <<EOF
|
7
|
-
# Encoding: UTF-8
|
8
|
-
# DO NOT EDIT THIS FILE DIRECTLY! Instead, use lib/gemspec.rb to generate it.
|
9
|
-
|
10
|
-
Gem::Specification.new do |s|
|
11
|
-
s.name = %q{#{gemname = 'refinerycms-dashboard'}}
|
12
|
-
s.version = %q{#{::Refinery.version}}
|
13
|
-
s.summary = %q{Dashboard engine for Refinery CMS}
|
14
|
-
s.description = %q{The dashboard is usually the first engine the user sees in the backend of Refinery CMS. It displays useful information and contains links to common functionality.}
|
15
|
-
s.date = %q{#{Time.now.strftime('%Y-%m-%d')}}
|
16
|
-
s.email = %q{info@refinerycms.com}
|
17
|
-
s.homepage = %q{http://refinerycms.com}
|
18
|
-
s.rubyforge_project = %q{refinerycms}
|
19
|
-
s.authors = ['Resolve Digital', 'Philip Arndt', 'David Jones', 'Steven Heidel', 'Uģis Ozols']
|
20
|
-
s.license = %q{MIT}
|
21
|
-
s.require_paths = %w(lib)
|
22
|
-
s.executables = %w(#{Pathname.glob(gempath.join('bin/*')).map{|d| d.relative_path_from(gempath)}.sort.join(" ")})
|
23
|
-
|
24
|
-
s.files = [
|
25
|
-
'#{%w( **/{*,.rspec,.gitignore,.yardopts} ).map { |file| Pathname.glob(gempath.join(file)) }.flatten.reject{|f|
|
26
|
-
!f.exist? or f.to_s =~ /(\.(gem|rbc)|tmp(\/.*)?|spec\/lib\/tmp(\/.*)?)$/ or (f.directory? and f.children.empty?)
|
27
|
-
}.map{|d| d.relative_path_from(gempath)}.uniq.sort.join("',\n '")}'
|
28
|
-
]
|
29
|
-
|
30
|
-
s.add_dependency 'refinerycms-core', '= #{::Refinery::Version}'
|
31
|
-
end
|
32
|
-
EOF
|
33
|
-
|
34
|
-
(gemfile = gempath.join("#{gemname}.gemspec")).open('w') {|f| f.puts(gemspec)}
|
35
|
-
puts `cd #{gempath} && gem build #{gemfile}` if ARGV.any?{|a| a == "BUILD=true"}
|