-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
/galleries/:id expands upon /search/G321
truncate the gallery panel text on search pages, it gets a bit wordy. Show full text on dedicated gallery pages
- Loading branch information
Showing
6 changed files
with
76 additions
and
8 deletions.
There are no files selected for viewing
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
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,47 @@ | ||
var React = require('react') | ||
var Router = require('react-router') | ||
var Helmet = require('react-helmet') | ||
|
||
var rest = require('rest') | ||
|
||
var Search = require('./search') | ||
var SearchResults = require('./search-results') | ||
var GalleryDecorator = require('./decorate/gallery.js') | ||
var Markdown = require('./markdown') | ||
var Peek = require('./peek') | ||
|
||
var Gallery = React.createClass({ | ||
mixins: [Router.State], | ||
|
||
statics: { | ||
fetchData: { | ||
gallery: (params, query) => { | ||
var id = params.gallery.replace(/g/i, '') | ||
var url = `https://cdn.rawgit.com/artsmia/mia-gallery-panels/master/${id}.md` | ||
return rest(url).then(result => result.entity) | ||
}, | ||
searchResults: (params, query) => { | ||
if(!params.gallery.match(/g/i)) params.gallery = `G${params.gallery}` | ||
params.terms = '*' | ||
params.splat = 'room:"'+params.gallery+'"' | ||
return SearchResults.fetchData.searchResults(params, query) | ||
}, | ||
// departments: (params, query) => { | ||
// return rest(endpoint).then((r) => JSON.parse(r.entity)) | ||
// } | ||
}, | ||
}, | ||
|
||
render() { | ||
var {gallery} = this.props.params | ||
var facet = `room:"${gallery}"` | ||
|
||
return <Search | ||
facet={facet} | ||
{...this.props} | ||
summaryProps={{showFullGalleryInfo: true}} | ||
/> | ||
}, | ||
}) | ||
|
||
module.exports = Gallery |
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