taxweb-frontend 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +22 -0
- data/README.md +152 -0
- data/app/assets/images/logo_taxweb.png +0 -0
- data/app/assets/javascripts/taxweb-frontend.js +45 -0
- data/app/assets/stylesheets/taxweb-frontend.scss +224 -0
- data/app/assets/stylesheets/taxweb-frontend/_sidebar.scss +98 -0
- data/app/assets/stylesheets/taxweb-frontend/_variables.scss +37 -0
- data/app/controllers/taxweb_frontend_controller.rb +3 -0
- data/app/helpers/taxweb_frontend_helper.rb +16 -0
- data/app/views/layouts/taxweb-frontend/_brand_menu.html.haml +15 -0
- data/app/views/layouts/taxweb-frontend/_messages.html.haml +6 -0
- data/app/views/layouts/taxweb_frontend.html.haml +20 -0
- data/lib/simple_navigation/renderer/sidebar.rb +49 -0
- data/lib/taxweb/frontend.rb +16 -0
- data/lib/taxweb/frontend/version.rb +5 -0
- metadata +163 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 66307f17b4ca8cde241b26154bd5a9f71dd3c3d6
|
4
|
+
data.tar.gz: a06856f95d2d5e3393a42439837b43ea8211007f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 63eaa9db587b785031ac20d563559213e02938da72d68c4b32def1dea613908c8ad5bde6490be3facd754881357c2767ea8e0d6df932bffeb7ee7d7a233b4c98
|
7
|
+
data.tar.gz: 5d8f0caac4a9757b325ae715c80ef0156006cdd54a14593e3c9a65adb6df78b6a3a62047ca892bbce541b39275d7209ea01bf39e123af9cc726e2ba075143528
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Filipe Abreu
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,152 @@
|
|
1
|
+
# Taxweb::Frontend
|
2
|
+
|
3
|
+
Aplica assets, layout, helpers e gems comuns às aplicações da Taxweb.
|
4
|
+
|
5
|
+
## Instalação
|
6
|
+
|
7
|
+
A gem `Taxweb::Frontend` está localizada em um repositório privado no Github. Para garantir a instalação, certifique-se que você utilize um usuário Github com acesso ao repositório.
|
8
|
+
|
9
|
+
### SSH
|
10
|
+
|
11
|
+
|
12
|
+
Adicione esta linha no Gemfile da sua aplicação:
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
gem 'taxweb-frontend', git: 'git@github.com:taxweb/taxweb-frontend', :branch => 'master'
|
16
|
+
```
|
17
|
+
|
18
|
+
E então execute:
|
19
|
+
|
20
|
+
$ bundle
|
21
|
+
|
22
|
+
Para instalar usando SSH, primeiramente certifique-se que as chaves SSH públicas de seu usuário estão cadastradas na sua conta Github. Você pode adicionar chaves SSH na sua conta Github seguindo as instruções na página:
|
23
|
+
|
24
|
+
[Github - Generating SSH Keys](https://help.github.com/articles/generating-ssh-keys)
|
25
|
+
|
26
|
+
### HTTPS
|
27
|
+
|
28
|
+
Adiciona esta linha no Gemfile da sua aplicação
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
gem 'taxweb-frontend', git: 'https://github.com/taxweb/taxweb-frontend', :branch => 'master'
|
32
|
+
```
|
33
|
+
E então execute:
|
34
|
+
|
35
|
+
$ bundle
|
36
|
+
|
37
|
+
Quando solicitado, entre com o seu nome de usuário Github e senha.
|
38
|
+
|
39
|
+
## Gems
|
40
|
+
|
41
|
+
As seguintes gems são utilizadas pelo `Taxweb::Frontend`
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
'bootstrap-sass', '~> 3.2.0'
|
45
|
+
'simple-navigation'
|
46
|
+
'haml'
|
47
|
+
'haml-rails'
|
48
|
+
```
|
49
|
+
|
50
|
+
Portanto, estas gems podem ser removidas do Gemfile da sua aplicação, caso ela use a gem `Taxweb::Frontend`.
|
51
|
+
|
52
|
+
# Como usar
|
53
|
+
|
54
|
+
## Layout
|
55
|
+
|
56
|
+
Para aplicar o layout `taxweb-frontend`, faça o controller em questão como uma extensão do `TaxwebFrontendController`
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
class UsersController < TaxwebFrontendController
|
60
|
+
# código do seu controller aqui
|
61
|
+
end
|
62
|
+
```
|
63
|
+
|
64
|
+
Por padrão, o Rails tem todos os seus controllers como uma extensão do `ApplicationController`. Portanto, para aplicar o layout `taxweb-frontend` em toda a sua aplicação padrão Rails, faça do seu `ApplicationController` uma extesão do `TaxwebFrontendController`
|
65
|
+
|
66
|
+
```ruby
|
67
|
+
class ApplicationController < TaxwebFrontendController
|
68
|
+
# código do seu controller aqui
|
69
|
+
end
|
70
|
+
```
|
71
|
+
|
72
|
+
Ao fazer um controller uma extensão do `TaxwebFrontendController`, as suas views também herdarão as classes do TaxwebFrontendHelper.
|
73
|
+
|
74
|
+
|
75
|
+
## Folhas de estilo
|
76
|
+
|
77
|
+
Também será necessário carregar as folhas de estilo no Taxweb::Frontend.
|
78
|
+
|
79
|
+
Para fazer isso, adicione em sua folha de estilos:
|
80
|
+
|
81
|
+
```css
|
82
|
+
@import "taxweb-frontend";
|
83
|
+
```
|
84
|
+
|
85
|
+
## Menu de Navegação
|
86
|
+
|
87
|
+
O `Taxweb::Frontend` utiliza a gem `SimpleNavigation` para a geração do menu de navegação principal.
|
88
|
+
|
89
|
+
### Configurando o menu
|
90
|
+
Menus do `SimpleNavigation` são configurados através da classe `SimpleNavigation::Configuration`, que deve ser configurada no arquivo `config/navigation.rb`.
|
91
|
+
|
92
|
+
Para saber como configurar um menu do `SimpleNavigation`, consulte esta página:
|
93
|
+
|
94
|
+
[Simple Navigation Configuration](https://github.com/codeplant/simple-navigation/wiki/Configuration)
|
95
|
+
|
96
|
+
### CSS
|
97
|
+
Para usufruir do menu em sidebar e com accordion, é necessário adicionar estas classes CSS na configuração do seu menu:
|
98
|
+
|
99
|
+
```ruby
|
100
|
+
navigation.items do |primary|
|
101
|
+
primary.dom_id = 'app-nav'
|
102
|
+
primary.dom_class = 'nav sidebar-nav'
|
103
|
+
|
104
|
+
...
|
105
|
+
end
|
106
|
+
```
|
107
|
+
|
108
|
+
### Logotipo
|
109
|
+
|
110
|
+
O `Taxweb::Frontend` utiliza em seu layout o logotipo da sua aplicação.
|
111
|
+
|
112
|
+
Este logotipo deve ter o nome `logo.png` e estar localizado na pasta raiz de seus assets.
|
113
|
+
|
114
|
+
|
115
|
+
### Ícones
|
116
|
+
A gem `TaxwebFrontend` extende o renderer padrão do `SimpleNavigation`, permitindo a inclusão de ícones para cada item do menu. Os ícones são adicionados utilizando o padrão do `Bootstrap 3`, com a biblioteca [Glyphicons](http://glyphicons.com/).
|
117
|
+
|
118
|
+
Adicione a option `:icon` em um item ou sub-item de menu que você deseja adicionar um ícone. Deve ser escolhido uma das classes de ícone do `Bootstrap 3` (ex: `'glyphicon-user'`).
|
119
|
+
|
120
|
+
Exemplo de adição de ícone em um item de menu:
|
121
|
+
```ruby
|
122
|
+
primary.item :pendencias, 'Pendências', '#', :icon => 'glyphicon-warning-sign'
|
123
|
+
```
|
124
|
+
|
125
|
+
Exemplo de adição de ícone em um item de menu e submenu:
|
126
|
+
```ruby
|
127
|
+
primary.item :pendencias, 'Pendências', '#', :icon => 'glyphicon-warning-sign' do |sub_nav|
|
128
|
+
sub_nav.item :pend1, 'Indicadores', calendario_pivot_path, :icon => 'glyphicon-tasks'
|
129
|
+
sub_nav.item :pend2, 'Listagem', calendario_pendencias_path, :icon => 'glyphicon-list-alt'
|
130
|
+
end
|
131
|
+
```
|
132
|
+
|
133
|
+
### Renderizando o menu
|
134
|
+
|
135
|
+
A gem `Taxweb::Frontend` possui um renderer customizado do `SimpleNavigation`, gerando um menu vertical, estilo sidebar, com a funcionalidade de accordion, utilizando o plugin javascript `collapse` do `Bootstrap`.
|
136
|
+
|
137
|
+
O layout padrão do `Taxweb::Frontend` já utiliza este menu. Não será necessário adicionar este menu, caso você já utilize o layout do `Taxweb::Frontend`, como descrito acima.
|
138
|
+
|
139
|
+
Caso você não utilize o layout do `Taxweb::Frontend`, ainda é possível utilizar este menu. Para utilizar este menu de navegação sem o layout do `Taxweb::Frontend`, renderize na sua view ou layout o menu `SimpleNavigation` da seguinte forma:
|
140
|
+
|
141
|
+
```ruby
|
142
|
+
render_navigation :expand_all => true, :renderer => :sidebar
|
143
|
+
```
|
144
|
+
|
145
|
+
|
146
|
+
## Contributing
|
147
|
+
|
148
|
+
1. Fork it ( https://github.com/[my-github-username]/taxweb-frontend/fork )
|
149
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
150
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
151
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
152
|
+
5. Create a new Pull Request
|
Binary file
|
@@ -0,0 +1,45 @@
|
|
1
|
+
//= require bootstrap-sprockets
|
2
|
+
|
3
|
+
$(function() {
|
4
|
+
$('#app-nav .accordion').on('show.bs.collapse', function (e) {
|
5
|
+
var actives = $(e.currentTarget).parent().find('li:not(.selected)').has('.in, .collapsing').find('.in, .collapsing');
|
6
|
+
|
7
|
+
console.log(actives.length);
|
8
|
+
|
9
|
+
if (actives && actives.length) {
|
10
|
+
var hasData = actives.data('bs.collapse');
|
11
|
+
if (hasData && hasData.transitioning) {
|
12
|
+
e.preventDefault();
|
13
|
+
return false;
|
14
|
+
}
|
15
|
+
actives.collapse('hide');
|
16
|
+
hasData || actives.data('bs.collapse', null);
|
17
|
+
}
|
18
|
+
|
19
|
+
var accordion = $(e.target).closest('.accordion');
|
20
|
+
accordion.addClass('active');
|
21
|
+
|
22
|
+
|
23
|
+
});
|
24
|
+
|
25
|
+
|
26
|
+
$('#app-nav .accordion').on('hidden.bs.collapse', function (e) {
|
27
|
+
var accordion = $(e.target).closest('.accordion');
|
28
|
+
accordion.removeClass('active');
|
29
|
+
accordion.children('a').blur();
|
30
|
+
});
|
31
|
+
|
32
|
+
$('#app-nav .accordion > a').on('click', function (e) {
|
33
|
+
e.preventDefault();
|
34
|
+
});
|
35
|
+
|
36
|
+
$('#app-nav a.selected').on('click', function (e) {
|
37
|
+
e.preventDefault();
|
38
|
+
return false;
|
39
|
+
});
|
40
|
+
|
41
|
+
$('#context .dropdown').on('hidden.bs.dropdown', function (e) {
|
42
|
+
$(e.target).children('a').blur();
|
43
|
+
});
|
44
|
+
|
45
|
+
});
|
@@ -0,0 +1,224 @@
|
|
1
|
+
@import "taxweb-frontend/variables";
|
2
|
+
@import "bootstrap-sprockets";
|
3
|
+
@import "bootstrap";
|
4
|
+
@import "taxweb-frontend/sidebar";
|
5
|
+
|
6
|
+
// Novo Layout
|
7
|
+
html, body {
|
8
|
+
height: 100%;
|
9
|
+
}
|
10
|
+
|
11
|
+
body {
|
12
|
+
padding-top: ($padding-large-horizontal * 2) + $context-line-height + $userbar-height;
|
13
|
+
padding-left: $sidebar-width;
|
14
|
+
}
|
15
|
+
|
16
|
+
.table > thead > tr > th, .table > thead > tr > td, .table > tbody > tr > th, .table > tbody > tr > td, .table > tfoot > tr > th, .table > tfoot > tr > td {
|
17
|
+
vertical-align: middle;
|
18
|
+
}
|
19
|
+
|
20
|
+
#content {
|
21
|
+
height: 100%;
|
22
|
+
padding: 20px 40px;
|
23
|
+
overflow: auto;
|
24
|
+
}
|
25
|
+
|
26
|
+
#context {
|
27
|
+
font-size: $font-size-large;
|
28
|
+
line-height: $context-line-height;
|
29
|
+
color: $navbar-default-link-color;
|
30
|
+
border-bottom-width: 1px;
|
31
|
+
border-bottom-style: solid;
|
32
|
+
top: $userbar-height;
|
33
|
+
z-index: 100;
|
34
|
+
}
|
35
|
+
|
36
|
+
#context .navbar-header {
|
37
|
+
position: relative;
|
38
|
+
width: $sidebar-width;
|
39
|
+
border-right: 1px solid $navbar-default-border;
|
40
|
+
height: $context-height;
|
41
|
+
}
|
42
|
+
|
43
|
+
#context .navbar-header .navbar-brand {
|
44
|
+
float: none;
|
45
|
+
margin: 0px auto;
|
46
|
+
}
|
47
|
+
|
48
|
+
#context a {
|
49
|
+
color: $navbar-default-link-color;
|
50
|
+
text-decoration: none;
|
51
|
+
line-height: $context-line-height;
|
52
|
+
}
|
53
|
+
|
54
|
+
#context .navbar-brand img {
|
55
|
+
margin-top: -10px;
|
56
|
+
}
|
57
|
+
|
58
|
+
#context .dropdown > a > span {
|
59
|
+
font-size: 14px;
|
60
|
+
}
|
61
|
+
|
62
|
+
#context .dropdown-link {
|
63
|
+
float: left;
|
64
|
+
padding-right: $navbar-padding-vertical * 3/2;
|
65
|
+
padding-left: $navbar-padding-vertical * 3/2;
|
66
|
+
}
|
67
|
+
|
68
|
+
#context .dropdown-link.bordered {
|
69
|
+
border-right: 1px solid $navbar-default-border;
|
70
|
+
border-left: 1px solid $navbar-default-border;
|
71
|
+
}
|
72
|
+
|
73
|
+
#context .dropdown-menu {
|
74
|
+
min-width: 411px;
|
75
|
+
max-height: 75vh;
|
76
|
+
padding: 0px;
|
77
|
+
border-radius: 0px;
|
78
|
+
border: none;
|
79
|
+
overflow: auto;
|
80
|
+
@include box-shadow(6px 12px 12px rgba(0,0,0,.175));
|
81
|
+
}
|
82
|
+
|
83
|
+
#context .dropdown-menu ul {
|
84
|
+
list-style: none;
|
85
|
+
padding: 0px;
|
86
|
+
}
|
87
|
+
|
88
|
+
#context .dropdown-menu ul li a {
|
89
|
+
padding-left: 40px;
|
90
|
+
}
|
91
|
+
|
92
|
+
#context .dropdown-menu li a {
|
93
|
+
padding: $nav-link-padding;
|
94
|
+
display: block;
|
95
|
+
clear: both;
|
96
|
+
white-space: nowrap;
|
97
|
+
}
|
98
|
+
|
99
|
+
#context .dropdown-menu li a:hover {
|
100
|
+
background-color: rgba(0, 0, 0, 0.1);
|
101
|
+
}
|
102
|
+
|
103
|
+
#context .dropdown-menu > li {
|
104
|
+
background-color: $navbar-default-link-hover-bg;
|
105
|
+
}
|
106
|
+
|
107
|
+
#context p {
|
108
|
+
line-height: $context-line-height - 2;
|
109
|
+
}
|
110
|
+
|
111
|
+
#context .navbar-right {
|
112
|
+
margin-right: 40px;
|
113
|
+
}
|
114
|
+
|
115
|
+
.page-header:first-child {
|
116
|
+
margin-top: 0px;
|
117
|
+
}
|
118
|
+
|
119
|
+
|
120
|
+
// Override o responsive do bootstrap para o #context navbar
|
121
|
+
|
122
|
+
.navbar-header {
|
123
|
+
float: left;
|
124
|
+
}
|
125
|
+
|
126
|
+
#context .navbar-nav {
|
127
|
+
float: left;
|
128
|
+
margin: 0px;
|
129
|
+
}
|
130
|
+
|
131
|
+
#context .navbar-nav a {
|
132
|
+
padding-top: 15px;
|
133
|
+
padding-bottom:15px;
|
134
|
+
}
|
135
|
+
|
136
|
+
#context .navbar-nav .open .dropdown-menu {
|
137
|
+
position: absolute;
|
138
|
+
float: left;
|
139
|
+
background-color: $navbar-default-bg;
|
140
|
+
top: $context-height;
|
141
|
+
}
|
142
|
+
|
143
|
+
.navbar-right {
|
144
|
+
float: right !important;
|
145
|
+
}
|
146
|
+
|
147
|
+
.navbar-collapse.collapse {
|
148
|
+
display: block;
|
149
|
+
margin: 0px;
|
150
|
+
}
|
151
|
+
|
152
|
+
.navbar-collapse.collapse .navbar-nav {
|
153
|
+
margin: 0px;
|
154
|
+
}
|
155
|
+
|
156
|
+
|
157
|
+
// Alteração paliativa de Nav Bar
|
158
|
+
|
159
|
+
nav.userbar {
|
160
|
+
font-size: $font-size-small;
|
161
|
+
min-height: $userbar-height;
|
162
|
+
}
|
163
|
+
|
164
|
+
nav.userbar .navbar-nav.navbar-right:last-child {
|
165
|
+
margin-right: 25px;
|
166
|
+
}
|
167
|
+
|
168
|
+
nav.userbar .navbar-nav a, nav.userbar .navbar-header {
|
169
|
+
padding: 5px 10px 5px 10px;
|
170
|
+
}
|
171
|
+
|
172
|
+
nav.userbar .navbar-header {
|
173
|
+
width: $sidebar-width;
|
174
|
+
text-align: center;
|
175
|
+
}
|
176
|
+
|
177
|
+
nav.userbar .dropdown-menu {
|
178
|
+
background-color: $navbar-inverse-bg;
|
179
|
+
border-color: $navbar-inverse-border;
|
180
|
+
}
|
181
|
+
|
182
|
+
nav.userbar .dropdown-menu li a:hover {
|
183
|
+
background-color: rgba(0,0,0,0.5);
|
184
|
+
}
|
185
|
+
|
186
|
+
// End Alteração paliativa de Nav Bar
|
187
|
+
|
188
|
+
.nav > li > a:focus {
|
189
|
+
background-color: transparent;
|
190
|
+
}
|
191
|
+
|
192
|
+
.navbar-default .navbar-nav > li > a.no-hover:hover, .navbar-default .navbar-nav > li > a.no-hover:focus {
|
193
|
+
background-color: transparent;
|
194
|
+
}
|
195
|
+
|
196
|
+
.navbar-default .navbar-nav > .open > a.no-hover, .navbar-default .navbar-nav > .open > a.no-hover:hover, .navbar-default .navbar-nav > .open > a.no-hover:focus {
|
197
|
+
background-color: transparent;
|
198
|
+
}
|
199
|
+
|
200
|
+
.table thead th {
|
201
|
+
background-color: $gray-lighter;
|
202
|
+
color: $gray;
|
203
|
+
}
|
204
|
+
|
205
|
+
.page-header h1, .page-header h2, .page-header h3, .page-header h4, .page-header h5, .page-header h6 {
|
206
|
+
margin: 0px;
|
207
|
+
}
|
208
|
+
|
209
|
+
.actions {
|
210
|
+
margin-bottom: $line-height-computed;
|
211
|
+
}
|
212
|
+
|
213
|
+
.table > tbody > tr > td.h3 {
|
214
|
+
line-height: 1;
|
215
|
+
}
|
216
|
+
|
217
|
+
// End Novo Layout
|
218
|
+
|
219
|
+
|
220
|
+
// Remove dotted outline from links in Firefox and old IE
|
221
|
+
a:focus {
|
222
|
+
outline: 0;
|
223
|
+
}
|
224
|
+
|
@@ -0,0 +1,98 @@
|
|
1
|
+
// Custom variables
|
2
|
+
@import "variables";
|
3
|
+
|
4
|
+
$sidebar-width: 180px !default;
|
5
|
+
$sidebar-bg: $navbar-default-bg !default;
|
6
|
+
$sidebar-text-color: $navbar-default-link-color !default;
|
7
|
+
$sidebar-border-color: $navbar-default-border !default;
|
8
|
+
$sidebar-link-hover-bg: $navbar-default-link-hover-bg !default;
|
9
|
+
$sidebar-link-height: 18px !default;
|
10
|
+
$sidebar-link-padding: $padding-large-vertical $padding-large-horizontal !default;
|
11
|
+
|
12
|
+
$context-line-height: 24px !default;
|
13
|
+
$context-height: $context-line-height + ($navbar-padding-vertical * 2) !default;
|
14
|
+
$userbar-height: 30px !default;
|
15
|
+
|
16
|
+
|
17
|
+
// Sidebar Navbar
|
18
|
+
|
19
|
+
.sidebar {
|
20
|
+
position: absolute;
|
21
|
+
height: 100%;
|
22
|
+
width: $sidebar-width;
|
23
|
+
padding-top: ($navbar-padding-horizontal * 2) + $context-line-height + $userbar-height;
|
24
|
+
top: 0;
|
25
|
+
border-radius: 0;
|
26
|
+
border-bottom: 0px;
|
27
|
+
border-top: 0px;
|
28
|
+
font-size: $font-size-small;
|
29
|
+
background-color: $sidebar-bg;
|
30
|
+
z-index: 10;
|
31
|
+
}
|
32
|
+
|
33
|
+
.sidebar > .sidebar-nav {
|
34
|
+
width: 100%;
|
35
|
+
}
|
36
|
+
|
37
|
+
.sidebar-nav > li, .sidebar-header {
|
38
|
+
float: none;
|
39
|
+
border-bottom: 1px solid $sidebar-border-color;
|
40
|
+
border-right: 1px solid $sidebar-border-color;
|
41
|
+
}
|
42
|
+
|
43
|
+
.sidebar-nav > li a {
|
44
|
+
color: $sidebar-text-color;
|
45
|
+
padding: $sidebar-link-padding;
|
46
|
+
}
|
47
|
+
|
48
|
+
.sidebar-nav li a:hover, .sidebar-nav li.active, .sidebar-nav li.selected {
|
49
|
+
background-color: $sidebar-link-hover-bg;
|
50
|
+
}
|
51
|
+
|
52
|
+
.sidebar-nav li a:hover, .sidebar-nav li.selected:not(.accordion) a {
|
53
|
+
border-right: 3px solid;
|
54
|
+
padding-right: $padding-large-horizontal - 3px;
|
55
|
+
}
|
56
|
+
|
57
|
+
.sidebar-nav li.selected:not(.accordion) a {
|
58
|
+
border-color: $brand-primary;
|
59
|
+
}
|
60
|
+
|
61
|
+
.sidebar-nav li.active > a, .sidebar-nav li.selected > a {
|
62
|
+
background-color: transparent;
|
63
|
+
}
|
64
|
+
|
65
|
+
.sidebar-fixed-left {
|
66
|
+
left: 0;
|
67
|
+
}
|
68
|
+
|
69
|
+
.sidebar-nav > li .glyphicon {
|
70
|
+
margin-right: 3px;
|
71
|
+
}
|
72
|
+
|
73
|
+
.sidebar-nav > li .accordion-icon {
|
74
|
+
opacity: 0.5;
|
75
|
+
margin: 0px;
|
76
|
+
float: right;
|
77
|
+
}
|
78
|
+
|
79
|
+
.sidebar-nav > li.accordion:not(.selected) a.collapsed .accordion-icon.glyphicon-chevron-down, .sidebar-nav > li.accordion a:not(.collapsed) .accordion-icon.glyphicon-chevron-right, .sidebar-nav > li.accordion.selected a .accordion-icon.glyphicon-chevron-right {
|
80
|
+
display: none;
|
81
|
+
}
|
82
|
+
|
83
|
+
.sidebar-nav > li.selected .accordion-icon.glyphicon-chevron-down, .sidebar-nav > li.active .accordion-icon.glyphicon-chevron-down {
|
84
|
+
display: inline;
|
85
|
+
}
|
86
|
+
|
87
|
+
.sidebar-nav > li > ul > li > a {
|
88
|
+
padding-left: 30px;
|
89
|
+
}
|
90
|
+
|
91
|
+
.sidebar-header {
|
92
|
+
padding: $nav-link-padding;
|
93
|
+
text-align: center;
|
94
|
+
}
|
95
|
+
|
96
|
+
.sidebar-nav .selected .collapse {
|
97
|
+
@extend .in;
|
98
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
$body-bg: #f0f0ec !default;
|
2
|
+
|
3
|
+
$gray-light: darken($body-bg, 13.7%);
|
4
|
+
$gray-lighter: darken($body-bg, 6.5%);
|
5
|
+
|
6
|
+
$brand-primary: #2980B9 !default;
|
7
|
+
|
8
|
+
|
9
|
+
$navbar-default-color: #fff;
|
10
|
+
$navbar-default-bg: $brand-primary;
|
11
|
+
$navbar-default-border: desaturate(lighten($navbar-default-bg, 12%), 12%) !default;
|
12
|
+
|
13
|
+
$navbar-default-link-color: #fff;
|
14
|
+
$navbar-default-link-hover-color: #fff;
|
15
|
+
$navbar-default-link-hover-bg: rgba(0,0,0,0.05);
|
16
|
+
$navbar-default-link-active-color: $navbar-default-link-hover-color;
|
17
|
+
$navbar-default-link-active-bg: $navbar-default-link-hover-bg;
|
18
|
+
$navbar-default-link-disabled-color: ligthen($navbar-default-bg, 25%);
|
19
|
+
|
20
|
+
$navbar-default-brand-hover-color: $navbar-default-link-color !default;
|
21
|
+
$navbar-default-brand-hover-bg: transparent !default;
|
22
|
+
|
23
|
+
$navbar-inverse-bg: #333;
|
24
|
+
$navbar-inverse-border: darken($navbar-inverse-bg, 5%) !default;
|
25
|
+
|
26
|
+
$dropdown-bg: $navbar-default-bg;
|
27
|
+
$dropdown-border: $navbar-default-border;
|
28
|
+
$dropdown-divider-bg: $navbar-default-bg;
|
29
|
+
$dropdown-link-color: $navbar-default-link-color;
|
30
|
+
$dropdown-link-hover-color: $navbar-default-link-hover-color;
|
31
|
+
$dropdown-link-hover-bg: $navbar-default-link-hover-bg;
|
32
|
+
$dropdown-link-active-color: $navbar-default-link-hover-color;
|
33
|
+
$dropdown-link-active-bg: $navbar-default-link-hover-color;
|
34
|
+
|
35
|
+
$sidebar-bg: rgba(0, 0, 0, 0.05);
|
36
|
+
$sidebar-text-color: #666;
|
37
|
+
$sidebar-border-color: rgba(0, 0, 0, 0.25);
|
@@ -0,0 +1,15 @@
|
|
1
|
+
%nav.navbar.navbar-default.navbar-fixed-top.navbar-inverse.userbar
|
2
|
+
.navbar-header
|
3
|
+
%a{ :href => 'http://taxweb.com.br', :target => '_blank' }
|
4
|
+
= image_tag 'logo_taxweb.png'
|
5
|
+
.collapse.navbar-collapse
|
6
|
+
%ul.nav.navbar-nav.navbar-right
|
7
|
+
- if user_signed_in?
|
8
|
+
%li.dropdown
|
9
|
+
%a.dropdown{ :data => { toggle: 'dropdown'}, :href => "#" }
|
10
|
+
%span.hidden-xs Bem Vindo
|
11
|
+
=current_user.name || current_user.email
|
12
|
+
%b.caret
|
13
|
+
%ul.dropdown-menu
|
14
|
+
%li= link_to 'Seus dados', edit_user_path(current_user, path: "registration")
|
15
|
+
%li= link_to 'Sair', destroy_user_session_path, :method => 'delete'
|
@@ -0,0 +1,6 @@
|
|
1
|
+
-# Rails flash messages styled for Bootstrap 3.0
|
2
|
+
- flash.each do |name, msg|
|
3
|
+
- if msg.is_a?(String)
|
4
|
+
%div{:class => "alert alert-#{name.to_s == 'notice' ? 'success' : 'danger'}"}
|
5
|
+
%button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "button"} ×
|
6
|
+
= content_tag :div, msg, :id => "flash_#{name}"
|
@@ -0,0 +1,20 @@
|
|
1
|
+
!!!
|
2
|
+
%html
|
3
|
+
%head
|
4
|
+
%meta{charset: "utf-8", 'http-equiv'=>"Content-Language", content: "pt-BR"}
|
5
|
+
%meta{:name => "viewport", :content => "width=device-width, initial-scale=1.0"}
|
6
|
+
%title= app_title + yield(:title)
|
7
|
+
%meta{:name => "description", :content => yield(:description) }
|
8
|
+
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
|
9
|
+
= javascript_include_tag 'application', 'data-turbolinks-track' => true
|
10
|
+
= csrf_meta_tags
|
11
|
+
= favicon_link_tag 'favicon.png'
|
12
|
+
%body{"data-controller" => "#{controller.controller_name}", "data-action" => "#{controller.action_name}"}
|
13
|
+
= render 'layouts/taxweb-frontend/brand_menu'
|
14
|
+
%header#context.navbar.navbar-default.navbar-fixed-top
|
15
|
+
= yield :context
|
16
|
+
%nav.sidebar.sidebar-fixed-left
|
17
|
+
= yield :navigation
|
18
|
+
%main#content.container-fluid{:role => "main"}
|
19
|
+
= render 'layouts/taxweb-frontend/messages'
|
20
|
+
= yield
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module SimpleNavigation
|
2
|
+
module Renderer
|
3
|
+
class Sidebar < SimpleNavigation::Renderer::Base
|
4
|
+
def render(item_container)
|
5
|
+
if skip_if_empty? && item_container.empty?
|
6
|
+
''
|
7
|
+
else
|
8
|
+
tag = options[:ordered] ? :ol : :ul
|
9
|
+
content = list_content(item_container)
|
10
|
+
content_tag(tag, content, item_container.dom_attributes)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def list_content(item_container)
|
17
|
+
item_container.items.map { |item|
|
18
|
+
li_options = item.html_options.except(*[:link, :icon])
|
19
|
+
li_options[:class] = [li_options[:class], 'accordion'].flatten.compact.join(' ') if include_sub_navigation?(item)
|
20
|
+
item_options = item.html_options
|
21
|
+
item_options.merge!({ 'data-parent' => "##{item_container.dom_id}" }) if include_sub_navigation?(item)
|
22
|
+
item_options.merge!({ 'data-target' => "##{item_container.dom_id}-#{item_options[:id]}" }) if include_sub_navigation?(item)
|
23
|
+
item_options.merge!({ 'data-toggle' => "collapse" }) if include_sub_navigation?(item)
|
24
|
+
item_options.merge!({ :class => "collapsed" }) if include_sub_navigation?(item) && !item.selected?
|
25
|
+
li_content = tag_for(item, item_options)
|
26
|
+
if include_sub_navigation?(item)
|
27
|
+
item.sub_navigation.dom_id = [item.sub_navigation.dom_id, "#{item_container.dom_id}-#{item_options[:id]}"].flatten.compact.join(' ')
|
28
|
+
item.sub_navigation.dom_class = [item.sub_navigation.dom_class, 'nav collapse'].flatten.compact.join(' ')
|
29
|
+
li_content << render_sub_navigation_for(item)
|
30
|
+
end
|
31
|
+
content_tag(:li, li_content, li_options)
|
32
|
+
}.join
|
33
|
+
end
|
34
|
+
|
35
|
+
def tag_for(item, options = {})
|
36
|
+
icon = options.delete(:icon)
|
37
|
+
if suppress_link?(item)
|
38
|
+
content_tag('span', item.name, link_options_for(item).except(:method))
|
39
|
+
else
|
40
|
+
item.name.insert(0, "#{content_tag('span', '', { :class => "glyphicon #{icon}" })}\n") if icon
|
41
|
+
item.name << content_tag('span', '', { :class => "accordion-icon glyphicon glyphicon-chevron-right" }) if include_sub_navigation?(item)
|
42
|
+
item.name << content_tag('span', '', { :class => "accordion-icon glyphicon glyphicon-chevron-down" }) if include_sub_navigation?(item)
|
43
|
+
link_to(item.name.html_safe, item.url, options.except(:icon))
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require "taxweb/frontend/version"
|
2
|
+
require "haml"
|
3
|
+
require "bootstrap-sass"
|
4
|
+
require "simple-navigation"
|
5
|
+
require "simple_navigation/renderer/sidebar"
|
6
|
+
|
7
|
+
module Taxweb
|
8
|
+
module Frontend
|
9
|
+
module Rails
|
10
|
+
class Engine < ::Rails::Engine
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
SimpleNavigation.register_renderer sidebar: SimpleNavigation::Renderer::Sidebar
|
metadata
ADDED
@@ -0,0 +1,163 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: taxweb-frontend
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.7
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Filipe Abreu
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-12-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.7'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bootstrap-sass
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 3.2.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 3.2.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: sass-rails
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.2'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.2'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: simple-navigation
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: railties
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.0'
|
90
|
+
- - "<"
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '5.0'
|
93
|
+
type: :runtime
|
94
|
+
prerelease: false
|
95
|
+
version_requirements: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '3.0'
|
100
|
+
- - "<"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '5.0'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: haml-rails
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
type: :runtime
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
description:
|
118
|
+
email:
|
119
|
+
- filabreu@gmail.com
|
120
|
+
executables: []
|
121
|
+
extensions: []
|
122
|
+
extra_rdoc_files: []
|
123
|
+
files:
|
124
|
+
- LICENSE.txt
|
125
|
+
- README.md
|
126
|
+
- app/assets/images/logo_taxweb.png
|
127
|
+
- app/assets/javascripts/taxweb-frontend.js
|
128
|
+
- app/assets/stylesheets/taxweb-frontend.scss
|
129
|
+
- app/assets/stylesheets/taxweb-frontend/_sidebar.scss
|
130
|
+
- app/assets/stylesheets/taxweb-frontend/_variables.scss
|
131
|
+
- app/controllers/taxweb_frontend_controller.rb
|
132
|
+
- app/helpers/taxweb_frontend_helper.rb
|
133
|
+
- app/views/layouts/taxweb-frontend/_brand_menu.html.haml
|
134
|
+
- app/views/layouts/taxweb-frontend/_messages.html.haml
|
135
|
+
- app/views/layouts/taxweb_frontend.html.haml
|
136
|
+
- lib/simple_navigation/renderer/sidebar.rb
|
137
|
+
- lib/taxweb/frontend.rb
|
138
|
+
- lib/taxweb/frontend/version.rb
|
139
|
+
homepage: https://github.com/taxweb/taxweb-frontend
|
140
|
+
licenses:
|
141
|
+
- MIT
|
142
|
+
metadata: {}
|
143
|
+
post_install_message:
|
144
|
+
rdoc_options: []
|
145
|
+
require_paths:
|
146
|
+
- lib
|
147
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - ">="
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '0'
|
152
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
|
+
requirements:
|
154
|
+
- - ">="
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
version: '0'
|
157
|
+
requirements: []
|
158
|
+
rubyforge_project:
|
159
|
+
rubygems_version: 2.2.2
|
160
|
+
signing_key:
|
161
|
+
specification_version: 4
|
162
|
+
summary: Base de front-end para todas as aplicações da TaxWeb
|
163
|
+
test_files: []
|