added artist to extended

This commit is contained in:
Daniel 2019-02-07 20:41:57 -05:00
parent 2ac310136f
commit edf9aeac3d
8 changed files with 52 additions and 23 deletions

File diff suppressed because one or more lines are too long

View File

@ -341,17 +341,20 @@ export default class SearchCollection extends React.Component {
{'gsx$tags': {"$or": textList}},
{'gsx$ability': {"$or": textList}},
{'gsx$flavortext': {"$or": textList}},
{'gsx$brainwashed': {"$or": textList}}
{'gsx$brainwashed': {"$or": textList}},
{'gsx$artist': {"$or": textList}}
]});
locationResults = locationResults.find({'$or': [
{'gsx$tags': {"$or": textList}},
{'gsx$ability': {"$or": textList}},
{'gsx$flavortext': {"$or": textList}}
{'gsx$flavortext': {"$or": textList}},
{'gsx$artist': {"$or": textList}}
]});
mugicResults = mugicResults.find({'$or': [
{'gsx$tags': {"$or": textList}},
{'gsx$ability': {"$or": textList}},
{'gsx$flavortext': {"$or": textList}}
{'gsx$flavortext': {"$or": textList}},
{'gsx$artist': {"$or": textList}}
]});
}

View File

@ -41,7 +41,10 @@ export default class Attack extends React.Component {
<Name name={card.gsx$name} /><br />
<Ability ability={card.gsx$ability} />
<Unique data={{unique: card.gsx$unique, loyal: card.gsx$loyal, legendary: card.gsx$legendary}} />
<span className="flavortext">{card.gsx$flavortext}</span>
{card.gsx$flavortext && <React.Fragment>
<span className="flavortext">{card.gsx$flavortext}</span><br />
</React.Fragment>}
<span>Art By: {card.gsx$artist}</span>
</div>
</div>
);

View File

@ -33,7 +33,10 @@ export default class Battlegear extends React.Component {
<Name name={card.gsx$name} /><br />
<Ability ability={card.gsx$ability} />
<Unique data={{unique: card.gsx$unique, loyal: card.gsx$loyal, legendary: card.gsx$legendary}} />
<span className="flavortext">{card.gsx$flavortext}</span>
{card.gsx$flavortext && <React.Fragment>
<span className="flavortext">{card.gsx$flavortext}</span><br />
</React.Fragment>}
<span>Art By: {card.gsx$artist}</span>
</div>
</div>
);

View File

@ -71,7 +71,10 @@ export default class Creature extends React.Component {
card.gsx$types.includes("Chieftain") &&
<span className="chieftain">(Minions use Brainwashed text. Minions may only play Generic Mugic.)<br /></span>
}
<span className="flavortext">{card.gsx$flavortext}</span>
{card.gsx$flavortext && <React.Fragment>
<span className="flavortext">{card.gsx$flavortext}</span><br />
</React.Fragment>}
<span>Art By: {card.gsx$artist}</span>
</div>
</div>
);

View File

@ -34,7 +34,10 @@ export default class Location extends React.Component {
<Name name={card.gsx$name} /><br />
<Ability ability={card.gsx$ability} />
<Unique data={{unique: card.gsx$unique, loyal: card.gsx$loyal, legendary: card.gsx$legendary}} />
<span className="flavortext">{card.gsx$flavortext}</span>
{card.gsx$flavortext && <React.Fragment>
<span className="flavortext">{card.gsx$flavortext}</span><br />
</React.Fragment>}
<span>Art By: {card.gsx$artist}</span>
</div>
</div>
);

View File

@ -49,7 +49,10 @@ export default class Attack extends React.Component {
<Name name={card.gsx$name} /><br />
<Ability ability={card.gsx$ability} tribe={card.gsx$tribe} />
<Unique data={{unique: card.gsx$unique, loyal: card.gsx$loyal, legendary: card.gsx$legendary}} />
<span className="flavortext">{card.gsx$flavortext}</span>
{card.gsx$flavortext && <React.Fragment>
<span className="flavortext">{card.gsx$flavortext}</span><br />
</React.Fragment>}
<span>Art By: {card.gsx$artist}</span>
</div>
</div>
);

View File

@ -137,19 +137,19 @@ class DBSearch extends React.Component {
switch (card.gsx$type) {
case "Attacks":
link += '/Attacks/' + card.gsx$name;
link += '/Attacks/' + encodeURIComponent(card.gsx$name);
break;
case "Battlegear":
link += '/Battlegear/' + card.gsx$name;
link += '/Battlegear/' + encodeURIComponent(card.gsx$name);
break;
case "Creatures":
link += '/Creatures/' + card.gsx$name;
link += '/Creatures/' + encodeURIComponent(card.gsx$name);
break;
case "Locations":
link += '/Locations/' + card.gsx$name;
link += '/Locations/' + encodeURIComponent(card.gsx$name);
break;
case "Mugic":
link += '/Mugic/' + card.gsx$name;
link += '/Mugic/' + encodeURIComponent(card.gsx$name);
break;
}
@ -168,18 +168,28 @@ class DBSearch extends React.Component {
mugicResults = API.portal.mugic.find({'gsx$name': {'$regex': new RegExp(string, 'i')}});
let names = [].concat(attackResults, battlegearResults, creatureResults, locationResults, mugicResults).map(makeLink);
attackResults = API.cards.attacks.find({'gsx$artist': {'$regex': new RegExp(string, 'i')}});
battlegearResults = API.cards.battlegear.find({'gsx$artist': {'$regex': new RegExp(string, 'i')}});
creatureResults = API.cards.creatures.find({'gsx$artist': {'$regex': new RegExp(string, 'i')}});
locationResults = API.cards.locations.find({'gsx$artist': {'$regex': new RegExp(string, 'i')}});
mugicResults = API.cards.mugic.find({'gsx$artist': {'$regex': new RegExp(string, 'i')}});
let artists = [].concat(attackResults, battlegearResults, creatureResults, locationResults, mugicResults).map(makeLink);
let header;
if (results.length == 0) {
let artists = [].concat(
API.cards.attacks.chain()
.find({'gsx$artist': {'$regex': new RegExp(string, 'i')}})
.where((obj) => {return (obj.gsx$splash != ('') )}).data(),
API.cards.battlegear.chain()
.find({'gsx$artist': {'$regex': new RegExp(string, 'i')}})
.where((obj) => {return (obj.gsx$splash != ('') )}).data(),
API.cards.creatures.chain()
.find({'gsx$artist': {'$regex': new RegExp(string, 'i')}})
.where((obj) => {return (obj.gsx$splash != ('') )}).data(),
API.cards.locations.chain()
.find({'gsx$artist': {'$regex': new RegExp(string, 'i')}})
.where((obj) => {return (obj.gsx$splash != ('') )}).data(),
API.cards.mugic.chain()
.find({'gsx$artist': {'$regex': new RegExp(string, 'i')}})
.where((obj) => {return (obj.gsx$splash != ('') )}).data()
).map(makeLink);
if (artists.length > 0) {
header = `Art contributed by ${string}:`;
content = artists;
@ -193,8 +203,9 @@ class DBSearch extends React.Component {
}
return (<div className="results">
<br />
<hr />
{names.length > 0 && <React.Fragment>
<div>Entries</div>
{names}
<hr />
</React.Fragment>}