Commit Graph

15 Commits

Author SHA1 Message Date
Isaac Janzen 554f03f3da
FEATURE: Add group and category restrictions to house ads (#205)
# Description

This PR adds the ability to apply **group** and **category** restrictions to a **house ad**.

# What is included
- In order to get the group and category selectors to work within `admin/assets/javascripts/discourse/controllers/admin-plugins-house-ads-show.js` I needed to modernize the file. 
- I dropped the `bufferedProperty` implementation in favor of a vanilla ember approach
- I added `category_ids` and `group_ids` to our house ads model
- I added tests for group / category restrictions
- I added a preview button to display the house ad
- `/site.json` would return a object called `house_creatives` and a list of key value pairs that matched the ad name with the html, like so:
```js
{ AD_KEY: ad.html }
```
I need access to the category ids on the client to conditionally render the house ads so the new format will be: 
```js
{ AD_KEY: { html: ad.html, category_ids: ad.category_ids } }
```

# Screenshots
<img width="658" alt="Screenshot 2024-04-08 at 2 39 22 PM" src="https://github.com/discourse/discourse-adplugin/assets/50783505/b44b386d-65a1-4a2a-a487-d735b13357dd">

# Preview Video

https://github.com/discourse/discourse-adplugin/assets/50783505/6d0d8253-afef-4e15-b6fc-c6f696efd169
2024-04-09 11:54:11 -06:00
Kris 58205cc9ac
UX: introduce min-height for responsive ads (#170) 2023-04-25 16:19:48 -04:00
Osama Sayegh c2057a5056
FEATURE: Add per-ad visibility settings for anons and logged-in users (#168)
This commit adds 2 new settings to house ads to control whether an ad is shown to anonymous users and logged in users. Existing ads that were created before this feature will default to true for both settings; i.e., they will remain to be visible to both anonymous and logged-in users, but it will be possible to change the settings. Turning off both settings will effectively disable the ad completely.
2023-04-07 17:56:22 +03:00
Penar Musaraj 190aa503ce
DEV: SCSS cleanup 2021-06-23 21:59:53 -04:00
Penar Musaraj c25c041f98
DEV: Remove SCSS color vars fallbacks (#112) 2021-05-12 16:16:40 -04:00
Penar Musaraj 1d073e2a96
DEV: Use CSS custom properties for colors in SCSS
Prepares the plugin for an upcoming change in core while maintaining
backwards compatiblity.
2020-08-03 13:11:20 -04:00
Bianca Nenciu 3fc872520e
FIX: CodeFund is shutting down (#85) 2020-07-10 18:09:32 +03:00
Neil Lalonde edc549b269 UX: remove left padding of ads between posts on narrow width browsers 2019-09-17 11:27:01 -04:00
Neil Lalonde 51c1b89a62 Prettier 2019-09-16 14:35:58 -04:00
discoursehosting 19f0457e8c AdButler support (#80) 2019-09-16 14:26:17 -04:00
Neil Lalonde 4991941d03 FIX: CodeFund ads in between posts on narrow widths 2019-07-18 12:16:02 -04:00
Penar Musaraj 574500ba08 Run Prettier 2019-06-14 13:24:55 -04:00
Neil Lalonde 1bd80e1afe FEATURE: House Ads
Allows creating ads within Discourse admin at Plugins > House Ads.
Write the ads in html and style them with CSS in themes.
2019-05-03 11:39:34 -04:00
Diego Barreiro 0980914d0c UI: Style Ads 2019-04-15 11:54:18 -04:00
Neil Lalonde 0debcbf2e8 Move scss out of plugin.rb into a file in assets/stylesheets 2019-02-01 13:46:11 -05:00