Commit Graph

59 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
Loïc Guitaut c4227de1b5 DEV: Fix new Rubocop offenses 2024-03-05 18:12:49 +01:00
Blake Erickson b0c95114ea
FIX: Calculate no ads for groups server side (#200)
If the selected group to not display ads to had its visibility set to
not be visible then this setting wouldn't work correctly because that
group wouldn't be available client side. The change moves that group
check to be server side so that we can correctly see all the groups that
should not see ads.
2024-02-15 14:52:15 -07:00
Blake Erickson 6f8ff34ffa
DEV: Convert TL settings to groups (#195)
* DEV: Convert TL settings to groups

This change converts the TL site settings in this plugin to use groups
instead.

See: https://meta.discourse.org/t/283408

Co-authored-by: Martin Brennan <martin@discourse.org>
2024-01-31 11:04:24 -07:00
Jarek Radosz 429c9644de
DEV: Update linting (#191) 2024-01-15 11:24:24 +00:00
Martin Brennan 1d39cd8c80
Update plugin.rb metadata (#183)
Co-authored-by: AlexDev <104522507+alexdevlaeminck@users.noreply.github.com>
2023-11-08 11:16:53 -08: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
David Taylor c73ac98748
DEV: Introduce syntax_tree for ruby formatting (#161) 2022-12-29 13:29:26 +01:00
Jarek Radosz c788b7bf1f
DEV: Lose the es6 suffix (#131) 2022-03-05 17:23:41 +01:00
jjaffeux 75fb2bf892 FIX: defines an enabled_site_setting
This will amongst other things prevent to load plugin's code if the plugin is disabled.
2020-08-01 17:31:28 +02:00
jjaffeux 1e6e3bb3e9 DEV: 2.5 is now stable 2020-08-01 17:22:17 +02:00
jjaffeux 06ea132309 DEV: 2.4.0.beta3 has been released 2020-08-01 17:21:40 +02:00
Kane York 5273d52f28
FIX: Do not require login to see ads.txt (#84) 2020-06-24 16:26:04 +10:00
Neil Lalonde 8d4df6df91 Rename house ad routes so ad blockers don't detect them
adplugin, house_ads, house_ad_settings become
pluginad, house_creatives, and house_settings.
2019-10-08 17:41:13 -04:00
Neil Lalonde cc09403757 Bump to version 1.2.5 2019-09-16 15:03:47 -04:00
Neil Lalonde 0612054da8 Bump to version 1.2.4 2019-09-10 17:09:21 -04:00
Roman Rizzi 2ceb99e151
DEV: migrate no_ads_for_groups to use IDs instead of group names (#77) [Undo revert] (#79)
This reverts commit dee02ac3ba.
2019-07-19 10:29:52 -03:00
Roman Rizzi dee02ac3ba
Revert "DEV: migrate no_ads_for_groups to use IDs instead of group names (#77)" (#78)
This reverts commit 09a92f3438.
2019-07-16 11:57:20 -03:00
Roman Rizzi 09a92f3438
DEV: migrate no_ads_for_groups to use IDs instead of group names (#77) 2019-07-16 11:35:16 -03:00
Neil Lalonde 6f786b2f4d Bump to version 1.2.3 2019-06-27 14:16:19 -04:00
Neil Lalonde 8ab28f4fda Bump to version 1.2.2 2019-06-17 21:01:33 -04:00
Neil Lalonde 92609c7af4 FIX: no_ads_for_tags support for hidden tags
Hidden tags aren't sent to the client, so they couldn't be used to
disable ads on topic pages. Do this calculation on the server.
Topic list pages for tags can continue to check on the client because
non-staff get a 404 error when trying to view a hidden tag's topic list.
2019-06-17 17:20:38 -04:00
Neil Lalonde 35c1af6648 Version bump to 1.2.1 2019-06-05 17:01:31 -04:00
Penar Musaraj f745ecfbdc Rename adsense_ads_txt setting to ads_txt 2019-06-03 11:39:28 -04:00
Guo Xiang Tan 546101a357 Add frozen string literal to files. 2019-05-13 10:16:50 +08:00
Neil Lalonde cdc14398ba FIX: linking to house ads URLs shows not found error page 2019-05-07 14:32:32 -04:00
Neil Lalonde 171656304b Version bump, update readme with House Ads info 2019-05-03 11:56:59 -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 7ee19d79c3 FIX: CSP URLs 2019-04-15 11:54:18 -04:00
Diego Barreiro a1649f7cce BUMP: Plugin Version 2019-04-15 11:54:18 -04:00
Diego Barreiro 40c0af2177 DEV: Whitelist CarbonAds URLs on CSP 2019-04-15 11:54:18 -04:00
Penar Musaraj ccad3ca226 FEAT: ads.txt support
Adds a plugin setting that holds text content served on a new /ads.txt route.
2019-02-04 16:14:43 -05:00
Neil Lalonde 0debcbf2e8 Move scss out of plugin.rb into a file in assets/stylesheets 2019-02-01 13:46:11 -05:00
Nathan Hopkins de0a47c1a7 Update CodeFund Ads to use new CodeFund API (#1)
Update CodeFund plugin to work with CodeFund's new API
2019-01-30 13:51:22 -05:00
Penar Musaraj 9172a8f405 Revert "Add support for ads.txt redirect"
This reverts commit f6c7c2d1af.

Ads.txt redirection can be done directly in core, in admin/customize/permalinks.
2019-01-29 16:22:00 -05:00
Penar Musaraj 4aa6da8913 Add support for ads.txt redirect 2019-01-28 21:39:49 -05:00
Joe 2ed1d1c5d6
UX: adsense label causes horizontal scroll on mobiles 2018-09-15 04:44:59 +08:00
Neil Lalonde eb4f18aaa8 fix layout of /categories page 2018-06-20 15:33:06 -04:00
Eric Berry 1cd33da722 Add CodeFund 2018-06-07 17:17:19 -06:00
Neil Lalonde e06005cb27 remove blue background 2018-02-15 13:59:44 -05:00
Neil Lalonde 5cfead3d2a FIX: AdSense responsive ads in between posts were too wide 2018-02-15 13:59:08 -05:00
Neil Lalonde dce06afbdb
Merge pull request #57 from jomaxro/patch-1
Add URL to plugin.rb
2018-01-08 12:05:59 -05:00
Guo Xiang Tan a1920b6e5f Fix rubocop offenses. 2017-08-02 15:04:15 +09:00
Neil Lalonde 62377e6111 Support for AdSense responsive ad size 2017-05-30 15:54:59 -04:00
jomaxro 5097ae9377 Add URL to plugin.rb 2017-04-26 00:43:04 -04:00
Neil Lalonde cee3f66009 Render nth post dfp ads in position where post would be 2016-04-21 18:53:39 -04:00
Neil Lalonde ef45e3290e Don't hard-code center justify of AdSense ads. Let position be customized with CSS. 2016-04-04 16:51:34 -04:00
Neil Lalonde 99319c7b91 FIX: mobile ad with is too wide on 320px wide devices 2015-10-28 17:08:38 -04:00
Neil Lalonde cf850b273d FIX: refresh DFP ads after navigating between topics and lists 2015-10-15 13:58:49 -04:00
Sarah Ni 292951e302 Added Advertisement Label on top of Ad 2015-09-30 10:48:26 +10:00