Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • applications/knowledge-base/knowledgebase-front
  • HannaP/knowledgebase-front
  • novalore/knowledgebase-front
3 results
Show changes
Commits on Source (59)
Showing
with 188 additions and 105 deletions
......@@ -8,6 +8,8 @@
/dist/lib/
/dist/oidc-client-config.json
*.iml
/www/
/www/*
!/www/.htaccess
!/www/index.html
package-lock.json
......@@ -29,3 +29,10 @@ Disclaimer: PUG could need to be installed globally as root `sudo npm i -g pug`
11. If you have no CSS when loading the project local URL, edit and save the `src/styles/index.scss` file with any kind of modifications to force the compilation.
You should now be able to access the application using your preferred browser on `http://localhost:9000/`
## Funding
![EULOGO](documentation/EU_logos.png)
This software has been co-funded by the European Union.
The contents of this software are the sole responsibility of Cooperatives Europe and can in no way be taken to reflect the views of the European Union.
const path = require('path')
const fs = require('fs').promises
const objectAssignDeep = require(`object-assign-deep`)
const yaml = require('js-yaml')
const pug = require('pug')
const chokidar = require('chokidar')
//Set default language
const default_lang = 'en'
const pugFile = './src/index.pug'
//Set the translation directory
const dataDir = './translation'
const outDir = './www'
//Compile custom function
async function compile() {
//Retrieve langues proposed
const langs = (await fs.readdir(dataDir))
.filter(f => path.extname(f) === '.yml')
.map(f => path.basename(f, '.yml'))
const langData = {}
//Retrieve traduction
await Promise.all(
langs.map(lang =>
fs
.readFile(`${dataDir}/${lang}.yml`, 'utf8')
.then(text => (langData[lang] = yaml.safeLoad(text))),
),
)
for (const lang in langData) {
if (lang === default_lang) continue
langData[lang] = objectAssignDeep(
{},
langData[default_lang],
langData[lang],
)
}
const options = JSON.parse(await fs.readFile('./src/config.json', 'utf-8'))
const pugFct = pug.compileFile(pugFile)
await fs.mkdir(outDir, { recursive: true })
//Creation of folders by language with their index.html dans wwww
await Promise.all(
Object.entries(langData).map(async([lang, data]) => {
const opt = Object.assign({}, options, { lang, data });
const dir = `${outDir}/${lang}`
await fs.mkdir(dir, { recursive: true })
const html = pugFct(opt)
const filename = `${dir}/index.html`
console.log(`write ${filename}`)
return fs.writeFile(filename, html)
}),
)
}
// Compile with --watch option
compile().then(() => {
if (!process.argv.includes('-w') && !process.argv.includes('--watch')) return
console.log('watching for changes…')
chokidar.watch([pugFile, dataDir]).on('change', editedFilePath => {
console.log(`\nchanged: ${editedFilePath}`)
compile()
})
})
documentation/EU_logos.png

17.1 KiB

......@@ -5,7 +5,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"scss": "node-sass -w ./src/styles/index.scss -o ./www/styles/",
"pug": "pug --watch ./src/index.pug --out ./www/ --obj ./src/config.json",
"pug": "node ./compile-pug.js -w",
"pugprod": "pug ./src/index.pug --out ./www/ --obj prod.json",
"copy-js": "cp ./src/scripts/*.js ./www/scripts/",
"copy-fonts": "cp -R ./src/fonts ./www",
......@@ -21,13 +21,17 @@
"@babel/core": "^7.1.0",
"@babel/cli": "^7.1.0",
"node-sass": "^4.9.3",
"pug-cli": "^1.0.0-alpha6",
"browser-sync": "^2.24.7",
"express": "^4.16.3"
"express": "^4.16.3",
"chokidar": "^3.2.3",
"js-yaml": "^3.13.1",
"object-assign-deep": "^0.4.0",
"pug": "^2.0.4"
},
"dependencies": {
"@webcomponents/html-imports": "^1.2.0",
"@webcomponents/webcomponentsjs": "^1.2.7",
"cookie-parser": "^1.4.4",
"include-media": "^1.4.9",
"normalize.css": "^8.0.0",
"onchange": "^6.1.0",
......
......@@ -9,9 +9,9 @@ const app = express();
app
.use(express.static(distPath))
// .use('/src', express.static(join(__dirname, 'src')))
.get(/^[^.]*$/, (req, rep) =>
rep.sendFile(join(__dirname, distPath, '/index.html'))
)
.get('/:lang/:path([^.]*)', (req, rep) => {
rep.sendFile(join(__dirname, distPath, `${req.params.lang}/index.html`));
})
.listen(port);
// browser sync
......
src/images/ica_logo.png

5.41 KiB

src/images/logo_CE.png

10.3 KiB

src/images/logo_UE.jpg

17.8 KiB

src/images/logo_coops4dev.jpg

69.7 KiB

......@@ -7,21 +7,21 @@ sib-router(default-route='account-creation-index')
figure(class="logo")
img(src="../images/logo.png" alt="Coopstarter logo")
h2.title_lead Welcome to our international index of resources for cooperative mentors and entrepreneurs
h2.title_lead=`${data.welcome}`
sib-link.block_log(next='mentor-new-account')
div
figure.img_log
img(src="../images/mentor.png"
alt="Create your account as mentor")
h2.button_base I am a mentor
h2.button_base=`${data.IAmMentor}`
sib-link.block_log(next='entrepreneur-new-account')
div
figure.img_log
img(src="../images/fusee.png"
alt="Create your account as entrepreneur")
h2.button_base I am an entrepreneur
h2.button_base=`${data.IAmEntrepreneur}`
#mentor-new-account(hidden).no-sidebar.container
include mentor/profile/create.pug
......
......@@ -13,9 +13,9 @@ sib-widget(name='cs-display-property')
sib-widget(name='cs-steps-resources-multiple')
template
div.resource_resume_header
p ${value.name}
p ${value.publication_year}
p ${value.description}
p ${await value.name}
p ${await value.publication_year}
p ${await value.description}
sib-widget(name='cs-steps-header')
template
......@@ -47,20 +47,20 @@ sib-widget(name='cs-display-checkbox')
sib-widget(name='cs-display-related-property')
template
p #[a(href="${value.name}")] ${value.name}
p #[a(href="${value.name}")] ${await value.name}
sib-widget(name='cs-display-multiple-property')
template
p #[b ${label}] ${value.name}
p #[b ${label}] ${await value.name}
sib-widget(name='cs-display-step-property')
template
p #[b ${label} ${value.order}:] ${value.name}
p #[b ${label} ${await value.order}:] ${await value.name}
sib-widget(name='cs-resource-format-name')
template
div
p ${value.name}
p ${await value.name}
sib-widget(name='cs-resource-reviewer')
template
......@@ -164,3 +164,6 @@ sib-widget(name="cs-form-file-custom" )
sib-form-file(upload-url=`${sdn}upload/` name="preview_image")
sib-widget(name="iframe-video-resource" )
template
div ${value}
\ No newline at end of file
......@@ -7,7 +7,7 @@
include menu.pug
div.flex.flex_espace.flex_item_center
sib-form(
sib-form.languageChoice(
data-src=`${endpoints.languages}`
fields='languages'
range-languages=`${endpoints.languages}`
......@@ -27,10 +27,10 @@
ul
li
sib-link(next='entrepreneur-dashboard')
p Dashboard
p= data.Dashboard
li
sib-link(next='entrepreneur-account')
p My account
p= data.MyAccount
li
a.logout-button
p Logout
\ No newline at end of file
p= data.Logout
\ No newline at end of file
......@@ -28,7 +28,7 @@ section#home
include ./requests/create.pug
dialog#entrepreneur-request-validation.no-sidebar.container
p You request has been submitted
p=`${data.YouRequestHasBeenSubmitted}`
p.flex
sib-link(next='entrepreneur-resource-list', class='button_base') Ok
......@@ -43,3 +43,4 @@ section#home
#entrepreneur-account-edit-confirmation(hidden).no-sidebar.container
include profile/confirmation.pug
div.container_min
h2.title_lead.fd_bleu Edit your account
h2.title_lead.fd_bleu= data.EditYourAccount
p.p_entete Your modifications have properly been saved.
p.p_entete= data.ModificationsProperlySaved
div
div.flex
h3.button_base
sib-link(next='entrepreneur-resource-list') -> Back to the database
\ No newline at end of file
sib-link(next='entrepreneur-resource-list')= data.BackToDashboard
\ No newline at end of file
include ../../components/widgets
figure.logo
img(src="../images/logo.png"
alt="Coopstarter")
......@@ -8,20 +6,20 @@ figure.logo.img_log
img(src="../images/fusee.png"
alt="Create an entrepreneur account")
h2.title_create Complete your entrepreneur account
h2.title_create=`${data.CompleteEntrepreneurAccount}`
sib-form#entrepreneur_profile_creation.block_log.block_creat_count(
bind-user
fields="last_name, first_name, entrepreneur_profile.organisation, account.picture, username"
fields="last_name, first_name, entrepreneurProfile.organisation, account.picture, username"
range-entrepreneur_profile.organisation=`${endpoints.organisations}`
range-entrepreneurProfile.organisation=`${endpoints.organisations}`
label-first_name="Surname"
label-last_name="Name"
label-entrepreneur_profile.organisation="Organisation *"
label-first_name=`${data.Surname}`
label-last_name=`${data.Name}`
label-entrepreneurProfile.organisation=`${data.Organisation}`
class-entrepreneur_profile.organisation='form-label is-dark'
widget-entrepreneur_profile.organisation='sib-form-auto-completion'
class-entrepreneurProfile.organisation='form-label is-dark'
widget-entrepreneurProfile.organisation='sib-form-auto-completion'
widget-username='sib-form-hidden'
......@@ -29,7 +27,7 @@ sib-form#entrepreneur_profile_creation.block_log.block_creat_count(
widget-account.picture='cs-form-file-custom'
class-account.picture='input_photo w_25'
submit-button="COMPLETE YOUR ACCOUNT"
submit-button=`${data.CompleteYourAccount}`
next="entrepreneur-dashboard"
)
include ../../components/widgets
div.container_min
h2.title_lead.fd_bleu My Account
h2.title_lead.fd_bleu=`${data.MyAccount}`
div.block_list.flex
div.button__actions.w_25
div.dashboard__database
sib-link(next='entrepreneur-database')
div.button_base.ico_gauche.ico_database Browse database
div.button_base.ico_gauche.ico_database=`${data.BrowseDatabase}`
div.dashboard__database
sib-link(next='entrepreneur-resource-list')
div.button_base.ico_gauche.ico_search Back to dashboard
div.button_base.ico_gauche.ico_search=`${data.BackToDashboard}`
div.dashboard__database
div.logout-button.button_base(
role='log out'
) Logout
)=`${data.Logout}`
div.profile_information.block_log.w_75
sib-link(next='entrepreneur-account-edit')
......@@ -25,17 +23,17 @@ div.block_list.flex
sib-display#entrepreneur_info(
bind-user
fields='account.picture, name, entrepreneur_profile.organisation.name, registered_on'
fields='account.picture, name, entrepreneurProfile.organisation.name, registeredOn'
widget-name='cs-display-property'
widget-account.picture='cs-profile-picture'
widget-entrepreneur_profile.organisation.name='cs-display-property'
widget-entrepreneur_profile.registered_on='cs-display-property'
widget-entrepreneurProfile.organisation.name='cs-display-property'
widget-entrepreneurProfile.registeredOn='cs-display-property'
)
sib-display#entrepreneur_contact(
bind-user
fields='email'
label-email='Email:'
label-email=`${data.Email}`
class-email="contact_profil"
widget-email='cs-display-resource-property'
)
\ No newline at end of file
include ../../components/widgets
h2.title_create Edit your account
h2.title_create= data.EditYourAccount
sib-form#entrepreneur_profile_edition.block_log.block_creat_count(
bind-user
fields="info(last_name, first_name, username, email, entrepreneur_profile.organisation, account.picture)"
range-entrepreneur_profile.organisation=`${endpoints.organisations}`
fields="info(last_name, first_name, username, email, entrepreneurProfile.organisation, account.picture)"
range-entrepreneurProfile.organisation=`${endpoints.organisations}`
label-first_name="Surname"
label-last_name="Name"
label-entrepreneur_profile.organisation="Organisation"
label-account.picture="Profile picture"
label-first_name=`${data.Surname}`
label-last_name=`${data.Name}`
label-entrepreneurProfile.organisation=`${data.Organisation}`
label-account.picture=`${data.Photo}`
widget-username="sib-form-hidden"
class-last_name='form-label is-dark input_big'
class-first_name='form-label is-dark input_big'
class-email='form-label is-dark input_big'
class-entrepreneur_profile.phone='form-label is-dark input_big'
class-entrepreneurProfile.phone='form-label is-dark input_big'
class-entrepreneur_profile.organisation='form-label is-dark input_big'
widget-entrepreneur_profile.organisation='sib-form-auto-completion'
class-entrepreneurProfile.organisation='form-label is-dark input_big'
widget-entrepreneurProfile.organisation='sib-form-auto-completion'
upload-url-account.picture=`${sdn}upload/`
widget-account.picture='cs-form-file-custom'
class-account.picture='input_photo w_25'
submit-button="Save modifications"
submit-button=`${data.SaveModification}`
next='entrepreneur-account-edit-confirmation'
)
sib-link(class="backlink", next="entrepreneur-resource-list") Back to the dashboard
\ No newline at end of file
sib-link(class="backlink", next="entrepreneur-resource-list")= data.BackToDashboard
\ No newline at end of file
......@@ -4,11 +4,12 @@
p.backlink
i.fas.fa-times
div#resource-creation-form-loader
hidden Loading form, please wait...
hidden
i.fas.fa-spinner.fa-spin
h2.title_form Request a ressource
h2.title_form=`${data.RequestRessource}`
p.p_entete You can't find a resource you are looking for ? You need resources to acquire certain skills or progress in your cooperative developement ? It can be a book, a document model, a tutorial, anything you need, make a request to our mentors so they know how to help you.
p.p_entete=`${data.RequestRessourceInfo}`
img(src="../images/asid_entre.png" alt="rechercher de ressources")
sib-form#resource-creation-form(
......@@ -25,16 +26,16 @@
range-organisation=`${endpoints.organisations}`
range-country=`${endpoints.countries}`
label-header_mandatory='Mandatory information'
label-header_complementary='Complementary information'
label-header_mandatory=`${data.MandatoryInformation}`
label-header_complementary=`${data.ComplementaryInformation}`
label-name='Title*'
label-description='Description'
label-language='Language*'
label-country='Country*'
label-field='Field*'
label-organisation='Organisation'
label-skills='What do you need to learn with this resource ?'
label-name=`${data.TitleRequired}`
label-description=`${data.Description}`
label-language=`${data.Language}`
label-country=`${data.Country}`
label-field=`${data.FieldRequired}`
label-organisation=`${data.Organisation}`
label-skills=`${data.SkillToLearn}`
multiple-fields='sib-multiple-select'
widget-fields='sib-form-auto-completion'
......@@ -47,7 +48,7 @@
widget-skills='sib-form-textarea'
widget-organisation='sib-form-auto-completion'
submit-button='Send request'
submit-button=`${data.SendRequest}`
next="entrepreneur-request-validation"
)
......
include ../../components/widgets
.block_log.block_creat_count.no_shadow
sib-link(class="backlink", next="entrepreneur-resource-list")
.like
......@@ -14,8 +12,8 @@ include ../../components/widgets
bind-resources,
fields='name, steps, format.name, \
submitter_info(submitter.account.picture, submitter.name, \
submitter.mentor_profile.organisation.name, skills, uri, broken),\
content(preview_image, tags),\
submitter.mentorProfile.organisation.name, skills, uri, broken),\
content(preview_image, iframe_link, tags),\
description, review.reviewer.account.picture, review.reviewer.name,\
copyright, specifications(\
header_specifications, author, country.name, language.name,\
......@@ -26,7 +24,7 @@ include ../../components/widgets
class-steps="steps"
widget-author='cs-display-resource-property',
widget-country.name='cs-display-resource-property',
widget-submitter.mentor_profile.organisation.name='cs-display-resource-property'
widget-submitter.mentorProfile.organisation.name='cs-display-resource-property'
class-submitter.name="autor_ressource"
class-broken="broken"
widget-format.name='cs-display-resource-property'
......@@ -45,32 +43,34 @@ include ../../components/widgets
widget-review.reviewer.name='cs-resource-reviewer'
class-review.reviewer.name="validator_ressource"
widget-header_specifications='cs-section_header'
widget-iframe_link='iframe-video-resource'
label-broken='Report broken link'
label-sharing='Access:'
label-language.name='Language:'
label-publication_year='Year of publication:'
label-header_specifications='Resource specifications'
label-broken=`${data.ReportBrokenLink}`
label-sharing=`${data.Access}`
label-language.name=`${data.Language}`
label-publication_year=`${data.DatePublication}`
label-header_specifications=`${data.ResourceSpecifications}`
class-format.name='format_type'
label-format.name=''
widget-steps='cs-display-step-property'
label-steps=''
each-label-steps="Step"
each-label-steps=`${data.Step}`
multiple-steps
widget-fields='cs-display-multiple-property'
label-fields=''
each-label-fields='Field:'
each-label-fields=`${data.Field}`
multiple-fields
label-skills='With this resource, you will be able to:'
label-uri='Link to resource'
label-skills=`${data.WithThisResourceBeAbleTo}`
label-uri=`${data.LinkToResource}`
name-uri='original-link'
label-country.name='Country:'
label-submitter.mentor_profile.organisation.name='Organisation:'
label-author='Author :'
label-submitter.name='Resource posted by:'
label-country.name=`${data.Country}`
label-submitter.mentorProfile.organisation.name=`${data.Organisation}`
label-author=`${data.Author}`
label-submitter.name=`${data.ResourcePostedBy}`
action-broken='resource-report-broken-link-entrepreneur'
)
......@@ -80,25 +80,25 @@ include ../../components/widgets
//- <p class="backlink"><i class='far fa-thumbs-down'></i>3</p>
//- </div>
sib-display(
bind-resources
fields=""
nested-field="likes"
counter-template="<p><i class='fas fa-thumbs-up'></i>${counter}</p>"
)
//- sib-display(
//- bind-resources
//- fields=""
//- nested-field="likes"
//- counter-template="<p><i class='fas fa-thumbs-up'></i>${counter}</p>"
//- )
sib-display(
bind-resources
fields=""
nested-field="dislikes"
counter-template="<p><i class='fas fa-thumbs-down'></i>${counter}</p>"
)
//- sib-display(
//- bind-resources
//- fields=""
//- nested-field="dislikes"
//- counter-template="<p><i class='fas fa-thumbs-down'></i>${counter}</p>"
//- )
sib-display(
bind-resources
fields=""
nested-field="conversations"
counter-template="<p>Comments (${counter})</p>"
counter-template=`<p>${data.Comments} (${counter})</p>`
)
sib-conversation(
......@@ -106,7 +106,7 @@ include ../../components/widgets
id-suffix="conversations"
)
h2.title_lead_avenir Related resources
h2.title_lead_avenir=`${data.RelatedResources}`
sib-display(
bind-resources,
......