edgrid_rb 0.0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d4540d0d0a88733557f3bd6ee49499174f02d54f
4
+ data.tar.gz: 4fe53eeb15c7ac4216727fbd56c7e7afa20df927
5
+ SHA512:
6
+ metadata.gz: 542422c0a617090b28e69b13af25736a75e74b43e74a8d6ececc9a3ff1e42a03b91da55629fad173c9d8799cb23d9f798b82bcd6fc96b7f2c140925d411c3d11
7
+ data.tar.gz: 4f75f4b17a9efab14e02c90d8a10a60c7e5a4e5c9544cd38fe2e10b8a5ab9443a50d5902079c64e77e542924103a96651dd93ecc863543e039920d0d5db248fc
@@ -0,0 +1,15 @@
1
+ module MyEdgridHelper
2
+ ["hd","web","tablet","movil"].each do |device|
3
+ 1.upto(20) do |val|
4
+ new_val = val * 5
5
+ define_method("#{device}_#{new_val}") do |args = {}, &block|
6
+ args[:class] = args.has_key?(:class) ? "#{args[:class]} caja #{device}-#{new_val}" : "caja #{device}-#{new_val}"
7
+ attrs = args.map {|k,v| "#{k}='#{v}' " }.join(" ")
8
+ html= "<div #{attrs}>"
9
+ html+= capture(&block)
10
+ html+= "</div>"
11
+ html.html_safe
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,3 @@
1
+ module EdgridRb
2
+ VERSION = "0.0.1.0"
3
+ end
data/lib/edgrid_rb.rb ADDED
@@ -0,0 +1,14 @@
1
+ require "edgrid_rb/version"
2
+ require "edgrid_rb/my_edgrid_helper"
3
+ require 'rails'
4
+ require 'active_support/core_ext/numeric/time'
5
+ require 'active_support/dependencies'
6
+ module EdgridRb
7
+ class Engine < ::Rails::Engine
8
+ initializer "my_gem.include_view_helpers" do |app|
9
+ ActiveSupport.on_load :action_view do
10
+ include MyEdgridHelper
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,20 @@
1
+ // RWD Bases
2
+ *,
3
+ *:before,
4
+ *:after {
5
+ -webkit-box-sizing: border-box;
6
+ -moz-box-sizing: border-box;
7
+ box-sizing: border-box;
8
+ }
9
+
10
+ body {
11
+ font-family: sans-serif;
12
+ margin: 0;
13
+ padding: 0;
14
+ }
15
+
16
+ // Imágenes responsive
17
+ img {
18
+ max-width: 100%;
19
+ height: auto;
20
+ }
@@ -0,0 +1,13 @@
1
+ // Modo cuadricula, se usa cuando se quiere hacer una rejilla
2
+ .grupo.cuadricula {
3
+ font-size: 0;
4
+ }
5
+
6
+ .grupo.cuadricula > .caja {
7
+ float: none;
8
+ display: inline-block;
9
+ font-size: 1rem;
10
+ }
11
+
12
+ // Mixin para crear cuadriculas
13
+ // Buscarlo en el archivo _mixins.scss
@@ -0,0 +1,103 @@
1
+ /* ESTILOS PARA DESARROLLO
2
+ ========================
3
+ Añada la clase "desarrollo"
4
+ a body para tener ayudas al trabajar con ED GRID
5
+ */
6
+ body.desarrollo {
7
+ padding : 0 !important;
8
+ margin : 0 !important;
9
+
10
+ &:before {
11
+ // Estilos para el mensaje en el top del body
12
+ background : steelblue; /*Azul Escuela Digital*/
13
+ color : #fff;
14
+ // Estilos de fuente
15
+ font-size : 18px;
16
+ font-weight : bold;
17
+ line-height : 36px;
18
+ text-align : center;
19
+ // Layout y caja
20
+ display : block;
21
+ height : 36px;
22
+ margin-bottom : 30px;
23
+ }
24
+
25
+ .grupo {
26
+ // El padding deja espacio para imprimir la clase
27
+ padding-top : 22px;
28
+ // Se separan los grupos para ver mejor el layout
29
+ margin-bottom : 10px;
30
+ // Identificar al grupo
31
+ outline: 1px solid tomato;
32
+
33
+ .caja{
34
+ // Color de fondo que identifica el modo desarrollo
35
+ // background : #eee;
36
+ // Para dar position absolute a las clases que se imprimen
37
+ position : relative;
38
+ // Espacio inferior para imprimir las clases
39
+ padding-bottom : 22px;
40
+ // Colorear los pares de otro color para diferenciar las cajas
41
+ &:nth-child(even){
42
+ background: rgba(steelblue,.2);
43
+ }
44
+ }
45
+
46
+ .grupo {
47
+ // Grupos dentro de grupos
48
+ margin-bottom : 0;
49
+ }
50
+ }
51
+ }
52
+
53
+ .desarrollo .grupo .caja:after,
54
+ .desarrollo .grupo:before{
55
+ // Imprimir las clases
56
+ content : attr(class);
57
+
58
+ // Diseño
59
+ font-style : italic;
60
+ font-size : 12px;
61
+ font-weight : normal;
62
+
63
+ // Layout
64
+ padding : 0 5px;
65
+ z-index : 1;
66
+ bottom : 0;
67
+ right : 0;
68
+ position : absolute;
69
+ display : table;
70
+ width : 100%;
71
+ height : 22px;
72
+ line-height : 22px;
73
+ }
74
+
75
+ .desarrollo .grupo:before{
76
+ background : rgba(tomato,.3);
77
+ color : tomato;
78
+ top : 0;
79
+ left : 0;
80
+ width : 100%;
81
+ }
82
+
83
+ .desarrollo .caja:after {
84
+ background: rgba(steelblue,.2);
85
+ color: steelblue;
86
+ }
87
+
88
+ .desarrollo .caja.total:after{
89
+ background: rgba(darken(steelblue,30%),.3);
90
+ }
91
+
92
+ // Mensajes de desarrollo
93
+ body.desarrollo:before {
94
+ content: "ED-GRID: Tamaño base";
95
+ }
96
+ // Loop para imprimir el mensaje de desarrollo basado en los breakpoints
97
+ @each $size, $screen-size in $breakpoints {
98
+ @include desde($size){
99
+ body.desarrollo:before{
100
+ content: "ED-GRID: Tamaño #{$size}, a partir de #{$screen-size}";
101
+ }
102
+ }
103
+ }
@@ -0,0 +1,47 @@
1
+ //Mixins para media queries
2
+ // El parámetro es el nombre del breakpoint
3
+ @mixin hasta($size){
4
+ @media screen and (max-width: map-get($breakpoints,$size) - 1){
5
+ @content;
6
+ }
7
+ }
8
+
9
+ @mixin desde($size){
10
+ @media screen and (min-width: map-get($breakpoints,$size)){
11
+ @content;
12
+ }
13
+ }
14
+
15
+ @mixin desde-hasta($desde,$hasta){
16
+ @media screen and (min-width: map-get($breakpoints,$desde)) and (max-width: map-get($breakpoints,$hasta) - 1){
17
+ @content;
18
+ }
19
+ }
20
+
21
+ // Mixins para cuadriculas
22
+ // Se aplica contendor de la cuadricula.
23
+ // Los parámetros son el selector de cada item y el número de columnas
24
+
25
+ @mixin cuadricula($items,$columnas){
26
+ font-size : 0;
27
+ margin : 0;
28
+ padding : 0;
29
+ list-style : none; // por si el contenedor es un ul
30
+
31
+ #{$items}, .#{$items}{
32
+ display : inline-block;
33
+ font-size : 1rem;
34
+ width : (100% / $columnas);
35
+ margin : 0 0 $caja--separacion;
36
+ padding-left : ($caja--separacion / 2);
37
+ padding-right : ($caja--separacion / 2);
38
+ vertical-align : top;
39
+ }
40
+ }
41
+
42
+ // Mixin para controlar el padding
43
+ // El parámetro es por cuanto se va a multiplicar el padding base.
44
+ @mixin padding($numero){
45
+ padding-left: ($caja--separacion / 2) * $numero;
46
+ padding-right: ($caja--separacion / 2) * $numero;
47
+ }
@@ -0,0 +1,106 @@
1
+ /*
2
+ GRUPOS Y CAJAS
3
+ ==============
4
+ Los grupos son contenedores para las cajas.
5
+ Las cajas crean las divisiones en el grupo (columnas)
6
+ */
7
+ .grupo {
8
+ position : relative;
9
+ max-width : $grupo--max-width;
10
+ width : 100%;
11
+ margin : 0 auto;
12
+
13
+ &.total {
14
+ max-width : 100% !important;
15
+ }
16
+
17
+ &:before, &:after {
18
+ content : "";
19
+ display : table;
20
+ width : 100%;
21
+ clear : both;
22
+ }
23
+
24
+ .caja {
25
+ float : left;
26
+ margin : 0;
27
+ padding-left : ($caja--separacion / 2);
28
+ padding-right : ($caja--separacion / 2);
29
+ width : 100%;
30
+
31
+ &:last-child{
32
+ float: right;
33
+ }
34
+ }
35
+
36
+ .caja.total {
37
+ float : none;
38
+ display : table;
39
+
40
+ &:before, &:after {
41
+ content : "";
42
+ display : table;
43
+ width : 100%;
44
+ clear : both;
45
+ }
46
+ }
47
+ }
48
+
49
+ // Modo tabla (alturas iguales para cada caja) **experimental, no es RWD**
50
+ .grupo.tabla {
51
+ display : table;
52
+
53
+ & > .caja {
54
+ float : none;
55
+ display : table-cell;
56
+ }
57
+
58
+ &.middle > .caja{
59
+ vertical-align: middle;
60
+ }
61
+
62
+ &.top > .caja {
63
+ vertical-align: top;
64
+ }
65
+
66
+ &.bottom > .caja {
67
+ vertical-align: bottom;
68
+ }
69
+ }
70
+
71
+ //Tamaño base en porcentajes
72
+ @for $i from 1 through 20 {
73
+ .grupo .base-#{$i*5}{
74
+ width: unquote($i*5 + "%");
75
+ }
76
+ }
77
+
78
+ // Tamaño base en fracciones
79
+ @each $fraccion-nombre, $fraccion in $fracciones{
80
+ @for $i from 1 through $fraccion{
81
+ .grupo .base-#{$i}-#{$fraccion}{
82
+ width: (100% / $fraccion) * $i;
83
+ }
84
+ }
85
+ }
86
+
87
+ // Breakpoints
88
+ @each $size, $screen-size in $breakpoints{
89
+ /*#{$size}: A partir de #{$screen-size}*/
90
+ @media all and (min-width: $screen-size){
91
+ /*Tamaños en porcentajes*/
92
+ @for $i from 1 through 20 {
93
+ .grupo .caja.#{$size}-#{$i*5}{
94
+ width: unquote($i*5 + "%");
95
+ }
96
+ }
97
+ /*Tamaño en fracciones*/
98
+ @each $fraccion-nombre, $fraccion in $fracciones{
99
+ @for $i from 1 through $fraccion{
100
+ .grupo .caja.#{$size}-#{$i}-#{$fraccion}{
101
+ width: (100% / $fraccion) * $i;
102
+ }
103
+ }
104
+ }
105
+ }
106
+ }
@@ -0,0 +1,47 @@
1
+ /*
2
+ ESTILOS DE LAYOUT
3
+ ==================
4
+ */
5
+ .centrar-caja{
6
+ display: block;
7
+ clear: both;
8
+ float: none !important;
9
+ margin: 0 auto !important;
10
+ }
11
+
12
+ .centrar-texto {
13
+ text-align: center;
14
+ }
15
+
16
+ .derecha-texto {
17
+ text-align: right;
18
+ }
19
+
20
+ .left, .izquierda {
21
+ float: left;
22
+ }
23
+
24
+ .right, .derecha {
25
+ float: right;
26
+ }
27
+
28
+ /* NO PADDING
29
+ ===========
30
+ class="no-padding" al grupo, le da padding cero a todas sus cajas.
31
+ class="no-padding" a la caja le da padding cero solo a ella
32
+ */
33
+ .no-padding.grupo > .caja,
34
+ .grupo > .no-padding {
35
+ padding: 0 !important;
36
+ }
37
+
38
+ /* Controlar el padding*/
39
+ .padding {
40
+ padding-left: ($caja--separacion / 2);
41
+ padding-right: ($caja--separacion / 2);
42
+ }
43
+
44
+ .doble-padding {
45
+ padding-left: $caja--separacion;
46
+ padding-right: $caja--separacion;
47
+ }
@@ -0,0 +1,31 @@
1
+ // Visibilidad
2
+ // solo-$size ya no se usa porque se puede conseguir
3
+ // combinando clases desde y hasta
4
+
5
+ // Visibilidad desde $size
6
+ @each $size, $screen-size in $breakpoints{
7
+ @media screen and (max-width: $screen-size - 1){
8
+ .desde-#{$size}{
9
+ display: none;
10
+ }
11
+ }
12
+ @media screen and (min-width: $screen-size){
13
+ .desde-#{$size}{
14
+ display: block;
15
+ }
16
+ }
17
+ }
18
+
19
+ // Visibilidad hasta $size
20
+ @each $size, $screen-size in $breakpoints{
21
+ @media screen and (max-width: $screen-size - 1){
22
+ .hasta-#{$size}{
23
+ display: block;
24
+ }
25
+ }
26
+ @media screen and (min-width: $screen-size){
27
+ .hasta-#{$size}{
28
+ display: none;
29
+ }
30
+ }
31
+ }
@@ -0,0 +1,33 @@
1
+ // VARIABLES DE ED GRID
2
+
3
+ // Ancho máximo de cada grupo
4
+ $grupo--max-width : 1100px;
5
+
6
+ // Separación entre cajas
7
+ $caja--separacion : 30px;
8
+
9
+ // Tamaños. Puede editar los nombres y las
10
+ // medidas, añadir más o quitar.
11
+ $breakpoints: (
12
+ movil : 480px,
13
+ tablet : 768px,
14
+ web : 1025px,
15
+ hd : 1400px
16
+ );
17
+
18
+ // Fracciones para los anchos de las cajas.
19
+ // También puede editarlos si desea
20
+ $fracciones: (
21
+ tercios : 3,
22
+ sextos : 6,
23
+ octavos : 8
24
+ );
25
+
26
+ // Componentes ED GRID
27
+ @import "componentes/base"; // Estilos básicos para RWD
28
+ @import "componentes/nucleo"; // Núcleo de ED GRID, grupos y cajas
29
+ @import "componentes/mixins"; // Mixins ED GRID
30
+ @import "componentes/cuadricula"; // Realizar cuadriculas
31
+ @import "componentes/desarrollo"; // Modo desarrollo
32
+ @import "componentes/visibilidad"; // Controlar la visibilidad
33
+ @import "componentes/utilidades"; // Utilidades adicionales
metadata ADDED
@@ -0,0 +1,119 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: edgrid_rb
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - zetanova
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-04-01 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.8'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.8'
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: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: railties
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 3.2.6
62
+ - - "<"
63
+ - !ruby/object:Gem::Version
64
+ version: '5'
65
+ type: :runtime
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: 3.2.6
72
+ - - "<"
73
+ - !ruby/object:Gem::Version
74
+ version: '5'
75
+ description: Allows you to include https://github.com/escueladigital/ed-grid in your
76
+ application alongside some view helper methods
77
+ email:
78
+ - carlosmontalvo@zetanova.com
79
+ executables: []
80
+ extensions: []
81
+ extra_rdoc_files: []
82
+ files:
83
+ - lib/edgrid_rb.rb
84
+ - lib/edgrid_rb/my_edgrid_helper.rb
85
+ - lib/edgrid_rb/version.rb
86
+ - vendor/assets/css/componentes/_base.scss
87
+ - vendor/assets/css/componentes/_cuadricula.scss
88
+ - vendor/assets/css/componentes/_desarrollo.scss
89
+ - vendor/assets/css/componentes/_mixins.scss
90
+ - vendor/assets/css/componentes/_nucleo.scss
91
+ - vendor/assets/css/componentes/_utilidades.scss
92
+ - vendor/assets/css/componentes/_visibilidad.scss
93
+ - vendor/assets/css/ed-grid.scss
94
+ homepage: https://github.com/zephiro/edgrid_rb
95
+ licenses:
96
+ - MIT
97
+ metadata:
98
+ allowed_push_host: https://rubygems.org
99
+ post_install_message:
100
+ rdoc_options: []
101
+ require_paths:
102
+ - lib
103
+ required_ruby_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ required_rubygems_version: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ requirements: []
114
+ rubyforge_project:
115
+ rubygems_version: 2.4.5
116
+ signing_key:
117
+ specification_version: 4
118
+ summary: Ruby wrapper for EdGrid
119
+ test_files: []