Skip to content

Commit 17b3676

Browse files
authored
Merge pull request #18 from PHPSP/comunidades
Faz tudo relativo a comunidades (e seus braços) mais configurável.
2 parents 42199bf + 28a053f commit 17b3676

File tree

6 files changed

+50
-27
lines changed

6 files changed

+50
-27
lines changed

config.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,28 @@
6969
'github', 'twitter', 'slack', 'linkedin', 'facebook',
7070
],
7171
],
72+
'branches' => [
73+
'sao_paulo' => [
74+
'title' => 'PHPSP São Paulo',
75+
'description' => 'Eventos na cidade de SP',
76+
'link' => 'https://www.meetup.com/php-sp/events/',
77+
],
78+
'campinas' => [
79+
'title' => 'PHPSP Campinas',
80+
'description' => 'Eventos na cidade de Campinas',
81+
'link' => 'https://www.meetup.com/phpsp-campinas/events/',
82+
],
83+
'santos' => [
84+
'title' => 'PHPSP Santos',
85+
'description' => 'Eventos na cidade de Santos',
86+
'link' => 'https://www.meetup.com/phpsp-santos/events/',
87+
],
88+
],
89+
'events' => [
90+
'php-sp',
91+
'phpsp-campinas',
92+
'phpsp-santos',
93+
],
7294
'sponsors' => [
7395
'azure' => [
7496
'title' => 'Microsoft Azure',

source/_assets/js/components/meetup-events.vue

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
required: true,
2424
type: String
2525
},
26+
groups: {
27+
required: true,
28+
type: Array
29+
},
2630
quantity: {
2731
type: Number,
2832
default: 3
@@ -38,10 +42,13 @@
3842
}
3943
},
4044
mounted() {
41-
let linksArr = [
42-
`${this.url}call/?group=php-sp&endpoint=events&photo-host=public&page=${this.quantity}&status=${this.status}`,
43-
`${this.url}call/?group=phpsp-campinas&endpoint=events&photo-host=public&page=${this.quantity}&status=${this.status}`,
44-
];
45+
let linksArr = [];
46+
47+
this.groups.forEach( group => {
48+
linksArr.push(
49+
`${this.url}call/?group=${group}&endpoint=events&photo-host=public&page=${this.quantity}&status=${this.status}`
50+
)
51+
});
4552
4653
let promiseArr = linksArr.map(link => fetch(link).then(response => response.json()));
4754
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
2-
<meetup-events url="{{ $page->meetup['baseUrl'] }}"></meetup-events>
1+
<meetup-events url="{{ $page->meetup['baseUrl'] }}" :groups={{ $page->events }}></meetup-events>

source/_partials/layout/navbar.blade.php

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,29 +61,16 @@
6161
<div class="navbar-item has-dropdown is-hoverable">
6262
<span class="navbar-link">Eventos</span>
6363
<div id="moreDropdown" class="navbar-dropdown">
64-
<a class="navbar-item" href="https://www.meetup.com/php-sp/events/" target="_blank">
64+
@foreach ($page->branches as $branch)
65+
<a class="navbar-item" href="{{ $branch->link }}" target="_blank">
6566
<span>
66-
<strong>PHPSP São Paulo</strong>
67+
<strong>{{ $branch->title }}</strong>
6768
<br>
68-
Eventos na cidade de SP
69-
</span>
70-
</a>
71-
72-
<a class="navbar-item" href="https://www.meetup.com/PHPSP-Campinas/events" target="_blank">
73-
<span>
74-
<strong>PHPSP Campinas</strong>
75-
<br>
76-
Eventos na cidade de Campinas
69+
{{ $branch->description }}
7770
</span>
7871
</a>
72+
@endforeach
7973

80-
<a class="navbar-item" href="https://www.meetup.com/PHPSP-Santos/events" target="_blank">
81-
<span>
82-
<strong>PHPSP Santos</strong>
83-
<br>
84-
Eventos na região de Santos
85-
</span>
86-
</a>
8774
<hr class="navbar-divider">
8875

8976
<a class="navbar-item " href="/codigo-de-conduta-para-eventos">

source/assets/build/js/main.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
9595
required: true,
9696
type: String
9797
},
98+
groups: {
99+
required: true,
100+
type: Array
101+
},
98102
quantity: {
99103
type: Number,
100104
default: 3
@@ -112,7 +116,11 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
112116
mounted: function mounted() {
113117
var _this = this;
114118

115-
var linksArr = [this.url + "call/?group=php-sp&endpoint=events&photo-host=public&page=" + this.quantity + "&status=" + this.status, this.url + "call/?group=phpsp-campinas&endpoint=events&photo-host=public&page=" + this.quantity + "&status=" + this.status];
119+
var linksArr = [];
120+
121+
this.groups.forEach(function (group) {
122+
linksArr.push(_this.url + "call/?group=" + group + "&endpoint=events&photo-host=public&page=" + _this.quantity + "&status=" + _this.status);
123+
});
116124

117125
var promiseArr = linksArr.map(function (link) {
118126
return fetch(link).then(function (response) {
@@ -146,7 +154,7 @@ exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/cs
146154

147155

148156
// module
149-
exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", ""]);
157+
exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", ""]);
150158

151159
// exports
152160

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"/js/main.js": "/js/main.js?id=81de86ab988037dfdafe",
2+
"/js/main.js": "/js/main.js?id=fbba2eec4cbc1eee29a7",
33
"/css/main.css": "/css/main.css?id=8e332df019faebca9398"
44
}

0 commit comments

Comments
 (0)