-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from zarathustra323/branding
Story publisher and advertiser/publisher website fields
- Loading branch information
Showing
21 changed files
with
153 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import Component from '@ember/component'; | ||
import { inject } from '@ember/service'; | ||
|
||
export default Component.extend({ | ||
autocomplete: inject(), | ||
|
||
classNames: ['form-group'], | ||
value: null, | ||
|
||
actions: { | ||
/** | ||
* Performs the advertiser autocomplete search. | ||
* | ||
* @param {*} phrase | ||
*/ | ||
search(phrase) { | ||
return this.get('autocomplete').query('publishers', phrase); | ||
}, | ||
}, | ||
}); |
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
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
fragment AdvertiserEditFragment on Advertiser { | ||
id | ||
name | ||
website | ||
hash | ||
logo { | ||
...ImageSrcFragment | ||
|
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 |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
fragment PublisherEditFragment on Publisher { | ||
id | ||
name | ||
website | ||
createdAt | ||
updatedAt | ||
domainName | ||
|
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
22 changes: 22 additions & 0 deletions
22
app/templates/components/-forms/story/-fields/publisher.hbs
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,22 @@ | ||
<label for="story-publisher">Primary Publisher {{required-field-label}}</label> | ||
{{#form.elements.typeahead | ||
id="story-publisher" | ||
placeholder="Begin typing to search..." | ||
autocomplete="off" | ||
class="form-control" | ||
name="publisher" | ||
label="Primary Publisher" | ||
value=model.publisher | ||
disabled=disabled | ||
required=true | ||
aria-labeledby="story-publisher-help" | ||
allowClear=false | ||
on-search=(action "search") | ||
on-change=on-change as |typeahead| | ||
}} | ||
{{#typeahead.element as |publisher|}} | ||
{{publisher.name}} | ||
{{/typeahead.element}} | ||
{{typeahead.elements.invalid-feedback}} | ||
{{/form.elements.typeahead}} | ||
<small id="story-publisher-help" class="form-text text-muted">The primary publisher running the story.</small> |
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
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 @@ | ||
<div class="form-group"> | ||
<label for="name">Primary Publisher {{required-field-label}}</label> | ||
{{#type-ahead | ||
required=true | ||
wasFormValidated=form.wasValidated | ||
invalidFeedback="Please select a publisher." | ||
triggerClass="form-control" | ||
placeholder="Begin typing to search..." | ||
type="publisher" | ||
closeOnSelect=true | ||
allowClear=false | ||
onChange=(action form.actions.autosave) | ||
selected=form.model.publisher as |item| | ||
}} | ||
{{item.name}} | ||
{{/type-ahead}} | ||
</div> |
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