Skip to content

Commit

Permalink
Merge pull request #2393 from fossasia/development
Browse files Browse the repository at this point in the history
  • Loading branch information
iamareebjamal authored Nov 12, 2020
2 parents 81d3e2c + 2281d84 commit 96a0511
Show file tree
Hide file tree
Showing 23 changed files with 1,736 additions and 1,511 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@ configmap.yml.secret
.tool-versions
.env
.vscode

package-lock.json
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
dist: xenial
dist: bionic
language: node_js
node_js:
- 12

services:
- docker
- redis
- xvfb

env:
- TESTFOLDER=test/serverTest.js
Expand All @@ -15,10 +16,7 @@ env:
- TESTFOLDER=test/sessionEventAndCoC.js

addons:
sauce_connect:
username: princu7
jwt:
secure: FslueGK2gtPHkRANMpUlGyCGsr1jTVuaKpP+SvYUxBYh5zbz73GMq+VsqlE29IZ1ER1+xMfWuCCvg3VA7HePyN6hzoZ/t0LADureYVPur6R5ZJgqgQpBinjpytIjo2BhN3NqaNWaIJZTLDSAT76R7HuNm016jbuOEjO5foYWuz2F82B03viHmk42CRNl3eqXEMcwkkLfEkvu9iupeVAArPXepA2YCpaaFbV2D5ahTelzMROnc2YQ/HyAdaaLtto8L0CDmZSrFsPZtTGQKarFdOgKWeor2iD1AiYLHYdcbvXV5YbBVvi7tFJG8r5h0YBUu1JIkhvzWIi698GJRGwDCONStCaKVhrMvpL7C8fEpbzullxFSpWOVupTEjn+u0OGaxrugwSZ1dtSkbIu+2SlVR/QuXS8o6OMiDz7lrFhIc+hF6EvFRWI7UIjt9NPte1o3COA8WESaseCWKhLY0g/hgpRSM7pyfKx2NAj4UCXyPATTKRJNlEHcs/jMpgxu+RSjPYphK4rrWxm6O6bJxd+jNwQNBOmJ1lQgOPAxpA7SvRDpN5Et+L61tWttR1EEO1+sj0g/iGO+zrZfD8m+jxNnIGWih/ykSzggiaJ42VFbQcJFk5BCfxlty6c0p8DvJkdulcRkboU21nQx9irqWmSeedcA3VJX2r0womx3tZYnbY=
chrome: stable
apt:
sources:
- ubuntu-toolchain-r-test
Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# Open Event Website Generator
![Open Event webapp](./docs/images/wsgen_branding.png)

[![Build Status](https://travis-ci.org/fossasia/open-event-wsgen.svg?branch=development)](https://travis-ci.org/fossasia/open-event-wsgen?branch=development)
[![Heroku](https://heroku-badge.herokuapp.com/?app=opev-webgen-dev)](http://opev-webgen-dev.herokuapp.com)
[![Build Status](https://travis-ci.com/fossasia/open-event-wsgen.svg?branch=development)](https://travis-ci.com/fossasia/open-event-wsgen)
[![Heroku](https://heroku-badge.herokuapp.com/?app=open-event-wsgen-dev)](http://open-event-wsgen-dev.herokuapp.com)
[![Dependencies](https://david-dm.org/fossasia/open-event-wsgen.svg)](https://david-dm.org/fossasia/open-event-wsgen)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/c5b7e2ca3e4640c9b38e2f3274072583)](https://www.codacy.com/app/dev_19/open-event-wsgen?utm_source=github.com&utm_medium=referral&utm_content=fossasia/open-event-wsgen&utm_campaign=Badge_Grade)
[![Code Climate](https://api.codeclimate.com/v1/badges/44552f8cc1b5ba1c760d/maintainability.svg)](https://codeclimate.com/github/fossasia/open-event-webapp)
[![Maintainability](https://api.codeclimate.com/v1/badges/6498f490127101665851/maintainability)](https://codeclimate.com/github/fossasia/open-event-wsgen/maintainability)
[![codecov](https://codecov.io/gh/fossasia/open-event-wsgen/branch/development/graph/badge.svg)](https://codecov.io/gh/fossasia/open-event-wsgen)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/fossasia/open-event-wsgen?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/fossasia/open-event-wsgen?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Mailing](https://img.shields.io/badge/Mailing-List-red.svg)](https://groups.google.com/forum/#!forum/open-event)
[![Twitter Follow](https://img.shields.io/twitter/follow/eventyay.svg?style=social&label=Follow&maxAge=2592000?style=flat-square)](https://twitter.com/eventyay)


The **Open Event Website Generator App** project has **TWO** components :
- **An event website generator**
Expand Down Expand Up @@ -140,9 +143,9 @@ The HTML pages of the generated website are created using Handelbars templates.

### Web App Generator Test Installation

* You can try out the web generator at https://opev-webgen.herokuapp.com
* You can try out the web generator at https://open-event-wsgen.herokuapp.com

* The `development-version` is available here: https://opev-webgen-dev.herokuapp.com
* The `development-version` is available here: https://open-event-wsgen-dev.herokuapp.com

* You can use one of the event sample zip files here: https://github.com/fossasia/open-event/tree/master/sample

Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"PORT": 5000,
"PORT": 3000,
"DEFAULT_MAIL_STRATEGY": "Sendgrid",
"DEFAULT_FROM_EMAIL": "[email protected]",
"SMTP_HOST": "mail.smtp2go.com",
Expand Down
2 changes: 1 addition & 1 deletion docs/INSTALLATION_LOCAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ or
npm run server.generator
```

The app will be running on http://localhost:5000
The app will be running on http://localhost:3000

Note : If you are running the app behind a proxy, set the proxy option in config.json to `http://username:password@proxy_url:proxy_port`, and make sure it is url encoded.

Expand Down
40 changes: 21 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,63 +24,65 @@
},
"homepage": "https://github.com/fossasia/open-event-webapp#readme",
"dependencies": {
"archiver": "^3.1.1",
"@babel/core": "^7.0.0",
"@babel/preset-env": "^7.12.1",
"@octokit/rest": "^14.0.0",
"archiver": "^5.0.2",
"async": "^3.2.0",
"aws-sdk": "^2.639.0",
"babel-preset-es2015": "^6.24.0",
"bee-queue": "^1.2.2",
"bee-queue": "^1.3.0",
"bluebird": "^3.4.7",
"body-parser": "^1.15.2",
"chai": "^4.0.1",
"compression": "^1.6.2",
"connect-domain": "^0.5.0",
"cookie-parser": "^1.4.4",
"cookie-parser": "^1.4.5",
"decompress-zip": "^0.3.0",
"del": "^5.1.0",
"del": "^6.0.0",
"dotenv": "^8.2.0",
"express": "^4.13.4",
"express-session": "^1.15.0",
"folder-hash": "^3.3.0",
"express-session": "^1.17.1",
"folder-hash": "^4.0.0",
"fs": "0.0.2",
"fs-extra": "^3.0.1",
"ftp-deploy": "^2.3.6",
"github": "^9.2.0",
"fs-extra": "^9.0.1",
"ftp-deploy": "^2.3.7",
"gulp": "^4.0.2",
"gulp-babel": "^6.1.2",
"gulp-babel": "^8.0.0",
"gulp-concat": "^2.6.1",
"gulp-htmlmin": "^5.0.1",
"gulp-iife": "^0.4.0",
"gulp-minify-css": "^1.2.4",
"gulp-uglify": "^3.0.0",
"handlebars": "^4.0.5",
"handlebars": "^4.7.6",
"html-minifier": "^4.0.0",
"jsonapi-serializer": "^3.5.3",
"jsonfile": "^6.0.1",
"moment": "^2.13.0",
"node-sass": "^4.5.3",
"jsonfile": "^6.1.0",
"moment": "^2.27.0",
"node-sass": "^4.14.0",
"node-uuid": "^1.4.7",
"nodemailer": "^6.4.5",
"nodemailer": "^6.4.15",
"nodemailer-smtp-transport": "^2.7.2",
"npm": "^6.14.2",
"npm": "^6.14.7",
"passport": "^0.4.1",
"passport-github": "^1.1.0",
"path": "^0.12.7",
"progress-stream": "^2.0.0",
"promise-ftp-common": "^1.1.5",
"raven": "^2.6.4",
"recursive-readdir": "^2.1.0",
"redis": "^3.0.2",
"request": "^2.74.0",
"selenium-webdriver": "^3.4.0",
"sendgrid": "^5.1.1",
"sharp": "^0.25.1",
"sharp": "^0.26.2",
"socket.io": "^2.0.2",
"socket.io-stream": "^0.9.1",
"socketio-file-upload": "^0.7.0",
"stream-buffers": "^3.0.1",
"url-join": "^4.0.1"
},
"devDependencies": {
"eslint": "^6.8.0",
"eslint": "^7.13.0",
"husky": "^0.14.3"
}
}
15 changes: 13 additions & 2 deletions src/backend/_scss/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,6 @@ a {
}

margin-right: 10px;
display: inline-block;
vertical-align: text-top;
}

Expand Down Expand Up @@ -1396,8 +1395,9 @@ a {
}

.speaker-description {
padding-top: 20px;
text-align: center;
width: 50%;
width: 100%;
}
}
}
Expand Down Expand Up @@ -2469,3 +2469,14 @@ a.skip:hover {
display: none;
}
}

.date-list-search-filter {

label {
display: inline;

.fa {
margin-top: 13px;
}
}
}
2 changes: 1 addition & 1 deletion src/backend/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

const distHelper = require('./dist.js');
const fs = require('fs');
const Github = require('github');
const Github = require('@octokit/rest');
const gh = new Github();
const async = require('async');
let results, bitmap, i, file, fullPath, eventName, repoName, total, counter, elem, fileName, sha;
Expand Down
10 changes: 5 additions & 5 deletions src/backend/dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const extensionChange = function(image) {
};

const optimizeBackground = function(image, socket, done) {
if (image !== null) {
if (image) {
sharp(image)
.resize({
width: 1150,
Expand Down Expand Up @@ -480,7 +480,7 @@ module.exports = {
});

unzipper.extract({
path: appPath + '/zip'
path: 'dist/' + appFolder + '/zip'
});

unzipper.on('extract', function(log) {
Expand All @@ -499,7 +499,7 @@ module.exports = {
const fPath = appPath + '/zip/' + file;

function check(error) {
if (error !== null) {
if (error) {
logger.addLog('Error', 'Error while copying folder', socket, error);
cb(err);
} else {
Expand Down Expand Up @@ -538,7 +538,7 @@ module.exports = {
default: cb(null);
}
}, function(error) {
if (error !== null) {
if (error) {
return done(error);
}

Expand Down Expand Up @@ -581,7 +581,7 @@ module.exports = {
// duplicate folder found
logger.addLog('Info', 'Removing the duplicate folder', socket);
fs.remove(removeFolder, function(error) {
if (error !== null) {
if (error) {
logger.addLog('Error', 'Error occured during deletion of the duplicate folder', socket, error);
return done(error);
}
Expand Down
4 changes: 2 additions & 2 deletions src/backend/fold_v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ function returnAttendees(attendeesData) {
}

function createSocialLinks(event) {
const sociallinks = Array.from(event['social-links']);
const sociallinks = Array.from(event['social-links']).filter(Boolean);

sociallinks.forEach((link) => {
link.show = true;
Expand Down Expand Up @@ -488,7 +488,7 @@ function createSocialLinks(event) {
}

function extractEventUrls(event, speakers, sponsors, reqOpts, next) {
const sociallinks = Array.from(event['social-links']);
const sociallinks = Array.from(event['social-links']).filter(Boolean);
let sociallink = '';
let featuresection = 0;
let sponsorsection = 0;
Expand Down
16 changes: 8 additions & 8 deletions src/backend/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ exports.createDistDir = function(req, socket, callback) {
socket.emit('live.process', {donePercent: 5, status: 'Cleaning temporary folder'});
}
fs.remove(distHelper.distPath + '/' + appFolder, (err) => {
if (err !== null) {
if (err) {
logger.addLog('Error', 'Failed to clean up the previously existing temporary folders', socket, err);
callback(null);
console.log(err);
Expand All @@ -279,7 +279,7 @@ exports.createDistDir = function(req, socket, callback) {
distHelper.copyAssets(appFolder, (copyerr) => {
console.log('================================COPYING\n');

if (copyerr !== null) {
if (copyerr) {
console.log(copyerr);
logger.addLog('Error', 'Error occured while copying assets into the appFolder', socket, copyerr);
callback(null);
Expand All @@ -296,7 +296,7 @@ exports.createDistDir = function(req, socket, callback) {
logger.addLog('Info', 'Cleaning dependencies folder created as a part of copying assets inside the appFolder', socket);
distHelper.removeDependency(appFolder, socket, (copyerr) => {
console.log('============================Moving contents from dependency folder and deleting the dependency folder');
if (copyerr !== null) {
if (copyerr) {
logger.addLog('Error', 'Error while reading directory', socket, copyerr);
callback(null);
console.log(copyerr);
Expand Down Expand Up @@ -331,7 +331,7 @@ exports.createDistDir = function(req, socket, callback) {
console.log('================================FETCHING JSONS\n');
logger.addLog('Info', 'Fetching Jsons from the internet', socket);
distHelper.fetchApiJsons(appFolder, req.body.apiendpoint, req.body.apiVersion, socket, (err) => {
if (err !== null) {
if (err) {
console.log(err);
callback(null);
return done(err);
Expand Down Expand Up @@ -359,7 +359,7 @@ exports.createDistDir = function(req, socket, callback) {
if (!err) {
logger.addLog('Success', 'SASS file compiled successfully', socket);
fs.writeFile(distHelper.distPath + '/' + appFolder + '/css/schedule.css', result.css, (writeErr) => {
if (writeErr !== null) {
if (writeErr) {
logger.addLog('Error', 'Error in writing css file', socket, writeErr);
console.log(writeErr);
return socket.emit('live.error', {status: 'Error in Writing css file'});
Expand Down Expand Up @@ -407,7 +407,7 @@ exports.createDistDir = function(req, socket, callback) {
}
logger.addLog('Info', 'Compiling the html pages from the templates', socket);

const jsonData = data;
const jsonData = data;
eventName = fold.removeSpace(jsonData.eventurls.name);
const backPath = distHelper.distPath + '/' + appFolder + '/' + jsonData.eventurls.background_path;
const basePath = distHelper.distPath + '/' + appFolder + '/images';
Expand Down Expand Up @@ -554,7 +554,7 @@ exports.createDistDir = function(req, socket, callback) {
}

distHelper.removeDuplicateEventFolders(eventName, req.body.email, socket, (remerr) => {
if (remerr !== null) {
if (remerr) {
logger.addLog('Error', 'Error occured while removing the duplicate event folders', socket, remerr);
callback(null);
console.log(remerr);
Expand All @@ -578,7 +578,7 @@ exports.createDistDir = function(req, socket, callback) {
const eventFolderSource = __dirname + '/../../dist/';

fs.move(eventFolderSource + appFolder, eventFolderSource + req.body.email + '/' + eventName, (moveerr) => {
if (moveerr !== null) {
if (moveerr) {
logger.addLog('Error', 'Error in moving files to the event folders', socket, moveerr);
callback(null);
console.log(moveerr);
Expand Down
4 changes: 2 additions & 2 deletions src/backend/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ exports.minifyJs = function(path, cb) {
return gulp.src(src.map(file => dir + file))
.pipe(iife({useStrict: false}))
.pipe(concat(dist + '.min.js'))
.pipe(babel({presets: ['es2015']}))
.pipe(babel({presets: ['@babel/preset-env']}))
.pipe(uglify().on('error', function(e) {
console.log(`Error while compiling ${dist}.js` + e);
}))
Expand All @@ -42,7 +42,7 @@ exports.minifyJs = function(path, cb) {
function tracksJs() {
return minifyPipeline('tracks', ['social.js', 'scroll.js', 'navbar.js', 'jquery.lazyload.js']);
}

function eventJs() {
return minifyPipeline('event', ['map.js', 'scroll.js', 'navbar.js', 'popover.js', 'loklak-fetcher.js', 'tweets.js', 'jquery.lazyload.js']);
}
Expand Down
6 changes: 3 additions & 3 deletions src/backend/templates/rooms.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
</li>
</ul>
</span>
<div class="filter search-filter search-filter-room">
<div class="filter search-filter search-filter-room date-list-search-filter">
<label for="search-input"><i class="fa fa-search" aria-hidden="true"></i></label>
<input class="fossasia-filter" type="text" placeholder="Search">
</div>
Expand Down Expand Up @@ -331,7 +331,7 @@
{{#each roomsnames}}
<div class="room-info">
<span class="titlecolor room-titlecolor"></span>
<span class="room-name">{{this}}</span>
<span class="room-name"><a href="#{{this}}">{{this}}</a></span>
</div>
{{/each}}
</div>
Expand All @@ -341,7 +341,7 @@
{{#if title}}
<div class="track-info">
<span style="background-color: {{color}};" class="titlecolor"></span>
<span class="track-name">{{title}}</span>
<span class="track-name"><a href="#{{title}}">{{title}}</a></span>
</div>
{{/if}}
{{/tracknames}}
Expand Down
Loading

0 comments on commit 96a0511

Please sign in to comment.