tusur_header 0.2.7 → 0.2.8
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5f3d7b10f27c5e35474b6368794bb5d2512dfdf
|
4
|
+
data.tar.gz: 3916c05d75e9c3f345707cc86acb26835a5b2c99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8fc63c260e24349e68b401f1ca6046819d4ac9ae20a37a3eb99fd7407148ad32d89249f48118dfbbeb25750763457d46332ed925a3bb4fb7a87c39c6c706c5b
|
7
|
+
data.tar.gz: b736acd845454e3524fd3a7cc1b831ceb6cad1f6e8627b058073621e2a0142e5c88b421b621768e7bc1708e9882621508e75c320c0f4e1ac4027f0624cee0973
|
@@ -16,10 +16,21 @@
|
|
16
16
|
</div>
|
17
17
|
<% end %>
|
18
18
|
|
19
|
-
|
20
|
-
<%
|
21
|
-
|
22
|
-
<%
|
19
|
+
<% begin %>
|
20
|
+
<% raise 'redis.cdn not found' if Settings['redis.cdn'].blank? %>
|
21
|
+
<%= render_cdn('header').gsub('"', '"').gsub('>', '>').html_safe %>
|
22
|
+
<% if content_for?(:tusur_cdn_header_subtop) %>
|
23
|
+
<div class='tusur-cdn-header-subtop'>
|
24
|
+
<%= yield :tusur_cdn_header_subtop %>
|
25
|
+
</div>
|
26
|
+
<% end %>
|
27
|
+
<% if content_for?(:tusur_cdn_header_menu) %>
|
28
|
+
<div class='tusur-cdn-header-menu'>
|
29
|
+
<%= yield :tusur_cdn_header_menu %>
|
30
|
+
</div>
|
31
|
+
<% end %>
|
32
|
+
<% rescue %>
|
33
|
+
<div class='tusur_header_wrapper'>
|
23
34
|
<div class='navbar navbar-inverse navbar-fixed-top navbar-desktop' role='navigation' id='menu_first'>
|
24
35
|
<div class='container'>
|
25
36
|
|
@@ -59,43 +70,44 @@
|
|
59
70
|
</div>
|
60
71
|
</div>
|
61
72
|
</div>
|
62
|
-
<% end %>
|
63
|
-
<div class='navbar navbar-inverse navbar-second-menu' role='navigation' id='menu_second'>
|
64
|
-
<div class='container'>
|
65
73
|
|
66
|
-
|
67
|
-
|
68
|
-
<%= yield :tusur_header_second_menu_left %>
|
69
|
-
<% end %>
|
70
|
-
<!-- / Левая часть второй линии меню -->
|
74
|
+
<div class='navbar navbar-inverse navbar-second-menu' role='navigation' id='menu_second'>
|
75
|
+
<div class='container'>
|
71
76
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
+
<!-- Левая часть второй линии меню -->
|
78
|
+
<% if content_for?(:tusur_header_second_menu_left) %>
|
79
|
+
<%= yield :tusur_header_second_menu_left %>
|
80
|
+
<% end %>
|
81
|
+
<!-- / Левая часть второй линии меню -->
|
82
|
+
|
83
|
+
<!-- Правая часть второй линии меню -->
|
84
|
+
<% if content_for?(:tusur_header_second_menu_right) %>
|
85
|
+
<%= yield :tusur_header_second_menu_right %>
|
86
|
+
<% end %>
|
87
|
+
<!-- / Правая часть второй линии меню -->
|
77
88
|
|
89
|
+
</div>
|
78
90
|
</div>
|
79
|
-
</div>
|
80
91
|
|
81
|
-
|
82
|
-
|
92
|
+
<div class='navbar navbar-inverse navbar-fixed-top navbar-mobile' role='navigation' id='menu_mobile'>
|
93
|
+
<div class='container'>
|
83
94
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
95
|
+
<div class='navbar-header'>
|
96
|
+
<button type='button' class='navbar-toggle mobile-toggler' data-toggle='collapse' data-target='#site-menu'>
|
97
|
+
<span class='icon-bar'></span>
|
98
|
+
<span class='icon-bar'></span>
|
99
|
+
<span class='icon-bar'></span>
|
100
|
+
</button>
|
101
|
+
<a class='navbar-brand' href='/'></a>
|
102
|
+
</div>
|
92
103
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
104
|
+
<div class='navbar-collapse collapse' id='site-menu'>
|
105
|
+
<% if content_for?(:tusur_header_mobile_menu_block) %>
|
106
|
+
<%= yield :tusur_header_mobile_menu_block %>
|
107
|
+
<% end %>
|
108
|
+
</div>
|
98
109
|
|
110
|
+
</div>
|
99
111
|
</div>
|
100
112
|
</div>
|
101
|
-
|
113
|
+
<% end %>
|
@@ -21,7 +21,7 @@ module TusurHeader
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def separator
|
24
|
-
content_tag :li, nil, :
|
24
|
+
content_tag :li, nil, class: 'divider'
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -29,7 +29,7 @@ module TusurHeader
|
|
29
29
|
include ActionView::Helpers
|
30
30
|
|
31
31
|
attr_accessor :user
|
32
|
-
delegate :uid, :teacher?, :student?, :app_name, :
|
32
|
+
delegate :uid, :teacher?, :student?, :app_name, to: :user
|
33
33
|
|
34
34
|
def initialize(user)
|
35
35
|
@user = user
|
@@ -42,7 +42,7 @@ module TusurHeader
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def list
|
45
|
-
content_tag :ul, links.join.html_safe, :
|
45
|
+
content_tag :ul, links.join.html_safe, class: 'dropdown-menu'
|
46
46
|
end
|
47
47
|
|
48
48
|
def system_infos
|
@@ -66,38 +66,7 @@ module TusurHeader
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def sign_out_url
|
69
|
-
|
70
|
-
|
71
|
-
sign_out_link + path
|
72
|
-
end
|
73
|
-
|
74
|
-
# TODO: remove
|
75
|
-
def example_system_infos
|
76
|
-
{
|
77
|
-
:timetable_info => {
|
78
|
-
:url => {
|
79
|
-
:title => 'TITLE #1',
|
80
|
-
:link => 'http://url1.com'
|
81
|
-
},
|
82
|
-
|
83
|
-
:my_url => {
|
84
|
-
:title => 'MY TITLE #1',
|
85
|
-
:link => 'http://my_url1.com'
|
86
|
-
}
|
87
|
-
}.to_json,
|
88
|
-
|
89
|
-
:attendance_info => {
|
90
|
-
:url => {
|
91
|
-
:title => 'TITLE #2',
|
92
|
-
:link => 'http://url2.com'
|
93
|
-
},
|
94
|
-
|
95
|
-
:my_url => {
|
96
|
-
:title => 'MY TITLE #2',
|
97
|
-
:link => 'http://my_url2.com'
|
98
|
-
}
|
99
|
-
}.to_json
|
100
|
-
}
|
69
|
+
"#{sign_out_link}/users/sign_out?redirect_url=#{Settings['app.url']}"
|
101
70
|
end
|
102
71
|
|
103
72
|
def links_from_system_infos(key)
|
@@ -108,29 +77,34 @@ module TusurHeader
|
|
108
77
|
|
109
78
|
def links_data
|
110
79
|
@links_hash ||= begin
|
111
|
-
array = []
|
112
80
|
|
81
|
+
my_urls = []
|
113
82
|
if links_from_system_infos('my_url').any?
|
114
|
-
links_from_system_infos('my_url').each do |elem|
|
115
|
-
|
83
|
+
links_from_system_infos('my_url').reject{ |elem| elem['link'].blank? }.each do |elem|
|
84
|
+
my_urls << { title: elem['title'], url: elem['link'] }
|
116
85
|
end
|
117
86
|
|
118
|
-
|
87
|
+
my_urls = my_urls.sort{ |a, b| a[:title] <=> b[:title] }
|
88
|
+
my_urls << { separator: true }
|
119
89
|
end
|
120
90
|
|
121
|
-
|
122
|
-
|
91
|
+
urls = []
|
92
|
+
urls << { title: 'Кабинет ТУСУР', url: "#{profile_url}/" }
|
123
93
|
if links_from_system_infos('url').any?
|
124
|
-
links_from_system_infos('url').each do |elem|
|
125
|
-
|
94
|
+
links_from_system_infos('url').reject{ |elem| elem['link'].blank? }.each do |elem|
|
95
|
+
urls << { title: elem['title'], url: elem['link'] }
|
126
96
|
end
|
127
|
-
array << { :separator => true }
|
128
97
|
end
|
129
98
|
|
130
|
-
|
131
|
-
|
99
|
+
urls = urls.sort{ |a, b| a[:title] <=> b[:title] }
|
100
|
+
urls << { separator: true }
|
101
|
+
|
102
|
+
array = my_urls + urls
|
103
|
+
array << { title: 'Редактировать профиль', url: edit_user_url }
|
104
|
+
array << { title: 'Выход', url: sign_out_url, options: { method: :delete } }
|
132
105
|
|
133
106
|
array
|
107
|
+
|
134
108
|
end
|
135
109
|
end
|
136
110
|
end
|
data/lib/tusur_header/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tusur_header
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evgeny Lapin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|