Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
frente-brasil-popular
Comite Nacional Lula Livre
Commits
ec492ba7
Commit
ec492ba7
authored
6 years ago
by
Henrique Marques
Browse files
Options
Download
Plain Diff
Merge branch 'develop'
parents
dce8d2ce
6bdf4b46
Pipeline
#7359
passed with stages
in 3 minutes and 51 seconds
Changes
14
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
265 additions
and
8 deletions
+265
-8
themes/comite-nacional-lula-livre/assets/images/map-icon.png
themes/comite-nacional-lula-livre/assets/images/map-icon.png
+0
-0
themes/comite-nacional-lula-livre/assets/images/map-icon2.png
...es/comite-nacional-lula-livre/assets/images/map-icon2.png
+0
-0
themes/comite-nacional-lula-livre/assets/javascript/app.js
themes/comite-nacional-lula-livre/assets/javascript/app.js
+27
-0
themes/comite-nacional-lula-livre/assets/scss/2--atoms/_a-positioning.scss
...ional-lula-livre/assets/scss/2--atoms/_a-positioning.scss
+4
-0
themes/comite-nacional-lula-livre/assets/scss/2--atoms/_a-typography.scss
...cional-lula-livre/assets/scss/2--atoms/_a-typography.scss
+2
-2
themes/comite-nacional-lula-livre/assets/scss/3--components/_c-mapa-cadastro.scss
...ula-livre/assets/scss/3--components/_c-mapa-cadastro.scss
+29
-0
themes/comite-nacional-lula-livre/assets/scss/4--layouts/_l-navigation.scss
...onal-lula-livre/assets/scss/4--layouts/_l-navigation.scss
+2
-2
themes/comite-nacional-lula-livre/assets/scss/foundation.scss
...es/comite-nacional-lula-livre/assets/scss/foundation.scss
+1
-0
themes/comite-nacional-lula-livre/dist/app.css
themes/comite-nacional-lula-livre/dist/app.css
+76
-2
themes/comite-nacional-lula-livre/dist/app.js
themes/comite-nacional-lula-livre/dist/app.js
+25
-0
themes/comite-nacional-lula-livre/functions.php
themes/comite-nacional-lula-livre/functions.php
+2
-1
themes/comite-nacional-lula-livre/header.php
themes/comite-nacional-lula-livre/header.php
+8
-1
themes/comite-nacional-lula-livre/library/pagebuilder-widgets/mapa-cadastro/mapa-cadastro.php
...brary/pagebuilder-widgets/mapa-cadastro/mapa-cadastro.php
+77
-0
themes/comite-nacional-lula-livre/library/pagebuilder-widgets/mapa-cadastro/tpl/template.php
...ibrary/pagebuilder-widgets/mapa-cadastro/tpl/template.php
+12
-0
No files found.
themes/comite-nacional-lula-livre/assets/images/map-icon.png
0 → 100644
View file @
ec492ba7
3.49 KB
This diff is collapsed.
Click to expand it.
themes/comite-nacional-lula-livre/assets/images/map-icon2.png
0 → 100644
View file @
ec492ba7
1.28 KB
This diff is collapsed.
Click to expand it.
themes/comite-nacional-lula-livre/assets/javascript/app.js
View file @
ec492ba7
...
...
@@ -16,6 +16,33 @@ jQuery(window).on('scroll', function(){
}
});
if
(
jQuery
(
'
#mapa-cadastro
'
).
length
>
0
){
var
mymap
=
L
.
map
(
'
mapa-cadastro
'
).
setView
([
-
16
,
-
57
],
4
);
L
.
tileLayer
(
'
https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw
'
,
{
maxZoom
:
18
,
attribution
:
'
Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors,
'
+
'
<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>,
'
+
'
Imagery © <a href="https://www.mapbox.com/">Mapbox</a>
'
,
id
:
'
mapbox.streets
'
}).
addTo
(
mymap
);
var
flagIcon
=
L
.
icon
({
iconUrl
:
'
/wp-content/themes/comite-nacional-lula-livre/assets/images/map-icon.png
'
,
shadowUrl
:
''
,
iconSize
:
[
30
,
30
],
// size of the icon
shadowSize
:
[
0
,
0
],
// size of the shadow
iconAnchor
:
[
15
,
15
],
// point of the icon which will correspond to marker's location
shadowAnchor
:
[
0
,
0
],
// the same for the shadow
popupAnchor
:
[
0
,
0
]
// point from which the popup should open relative to the iconAnchor
});
if
(
window
.
mapa_cadastro
){
window
.
mapa_cadastro
.
map
(
m
=>
{
let
marker
=
L
.
marker
([
m
.
latitude
,
m
.
longitude
],
{
icon
:
flagIcon
}).
addTo
(
mymap
);
})
}
}
window
.
fetchArt
=
function
(
id
){
jQuery
.
get
(
'
/art/
'
+
id
,
{},
function
(
response
){
jQuery
(
'
.modal-art--content
'
).
html
(
response
);
...
...
This diff is collapsed.
Click to expand it.
themes/comite-nacional-lula-livre/assets/scss/2--atoms/_a-positioning.scss
View file @
ec492ba7
...
...
@@ -71,4 +71,8 @@
.justify-content-end
{
justify-content
:
flex-end
;
}
.relative
{
position
:
relative
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
themes/comite-nacional-lula-livre/assets/scss/2--atoms/_a-typography.scss
View file @
ec492ba7
...
...
@@ -5,13 +5,13 @@
/*------------------------------------------------------------------------ */
// TYPOGRAPHY
@each
$font-size
in
(
8
,
11
,
13
,
1
5
,
17
,
20
,
26
,
32
,
42
,
50
)
{
@each
$font-size
in
(
8
,
11
,
13
,
1
4
,
15
,
16
,
17
,
18
,
19
,
20
,
26
,
32
,
42
,
50
)
{
.fz
#{
$font-size
}
{
font-size
:
#{
$font-size
}
px
;
}
}
@each
$line-height
,
$val
in
(
"1-2"
:
1
.2
,
"1-6"
:
1
.6
,
"2"
:
2
)
{
@each
$line-height
,
$val
in
(
"1-2"
:
1
.2
,
"1-
4"
:
1
.4
,
"1-
6"
:
1
.6
,
"2"
:
2
)
{
.lh
#{
$line-height
}
{
line-height
:
#{
$val
}
em
;
}
...
...
This diff is collapsed.
Click to expand it.
themes/comite-nacional-lula-livre/assets/scss/3--components/_c-mapa-cadastro.scss
0 → 100644
View file @
ec492ba7
.mapa-cadastro
{
#mapa-cadastro
{
height
:
480px
;
z-index
:
1
;
}
.left
{
position
:
absolute
;
top
:
50%
;
transform
:
translateY
(
-50%
);
z-index
:
10
;
max-width
:
40%
;
left
:
0
;
}
.right
{
position
:
relative
;
&
:before
{
content
:
''
;
position
:
absolute
;
height
:
100%
;
width
:
300px
;
top
:
0
;
left
:
0
;
z-index
:
9
;
background
:
linear-gradient
(
270deg
,
rgba
(
21
,
41
,
75
,
0
)
0%
,
rgba
(
21
,
41
,
75
,
0
.32
)
40%
,
#15294B
98%
);
pointer-events
:
none
;
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
themes/comite-nacional-lula-livre/assets/scss/4--layouts/_l-navigation.scss
View file @
ec492ba7
...
...
@@ -27,7 +27,7 @@ body{
align-items
:
center
;
transition
:
all
.6s
;
left
:
0
;
z-index
:
10
;
z-index
:
10
0
;
@include
mobile
{
left
:
-90vw
;
...
...
@@ -179,7 +179,7 @@ body{
width
:
100vw
;
background-color
:
#FFFFFF
;
box-shadow
:
0
2px
2px
0
rgba
(
0
,
0
,
0
,
0
.15
);
z-index
:
9
;
z-index
:
100
;
transition
:
all
.6s
;
top
:
0
;
position
:
fixed
;
...
...
This diff is collapsed.
Click to expand it.
themes/comite-nacional-lula-livre/assets/scss/foundation.scss
View file @
ec492ba7
...
...
@@ -119,6 +119,7 @@ $theme-root: '/wp-content/themes/comite-nacional-lula-livre';
@import
"3--components/c-art-card"
;
@import
"3--components/c-abra-comite"
;
@import
"3--components/c-banner-small"
;
@import
"3--components/c-mapa-cadastro"
;
// LAYOUT PARTS
@import
"4--layouts/l-navigation"
;
...
...
This diff is collapsed.
Click to expand it.
themes/comite-nacional-lula-livre/dist/app.css
View file @
ec492ba7
...
...
@@ -6828,14 +6828,30 @@ body {
font-size
:
13px
;
}
.fz14
{
font-size
:
14px
;
}
.fz15
{
font-size
:
15px
;
}
.fz16
{
font-size
:
16px
;
}
.fz17
{
font-size
:
17px
;
}
.fz18
{
font-size
:
18px
;
}
.fz19
{
font-size
:
19px
;
}
.fz20
{
font-size
:
20px
;
}
...
...
@@ -6860,6 +6876,10 @@ body {
line-height
:
1.2em
;
}
.lh1-4
{
line-height
:
1.4em
;
}
.lh1-6
{
line-height
:
1.6em
;
}
...
...
@@ -7115,6 +7135,10 @@ ul.nav {
justify-content
:
flex-end
;
}
.relative
{
position
:
relative
;
}
/* --------------------------------------------------------------------------
SPACING
-------------------------------------------------------------------------- */
...
...
@@ -7529,14 +7553,30 @@ ul.nav {
font-size
:
13px
;
}
.fz14
{
font-size
:
14px
;
}
.fz15
{
font-size
:
15px
;
}
.fz16
{
font-size
:
16px
;
}
.fz17
{
font-size
:
17px
;
}
.fz18
{
font-size
:
18px
;
}
.fz19
{
font-size
:
19px
;
}
.fz20
{
font-size
:
20px
;
}
...
...
@@ -7561,6 +7601,10 @@ ul.nav {
line-height
:
1.2em
;
}
.lh1-4
{
line-height
:
1.4em
;
}
.lh1-6
{
line-height
:
1.6em
;
}
...
...
@@ -9284,6 +9328,36 @@ body .em-calendar td ul li a {
color
:
white
;
}
.mapa-cadastro
#mapa-cadastro
{
height
:
480px
;
z-index
:
1
;
}
.mapa-cadastro
.left
{
position
:
absolute
;
top
:
50%
;
transform
:
translateY
(
-50%
);
z-index
:
10
;
max-width
:
40%
;
left
:
0
;
}
.mapa-cadastro
.right
{
position
:
relative
;
}
.mapa-cadastro
.right
:before
{
content
:
''
;
position
:
absolute
;
height
:
100%
;
width
:
300px
;
top
:
0
;
left
:
0
;
z-index
:
9
;
background
:
linear-gradient
(
270deg
,
rgba
(
21
,
41
,
75
,
0
)
0%
,
rgba
(
21
,
41
,
75
,
0.32
)
40%
,
#15294B
98%
);
pointer-events
:
none
;
}
/* --------------------------------------------------------------------------
NAVIGATION
-------------------------------------------------------------------------- */
...
...
@@ -9315,7 +9389,7 @@ body {
align-items
:
center
;
transition
:
all
.6s
;
left
:
0
;
z-index
:
10
;
z-index
:
10
0
;
}
@media
(
max-width
:
767px
)
{
...
...
@@ -9478,7 +9552,7 @@ body {
width
:
100vw
;
background-color
:
#FFFFFF
;
box-shadow
:
0
2px
2px
0
rgba
(
0
,
0
,
0
,
0.15
);
z-index
:
9
;
z-index
:
100
;
transition
:
all
.6s
;
top
:
0
;
position
:
fixed
;
...
...
This diff is collapsed.
Click to expand it.
themes/comite-nacional-lula-livre/dist/app.js
View file @
ec492ba7
...
...
@@ -11430,6 +11430,31 @@ jQuery(window).on('scroll', function () {
}
});
if (jQuery('#mapa-cadastro').length > 0) {
var mymap = L.map('mapa-cadastro').setView([-16, -57], 4);
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
maxZoom: 18,
attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, ' + '<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + 'Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
id: 'mapbox.streets'
}).addTo(mymap);
var flagIcon = L.icon({
iconUrl: '/wp-content/themes/comite-nacional-lula-livre/assets/images/map-icon.png',
shadowUrl: '',
iconSize: [30, 30], // size of the icon
shadowSize: [0, 0], // size of the shadow
iconAnchor: [15, 15], // point of the icon which will correspond to marker's location
shadowAnchor: [0, 0], // the same for the shadow
popupAnchor: [0, 0] // point from which the popup should open relative to the iconAnchor
});
if (window.mapa_cadastro) {
window.mapa_cadastro.map(function (m) {
var marker = L.marker([m.latitude, m.longitude], { icon: flagIcon }).addTo(mymap);
});
}
}
window.fetchArt = function (id) {
jQuery.get('/art/' + id, {}, function (response) {
jQuery('.modal-art--content').html(response);
This diff is collapsed.
Click to expand it.
themes/comite-nacional-lula-livre/functions.php
View file @
ec492ba7
...
...
@@ -18,7 +18,8 @@ add_action( 'after_setup_theme', function() {
}
);
function
lula_load_assets
()
{
wp_enqueue_style
(
'flickity-css'
,
get_template_directory_uri
()
.
'/dist/flickity.min.css'
);
wp_enqueue_script
(
'no-js'
,
get_stylesheet_directory_uri
()
.
'/no-js.js'
,
array
(
'jquery'
),
false
,
true
);
wp_enqueue_style
(
'flickity-css'
,
get_template_directory_uri
()
.
'/ dist/flickity.min.css'
);
wp_enqueue_style
(
'app'
,
get_template_directory_uri
()
.
'/dist/app.css'
,
[],
filemtime
(
__DIR__
.
'/dist/app.css'
)
);
// wp_enqueue_script( 'manifest', get_template_directory_uri() . '/dist/manifest.js', array('jquery'), '1.0.0', true);
// wp_enqueue_script( 'vendor', get_template_directory_uri() . '/dist/vendor.js', array('manifest'), '1.0.0', true);
...
...
This diff is collapsed.
Click to expand it.
themes/comite-nacional-lula-livre/header.php
View file @
ec492ba7
...
...
@@ -8,10 +8,17 @@
<?php
wp_head
()
?>
<title>
<?php
wp_title
()
?>
</title>
<link
rel=
"stylesheet"
href=
"https://unpkg.com/leaflet@1.4.0/dist/leaflet.css"
integrity=
"sha512-puBpdR0798OZvTTbP4A8Ix/l+A4dHDD0DGqYW6RQ+9jxkRFclaxxQb/SJAWZfWAkuyeQUytO7+7N4QKrDh+drA=="
crossorigin=
""
/>
<script
src=
"https://unpkg.com/leaflet@1.4.0/dist/leaflet.js"
integrity=
"sha512-QVftwZFqvtRNi0ZyCtsznlKSWOStnDORoefr1enyq5mVL4tmKB3S/EnC3rRJcxCPavG10IcrVGSmPh6Qw5lwrg=="
crossorigin=
""
></script>
<script
src=
"https://www.google.com/recaptcha/api.js?hl=pt-BR"
async
defer
></script>
</head>
<body
<?php
body_class
();
?>
>
<script
src=
"https://www.google.com/recaptcha/api.js?hl=pt-BR"
async
defer
></script>
<?php
if
(
is_page
()
&&
$slider
=
get_post_meta
(
get_the_ID
(),
'_page_slider_shortcode'
,
true
))
:
?>
<header
class=
"slider-revolution"
>
...
...
This diff is collapsed.
Click to expand it.
themes/comite-nacional-lula-livre/library/pagebuilder-widgets/mapa-cadastro/mapa-cadastro.php
0 → 100644
View file @
ec492ba7
<?php
/*
Widget Name: Mapa de Cadastros
Description: Adiciona um mapa que exibe os pins dos cadastros
Author: hacklab/
Author URI: https://hacklab.com.br/
*/
namespace
widgets
;
class
MapaCadastro
extends
\
SiteOrigin_Widget
{
function
__construct
()
{
$fields
=
[
'title'
=>
[
'type'
=>
'text'
,
'label'
=>
'Título'
,
'default'
=>
'Mapa de Comitês Lula Livre'
],
'description'
=>
[
'type'
=>
'text'
,
'label'
=>
'Descrição'
],
'button_text'
=>
[
'type'
=>
'text'
,
'label'
=>
'Título do Botão'
,
'default'
=>
'Cadastre seu comitê'
],
'button_link'
=>
[
'type'
=>
'text'
,
'label'
=>
'Link do Botão'
,
'default'
=>
'#mapa-cadastro'
],
];
parent
::
__construct
(
'mapa-cadastro'
,
'Mapa de Cadastros'
,
[
'panels_groups'
=>
[
WIDGETGROUP_MAIN
],
'description'
=>
'Adiciona um mapa com pins de cadastro'
],
[],
$fields
,
plugin_dir_path
(
__FILE__
)
);
}
function
get_template_variables
(
$instance
,
$args
)
{
$markers
=
[];
$markers_query
=
new
\
WP_Query
([
'post_type'
=>
'cadastros'
,
'posts_per_page'
=>
'-1'
,
]);
while
(
$markers_query
->
have_posts
()){
$markers_query
->
the_post
();
$markers
[]
=
[
'latitude'
=>
get_post_meta
(
get_the_ID
(),
'LATITUDE'
,
true
),
'longitude'
=>
get_post_meta
(
get_the_ID
(),
'LONGITUDE'
,
true
),
];
}
wp_localize_script
(
'no-js'
,
'mapa_cadastro'
,
$markers
);
return
[];
}
function
get_template_name
(
$instance
)
{
return
'template'
;
}
function
get_style_name
(
$instance
)
{
return
'style'
;
}
}
Siteorigin_widget_register
(
'mapa-cadastro'
,
__FILE__
,
'widgets\MapaCadastro'
);
This diff is collapsed.
Click to expand it.
themes/comite-nacional-lula-livre/library/pagebuilder-widgets/mapa-cadastro/tpl/template.php
0 → 100644
View file @
ec492ba7
<div
class=
"mapa-cadastro wrapper dark"
>
<div
class=
"row justify-content-end relative"
>
<div
class=
"left"
>
<h2
class=
"text-white section-title"
>
<?=
$instance
[
'title'
]
?>
</h2>
<p
class=
"text-white fz14 lh1-4"
>
<?=
$instance
[
'description'
]
?>
</p>
<a
href=
"
<?=
$instance
[
'button_link'
]
?>
"
class=
"button outline"
>
<?=
$instance
[
'button_text'
]
?>
</a>
</div>
<div
class=
"column large-8 right"
>
<div
id=
"mapa-cadastro"
></div>
</div>
</div>
</div>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment