forked from MachinisteWeb/BlogAtlas
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Bruno Lesieur <[email protected]>
- Loading branch information
1 parent
5fcf5cd
commit 1d82b1b
Showing
26 changed files
with
196 additions
and
11 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* jslint node: true */ | ||
var website = {}; | ||
|
||
website.components = {}; | ||
|
||
(function (publics) { | ||
"use strict"; | ||
|
||
website.components.listOfArticles = require('./modules/list-of-articles'); | ||
website.components.markdownRender = require('./modules/markdown-render'); | ||
website.components.extendedFormatDate = require('../assets/javascripts/components/extended-format-date'); | ||
|
||
publics.changeVariations = function (next, locals, request) { | ||
var NA = this, | ||
mongoose = NA.modules.mongoose, | ||
marked = NA.modules.marked, | ||
Article = mongoose.model('article'), | ||
session = request.session; | ||
|
||
locals.backend = {}; | ||
locals.session = session; | ||
|
||
if (locals.query.query) { | ||
website.components.listOfArticles({ | ||
Article: Article, | ||
search: locals.query.query, | ||
marked: marked, | ||
session: locals.session, | ||
markdownRender: website.components.markdownRender, | ||
extendedFormatDate: website.components.extendedFormatDate, | ||
locals: locals | ||
}, function (listOfArticles) { | ||
var nbrArticle = listOfArticles.length, | ||
add = (nbrArticle > 1) ? 's' : ''; | ||
|
||
if (nbrArticle > 0) { | ||
locals.backend.articles = listOfArticles; | ||
locals.specific.breadcrumb.items[2].content = locals.query.query; | ||
locals.specific.breadcrumb.items[2].title = locals.query.query; | ||
locals.specific.breadcrumb.items[2].href = locals.specific.breadcrumb.items[2].href.replace(/%search%/g, locals.query.query.replace(/ /g, '+')); | ||
locals.specific.articles.title = locals.specific.articles.title.replace(/%search%/g, locals.query.query).replace(/%nbr%/g, nbrArticle).replace(/%moreOne%/g, add); | ||
locals.specific.description = locals.specific.articles.title; | ||
locals.specific.titlePage = locals.specific.articles.title; | ||
} else { | ||
locals.specific.breadcrumb.items[2].href = locals.specific.breadcrumb.items[2].href.replace(/%search%/g, locals.query.query.replace(/ /g, '+')); | ||
locals.specific.articles.title = locals.specific.articles.titleNoSearch; | ||
locals.specific.articles.noArticle = locals.specific.articles.noArticle.replace(/%search%/g, locals.query.query); | ||
locals.specific.description = locals.specific.articles.noArticle; | ||
locals.specific.titlePage = locals.specific.articles.titleNoSearch; | ||
} | ||
|
||
next(); | ||
}); | ||
} else { | ||
locals.specific.breadcrumb.items.splice(2, 1); | ||
next(); | ||
} | ||
}; | ||
|
||
}(website)); | ||
|
||
exports.changeVariations = website.changeVariations; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"classLayout": "search", | ||
"titlePage": "Recherche par mots-clés", | ||
"description": "Liste des résultats de la recherche pour les mots-clés.", | ||
"breadcrumb": { | ||
"title": "Vous êtes ici :", | ||
"items": [{ | ||
"content": "Accueil", | ||
"title": "Accueil", | ||
"href": "./" | ||
}, { | ||
"content": "Recherche", | ||
"title": "Recherche", | ||
"href": "./recherche/" | ||
}, | ||
{ | ||
"content": "Aucun résultats", | ||
"title": "Aucun résultats", | ||
"href": "./recherche/?query=%search%" | ||
}] | ||
}, | ||
"formSearch": { | ||
"query": { | ||
"label": "Recherche", | ||
"placeHolder": "Vos mots-clés", | ||
"errors": { | ||
"empty": "Le champ recherche est vide." | ||
} | ||
}, | ||
"submit": { | ||
"label": "Rechercher" | ||
} | ||
}, | ||
"articles": { | ||
"title": "%nbr% résultat%moreOne% trouvé%moreOne% pour la recherche « %search% »", | ||
"titleNoSearch": "Aucun résultats trouvés", | ||
"noArticle": "Aucun résultats trouvé pour la recherche « %search% »." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<? include partials/master-head.htm ?> | ||
|
||
<? include partials/master-content.htm ?> | ||
|
||
<div id="content" class="content"> | ||
|
||
<? include partials/search.htm ?> | ||
<? if (query.query) { ?> | ||
<? include partials/articles.htm ?> | ||
<? } ?> | ||
|
||
</div> | ||
|
||
<? include partials/header.htm ?> | ||
<? include partials/footer.htm ?> | ||
|
||
<? include partials/master-foot.htm ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<section class="search"> | ||
<h1><?- common.search.title ?></h1> | ||
|
||
<form class="form-search" action="./recherche/" method="get"> | ||
<div class="field query"> | ||
<label for="search-query"><?- specific.formSearch.query.label ?></label> | ||
<input type="text" id="search-query" class="search-query" name="query" placeholder="<?= specific.formSearch.query.placeHolder ?>" value="<?= query.query ?>"> | ||
<div class="errors"> | ||
<div class="empty"><?- specific.formSearch.query.errors.empty ?></div> | ||
</div> | ||
</div> | ||
|
||
<div class="submit"> | ||
<label><button class="search-button"><?= specific.formSearch.submit.label ?></button></label> | ||
</div> | ||
</form> | ||
|
||
</section> |