infopark_dashboard 0.0.1

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.
Files changed (47) hide show
  1. data/CHANGELOG.md +1 -0
  2. data/LICENSE +3 -0
  3. data/README.md +92 -0
  4. data/Rakefile +12 -0
  5. data/app/assets/javascripts/infopark_dashboard/dashboard.js +16 -0
  6. data/app/assets/stylesheets/infopark_dashboard/dashboard.css +19 -0
  7. data/app/assets/stylesheets/infopark_dashboard/print.css +11 -0
  8. data/app/controllers/infopark_dashboard/dashboard_controller.rb +47 -0
  9. data/app/models/infopark_dashboard/attribute.rb +39 -0
  10. data/app/models/infopark_dashboard/cms_stats.rb +31 -0
  11. data/app/models/infopark_dashboard/crm_stats.rb +23 -0
  12. data/app/models/infopark_dashboard/editor.rb +11 -0
  13. data/app/models/infopark_dashboard/gem.rb +31 -0
  14. data/app/models/infopark_dashboard/meta_stats.rb +35 -0
  15. data/app/models/infopark_dashboard/obj_class.rb +50 -0
  16. data/app/models/infopark_dashboard/resource.rb +49 -0
  17. data/app/views/infopark_dashboard/dashboard/content.html.haml +17 -0
  18. data/app/views/infopark_dashboard/dashboard/content/_cms_stats.html.haml +52 -0
  19. data/app/views/infopark_dashboard/dashboard/content/_crm_stats.html.haml +42 -0
  20. data/app/views/infopark_dashboard/dashboard/content/_recently_published.html.haml +33 -0
  21. data/app/views/infopark_dashboard/dashboard/help.html.haml +13 -0
  22. data/app/views/infopark_dashboard/dashboard/help/_gem.html.haml +16 -0
  23. data/app/views/infopark_dashboard/dashboard/help/_links.html.haml +30 -0
  24. data/app/views/infopark_dashboard/dashboard/help/_updates.html.haml +25 -0
  25. data/app/views/infopark_dashboard/dashboard/objects.html.haml +16 -0
  26. data/app/views/infopark_dashboard/dashboard/objects/_attribute.html.haml +38 -0
  27. data/app/views/infopark_dashboard/dashboard/objects/_attributes.html.haml +2 -0
  28. data/app/views/infopark_dashboard/dashboard/objects/_global_attribute_details.html.haml +13 -0
  29. data/app/views/infopark_dashboard/dashboard/objects/_mandatory_attributes.html.haml +6 -0
  30. data/app/views/infopark_dashboard/dashboard/objects/_obj_class.html.haml +29 -0
  31. data/app/views/infopark_dashboard/dashboard/objects/_obj_class_details.html.haml +13 -0
  32. data/app/views/infopark_dashboard/dashboard/objects/_preset_attributes.html.haml +12 -0
  33. data/app/views/infopark_dashboard/dashboard/people.html.haml +32 -0
  34. data/app/views/layouts/infopark_dashboard/dashboard.haml +45 -0
  35. data/app/views/layouts/infopark_dashboard/dashboard/_flash_message.html.haml +5 -0
  36. data/app/views/layouts/infopark_dashboard/dashboard/_flash_messages.html.haml +11 -0
  37. data/app/views/layouts/infopark_dashboard/dashboard/_nav_link.html.haml +5 -0
  38. data/app/views/layouts/infopark_dashboard/dashboard/_navigation.html.haml +18 -0
  39. data/app/views/layouts/infopark_dashboard/dashboard/_workspace_toggle.html.haml +16 -0
  40. data/config/routes.rb +7 -0
  41. data/lib/infopark_dashboard.rb +10 -0
  42. data/lib/infopark_dashboard/configuration.rb +55 -0
  43. data/lib/infopark_dashboard/dashboard.rb +14 -0
  44. data/lib/infopark_dashboard/engine.rb +13 -0
  45. data/lib/infopark_dashboard/rake/configuration_helper.rb +21 -0
  46. data/lib/infopark_dashboard/version.rb +3 -0
  47. metadata +253 -0
@@ -0,0 +1,49 @@
1
+ module InfoparkDashboard
2
+ class Resource
3
+ class << self
4
+ def find(id)
5
+ resources = fetch(id)
6
+
7
+ new(resources)
8
+ end
9
+
10
+ def fetch(id)
11
+ Rails.cache.fetch(cache_key(id)) do
12
+ endpoint(id)
13
+ end
14
+ end
15
+
16
+ def all
17
+ resources = endpoint['results']
18
+
19
+ resources.map do |resources|
20
+ new(resources)
21
+ end
22
+ end
23
+
24
+ def cache_key(id)
25
+ "#{namespace}_#{id}_#{revision_id}"
26
+ end
27
+
28
+ private
29
+
30
+ def namespace
31
+ raise NotImplementedError.new
32
+ end
33
+
34
+ def revision_id
35
+ RailsConnector::Workspace.current.revision_id
36
+ end
37
+
38
+ def endpoint(path = '')
39
+ RailsConnector::CmsRestApi.get("revisions/#{revision_id}/#{namespace}/#{path}")
40
+ end
41
+ end
42
+
43
+ def initialize(attributes = {})
44
+ attributes.each do |key, value|
45
+ send("#{key}=", value)
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,17 @@
1
+ .row-fluid
2
+ %h1
3
+ Project Content
4
+
5
+ %p
6
+ Gives you an overview of what currently is going on in your project.
7
+
8
+ .row-fluid
9
+ .span6.well.well-small
10
+ = render('infopark_dashboard/dashboard/content/cms_stats', stats: @cms_stats)
11
+
12
+ .span6.well.well-small
13
+ = render('infopark_dashboard/dashboard/content/crm_stats', stats: @crm_stats)
14
+
15
+ .row-fluid
16
+ .span12
17
+ = render('infopark_dashboard/dashboard/content/recently_published', recently_published: @cms_stats.recently_published)
@@ -0,0 +1,52 @@
1
+ %h2
2
+ CMS Statistic
3
+
4
+ %dl.dl-horizontal
5
+ %dt
6
+ Workspaces:
7
+
8
+ %dd
9
+ %span.badge
10
+ = stats.workspaces
11
+
12
+ %dl.dl-horizontal
13
+ %dt
14
+ Published objects:
15
+
16
+ %dd
17
+ %span.badge
18
+ = stats.published_objects
19
+
20
+ %hr
21
+
22
+ %dl.dl-horizontal
23
+ %dt
24
+ Websites:
25
+
26
+ %dd
27
+ %span.badge
28
+ = stats.websites
29
+
30
+ %dl.dl-horizontal
31
+ %dt
32
+ Homepages:
33
+
34
+ %dd
35
+ %span.badge
36
+ = stats.homepages
37
+
38
+ %dl.dl-horizontal
39
+ %dt
40
+ Resources:
41
+
42
+ %dd
43
+ %span.badge
44
+ = stats.resources
45
+
46
+ %dl.dl-horizontal
47
+ %dt
48
+ Widgets:
49
+
50
+ %dd
51
+ %span.badge
52
+ = stats.widgets
@@ -0,0 +1,42 @@
1
+ %h2
2
+ CRM Statistic
3
+
4
+ %dl.dl-horizontal
5
+ %dt
6
+ Contacts:
7
+
8
+ %dd
9
+ %span.badge
10
+ = stats.contacts
11
+
12
+ %dl.dl-horizontal
13
+ %dt
14
+ Accounts:
15
+
16
+ %dd
17
+ %span.badge
18
+ = stats.accounts
19
+
20
+ %dl.dl-horizontal
21
+ %dt
22
+ Mailings:
23
+
24
+ %dd
25
+ %span.badge
26
+ = stats.mailings
27
+
28
+ %dl.dl-horizontal
29
+ %dt
30
+ Events:
31
+
32
+ %dd
33
+ %span.badge
34
+ = stats.events
35
+
36
+ %dl.dl-horizontal
37
+ %dt
38
+ Activities:
39
+
40
+ %dd
41
+ %span.badge
42
+ = stats.activities
@@ -0,0 +1,33 @@
1
+ %h2
2
+ Recently Published CMS Objects
3
+
4
+ %table.table.table-bordered.table-hover
5
+ %thead
6
+ %tr
7
+ %th
8
+ Name
9
+
10
+ %th
11
+ Path
12
+
13
+ %th
14
+ Object Class
15
+
16
+ %th
17
+ Last Changed
18
+
19
+ %tbody
20
+ - recently_published.each do |obj|
21
+ %tr
22
+ %td
23
+ = obj.name
24
+
25
+ %td
26
+ = link_to(main_app.cms_id_path(obj.id)) do
27
+ = obj.path
28
+
29
+ %td
30
+ = obj.obj_class
31
+
32
+ %td
33
+ = time_ago_in_words(obj.last_changed)
@@ -0,0 +1,13 @@
1
+ .row-fluid
2
+ %h1
3
+ Help, Links &amp; Updates
4
+
5
+ %p
6
+ If you are looking for help or want to jump directly to Infopark GUI applications, then check
7
+ out the links below. Don't forget the feedback button, if you miss anything.
8
+
9
+ .row-fluid
10
+ = render('infopark_dashboard/dashboard/help/links')
11
+
12
+ .row-fluid
13
+ = render('infopark_dashboard/dashboard/help/updates', gems: @gems)
@@ -0,0 +1,16 @@
1
+ %tr
2
+ %td
3
+ = link_to(gem.rubygems_url, target: 'blank') do
4
+ = gem.name
5
+
6
+ - class_name = gem.latest? ? 'badge-success' : 'badge-warning'
7
+
8
+ %td
9
+ = gem.version
10
+
11
+ %td
12
+ %span.badge{class: class_name, title: "Latest Version: #{gem.latest_version}"}
13
+ - if gem.latest?
14
+ &nbsp;
15
+ - else
16
+ = gem.latest_version
@@ -0,0 +1,30 @@
1
+ %h2
2
+ Helpful Links
3
+
4
+ %ul
5
+ %li
6
+ = link_to(Rails.configuration.infopark_dashboard.cms_url, target: :_blank) do
7
+ Infopark CMS GUI
8
+
9
+ %li
10
+ = link_to(Rails.configuration.infopark_dashboard.crm_url, target: :_blank) do
11
+ Infopark CRM GUI
12
+
13
+ %li
14
+ = link_to(Rails.configuration.infopark_dashboard.console_url, target: :_blank) do
15
+ Infopark Console and Project Management
16
+
17
+ %hr
18
+
19
+ %ul
20
+ %li
21
+ = link_to(Rails.configuration.infopark_dashboard.dev_center_url, target: :_blank) do
22
+ Infopark Dev Center
23
+
24
+ %li
25
+ = link_to(Rails.configuration.infopark_dashboard.support_url, target: :_blank) do
26
+ Infopark Support
27
+
28
+ %li
29
+ = link_to(Rails.configuration.infopark_dashboard.status_url, target: :_blank) do
30
+ Infopark Status Page
@@ -0,0 +1,25 @@
1
+ %h2
2
+ Available Updates
3
+
4
+ %p
5
+ Check your Gem versions regularly to see if new updates are available. A yellow label indicates,
6
+ that newer versions of core gems are available. To update, add the new version to your Gemfile
7
+ and run <strong>bundle update &quot;name of the gem&quot;</strong>. When Infopark Software like
8
+ the Rails- or CrmConnector is updated, you can check the
9
+ <a href="#{Rails.configuration.infopark_dashboard.blog_url}" target="_blank">Infopark Blog</a>
10
+ to see what has changed.
11
+
12
+ %table.table
13
+ %thead
14
+ %tr
15
+ %th
16
+ Name
17
+
18
+ %th
19
+ Version
20
+
21
+ %th
22
+ Status
23
+
24
+ %tbody
25
+ = render(partial: 'infopark_dashboard/dashboard/help/gem', collection: gems)
@@ -0,0 +1,16 @@
1
+ .row-fluid
2
+ %h1
3
+ Object Classes and Attributes
4
+
5
+ %p
6
+ All active Object Classes and their Attributes are listed. Please use CMS Migrations to adopt the
7
+ list to your needs. You can easily create a new CMS Migration executing
8
+ <strong>rails generate cms:migration NAME</strong>, or use the more specific migration
9
+ generators, like <strong>rails generate cms:model</strong>.
10
+
11
+ .row-fluid
12
+ = render('layouts/infopark_dashboard/dashboard/workspace_toggle')
13
+
14
+ = render('infopark_dashboard/dashboard/objects/obj_class_details', stats: @meta_stats)
15
+
16
+ = render('infopark_dashboard/dashboard/objects/global_attribute_details', stats: @meta_stats)
@@ -0,0 +1,38 @@
1
+ %h5
2
+ %i.icon-list.pull-left
3
+
4
+ &nbsp;
5
+
6
+ = attribute.name
7
+
8
+ - if attribute.title?
9
+ %small
10
+ (#{attribute.title})
11
+
12
+ %ul.unstyled
13
+ %li
14
+ %strong
15
+ Type:
16
+
17
+ = attribute.type
18
+
19
+ - if attribute.values?
20
+ %li
21
+ %strong
22
+ Values:
23
+
24
+ = attribute.values.join(', ')
25
+
26
+ - if attribute.min_size?
27
+ %li
28
+ %strong
29
+ Min Size:
30
+
31
+ = attribute.min_size
32
+
33
+ - if attribute.max_size?
34
+ %li
35
+ %strong
36
+ Max Size:
37
+
38
+ = attribute.max_size
@@ -0,0 +1,2 @@
1
+ - attributes.each do |attribute|
2
+ = render('infopark_dashboard/dashboard/objects/attribute', attribute: attribute)
@@ -0,0 +1,13 @@
1
+ %h2
2
+ Global Attribute Details
3
+
4
+ %span.badge
5
+ = stats.global_attributes_count
6
+
7
+ - stats.global_attributes.in_groups_of(2).each do |group|
8
+ .row-fluid
9
+ - group.each do |attribute|
10
+ - next unless attribute
11
+
12
+ .span6.well.well-small
13
+ = render('infopark_dashboard/dashboard/objects/attribute', attribute: attribute)
@@ -0,0 +1,6 @@
1
+ %dl.dl-horizontal
2
+ %dt
3
+ Mandatory-Attributes:
4
+
5
+ %dd
6
+ = attributes.join(', ')
@@ -0,0 +1,29 @@
1
+ %h4
2
+ %i.icon-folder-open.pull-left
3
+
4
+ &nbsp;
5
+
6
+ = obj_class.name
7
+
8
+ %small
9
+ (#{obj_class.title})
10
+
11
+ - if @current_workspace['title'] == 'published'
12
+ %span.badge{class: obj_class.count == 0 ? 'badge-important' : nil}
13
+ ⅀ #{obj_class.count}
14
+
15
+ %ul.unstyled
16
+ %li
17
+ %strong
18
+ Type:
19
+
20
+ = obj_class.type
21
+
22
+ - if obj_class.mandatory_attributes?
23
+ = render('infopark_dashboard/dashboard/objects/mandatory_attributes', attributes: obj_class.mandatory_attributes)
24
+
25
+ - if obj_class.preset_attributes?
26
+ = render('infopark_dashboard/dashboard/objects/preset_attributes', attributes: obj_class.preset_attributes)
27
+
28
+ - if obj_class.attributes?
29
+ = render('infopark_dashboard/dashboard/objects/attributes', attributes: obj_class.attributes)
@@ -0,0 +1,13 @@
1
+ %h2
2
+ Object Class Details
3
+
4
+ %span.badge
5
+ = stats.obj_classes_count
6
+
7
+ - stats.obj_classes.in_groups_of(2).each do |group|
8
+ .row-fluid
9
+ - group.each do |item|
10
+ - next unless item
11
+
12
+ .span6.well.well-small
13
+ = render('infopark_dashboard/dashboard/objects/obj_class', obj_class: item)
@@ -0,0 +1,12 @@
1
+ %ul.unstyled
2
+ %li
3
+ %strong
4
+ Preset-Attributes:
5
+
6
+ %ul
7
+ - attributes.each do |attribute, preset|
8
+ %li
9
+ = attribute
10
+
11
+ %small
12
+ \= #{preset}
@@ -0,0 +1,32 @@
1
+ .row-fluid
2
+ %h1
3
+ Editors
4
+
5
+ %span.badge
6
+ ⅀ #{@editors.size}
7
+
8
+ .row-fluid
9
+ .span12
10
+ %p
11
+ People listed have access to your Infopark GUI applications. They are able to influence the
12
+ content of the webpage. You can add new editors in the CRM by creating a new Contact and give them
13
+ the <strong>cmsadmin</strong> role.
14
+
15
+ %table.table.table-bordered
16
+ %thead
17
+ %tr
18
+ %th
19
+ Name
20
+
21
+ %th
22
+ Login
23
+
24
+ %tbody
25
+ - @editors.each do |editor|
26
+ %tr
27
+ %td
28
+ = link_to(Rails.configuration.infopark_dashboard.contact_url(editor.id), target: :_blank) do
29
+ = [editor.last_name, editor.first_name].compact.join(', ')
30
+
31
+ %td
32
+ = editor.login