mirror of
https://github.com/discourse/discourse-subscriptions.git
synced 2025-07-08 15:22:46 +00:00
only show cause UI in cause categories
This commit is contained in:
parent
45ece34200
commit
d58c04a592
@ -13,13 +13,12 @@ createWidget('category-header-widget', {
|
|||||||
tagName: 'span',
|
tagName: 'span',
|
||||||
|
|
||||||
html() {
|
html() {
|
||||||
const path = window.location.pathname;
|
|
||||||
let category;
|
let category;
|
||||||
|
|
||||||
const controller = this.container.lookup('controller:navigation/category');
|
const controller = this.container.lookup('controller:navigation/category');
|
||||||
category = controller.get("category");
|
category = controller.get("category");
|
||||||
|
|
||||||
if(/^\/c\//.test(path)) {
|
if(category && category.donations_cause) {
|
||||||
$("body").addClass("donations-category");
|
$("body").addClass("donations-category");
|
||||||
|
|
||||||
let contents = [
|
let contents = [
|
||||||
|
@ -151,7 +151,6 @@ div.stripe-errors {
|
|||||||
width: 500px;
|
width: 500px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
padding-top: 10px;
|
|
||||||
padding-bottom: 40px;
|
padding-bottom: 40px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -36,6 +36,10 @@ after_initialize do
|
|||||||
end
|
end
|
||||||
|
|
||||||
class ::Category
|
class ::Category
|
||||||
|
def donations_cause
|
||||||
|
SiteSetting.discourse_donations_causes_categories.split('|').include? self.id.to_s
|
||||||
|
end
|
||||||
|
|
||||||
def donations_total
|
def donations_total
|
||||||
if custom_fields['donations_total']
|
if custom_fields['donations_total']
|
||||||
custom_fields['donations_total']
|
custom_fields['donations_total']
|
||||||
@ -82,6 +86,7 @@ after_initialize do
|
|||||||
end
|
end
|
||||||
|
|
||||||
if SiteSetting.discourse_donations_cause_category
|
if SiteSetting.discourse_donations_cause_category
|
||||||
|
add_to_serializer(:basic_category, :donations_cause) { object.donations_cause }
|
||||||
add_to_serializer(:basic_category, :donations_total) { object.donations_total }
|
add_to_serializer(:basic_category, :donations_total) { object.donations_total }
|
||||||
add_to_serializer(:basic_category, :donations_month) { object.donations_month }
|
add_to_serializer(:basic_category, :donations_month) { object.donations_month }
|
||||||
add_to_serializer(:basic_category, :donations_backers) {
|
add_to_serializer(:basic_category, :donations_backers) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user