Skip to content

Commit b69020a

Browse files
agbilotia1998ParthS007
authored andcommitted
Adds code of conduct to the web app (#1922)
1 parent 3d9e61d commit b69020a

File tree

6 files changed

+119
-22
lines changed

6 files changed

+119
-22
lines changed

src/backend/_scss/application.scss

+20
Original file line numberDiff line numberDiff line change
@@ -2244,6 +2244,26 @@ a.skip:hover {
22442244
-webkit-animation: blink-animation 1s steps(5, start) infinite;
22452245
}
22462246

2247+
.coc {
2248+
margin: auto;
2249+
text-align: justify;
2250+
width: 60%;
2251+
2252+
a {
2253+
&:hover {
2254+
color: $dark-black;
2255+
}
2256+
}
2257+
}
2258+
2259+
.main-coc-container {
2260+
background-color: $main-background;
2261+
margin-bottom: 4%;
2262+
margin-top: 2%;
2263+
padding-bottom: 50px;
2264+
padding-top: 2%;
2265+
}
2266+
22472267
.desc-speaker-name {
22482268
display: block;
22492269
}

src/backend/fold_v1.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,8 @@ function extractEventUrls(event, speakers, sponsors, reqOpts, next) {
491491
orgname: event.organizer_name,
492492
location_name: event.location_name,
493493
featuresection: featuresection,
494-
sponsorsection: sponsorsection
494+
sponsorsection: sponsorsection,
495+
codeOfConduct: event.code_of_conduct
495496
};
496497

497498
if (reqOpts.assetmode === 'download') {

src/backend/fold_v2.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,8 @@ function extractEventUrls(event, speakers, sponsors, reqOpts, next) {
495495
orgname: event['organizer-name'],
496496
location_name: event['location-name'],
497497
featuresection: featuresection,
498-
sponsorsection: sponsorsection
498+
sponsorsection: sponsorsection,
499+
codeOfConduct: event['code-of-conduct']
499500
};
500501

501502
if (reqOpts.assetmode === 'download') {

src/backend/generator.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const roomstpl = handlebars.compile(fs.readFileSync(__dirname + '/templates/room
3838
const speakerstpl = handlebars.compile(fs.readFileSync(__dirname + '/templates/speakers.hbs').toString('utf-8'));
3939
const eventtpl = handlebars.compile(fs.readFileSync(__dirname + '/templates/event.hbs').toString('utf-8'));
4040
const sessiontpl = handlebars.compile(fs.readFileSync(__dirname + '/templates/session.hbs').toString('utf-8'));
41+
const codeOfConductTpl = handlebars.compile(fs.readFileSync(__dirname + '/templates/CoC.hbs').toString('utf-8'));
4142

4243
if (!String.linkify) {
4344
String.prototype.linkify = function() {
@@ -417,7 +418,7 @@ exports.createDistDir = function(req, socket, callback) {
417418
}
418419

419420
function setPageFlag(page) {
420-
jsonData.trackFlag = jsonData.scheduleFlag = jsonData.roomFlag = jsonData.indexFlag = jsonData.speakerFlag = 0;
421+
jsonData.trackFlag = jsonData.scheduleFlag = jsonData.roomFlag = jsonData.indexFlag = jsonData.speakerFlag = jsonData.CoCflag = 0;
421422
switch(page) {
422423
case 'track':
423424
jsonData.trackFlag = 1;
@@ -434,6 +435,9 @@ exports.createDistDir = function(req, socket, callback) {
434435
case 'speaker':
435436
jsonData.speakerFlag = 1;
436437
break;
438+
case 'CoC':
439+
jsonData.CoCflag = 1;
440+
break;
437441
}
438442
}
439443

@@ -451,6 +455,12 @@ exports.createDistDir = function(req, socket, callback) {
451455

452456
setPageFlag('index');
453457
fs.writeFileSync(distHelper.distPath + '/' + appFolder + '/index.html', minifyHtml(eventtpl(jsonData)));
458+
459+
if(jsonData.eventurls.codeOfConduct) {
460+
setPageFlag('CoC');
461+
fs.writeFileSync(distHelper.distPath + '/' + appFolder + '/CoC.html', minifyHtml(codeOfConductTpl(jsonData)));
462+
}
463+
454464
} catch (err) {
455465
console.log(err);
456466
logger.addLog('Error', 'Error in compiling/writing templates', socket, err);

src/backend/templates/CoC.hbs

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<link rel="preload" as="script" href="./js/jquery.min.js">
5+
<link rel="preload" as="script" href="./js/bootstrap.min.js">
6+
<link rel="preload" as="script" href="./js/event.min.js">
7+
<link rel="preload" as="style" href="./css/schedule.css">
8+
<link rel="preload" as="style" href="./css/font-awesome.min.css">
9+
<link rel="preload" as="style" href="./css/bootstrap.min.css">
10+
<link rel="manifest" href="./manifest.json">
11+
<link rel="preload" as="font" href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,300" crossorigin>
12+
13+
<meta charset="utf-8">
14+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
15+
<meta name="viewport" content="width=device-width, initial-scale=1">
16+
<meta name="theme-color" content="#317EFB"/>
17+
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
18+
19+
<meta name="description" content="{{ apptitle }} Schedule">
20+
<meta name="author" content="{{ metaauthor }}">
21+
22+
<title>{{ apptitle }}</title>
23+
24+
<!-- Bootstrap core CSS -->
25+
<!-- Latest compiled and minified CSS -->
26+
<link rel="shortcut icon" href="{{ eventurls.ico_url }}" type="image/x-icon" />
27+
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,300' rel='stylesheet' type='text/css'>
28+
<link rel="stylesheet" type="text/css" href="./css/font-awesome.min.css">
29+
<link rel="stylesheet" href="./css/bootstrap.min.css">
30+
<link rel="stylesheet" href="./css/schedule.css">
31+
32+
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
33+
<!--[if lt IE 9]>
34+
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
35+
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
36+
<![endif]-->
37+
</head>
38+
<body>
39+
{{>navbar}}
40+
<div class="main-coc-container container">
41+
<div class="row">
42+
<div class="middle col-sm-12">
43+
<h2 class="filter-heading track-heading text-center">
44+
<span>Code of Conduct</span>
45+
</h2>
46+
</div>
47+
</div>
48+
49+
<div class="row">
50+
<div class="col-sm-12 col-md-12">
51+
<div class="coc">
52+
{{{eventurls.codeOfConduct}}}
53+
</div>
54+
</div>
55+
</div>
56+
</div>
57+
{{>footer}}
58+
<script src="./js/jquery.min.js"></script>
59+
<script src="./js/bootstrap.min.js" type="text/javascript"></script>
60+
<script type="text/javascript" src="./js/event.min.js"></script>
61+
</body>
62+
</html>

src/backend/templates/partials/footer.hbs

+22-19
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,32 @@
2121
{{#if speakerslist}}
2222
<li><a target="_self" href="speakers.html">Speakers</a></li>
2323
{{/if}}
24+
{{#if eventurls.codeOfConduct}}
25+
<li><a target="_self" href="CoC.html">Code of Conduct</a></li>
26+
{{/if}}
2427
<li><a class="inner-link back-to-top" href="#top">Back To Top</a></li>
2528
</ul>
2629
</div>
2730
<div id="copyright" class="col-sm-7 col-md-7 col-xs-12">
28-
{{#if copyright}}
29-
{{#if copyright.licence}}
30-
<p>
31-
<a href="{{{copyright.licence_url}}}"><img src="{{{copyright.logo}}}"></a>
32-
&nbsp; &copy; {{copyright.year}}
33-
{{#if copyright.holder_url}}
34-
<a href="{{{copyright.holder_url}}}">{{copyright.holder}}.</a>
35-
{{else}}
36-
{{copyright.holder}}.
37-
{{/if}}
38-
The website and its contents are licensed under
39-
<a href="{{{copyright.licence_url}}}"> {{copyright.licence}}. </a>
40-
The site was generated using the Open Event format on the <a href="https://eventyay.com/">eventyay</a> <a href="https://webgen.eventyay.com/">site generator</a>. Please submit issues <a href="https://github.com/fossasia/open-event-webapp/issues">here</a>.
41-
</p>
42-
{{/if}}
43-
{{/if}}
31+
{{#if copyright}}
32+
{{#if copyright.licence}}
33+
<p>
34+
<a href="{{{copyright.licence_url}}}"><img src="{{{copyright.logo}}}"></a>
35+
&nbsp; &copy; {{copyright.year}}
36+
{{#if copyright.holder_url}}
37+
<a href="{{{copyright.holder_url}}}">{{copyright.holder}}.</a>
38+
{{else}}
39+
{{copyright.holder}}.
40+
{{/if}}
41+
The website and its contents are licensed under
42+
<a href="{{{copyright.licence_url}}}"> {{copyright.licence}}. </a>
43+
The site was generated using the Open Event format on the <a href="https://eventyay.com/">eventyay</a> <a href="https://webgen.eventyay.com/">site generator</a>. Please submit issues <a href="https://github.com/fossasia/open-event-webapp/issues">here</a>.
44+
</p>
45+
{{/if}}
46+
{{/if}}
4447
</div>
45-
<div class="contact-details col-sm-3 col-md-3 col-xs-12">
46-
<ul class="contact-methods">
48+
<div class="contact-details col-sm-3 col-md-3 col-xs-12">
49+
<ul class="contact-methods">
4750
{{#if eventurls.email}}
4851
<li>
4952
<i class="fa fa-envelope"></i>
@@ -64,7 +67,7 @@
6467
</div>
6568
</div>
6669
<div class="row ui-sortable">
67-
<div class="col-sm-12 text-center">
70+
<div class="col-sm-10 text-center">
6871
<ul class="social-profiles">
6972
{{#sociallinks}}
7073
{{#if show}}

0 commit comments

Comments
 (0)