mirror of
https://github.com/davegallant/rfd-fyi.git
synced 2025-08-07 00:58:12 +00:00
Add dealer badge
This commit is contained in:
@@ -91,7 +91,7 @@ func (a *App) listTopics(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) refreshTopics() {
|
func (a *App) refreshTopics() {
|
||||||
latestTopics := a.getDeals(9, 1, 4)
|
latestTopics := a.getDeals(9, 1, 6)
|
||||||
latestTopics = a.updateScores(latestTopics)
|
latestTopics = a.updateScores(latestTopics)
|
||||||
log.Debug().Msg("Refreshing topics")
|
log.Debug().Msg("Refreshing topics")
|
||||||
a.CurrentTopics = latestTopics
|
a.CurrentTopics = latestTopics
|
||||||
|
@@ -14,6 +14,7 @@ type Topic struct {
|
|||||||
PostTime string `json:"post_time"`
|
PostTime string `json:"post_time"`
|
||||||
LastPostTime string `json:"last_post_time"`
|
LastPostTime string `json:"last_post_time"`
|
||||||
Votes Votes
|
Votes Votes
|
||||||
|
Offer Offer
|
||||||
Score int `json:"score"`
|
Score int `json:"score"`
|
||||||
} // @name Topic
|
} // @name Topic
|
||||||
|
|
||||||
@@ -21,3 +22,7 @@ type Votes struct {
|
|||||||
Up int `json:"total_up"`
|
Up int `json:"total_up"`
|
||||||
Down int `json:"total_down"`
|
Down int `json:"total_down"`
|
||||||
} // @name Votes
|
} // @name Votes
|
||||||
|
|
||||||
|
type Offer struct {
|
||||||
|
DealerName string `json:"dealer_name"`
|
||||||
|
} // @name Offer
|
||||||
|
@@ -85,7 +85,7 @@ export default {
|
|||||||
},
|
},
|
||||||
filteredTopics() {
|
filteredTopics() {
|
||||||
return this.topics.filter((row) => {
|
return this.topics.filter((row) => {
|
||||||
const titles = row.title.toString().toLowerCase();
|
const titles = (row.title.toString() + ' [' + row.Offer.dealer_name + ']').toLowerCase();
|
||||||
const searchTerm = this.filter.toLowerCase();
|
const searchTerm = this.filter.toLowerCase();
|
||||||
|
|
||||||
return titles.includes(searchTerm);
|
return titles.includes(searchTerm);
|
||||||
@@ -154,7 +154,7 @@ export default {
|
|||||||
<a
|
<a
|
||||||
:href="`https://forums.redflagdeals.com${topic.web_path}`"
|
:href="`https://forums.redflagdeals.com${topic.web_path}`"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
v-html="highlightMatches(topic.title)"
|
v-html="highlightMatches(topic.title + ' [' + topic.Offer.dealer_name + ']')"
|
||||||
></a>
|
></a>
|
||||||
</td>
|
</td>
|
||||||
<td v-if="topic.score > 0" scope="col" class="green-score">
|
<td v-if="topic.score > 0" scope="col" class="green-score">
|
||||||
|
Reference in New Issue
Block a user