home_page 0.0.5 → 0.0.6
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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/home_page/application.js +8 -1
- data/app/assets/javascripts/home_page/base.js.coffee.erb +44 -0
- data/app/assets/javascripts/home_page/lib/jquery.multisortable.js +254 -0
- data/app/assets/javascripts/home_page/page_module_collections/index.js.coffee +14 -0
- data/app/assets/javascripts/home_page/shared/sortable_list.js.coffee +44 -0
- data/app/assets/stylesheets/home_page/application.css +4 -0
- data/app/assets/stylesheets/home_page/bootswatch.css.less +4 -0
- data/app/assets/stylesheets/vendors/keen/dashboards.css +59 -0
- data/app/controllers/home_page/application_controller.rb +24 -0
- data/app/controllers/page_module_collections_controller.rb +96 -0
- data/app/controllers/page_module_collections_modules_controller.rb +43 -0
- data/app/controllers/page_modules_controller.rb +121 -0
- data/app/controllers/settings_controller.rb +30 -0
- data/app/controllers/users_controller.rb +7 -3
- data/app/helpers/home_page/application_helper.rb +22 -0
- data/app/helpers/home_page/form_helper.rb +23 -0
- data/app/helpers/home_page/show_helper.rb +67 -0
- data/app/models/page_module.rb +78 -0
- data/app/models/page_module_collection.rb +24 -0
- data/app/models/page_module_collection_module.rb +8 -0
- data/app/models/setting.rb +26 -0
- data/app/views/apis/volontariat/_settings.html.erb +5 -0
- data/app/views/layouts/application.html.erb +2 -1
- data/app/views/layouts/fluid/without_rows.html.erb +17 -0
- data/app/views/layouts/shared/_foot.html.erb +9 -1
- data/app/views/layouts/shared/_modal.html.erb +16 -0
- data/app/views/page_module_collections/_collection.html.erb +18 -0
- data/app/views/page_module_collections/_form.html.erb +29 -0
- data/app/views/page_module_collections/_page_module.html.erb +27 -0
- data/app/views/page_module_collections/_page_module_collection.html.erb +41 -0
- data/app/views/page_module_collections/destroy.js.erb +9 -0
- data/app/views/page_module_collections/edit.html.erb +3 -0
- data/app/views/page_module_collections/index.html.erb +67 -0
- data/app/views/page_module_collections/new.html.erb +3 -0
- data/app/views/page_module_collections/show.html.erb +44 -0
- data/app/views/page_module_collections/update.js.erb +11 -0
- data/app/views/page_module_collections_modules/_fields.html.erb +10 -0
- data/app/views/page_module_collections_modules/create.js.erb +8 -0
- data/app/views/page_module_collections_modules/destroy.js.erb +9 -0
- data/app/views/page_module_collections_modules/new.html.erb +27 -0
- data/app/views/page_modules/_actions.html.erb +26 -0
- data/app/views/page_modules/_collection.html.erb +19 -0
- data/app/views/page_modules/_fields.html.erb +52 -0
- data/app/views/page_modules/_form.html.erb +25 -0
- data/app/views/page_modules/_page_module.html.erb +14 -0
- data/app/views/page_modules/_tab.html.erb +39 -0
- data/app/views/page_modules/destroy.js.erb +9 -0
- data/app/views/page_modules/edit.html.erb +3 -0
- data/app/views/page_modules/new.html.erb +3 -0
- data/app/views/page_modules/update.js.erb +11 -0
- data/app/views/settings/_apis.html.erb +20 -0
- data/app/views/settings/index.html.erb +13 -0
- data/app/views/settings/plugins/home_page/_panel.html.erb +42 -0
- data/app/views/settings/plugins/home_page/tabs/_apis.html.erb +24 -0
- data/app/views/shared/_javascript_response.js.erb +50 -0
- data/app/views/shared/layouts/_modal.html.erb +14 -0
- data/app/views/users/index.html.erb +5 -1
- data/app/views/users/show.html.erb +5 -0
- data/config/initializers/default_settings.rb +8 -0
- data/config/locales/general/en.yml +33 -2
- data/config/locales/resources/page_module/en.yml +34 -0
- data/config/locales/resources/page_module_collection/en.yml +21 -0
- data/config/locales/resources/setting/en.yml +26 -0
- data/config/routes.rb +18 -1
- data/db/migrate/20150307193102_create_friendly_id_slugs.rb +3 -3
- data/db/migrate/20150313154924_create_settings.rb +17 -0
- data/db/migrate/20150315082328_create_page_modules_and_page_module_collections.rb +43 -0
- data/lib/home_page.rb +9 -0
- data/lib/home_page/api_provider_host.rb +54 -0
- data/lib/home_page/engine.rb +1 -0
- data/lib/home_page/navigation.rb +62 -21
- data/lib/home_page/pagination_metadata.rb +1 -2
- data/lib/home_page/simple_navigation_renderer/breadcrumbs_without_method_links.rb +6 -2
- data/lib/home_page/version.rb +1 -1
- metadata +242 -50
- data/README.rdoc +0 -3
- data/config/initializers/volontariat.rb +0 -3
@@ -0,0 +1,14 @@
|
|
1
|
+
<% title ||= nil %>
|
2
|
+
<% body ||= nil %>
|
3
|
+
<% footer ||= nil %>
|
4
|
+
|
5
|
+
<div class="modal-header">
|
6
|
+
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
7
|
+
<h4 class="modal-title" id="myModalLabel"><%= title || yield(:title) %></h4>
|
8
|
+
</div>
|
9
|
+
<div class="modal-body">
|
10
|
+
<%= body || yield(:modal_body) %>
|
11
|
+
</div>
|
12
|
+
<div class="modal-footer">
|
13
|
+
<%= footer || yield(:modal_footer) %>
|
14
|
+
</div>
|
@@ -1,3 +1,5 @@
|
|
1
|
+
<% content_for :title do %><%= t('users.index.title') %><% end %>
|
2
|
+
|
1
3
|
<table class='table table-striped'>
|
2
4
|
<thead>
|
3
5
|
<tr class='<%= cycle('odd', 'even') %>'>
|
@@ -31,4 +33,6 @@
|
|
31
33
|
</tr>
|
32
34
|
<% end %>
|
33
35
|
</tbody>
|
34
|
-
</table>
|
36
|
+
</table>
|
37
|
+
|
38
|
+
<%= will_paginate @users, renderer: BootstrapPagination::Rails %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
Setting.defaults['home_page.general.plugins'] = ['home_page']
|
2
|
+
Setting.defaults['home_page.general.navigation.items'] = ['page_modules', 'users', 'settings', 'authentication']
|
3
|
+
Setting.defaults['home_page.general.available_apis'] = ['volontariat']
|
4
|
+
Setting.defaults['home_page.general.enabled_apis'] = []
|
5
|
+
Setting.defaults['home_page.general.partial_paths'] = []
|
6
|
+
Setting.defaults['home_page.apis.providers.volontariat.hosts.development'] = 'http://localhost:3001'
|
7
|
+
Setting.defaults['home_page.apis.providers.volontariat.hosts.production'] = 'http://Volontari.at'
|
8
|
+
Setting.defaults['home_page.apis.providers.volontariat.user_id'] = 0
|
@@ -19,12 +19,27 @@ en:
|
|
19
19
|
year: Year
|
20
20
|
name: Name
|
21
21
|
position: position
|
22
|
+
liked_at: liked at
|
23
|
+
todo: TODO
|
24
|
+
loading: Loading ...
|
25
|
+
close: Close
|
26
|
+
not_available_short: n/a
|
27
|
+
remove_from_list_but_not_destroy_item: Remove from list (item will be not destroyed)
|
28
|
+
select_existing_item_or_create_new_one: Select Item or create new one
|
29
|
+
more: More
|
30
|
+
|
31
|
+
attributes:
|
32
|
+
title: Title
|
33
|
+
description: Description
|
34
|
+
slug: Slug
|
35
|
+
published: Published?
|
22
36
|
|
23
37
|
form:
|
24
38
|
errors_count: '%{count} prohibited this object from being saved:'
|
25
39
|
successfully_created: Creation successful
|
26
40
|
successfully_updated: Update successful
|
27
41
|
destroyed: Resource destroyed successfully.
|
42
|
+
destroy_failed: Destruction of resource failed.
|
28
43
|
|
29
44
|
questions:
|
30
45
|
are_you_sure: Are you sure?
|
@@ -33,9 +48,25 @@ en:
|
|
33
48
|
wrong_recaptcha: The captcha code which you typed in is wrong.
|
34
49
|
access_denied: Access denied
|
35
50
|
not_found: Resource not found.
|
51
|
+
|
52
|
+
environments:
|
53
|
+
development: Development
|
54
|
+
test: Test
|
55
|
+
staging: Staging
|
56
|
+
production: Production
|
57
|
+
|
58
|
+
apis:
|
59
|
+
host: Host
|
60
|
+
user_id: User ID
|
61
|
+
user_name: User Name
|
62
|
+
key: Key
|
63
|
+
secret: Secret
|
64
|
+
|
65
|
+
providers:
|
66
|
+
volontariat:
|
67
|
+
title: Volontari.at
|
36
68
|
|
37
|
-
|
38
|
-
request_failed: Volontari.at request failed!
|
69
|
+
request_failed: "%{provider} request failed!"
|
39
70
|
|
40
71
|
pages:
|
41
72
|
privacy_policy:
|
@@ -0,0 +1,34 @@
|
|
1
|
+
en:
|
2
|
+
page_modules:
|
3
|
+
index:
|
4
|
+
title: Page Modules
|
5
|
+
short_title: Modules
|
6
|
+
empty_collection: No page modules available.
|
7
|
+
|
8
|
+
new:
|
9
|
+
title: New Page Module
|
10
|
+
short_title: New Module
|
11
|
+
|
12
|
+
edit:
|
13
|
+
title: Edit Page Module
|
14
|
+
|
15
|
+
activerecord:
|
16
|
+
models:
|
17
|
+
page_module: Page Module
|
18
|
+
|
19
|
+
attributes:
|
20
|
+
page_module:
|
21
|
+
partial_path: Partial Path
|
22
|
+
content: Content
|
23
|
+
data: Data
|
24
|
+
published_from: Published_from
|
25
|
+
published_until: Published until
|
26
|
+
|
27
|
+
errors:
|
28
|
+
models:
|
29
|
+
page_module:
|
30
|
+
attributes:
|
31
|
+
base:
|
32
|
+
either_partial_path_or_content_must_be_present: Either partial path or content must be present!
|
33
|
+
content:
|
34
|
+
liquid_syntax_invalid: "Liquid template error: %{message}"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
en:
|
2
|
+
page_module_collections:
|
3
|
+
index:
|
4
|
+
title: Page Module Collections
|
5
|
+
short_title: Collections
|
6
|
+
empty_collection: No page module collections available.
|
7
|
+
|
8
|
+
new:
|
9
|
+
title: New Page Module Collection
|
10
|
+
short_title: New Collection
|
11
|
+
|
12
|
+
show:
|
13
|
+
add_module: Add Module to Collection
|
14
|
+
add_module_short: Add Module
|
15
|
+
|
16
|
+
edit:
|
17
|
+
title: Edit Page Module Collection
|
18
|
+
|
19
|
+
activerecord:
|
20
|
+
models:
|
21
|
+
page_module_collection: Page Module Collection
|
@@ -0,0 +1,26 @@
|
|
1
|
+
en:
|
2
|
+
settings:
|
3
|
+
index:
|
4
|
+
title: Settings
|
5
|
+
default_value: "Default value: %{value}"
|
6
|
+
plugins:
|
7
|
+
home_page:
|
8
|
+
index:
|
9
|
+
title: Core
|
10
|
+
tabs:
|
11
|
+
general:
|
12
|
+
title: General
|
13
|
+
apis:
|
14
|
+
title: APIs
|
15
|
+
|
16
|
+
updates:
|
17
|
+
done: Update done.
|
18
|
+
|
19
|
+
vars:
|
20
|
+
home_page:
|
21
|
+
general:
|
22
|
+
navigation:
|
23
|
+
items: Navigation Items
|
24
|
+
|
25
|
+
enabled_apis: Enabled APIs
|
26
|
+
partial_paths: Partial Paths
|
data/config/routes.rb
CHANGED
@@ -4,7 +4,24 @@ Rails.application.routes.draw do
|
|
4
4
|
sessions: 'devise_extensions/sessions'
|
5
5
|
}
|
6
6
|
|
7
|
-
resources :
|
7
|
+
resources :page_module_collections do
|
8
|
+
resources :modules, controller: 'page_modules', only: [:index, :new] do
|
9
|
+
collection do
|
10
|
+
put :move
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
resources :page_modules, only: [:index, :new, :create, :edit, :update, :destroy]
|
16
|
+
resources :page_module_collections_modules, only: [:create, :destroy]
|
17
|
+
|
18
|
+
resources :users, only: [:index, :show, :edit, :update, :destroy]
|
19
|
+
|
20
|
+
resources :settings, only: [:index, :show, :edit, :update] do
|
21
|
+
collection do
|
22
|
+
put :updates
|
23
|
+
end
|
24
|
+
end
|
8
25
|
|
9
26
|
root to: 'home#index'
|
10
27
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
class CreateFriendlyIdSlugs < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :friendly_id_slugs do |t|
|
4
|
-
t.string :slug, :
|
5
|
-
t.integer :sluggable_id, :
|
6
|
-
t.string :sluggable_type, :
|
4
|
+
t.string :slug, null: false
|
5
|
+
t.integer :sluggable_id, null: false
|
6
|
+
t.string :sluggable_type, limit: 50
|
7
7
|
t.string :scope
|
8
8
|
t.datetime :created_at
|
9
9
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class CreateSettings < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :settings do |t|
|
4
|
+
t.string :var, null: false
|
5
|
+
t.text :value, null: true
|
6
|
+
t.integer :thing_id, null: true
|
7
|
+
t.string :thing_type, limit: 30, null: true
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
|
11
|
+
add_index :settings, [ :thing_type, :thing_id, :var ], unique: true
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.down
|
15
|
+
drop_table :settings
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
class CreatePageModulesAndPageModuleCollections < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :page_module_collections do |t|
|
4
|
+
t.string :slug
|
5
|
+
t.string :slug_stub
|
6
|
+
t.string :title
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
|
10
|
+
add_index :page_module_collections, :slug, unique: true
|
11
|
+
add_index :page_module_collections, :slug_stub, unique: true
|
12
|
+
|
13
|
+
create_table :page_module_collections_modules do |t|
|
14
|
+
t.integer :collection_id
|
15
|
+
t.integer :position
|
16
|
+
t.integer :module_id
|
17
|
+
t.timestamps
|
18
|
+
end
|
19
|
+
|
20
|
+
add_index :page_module_collections_modules, [:collection_id, :position, :module_id], unique: true, name: 'uniq_page_module_collections_module'
|
21
|
+
|
22
|
+
create_table :page_modules do |t|
|
23
|
+
t.string :slug
|
24
|
+
t.string :slug_stub
|
25
|
+
t.string :title
|
26
|
+
t.string :description
|
27
|
+
t.string :partial_path
|
28
|
+
t.text :content, limit: 65535
|
29
|
+
t.text :data, limit: 16777215
|
30
|
+
t.string :moduleable_type
|
31
|
+
t.integer :moduleable_id
|
32
|
+
t.datetime :published_from
|
33
|
+
t.datetime :published_until
|
34
|
+
t.timestamps
|
35
|
+
end
|
36
|
+
|
37
|
+
add_index :page_modules, :slug, unique: true
|
38
|
+
add_index :page_modules, :slug_stub
|
39
|
+
add_index :page_modules, [:moduleable_type, :moduleable_id]
|
40
|
+
add_index :page_modules, :published_from
|
41
|
+
add_index :page_modules, :published_until
|
42
|
+
end
|
43
|
+
end
|
data/lib/home_page.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
require 'v8'
|
2
2
|
require 'twitter-bootswatch-rails'
|
3
|
+
require 'coffee_script'
|
4
|
+
require 'momentjs-rails'
|
5
|
+
require 'bootstrap3-datetimepicker-rails'
|
3
6
|
require 'jquery-rails'
|
7
|
+
require 'jquery-ui-rails'
|
4
8
|
require 'devise'
|
5
9
|
require 'friendly_id'
|
6
10
|
require 'recaptcha/rails'
|
@@ -19,7 +23,12 @@ require 'turbolinks'
|
|
19
23
|
require 'uglifier'
|
20
24
|
require 'yui/compressor'
|
21
25
|
require 'httparty'
|
26
|
+
require 'rails-settings-cached'
|
27
|
+
require 'liquid'
|
28
|
+
require 'selectize-rails'
|
29
|
+
require 'acts_as_list'
|
22
30
|
|
31
|
+
require 'home_page/api_provider_host'
|
23
32
|
require 'home_page/navigation'
|
24
33
|
require 'home_page/pagination_metadata'
|
25
34
|
require 'home_page/simple_navigation_renderer/breadcrumbs_without_method_links'
|
@@ -0,0 +1,54 @@
|
|
1
|
+
module HomePage
|
2
|
+
class ApiProviderHost
|
3
|
+
ENVIRONMENTS = [:development, :test, :staging, :production]
|
4
|
+
ALIASES = {
|
5
|
+
dev: :development, testing: :test, stage: :staging, show: :staging,
|
6
|
+
live: :production, prod: :production
|
7
|
+
}
|
8
|
+
FALLBACKS = {
|
9
|
+
development: [:development, :test, :staging, :production],
|
10
|
+
test: [:test, :development, :staging, :production],
|
11
|
+
staging: [:staging, :production],
|
12
|
+
production: [:production]
|
13
|
+
}
|
14
|
+
|
15
|
+
def initialize(provider, working_environment)
|
16
|
+
@provider = provider
|
17
|
+
@environment = working_environment.to_s.to_sym
|
18
|
+
end
|
19
|
+
|
20
|
+
def setting_namespace
|
21
|
+
"home_page.apis.providers.#{@provider}.hosts"
|
22
|
+
end
|
23
|
+
|
24
|
+
def environment
|
25
|
+
if ENVIRONMENTS.include?(@environment)
|
26
|
+
@environment
|
27
|
+
else
|
28
|
+
ALIASES[@environment] || raise(
|
29
|
+
NotImplementedError,
|
30
|
+
'Your environment is unknown. Please update alias mapping!'
|
31
|
+
)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def to_s
|
36
|
+
host = nil
|
37
|
+
|
38
|
+
FALLBACKS[environment].each do |provider_environment|
|
39
|
+
host = Setting["#{setting_namespace}.#{provider_environment}"]
|
40
|
+
|
41
|
+
break if host
|
42
|
+
end
|
43
|
+
|
44
|
+
unless host
|
45
|
+
raise(
|
46
|
+
NotImplementedError,
|
47
|
+
'The API provider does not support your environment!'
|
48
|
+
)
|
49
|
+
end
|
50
|
+
|
51
|
+
host
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
data/lib/home_page/engine.rb
CHANGED
data/lib/home_page/navigation.rb
CHANGED
@@ -1,18 +1,9 @@
|
|
1
1
|
module HomePage
|
2
2
|
module Navigation
|
3
3
|
class Base
|
4
|
-
@@items = [:users, :authentication]
|
5
4
|
@@products = {}
|
6
5
|
@@menu_options = {}
|
7
6
|
|
8
|
-
def self.items
|
9
|
-
@@items
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.items=(value)
|
13
|
-
@@items = value
|
14
|
-
end
|
15
|
-
|
16
7
|
def self.add_product(slug, text)
|
17
8
|
@@products[slug] = text
|
18
9
|
end
|
@@ -37,8 +28,8 @@ module HomePage
|
|
37
28
|
navigation.items do |primary, options|
|
38
29
|
primary.dom_class = 'nav navbar-nav'
|
39
30
|
|
40
|
-
|
41
|
-
klass = "HomePage#{item.is_a?(Array) ? item.first.
|
31
|
+
Setting['home_page.general.navigation.items'].each do |item|
|
32
|
+
klass = "HomePage#{item.is_a?(Array) ? item.first.classify : ''}::Navigation"
|
42
33
|
item = item.is_a?(Array) ? item.last : item
|
43
34
|
instance_exec primary, HomePage::Navigation::Base.menu_options(item), &klass.constantize.menu_code(item)
|
44
35
|
end
|
@@ -48,26 +39,76 @@ module HomePage
|
|
48
39
|
|
49
40
|
def self.menu_code(resource)
|
50
41
|
case resource
|
51
|
-
when
|
42
|
+
when 'page_modules'
|
43
|
+
Proc.new do |primary, options|
|
44
|
+
if user_signed_in?
|
45
|
+
primary.item(
|
46
|
+
:page_module_collections, t('page_modules.index.title'), page_module_collections_path,
|
47
|
+
breadcrumb_title: t('page_module_collections.index.title')
|
48
|
+
) do |page_module_collections|
|
49
|
+
page_module_collections.item :new, t('general.new'), new_page_module_collection_path
|
50
|
+
|
51
|
+
unless (@page_module_collection.new_record? rescue true)
|
52
|
+
page_module_collections.item(
|
53
|
+
:show, @page_module_collection.title, page_module_collection_path(@page_module_collection)
|
54
|
+
) do |page_module_collection|
|
55
|
+
page_module_collection.item(
|
56
|
+
:edit, t('general.edit'), edit_page_module_collection_path(@page_module_collection)
|
57
|
+
)
|
58
|
+
page_module_collection.item(
|
59
|
+
:destroy, t('general.destroy'), page_module_collection_path(@page_module_collection), method: :delete,
|
60
|
+
confirm: t('general.questions.are_you_sure')
|
61
|
+
)
|
62
|
+
|
63
|
+
page_module_collection.item(
|
64
|
+
:new_module, t('page_modules.new.short_title'), new_page_module_collection_module_path(@page_module_collection)
|
65
|
+
)
|
66
|
+
|
67
|
+
page_module_collection.item(
|
68
|
+
:modules, t('page_modules.index.short_title'), page_module_collection_modules_path(@page_module_collection)
|
69
|
+
) do |page_modules|
|
70
|
+
unless (@page_module.new_record? rescue true)
|
71
|
+
page_modules.item :edit, t('general.edit'), edit_page_module_path(@page_module) do |page_module|
|
72
|
+
page_module.item(
|
73
|
+
:destroy, t('general.destroy'), page_module_path(@page_module), method: :delete,
|
74
|
+
confirm: t('general.questions.are_you_sure')
|
75
|
+
)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
when 'users'
|
52
85
|
Proc.new do |primary, options|
|
53
86
|
if user_signed_in?
|
54
|
-
primary.item :users,
|
55
|
-
unless (@user.new_record? rescue true)
|
56
|
-
|
57
|
-
|
87
|
+
primary.item :users, t('users.index.title'), users_path do |users|
|
88
|
+
unless (@user.new_record? rescue true)
|
89
|
+
users.item :show, @user.name, user_path(@user) do |user|
|
90
|
+
user.item :edit, t('general.edit'), edit_user_path(@user)
|
91
|
+
|
92
|
+
if options[:after_resource_has_many]
|
93
|
+
instance_exec user, {}, &options[:after_resource_has_many]
|
94
|
+
end
|
58
95
|
end
|
59
96
|
end
|
60
97
|
end
|
61
98
|
end
|
62
99
|
end
|
63
|
-
when
|
100
|
+
when 'settings'
|
101
|
+
Proc.new do |primary, options|
|
102
|
+
primary.item :settings, t('settings.index.title'), settings_path if user_signed_in?
|
103
|
+
end
|
104
|
+
when 'authentication'
|
64
105
|
Proc.new do |primary, options|
|
65
106
|
if user_signed_in?
|
66
|
-
primary.item :sign_out,
|
107
|
+
primary.item :sign_out, t('authentication.sign_out'), destroy_user_session_path, method: :delete
|
67
108
|
else
|
68
|
-
primary.item :authentication,
|
69
|
-
authentication.item :sign_in,
|
70
|
-
authentication.item :sign_up,
|
109
|
+
primary.item :authentication, t('authentication.title'), new_user_session_path do |authentication|
|
110
|
+
authentication.item :sign_in, t('authentication.sign_in'), new_user_session_path
|
111
|
+
authentication.item :sign_up, t('authentication.sign_up'), new_user_registration_path
|
71
112
|
end
|
72
113
|
end
|
73
114
|
end
|