Author SHA1 Message Date
Kelvin Tan 23b8e3f607 DEV: Update to Font Awesome 6 icon names 2024-12-04 08:30:40 +08:00
David Taylor 7685ebf396 DEV: Update to native class syntax (#230) 2024-11-29 10:11:21 +00:00
David Taylor 4506b0b837 DEV: Update linting (#229) 2024-11-28 15:49:06 +01:00
David Taylor 0400165798 DEV: Update linting (#228) 2024-11-20 18:50:41 +01:00
David Taylor 119d331759 DEV: Update linting (#227) 2024-11-20 15:43:19 +01:00
dependabot[bot] e28f97a0f4 Bump cross-spawn from 7.0.3 to 7.0.6 (#226)
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-19 10:37:59 +00:00
David Taylor 1d3baa5519 DEV: Update eslint config (#225) 2024-11-19 11:18:26 +01:00
Discourse Translator Bot 21de3a2b10 Update translations (#224) 2024-10-29 15:31:18 +01:00
dependabot[bot] c91c456187 Bump rexml from 3.3.6 to 3.3.9 (#223)
Bumps [rexml](https://github.com/ruby/rexml) from 3.3.6 to 3.3.9.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.3.6...v3.3.9)

---
updated-dependencies:
- dependency-name: rexml
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-28 20:43:51 +01:00
Kelv e42b90507e DEV: Switch to use pnpm (#222) 2024-10-14 13:37:11 +02:00
dependabot[bot] 38354f2a2f Bump micromatch from 4.0.5 to 4.0.8 (#221)
Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.5 to 4.0.8.
- [Release notes](https://github.com/micromatch/micromatch/releases)
- [Changelog](https://github.com/micromatch/micromatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/micromatch/compare/4.0.5...4.0.8)

---
updated-dependencies:
- dependency-name: micromatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-01 12:46:36 +02:00
dependabot[bot] fc109c75c4 Bump rexml from 3.3.3 to 3.3.6 (#219)
Bumps [rexml](https://github.com/ruby/rexml) from 3.3.3 to 3.3.6.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.3.3...v3.3.6)

---
updated-dependencies:
- dependency-name: rexml
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-01 12:31:59 +02:00
Jarek Radosz 35cc34ab17 DEV: Update ace-editor usage (#220)
AceEditor is now a glimmer component (see: https://github.com/discourse/discourse/pull/28492) and it follows the "data down, actions up" pattern.
2024-08-27 13:53:15 +02:00
Discourse Translator Bot 95993e7d93 Update translations (#218) 2024-08-13 16:30:54 +02:00
dependabot[bot] 10093e0a9f Bump rexml from 3.2.8 to 3.3.3 (#217)
Bumps [rexml](https://github.com/ruby/rexml) from 3.2.8 to 3.3.3.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.2.8...v3.3.3)

---
updated-dependencies:
- dependency-name: rexml
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 13:16:47 +02:00
Natalie Tay 02f602236a DEV: Pin plugin for Discourse < 3.4.0.beta1-dev (#216) 2024-08-02 17:03:18 +08:00
Discourse Translator Bot da38a4c053 Update translations (#215) 2024-07-31 00:13:50 +02:00
Arpit Jalan ec53a0d6b8 FIX: add a fix for cases where ad record is not found (#214) 2024-07-05 13:00:18 +05:30
Arpit Jalan 9b72130fdf FIX: show non-restricted ads instead of not showing ads at all (#213)
In some cases where there were category restricted house ads we were not
showing ads on reload. This commit filter out all the ads that should
not be shown on current page, leaving only allowed ads. So now we'll
show ads on every reload in all the cases.

Internal ticket: t130920
2024-06-27 22:13:54 +05:30
Discourse Translator Bot a38fbd0935 Update translations (#212) 2024-06-25 15:39:10 +02:00
dependabot[bot] ea9a0def55 Bump braces from 3.0.2 to 3.0.3 (#211)
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-16 22:30:23 +02:00
Discourse Translator Bot 81843e8c98 Update translations (#210) 2024-06-04 21:43:55 +02:00
Discourse Translator Bot 114639d2e7 Update translations (#209) 2024-05-31 12:26:24 +02:00
Loïc Guitaut 5f1e07c556 DEV: Update rubocop-discourse to version 3.8.0 (#208) 2024-05-28 11:11:14 +02:00
dependabot[bot] f5c1b6da59 Bump rexml from 3.2.6 to 3.2.8 (#207)
Bumps [rexml](https://github.com/ruby/rexml) from 3.2.6 to 3.2.8.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.2.6...v3.2.8)

---
updated-dependencies:
- dependency-name: rexml
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-16 23:54:19 +02:00
Discourse Translator Bot 6cd52a4966 Update translations (#206) 2024-04-16 17:37:40 +02:00
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
Selase Krakani 84d9b1a6da DEV: Pin plugin for Discourse < 3.3.0.beta1-dev (#203) 2024-02-29 13:48:36 -07:00
Discourse Translator Bot 062efc8a54 Update translations (#202) 2024-02-23 09:42:33 +01:00
David Taylor 32f18893ec FEATURE: Improve DFP / Ad-manager Content-Security-Policy compat (#201)
Switching to cross-domain iframes is recommended by google here: https://developers.google.com/publisher-tag/guides/content-security-policy
2024-02-19 12:35:22 +00: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
David Taylor 1677f7ae39 DEV: Pass post instead of transformedPost to post-bottom-ad (#199)
Changes in 0948d6b19e caused the post-bottom-ad component to start receiving the widget-ised 'transformedPost' instead of the original `post` model. In most cases this difference didn't matter, but it did cause noticable issues with `@model.category` and `@model.topic`.

This commit also deletes the unused `post-bottom/discourse-adplugin.hbs` connector. In the past, the adplugin itself was defining the post-bottom outlet. But now, we use RenderGlimmer to load the `post-bottom-ad` directly.
2024-02-14 13:59:36 +00:00
Discourse Translator Bot 751916b8e3 Update translations (#198) 2024-02-13 16:11:16 +01:00
Blake Erickson 9581367239 FIX: Add exclude groups for each ad platforms (#197)
With the new group system for displaying ads we no longer can check if a
user belongs to a trust level group lower than specified. The other
problem is that ALL users including staff and higher trust levels all
belong to trust level 0. So without this fix if we say that an ad should
be visible to trust level 0 users then it will be shown to all users.

This fix adds a new default setting for each ad platform for excluding
trust level 3, 4, and staff users from being shown ads.

- Make display_groups hidden (they will be removed in a later commit)
- Switch to using only exclude_groups instead of display groups and
  exclude groups
- rename showToDisplayGroups to showXAds for each provider
2024-02-08 19:42:40 -07:00
Blake Erickson 6b5412826f DEV: Update migration to match new site settings (#196)
Forgot to update these values in the previous PR.

Follow up to: https://github.com/discourse/discourse-adplugin/pull/195
2024-01-31 11:17:56 -07:00
Blake EricksonandMartin Brennan 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 <[email protected]>
2024-01-31 11:04:24 -07:00
Discourse Translator Bot 19ac017dd4 Update translations (#194) 2024-01-16 14:54:13 +01:00
Jarek Radosz 429c9644de DEV: Update linting (#191) 2024-01-15 11:24:24 +00:00
David Taylor de7d8ce497 DEV: Resolve more link-to deprecations for ember upgrade (#193) 2024-01-09 20:07:04 +00:00
David Taylor 51af568c92 DEV: Resolve link-to deprecation for Ember upgrade (#192) 2023-12-13 14:59:32 +00:00
Martin BrennanandAlexDev 1d39cd8c80 Update plugin.rb metadata (#183)
Co-authored-by: AlexDev <[email protected]>
2023-11-08 11:16:53 -08:00
David Taylor 36f4ebc64b DEV: Abort placing adsense if Ember component is destroyed (#190)
This should avoid surprising error messages being printed to the console
2023-11-08 10:44:39 +11:00
David Taylor 789be84744 DEV: Log errors from adsense (#189) 2023-11-07 22:44:02 +00:00
David Taylor c88bb59d81 FIX: Fully re-render ads when navigating between pages (#188)
In the past, the ad plugin relied on two side-effects to achieve this behaviour:

1. Components being fully destroyed/rendered when navigating between pages. This stopped working when Discourse core moved to the more efficient 'loading slider' UI

2. The `listLoading` argument. This was an implementation detail of the old discovery routing infrastructure. Core recently overhauled this and removed the `listLoading` argument, because loading is now handled properly by the Ember router.

Instead of these two properties, we can use the `currentRoute` property of Ember's router service to trigger changes when navigating between pages. A common `{{#each` trick is used to fully destroy/re-render components even if the ad network is unchanged.
2023-11-07 21:12:30 +00:00
Discourse Translator Bot 5ad841de0b Update translations (#184) 2023-11-07 21:31:35 +01:00
David Taylor 0948d6b19e DEV: Refactor initializer to use RenderGlimmer and registerWidgetShim 2023-11-07 18:37:39 +00:00
David Taylor 3828578d5d DEV: Restructure file locations
- Colocate components / connectors
- Move admin UI files to `admin/assets` so they are only served to admins
2023-11-07 18:37:39 +00:00
David Taylor dbafb3b277 DEV: Update tests to use qunit-dom 2023-11-07 18:14:12 +00:00
David Taylor 86ef7da2eb DEV: Apply eslint --fix 2023-11-07 18:14:12 +00:00
David Taylor 32a43a850f DEV: Update linting config 2023-11-07 18:14:12 +00:00
dependabot[bot] 8931e2a07e Bump @babel/traverse from 7.20.10 to 7.23.2 (#182)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.20.10 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-18 18:26:49 +02:00
Discourse Translator Bot 44f49725f8 Update translations (#181) 2023-08-29 15:50:11 +02:00
Discourse Translator Bot 3a89fbdd9a Update translations (#180) 2023-08-23 09:28:54 +02:00
Penar Musaraj 8f51e0e4c0 DEV: Pin plugin for Discourse 3.1 stable (#179) 2023-08-22 13:45:25 -05:00
Discourse Translator Bot 30c49eb50d Update translations (#178) 2023-08-08 15:42:08 +02:00
dependabot[bot] 8cb9628f0d Bump word-wrap from 1.2.3 to 1.2.4 (#177)
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-19 01:00:58 +02:00
dependabot[bot] b4aa9a05be Bump semver from 6.3.0 to 6.3.1 (#176)
Bumps [semver](https://github.com/npm/node-semver) from 6.3.0 to 6.3.1.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v6.3.1/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v6.3.0...v6.3.1)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-11 10:37:40 +02:00
Discourse Translator Bot db0097b8f8 Update translations (#175) 2023-07-04 18:13:14 +02:00
Discourse Translator Bot bade14daa0 Update translations (#174) 2023-06-27 16:39:17 +02:00
Isaac Janzen 743478d593 DEV: Use angle bracket syntax (#172) 2023-05-26 09:20:47 -05:00
Kris 58205cc9ac UX: introduce min-height for responsive ads (#170) 2023-04-25 16:19:48 -04:00
Discourse Translator Bot d3005f26af Update translations (#169) 2023-04-11 15:44:40 +02: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
Discourse Translator Bot bfd4438b97 Update translations (#167) 2023-02-21 17:11:00 +01:00
Rishabh 4d2ec950d0 Ensure README images are pointing to discourse/gh-owned repositories (#166) 2023-01-25 17:30:08 +05:30
discoursebotanddiscoursebuild 165ecdefc5 DEV: Update CI workflows (#165)
Co-authored-by: discoursebuild <[email protected]>
2023-01-10 18:02:36 +00:00
David Taylor c519b4bc92 DEV: Update eslint-config-discourse, use prettier for hbs (#163) 2023-01-04 13:34:08 +01:00
Discourse Translator Bot dc48bea931 Update translations (#164) 2022-12-30 17:49:25 +01:00
David Taylor c73ac98748 DEV: Introduce syntax_tree for ruby formatting (#161) 2022-12-29 13:29:26 +01:00
Discourse Translator Bot ff6b767796 Update translations (#160) 2022-12-28 13:31:54 +01:00
Discourse Translator Bot 116795aff3 Update translations (#159) 2022-11-29 15:35:21 +01:00
dependabot[bot] fd6ac11ee9 Bump minimatch from 3.0.4 to 3.1.2 (#157)
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-27 17:33:42 +01:00
Discourse Translator Bot 203eedb915 Update translations (#156) 2022-11-16 11:36:55 +01:00
discoursebotanddiscoursebuild 8ac32a06c3 DEV: Update CI workflows (#155)
Co-authored-by: discoursebuild <[email protected]>
2022-11-07 12:45:46 -06:00
Discourse Translator Bot f52ac0775f Update translations (#154) 2022-11-02 15:12:51 +01:00
Penar Musaraj fa2ec23ebc DEV: Use popupAjaxError instead of bootbox (#153) 2022-10-18 13:58:55 -04:00
Discourse Translator Bot f7d9d13de8 Update translations (#152) 2022-10-05 15:31:18 +02:00
David Taylor a647813ce7 DEV: Bump rubocop-discourse (#151)
* DEV: Bump rubocop-discourse

* Fix rubocop violations
2022-10-03 21:36:57 +02:00
Discourse Translator Bot a570a46ad2 Update translations (#150) 2022-09-27 19:07:32 +02:00
Discourse Translator Bot 3b50a509f2 Update translations (#149) 2022-07-26 15:20:46 +02:00
Roman Rizzi 4940d0ea19 FIX: Ensure we won't render the connector if there are no ads (#148) 2022-07-14 15:58:29 -03:00
Roman Rizzi d9b739f803 FIX: Don't render the connector when we shouldn't display an ad in the topic list item. (#146)
We expose the ad-slot logic to determine which ads are potentially available for each slot and don't render the connector when there are none. Leaking the component logic is not ideal, but I don't see a better solution given the
current design.
2022-07-12 16:13:18 -03:00
Discourse Translator Bot a4aa6332bb Update translations (#147) 2022-07-12 17:25:54 +02:00
Roman Rizzi 469771db1d DEV: Skip assertion temporarily. (#145)
The code-review plugin overrides the core's topic-list template, which makes all the connectors for the outlets there stop working. I'm temporarily skipping this assertion until we remove the override.
2022-07-07 15:07:16 -03:00
5901a52dbc FEATURE: support placing ads between topic list for house ads (#143)
* init

* more

* Pass td and colspan to component

* various fixes for house ads between n topics and add a test

* Make adComponents condition easier to read

Co-authored-by: Jordan Vidrine <[email protected]>
Co-authored-by: Penar Musaraj <[email protected]>
Co-authored-by: romanrizzi <[email protected]>
2022-07-07 08:53:29 -03:00
Discourse Translator Bot c27f5717e4 Update translations (#144) 2022-07-06 09:14:50 +02:00
Discourse Translator Bot a514c7aee2 Update translations (#142) 2022-06-21 15:25:57 +02:00
discoursebotanddiscoursebuild 3f951116fa DEV: Update CI workflows (#141)
Co-authored-by: discoursebuild <[email protected]>
2022-06-17 21:32:32 +02:00
Isaac Janzen fb73dda584 DEV: Remove 'htmlSafe' string prototype extensions (#140)
Context: https://deprecations.emberjs.com/v3.x/#toc_ember-string-prototype_extensions
2022-06-01 11:37:01 -05:00
discoursebotanddiscoursebuild b9ac5516bf DEV: Update CI workflows (#139)
Co-authored-by: discoursebuild <[email protected]>
2022-05-23 16:58:32 +02:00
dependabot[bot] e56197505f Bump async from 2.6.3 to 2.6.4 (#136)
Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.3...v2.6.4)

---
updated-dependencies:
- dependency-name: async
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-29 18:02:21 +02:00
dependabot[bot] 208b56b130 Bump ansi-regex from 4.1.0 to 4.1.1 (#135)
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-12 13:53:32 +02:00
dependabot[bot] 898de0c9c8 Bump minimist from 1.2.5 to 1.2.6 (#134)
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-12 13:51:42 +02:00
discoursebotanddiscoursebuild 8ca041846a DEV: Update CI workflows (#133)
Co-authored-by: discoursebuild <[email protected]>
2022-03-22 14:01:25 +01:00
Jarek Radosz 7e2a490b67 DEV: Fix imports (#132) 2022-03-06 19:52:19 +01:00
Jarek Radosz c788b7bf1f DEV: Lose the es6 suffix (#131) 2022-03-05 17:23:41 +01:00
Discourse Translator Bot 03ec825e8e Update translations (#130) 2022-02-14 15:20:25 +11:00
David Taylor 912e68e587 DEV: Import test helpers 2022-01-25 14:41:53 +00:00
discoursebuild 9be37644d8 DEV: Update CI workflows 2022-01-25 14:41:53 +00:00
Discourse Translator Bot 58085298f0 Update translations (#128) 2022-01-11 14:20:49 +01:00
Andrei Prigorshnev 62a4eff705 DEV: migrate routes to the new @action pattern (#126) 2022-01-06 15:16:37 +04:00
Discourse Translator Bot 0d8e33c661 Update translations (#127) 2022-01-04 17:38:54 +01:00
Discourse Translator Bot 713d2951e7 Update translations (#125) 2021-12-28 14:13:16 +01:00
Discourse Translator Bot 0983b26180 Update translations (#124) 2021-12-21 10:10:58 -05:00
discoursebotanddavidtaylorhq 8c3f2b691f DEV: Update CI workflows (#121)
Co-authored-by: davidtaylorhq <[email protected]>
2021-12-16 16:16:25 +00:00
Jarek Radosz d5cf5776d9 DEV: Fix deprecated imports (#120) 2021-11-12 19:13:46 +01:00
Martin Brennan 55045bba3c DEV: Update code for eslint object-shorthand-rule. See https://github.com/discourse/eslint-config-discourse/commit/4f7aba06c03fdd22bb26669aeb8ed4af3127c409 (#119) 2021-11-10 11:58:31 +11:00
tshenry f2171a51c3 FIX: use imports instead of Discourse global (#118)
Replaces `Discourse.Site` with the imported equivalent and `Discourse.SiteSettings` with `this.siteSettings`
2021-09-21 11:27:10 -07:00
discoursebotandCvX a01058f041 DEV: Update CI workflows (#117)
Co-authored-by: CvX <[email protected]>
2021-09-15 15:39:13 +02:00
dependabot[bot] 1d47138cb7 Bump path-parse from 1.0.6 to 1.0.7 (#116)
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-13 00:49:51 +02:00
Discourse Translator Bot d7c127cc48 Update translations (#115) 2021-08-04 14:14:07 +02:00
discoursebotanddavidtaylorhq f4247ab7d2 DEV: Update CI workflows (#114)
Co-authored-by: davidtaylorhq <[email protected]>
2021-07-02 17:06:52 +02:00
Penar Musaraj 190aa503ce DEV: SCSS cleanup 2021-06-23 21:59:53 -04:00
dependabot[bot] d74deaad20 Bump glob-parent from 5.1.1 to 5.1.2 (#113)
Bumps [glob-parent](https://github.com/gulpjs/glob-parent) from 5.1.1 to 5.1.2.
- [Release notes](https://github.com/gulpjs/glob-parent/releases)
- [Changelog](https://github.com/gulpjs/glob-parent/blob/main/CHANGELOG.md)
- [Commits](https://github.com/gulpjs/glob-parent/compare/v5.1.1...v5.1.2)

---
updated-dependencies:
- dependency-name: glob-parent
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-12 13:55:12 +02:00
Penar Musaraj c25c041f98 DEV: Remove SCSS color vars fallbacks (#112) 2021-05-12 16:16:40 -04:00
dependabot[bot] 43189e0f56 Bump lodash from 4.17.20 to 4.17.21 (#111)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 10:22:25 +02:00
dependabot[bot] a43a5d2edc Bump handlebars from 4.7.6 to 4.7.7 (#110)
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.7.6 to 4.7.7.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.7.6...v4.7.7)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 10:48:36 +10:00
Discourse Translator Bot 1741deecfe Update translations (#109) 2021-05-04 15:18:24 +02:00
dependabot[bot] 8a3ca77a60 Bump rexml from 3.2.4 to 3.2.5 (#108)
Bumps [rexml](https://github.com/ruby/rexml) from 3.2.4 to 3.2.5.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.2.4...v3.2.5)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-02 17:09:36 +02:00
Discourse Translator Bot 9e30a576da Update translations (#107) 2021-04-20 15:31:55 +02:00
dependabot[bot] fbdff69540 Bump y18n from 4.0.0 to 4.0.1 (#106)
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-01 10:15:23 +02:00
Justin DiRose c4e88ba82c Add missing link to meta topic in README (#105) 2021-02-23 19:15:42 +01:00
discoursebotandCvX 7f90994154 DEV: Update CI workflows (#104)
Co-authored-by: CvX <[email protected]>
2021-02-11 17:12:28 +01:00
Jarek Radosz a16ed5f0bf UX: Add title to iframe elements
Fixes template linting errors
2021-02-09 20:03:39 +01:00
CvX d3730993a6 DEV: Update CI workflows 2021-02-09 20:03:39 +01:00
Discourse Translator Bot 4ac7779cc9 Update translations (#102) 2021-02-09 14:52:34 +01:00
Joffrey JAFFEUX 6438000ed4 DEV: prettier 2.2.1 (#101) 2021-01-27 10:36:36 +01:00
Discourse Translator Bot 1654937788 Update translations (#100) 2021-01-26 14:51:33 +01:00
discoursebotandjustindirose 112fe8f4cb DEV: Update CI workflows (#98)
* DEV: Update CI workflows

* DEV: Fix linting

Co-authored-by: justindirose <[email protected]>
2021-01-04 14:42:25 -06:00
Roman Rizzi 4bf6420b91 REFACTOR: Use the new format for acceptance tests. (#97) 2020-12-29 13:01:26 -03:00
Discourse Translator Bot 4131f8403a Update translations (#96) 2020-11-24 17:24:04 +01:00
Discourse Translator Bot 2390a9d1d9 Update translations (#95) 2020-11-03 10:15:25 -05:00
Discourse CI 7b912d9252 DEV: Update CI workflows 2020-10-14 16:27:46 +00:00
jjaffeux 9adaef17cc Revert "DEV: enforces no-var (#94)"
This reverts commit 9ad0133624.
2020-10-13 15:42:21 +02:00
Joffrey JAFFEUX 9ad0133624 DEV: enforces no-var (#94) 2020-10-13 11:40:33 +02:00
Discourse CI e692fdf64f DEV: Update CI workflows 2020-10-12 08:16:43 +00:00
Discourse CI 059b04468a DEV: Update CI workflows 2020-10-09 19:03:13 +00:00
Discourse CI fb7f4e5766 DEV: Update CI workflows 2020-10-09 16:15:07 +00:00
Discourse CI 12f15a0306 DEV: Update CI workflows 2020-10-09 15:09:39 +00:00
Discourse Translator Bot c66c651c5b Update translations 2020-10-06 15:21:57 +02:00
Justin DiRose a626b8e79d DEV: Add testing workflow 2020-09-25 12:04:33 -05:00
Justin DiRose 1f49cf94db DEV: Add linting workflow 2020-09-25 12:04:17 -05:00
Joffrey JAFFEUX 15b2c1a05e REFACTOR: loadGoogle doesn't take any argument (#92) 2020-09-23 15:05:23 +02:00
Discourse Translator Bot 22dfb3aa5e Update translations 2020-09-22 13:00:22 +00:00
Discourse Translator Bot 3a7e642ae3 Update translations 2020-09-16 10:14:07 +00:00
Discourse Translator Bot 87c1478743 Update translations 2020-09-15 13:00:25 +00:00
Joffrey JAFFEUX 30dad0281d DEV: apply coding standards (#91) 2020-09-04 13:24:14 +02:00
Discourse Translator Bot 88e2bab0d6 Update translations 2020-09-01 13:00:18 +00:00
Discourse Translator Bot a36c34bedc Update translations 2020-08-25 13:00:18 +00:00
jjaffeux 5afca0aaa1 linting 2020-08-21 16:48:41 +02:00
Lawrence Thorpe 8439608f17 FIX: isFluid parameter for in-feed adsense units (#90)
Fixes issue in #89
2020-08-21 10:24:12 -04:00
Lawrence Thorpe 50788a876e Add support for adsense fluid format for in-feed (#89) 2020-08-21 09:53:34 -04:00
Discourse Translator Bot 501ad7878e Update translations 2020-08-18 13:00:20 +00:00
Discourse Translator Bot 20ebd91f8f Update translations 2020-08-11 13:00:20 +00:00
Discourse Translator Bot b28039e86a Update translations 2020-08-05 13:23:04 +00:00
Joffrey JAFFEUX 914735767a FIX: re-revert db4f5f99 with updated tests (#88)
The tests were using an incorrect value for the site setting (the name of the group instead of the id).

`no_ads_for_groups` shows groups names in the UI byt actually stores IDs.
2020-08-04 08:03:22 +02:00
Penar Musaraj db4f5f990d Revert "FIX: removes part of the 2.4 legacy code forgotten (#87)"
This reverts commit c27d5f8e85.
2020-08-03 21:44:10 -04:00
Joffrey JAFFEUX c27d5f8e85 FIX: removes part of the 2.4 legacy code forgotten (#87)
no_ads_for_groups returns a list of ids
2020-08-03 21:01:51 +02: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
jjaffeux 0a23be6008 DEV: uses html-safe instead of triple curly brackets 2020-08-01 17:48:23 +02: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
dependabot[bot] 24cb463ddb Bump lodash from 4.17.15 to 4.17.19 (#86)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-16 10:20:14 -04:00
Discourse Translator Bot dd5fb1f785 DEV: Switch from Transifex to Crowdin 2020-07-16 14:00:09 +02:00
Bianca Nenciu 3fc872520e FIX: CodeFund is shutting down (#85) 2020-07-10 18:09:32 +03:00
Robin Ward 3d0ee3f28a FIX: Prettier 2020-06-25 15:50:21 -04:00
Robin Ward 05967a8d52 FIX: Plugin was broken in stable 2020-06-25 14:51:14 -04:00
Neil Lalonde cff1459dbc Update translations 2020-06-24 11:39:24 -04:00
Kane York 5273d52f28 FIX: Do not require login to see ads.txt (#84) 2020-06-24 16:26:04 +10:00
Rafael dos Santos Silva 4ded0bdba9 DEV: Fix usage of deprecated global 2020-06-04 17:30:26 -03:00
Robin Ward 5b99fd5bbd DEV: Discourse.Route has been deprecated 2020-05-12 13:58:12 -04:00
jjaffeux ef316ab4ac DEV: Move to rubocop-discourse. 2020-05-06 17:43:43 +02:00
Neil Lalonde f11382e224 Update translations 2020-05-04 10:47:54 -04:00
Rishabh f7582f0df8 Update README.md
plugin installation info is now at https://meta.discourse.org/t/install-plugins-in-discourse/19157
2020-04-17 16:21:28 +05:30
Joffrey JAFFEUX 270799166b REFACTOR: applies discourse core coding practices (#82) 2020-03-23 09:40:29 +01:00
Neil Lalonde cd82a905ae Load Google Ad Manager code from doubleclick.net
https://support.google.com/admanager/answer/1638622?hl=en
2020-03-13 14:24:54 -04:00
Neil Lalonde bec86bd59a Update translations 2020-02-25 10:30:45 -05:00
Neil Lalonde f2ccce4beb Update translations 2020-02-13 15:03:14 -05:00
jjaffeux af346fc1c2 FIX: makes houses hads work with sk2 2020-02-07 10:34:58 +01:00
Neil Lalonde 63ae1672ad Add note about CSP to DFP, AdSense, and AdButler settings
Ad networks that serve javascript files won't work unless CSP is
disabled (a bad idea), or the content security policy script src
site setting is updated to include all sources of permitted
javascript. We will keep instructions up-to-date in the first post
of this topic: https://meta.discourse.org/t/33734
2020-02-03 17:18:42 -05:00
Neil Lalonde 3fdd0f35f3 Update translations 2020-01-20 11:19:03 -05:00
Gerhard Schlager 275921ac70 Make prettier happy 2020-01-16 00:12:27 +01:00
Neil Lalonde 116f9dd238 FEATURE: add support for fluid ad size in Google Ad Manager
No width or height will be set on containers when ad size is fluid.
2020-01-15 16:52:02 -05:00
David Taylor cf27a7be64 DEV: Stop loading external scripts while running tests (#81)
* DEV: Stop loading external scripts while running tests

* Revert "Turn of CSP for tests"

This reverts commit db1bf99277. It had no effect, since CSP is set by the server, and this was only affecting the client
2020-01-06 10:01:40 -07:00
Blake Erickson db1bf99277 Turn of CSP for tests 2020-01-03 16:30:34 -07:00
Neil Lalonde 73aa618aef Update translations 2019-12-19 12:48:16 -05:00
Penar Musaraj 155d9f904c Import Promise from RSVP 2019-11-22 11:04:36 -05:00
Penar Musaraj b59f841944 DEV: Respect radix rule in eslint-config-discourse 1.0.6 2019-11-18 10:07:55 -05:00
Neil Lalonde a3e3dbf24b Update translations 2019-11-06 10:44:38 -05:00
Neil Lalonde 0d534ce52a Update translations 2019-10-10 11:24:07 -04: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 edc549b269 UX: remove left padding of ads between posts on narrow width browsers 2019-09-17 11:27:01 -04:00
Sam Saffron 02f9145751 lint file
AdButler is not a whitelisted constant, access it via window.
2019-09-17 13:46:32 +10:00
Neil Lalonde cc09403757 Bump to version 1.2.5 2019-09-16 15:03:47 -04:00
Neil Lalonde 9a02cae641 Update README with info about new settings
Also remove outdated list of supported sizes. It's not a useful table.
2019-09-16 15:03:14 -04:00
Neil Lalonde 6704238c94 Update README with more info about AdButler support 2019-09-16 14:50:15 -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 b500ea171f DEV: Add tests for no_ads_for_categories 2019-09-11 12:18:42 -04:00
Neil Lalonde 0612054da8 Bump to version 1.2.4 2019-09-10 17:09:21 -04:00
Neil Lalonde 62888e734f FIX: handle no ad size given for AdSense and DFP ad units
For AdSense, assume responsive size.
For DFP, don't attempt to render the ad unit.
2019-09-10 17:07:47 -04:00
Neil Lalonde 2ad24e4a60 FEATURE: add option to disable ads in restricted categories
Use the new setting "no ads for restricted categories".
2019-07-22 11:43:39 -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
Neil Lalonde 4991941d03 FIX: CodeFund ads in between posts on narrow widths 2019-07-18 12:16:02 -04:00
Neil Lalonde 71c51ebd8b FIX: ads always showing in all placements for CodeFund and Carbon Ads
Checkboxes used to choose which placements to have ads were not handled
correctly.
2019-07-17 14:05:58 -04: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
Neil Lalonde 93af4587fa FIX: Amazon ads never showing 2019-07-16 10:55:39 -04: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 3aa9cb8a0c FIX: wrong size DFP ads when using multiple sizes
getWidthAndHeight was being called twice for each ad placement:
once when setting the size of the div, and once when calling the 
defineSlot API. getWidthAndHeight always advances to the next size
in the list, so the wrong size ad would be inserted into the div.
2019-07-15 15:34:46 -04:00
Neil Lalonde e8295c600c Update translations 2019-07-15 13:59:41 -04:00
Neil Lalonde 1929ac405c lint errors 2019-07-08 15:18:34 -04:00
Neil Lalonde 333f6cef81 FEATURE: support multiple ad sizes in AdSense and Ad Manager
Each ad placement in the AdSense and Ad Manager settings takes a list
of ad sizes instead of only one size. If given multiple sizes, the sizes
will alternate in order for each ad that's rendered.
2019-07-08 15:10:25 -04:00
Neil Lalonde 6f786b2f4d Bump to version 1.2.3 2019-06-27 14:16:19 -04:00
Neil Lalonde ad939a851a FEATURE: option to disable ads on personal messages
Use the new setting "no ads for personal messages".
2019-06-27 14:13:51 -04:00
Neil Lalonde 2ba276b0fb FIX: DFP ad units being refreshed multiple times on the same render
Ember is firing events multiple times when the ad component is shown.

Only solution I can find is to add a delay between calls to refresh
the ad unit. I chose 3 seconds.
2019-06-26 11:15:04 -04:00
Brahn Partridge 89200f3b99 try io instead of app to maybe workaround CORs problem 2019-06-24 09:59:58 -04:00
Neil Lalonde 3054f2539a FEATURE: use a different Ad Manager publisher ID for mobile
If you want to use one Ad Manager publisher on desktop and a different
one on mobile, use the new dfp_publisher_id_mobile setting.
By default, dfp_publisher_id will be used for both desktop and mobile.
2019-06-19 11:52:23 -04:00
Neil Lalonde 8ab28f4fda Bump to version 1.2.2 2019-06-17 21:01:33 -04:00
Neil Lalonde 25090a55a1 prettier 2019-06-17 21:00:05 -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 ca345f273c Update translations 2019-06-17 13:56:18 -04:00
Arpit Jalan d34b45627e Fix the build. 2019-06-15 16:01:52 +05:30
Neil Lalonde 31efc7025d FEATURE: new setting to disable ads based on tags
Enter a list of tags in the new setting no_ads_for_tags to prevent
ads from being rendered on topics with one or more of those tags,
and on topic list pages for those tags.
2019-06-14 14:44:09 -04:00
Penar Musaraj 574500ba08 Run Prettier 2019-06-14 13:24:55 -04:00
Penar Musaraj 203e14b639 Fix eslint warnings 2019-06-14 12:10:11 -04:00
Joffrey JAFFEUX 8c3fe62e90 DEV: new API s/replaceCurrentUser/updateCurrentUser
See https://github.com/discourse/discourse/pull/7769
2019-06-14 10:59:32 +02:00
Neil Lalonde 3a04f95916 REFACTOR: some changes to be closer to example implementation
https://support.google.com/admanager/answer/4578089?hl=en

* unique div ID for every ad slot
* setTargeting before calling addService
* don't destroySlots async (no examples of correct way to use this...)
2019-06-10 15:43:48 -04:00
Neil Lalonde 0432256adb Update translations 2019-06-10 10:37:57 -04:00
Neil Lalonde 35c1af6648 Version bump to 1.2.1 2019-06-05 17:01:31 -04:00
Neil Lalonde 04525d0cf1 FIX: dfp category targeting params
DFP category targeting param wasn't always being updated on topic
list pages.

Also remove dependency on a category param being passed in to the
component from a template so that we can now place dfp ads
in places that don't have access to the current category and
targeting will still work.
2019-06-05 17:00:47 -04:00
Neil Lalonde 7af8f1d46b FEATURE: new setting to disable ads based on category of current page
Use the "no ads for categories" setting to define which category pages
(topic list and topics) should not render any ads.
2019-06-05 16:00:24 -04:00
Penar Musaraj f745ecfbdc Rename adsense_ads_txt setting to ads_txt 2019-06-03 11:39:28 -04:00
Neil Lalonde ab9cf6459e Update translations 2019-05-30 11:30:03 -04:00
Guo Xiang Tan 546101a357 Add frozen string literal to files. 2019-05-13 10:16:50 +08:00
Neil Lalonde d3a5927ede Don't render inside a cloaked post 2019-05-10 14:22:18 -04:00
Neil Lalonde 2ca0adca05 Fix failing js test 2019-05-08 13:44:25 -04:00
Neil Lalonde 896e5a9838 Prettier 2019-05-08 11:22:21 -04:00
Neil Lalonde 10ab104cd8 JS test for mixed ads 2019-05-08 11:17:40 -04:00
Neil Lalonde 365f441924 FIX: groups with mixed case names not working 2019-05-08 11:01:01 -04:00
Neil Lalonde 4bd2035866 FEATURE: house ads can be configured to alternate with other ads
Use the new "house ads frequency" site setting to configure how often
house ads should show, as a percentage. This only applies in ad
placements where other ad networks are configured to appear.
2019-05-07 19:52:51 -04: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 d9d7f4c8f4 FIX: house ads randomized instead of showing evenly 2019-05-03 16:04:04 -04:00
Neil Lalonde 26d42e9ed7 Fix compatibility with other js tests 2019-05-03 13:26:16 -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
Neil Lalonde 5272995e74 FEATURE: use groups to control who sees ads 2019-05-03 11:39:34 -04:00
Neil Lalonde 369d5dfc9e oops revert again "FEATURE: use groups to control who sees ads" and all later" 2019-04-17 16:02:19 -04:00
Neil Lalonde b105da53e8 disable js tests
works on my machine, but breaks build
2019-04-17 15:53:41 -04:00
Neil Lalonde e6bcd96d8e FEATURE: use groups to control who sees ads" and all later 2019-04-17 15:40:50 -04:00
Neil Lalonde 50d258dc37 Revert "FEATURE: use groups to control who sees ads" and all later
Revert "Updates to codefund-ad"
Revert "Updates to carbonads-ad"
Revert "Updates to amazon-product-links"
2019-04-17 15:37:09 -04:00
Neil Lalonde 63e604d81b Updates to codefund-ad 2019-04-17 11:36:50 -04:00
Neil Lalonde 8ef02aa351 Updates to carbonads-ad 2019-04-17 11:36:50 -04:00
Neil Lalonde 881a8e5d4c Updates to amazon-product-links 2019-04-17 11:36:50 -04:00
Neil Lalonde 4fd7caffd6 FEATURE: use groups to control who sees ads
A new setting has been added in Admin > Settings > Ad Plugin called
"no ads for groups". Add group names to this list. If a user belongs
to any of the groups, they will not see any ads. This is an alternative
to using trust level settings like "adsense through trust level".
2019-04-17 11:36:50 -04:00
Neil Lalonde 6097e6f097 Clean-up codefund-ad component 2019-04-17 11:36:50 -04:00
Neil Lalonde 943acbfeb1 Add some js tests, and update adsense js 2019-04-17 11:36:47 -04:00
Diego Barreiro 8f2e4c5a49 FIX: Wrong Image 2019-04-15 13:54:20 -04:00
Diego Barreiro 147b1350ea FIX: Switch Property to Computed 2019-04-15 11:54:18 -04:00
Diego Barreiro 23ece34f53 FIX: Switch Var to Const 2019-04-15 11:54:18 -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 79a4c228a6 DEV: Update Readme 2019-04-15 11:54:18 -04:00
Diego Barreiro 608feb2e54 UX: Add Spanish Translations 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
Diego Barreiro 0980914d0c UI: Style Ads 2019-04-15 11:54:18 -04:00
Diego Barreiro c5272db7f3 UX: Init Carbon Ads 2019-04-15 11:54:18 -04:00
Sam Saffron 4516dbca26 Add missing license file 2019-04-08 17:51:50 +10:00
Neil Lalonde cd35666059 Update translations 2019-04-05 10:08:42 -04:00
Régis Hanol 8fda5c3b7d Delete .DS_Store 2019-03-21 22:10:24 +01:00
Régis Hanol 2065b8bd41 fix new lines in README 2019-03-21 22:09:23 +01:00
Neil Lalonde ec10ef4483 FIX: wrong size setting being used for post-bottom desktop 2019-03-20 11:22:47 -04:00
Neil Lalonde 3f70312c84 Update translations 2019-03-04 10:12:10 -05:00
Neil Lalonde 9b7a8830b8 FIX: resizing of ad units when they're rendered 2019-02-25 09:53:28 -05:00
Neil Lalonde 9a695cc67d refactor google-dfp-ad component to reduce repetition 2019-02-22 11:15:40 -05: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
208 changed files with 12636 additions and 2536 deletions
+4
View File
@@ -0,0 +1,4 @@
< 3.4.0.beta2-dev: 7685ebf396c93e8accc5a76a81fcec4384a73fa3
< 3.4.0.beta1-dev: da38a4c053b68d7076db4441cfe86b473979945d
< 3.3.0.beta1-dev: 062efc8a547c19474eaeefae464837d63a5e5fb3
3.1.999: 30c49eb50d6d16fcf82bace3da0e1972b7b220c0
-105
View File
@@ -1,105 +0,0 @@
{
"env": {
"jasmine": true,
"node": true,
"mocha": true,
"browser": true,
"builtin": true
},
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module"
},
"globals":
{"Ember":true,
"jQuery":true,
"$":true,
"RSVP":true,
"Discourse":true,
"Em":true,
"PreloadStore":true,
"Handlebars":true,
"I18n":true,
"bootbox":true,
"module":true,
"moduleFor":true,
"moduleForComponent":true,
"Pretender":true,
"sandbox":true,
"controllerFor":true,
"test":true,
"ok":true,
"not":true,
"expect":true,
"equal":true,
"visit":true,
"andThen":true,
"click":true,
"currentPath":true,
"currentRouteName":true,
"currentURL":true,
"fillIn":true,
"keyEvent":true,
"triggerEvent":true,
"count":true,
"exists":true,
"visible":true,
"invisible":true,
"asyncRender":true,
"selectDropdown":true,
"asyncTestDiscourse":true,
"fixture":true,
"find":true,
"sinon":true,
"moment":true,
"start":true,
"_":true,
"alert":true,
"containsInstance":true,
"deepEqual":true,
"notEqual":true,
"define":true,
"require":true,
"requirejs":true,
"hasModule":true,
"Blob":true,
"File":true},
"rules": {
"block-scoped-var": 2,
"dot-notation": 0,
"eqeqeq": [
2,
"allow-null"
],
"guard-for-in": 2,
"no-bitwise": 2,
"no-caller": 2,
"no-cond-assign": 0,
"no-debugger": 2,
"no-empty": 0,
"no-eval": 2,
"no-extend-native": 2,
"no-extra-parens": 0,
"no-irregular-whitespace": 2,
"no-iterator": 2,
"no-loop-func": 2,
"no-multi-str": 2,
"no-new": 2,
"no-plusplus": 0,
"no-proto": 2,
"no-script-url": 2,
"no-sequences": 2,
"no-shadow": 2,
"no-undef": 2,
"no-unused-vars": 2,
"no-with": 2,
"semi": 2,
"strict": 0,
"valid-typeof": 2,
"wrap-iife": [
2,
"inside"
]
},
"parser": "babel-eslint"
}
+11
View File
@@ -0,0 +1,11 @@
name: Discourse Plugin
on:
push:
branches:
- main
pull_request:
jobs:
ci:
uses: discourse/.github/.github/workflows/discourse-plugin.yml@v1
+3 -2
View File
@@ -2,7 +2,8 @@
log/*.log
pkg/
auto_generated
Gemfile.lock
.DS_Store
*.swp
.rubocop-https---raw-githubusercontent-com-discourse-discourse-master--rubocop-yml
node_modules
yarn-error.log
.rubocop-https---raw-githubusercontent-com-discourse-*
+2
View File
@@ -0,0 +1,2 @@
engine-strict = true
auto-install-peers = false
+1
View File
@@ -0,0 +1 @@
module.exports = require("@discourse/lint-configs/prettier");
+5 -1
View File
@@ -1 +1,5 @@
inherit_from: https://raw.githubusercontent.com/discourse/discourse/master/.rubocop.yml
inherit_gem:
rubocop-discourse: stree-compat.yml
RSpec/NamedSubject:
Enabled: false
+2
View File
@@ -0,0 +1,2 @@
--print-width=100
--plugins=plugin/trailing_comma,plugin/disable_auto_ternary
+1
View File
@@ -0,0 +1 @@
module.exports = require("@discourse/lint-configs/template-lint");
-15
View File
@@ -1,15 +0,0 @@
[main]
host = https://www.transifex.com
lang_map = el_GR: el, es_ES: es, fr_FR: fr, hu_HU: hu, ko_KR: ko, pt_PT: pt, sk_SK: sk, vi_VN: vi
[discourse-org.discourse-adpluginclientenyml]
file_filter = config/locales/client.<lang>.yml
source_file = config/locales/client.en.yml
source_lang = en
type = YML
[discourse-org.discourse-adpluginserverenyml]
file_filter = config/locales/server.<lang>.yml
source_file = config/locales/server.en.yml
source_lang = en
type = YML
+5 -2
View File
@@ -1,5 +1,8 @@
source 'https://rubygems.org'
# frozen_string_literal: true
source "https://rubygems.org"
group :development do
gem 'translations-manager', git: 'https://github.com/discourse/translations-manager.git'
gem "rubocop-discourse"
gem "syntax_tree"
end
+87
View File
@@ -0,0 +1,87 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (7.1.3.3)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
ast (2.4.2)
base64 (0.2.0)
bigdecimal (3.1.8)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
drb (2.2.1)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
json (2.7.2)
language_server-protocol (3.17.0.3)
minitest (5.23.1)
mutex_m (0.2.0)
parallel (1.24.0)
parser (3.3.1.0)
ast (~> 2.4.1)
racc
prettier_print (1.2.1)
racc (1.8.0)
rack (3.0.11)
rainbow (3.1.1)
regexp_parser (2.9.2)
rexml (3.3.9)
rubocop (1.64.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.3)
parser (>= 3.3.1.0)
rubocop-capybara (2.20.0)
rubocop (~> 1.41)
rubocop-discourse (3.8.0)
activesupport (>= 6.1)
rubocop (>= 1.59.0)
rubocop-capybara (>= 2.0.0)
rubocop-factory_bot (>= 2.0.0)
rubocop-rails (>= 2.25.0)
rubocop-rspec (>= 2.25.0)
rubocop-factory_bot (2.25.1)
rubocop (~> 1.41)
rubocop-rails (2.25.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rspec (2.29.2)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
rubocop-rspec_rails (~> 2.28)
rubocop-rspec_rails (2.28.3)
rubocop (~> 1.40)
ruby-progressbar (1.13.0)
syntax_tree (6.2.0)
prettier_print (>= 1.2.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
PLATFORMS
ruby
DEPENDENCIES
rubocop-discourse
syntax_tree
BUNDLED WITH
2.5.10
+22
View File
@@ -0,0 +1,22 @@
Copyright (c) 2019 Discourse
MIT License
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+80 -38
View File
@@ -1,17 +1,26 @@
# Official Discourse Advertising Plugin
Official Plugin Topic & Documentation: https://meta.discourse.org/t/official-advertising-ad-plugin-for-discourse/33734
This is the official Discourse advertising plugin. It allows advertisements to be served by supported advertising platforms for users with a Discourse forum.
**Authors**: [Sarah Ni](https://github.com/cyberkoi) & [Vi Nguyen](https://github.com/ladydanger)
**Version**: 1.0.1
**Contributors**: See credits section below
**Version**: 1.2.5
**Contributors**: See [credits section](#credits) below
**License**: MIT License
**Supported Discourse Version**: 1.4
**Supported Ad Platforms**:
* House Ads: Your own ads served from Discourse
* [Google Adsense](http://www.google.com.au/adsense/start/why-adsense.html)
* [Google Double Click for Publishers](https://www.google.com/dfp)
* [Amazon Affiliates](http://affiliate-program.amazon.com) - Banner and Product Link Ads
* [CodeFund](https://codefund.io) - Ethical Ad Platform for Developers
* [Carbon Ads](https://www.carbonads.net/)
* [AdButler](https://www.adbutler.com/)
## Quick Start in 3 Steps
@@ -27,7 +36,7 @@ For non-docker or local development installation (those with programming experie
### Step 1 - Install the Official Discourse Advertising Plugin
As seen in a [how-to on meta.discourse.org](https://meta.discourse.org/t/advanced-troubleshooting-with-docker/15927#Example:%20Install%20a%20plugin), simply **add the plugin's repository url to your container's app.yml file**:
As seen in a [how-to on meta.discourse.org](https://meta.discourse.org/t/install-plugins-in-discourse/19157), simply **add the plugin's repository url to your container's app.yml file**:
```yml
hooks:
@@ -50,6 +59,18 @@ git pull
There are 2 easy steps for configuring your Discourse settings to enable advertisements to display in your Discourse forum.
#### House Ads
If you don't want to use an external ad platform, but want to show your own ads, then House Ads are for you!
Define your ads by going to the Admin section of your Discourse forum, and go to the Plugins section.
On the left, you should see a link called "House Ads".
Begin by creating your ads. Give each a short descriptive name and enter the html for each.
Style them using a custom theme (Admin > Customize > Themes).
Lastly, click the Settings button in the House Ads UI and choose which of your ads to show in each of
the ad slots. The ads will start showing as soon as you add them to slots.
#### Step 2(a) - Choose Your Advertisement Platform
<ul>
@@ -57,9 +78,11 @@ There are 2 easy steps for configuring your Discourse settings to enable adverti
<li>Click on Settings and a left vertical navigation bar should appear.</li>
<li>Choose your advertisement platform.</li>
<ul>
<li>House Ads - if you want to create and serve ads from your Discourse instance.</li>
<li>Adsense - if using Adsense as your advertisement platform.</li>
<li>DFP - if using the DoubleClick for Publishers advertisement platform.</li>
<li>CodeFund - if using the CodeFund ethical advertisement platform.</li>
<li>Carbon Ads - if using the Carbon Ads advertisement platform.</li>
<li>AdButler - if using the AdButler advertisement platform.</li>
</ul>
</ul>
@@ -73,20 +96,47 @@ There are 2 easy steps for configuring your Discourse settings to enable adverti
##### Adsense Advertisement Tag to Discourse's Site Settings
![](https://www.dropbox.com/sc/pguxq17zo2rovyd/AAD--LTH_IIgVhgczoaY1Ljva?dl=1)
![image](https://user-images.githubusercontent.com/5862206/214489271-32ce230f-9f79-441e-9d7a-c5488ebb8c8a.png)
##### DoubleClick for Publishers' Advertisement Tag to Discourse's Site Settings
![](https://www.dropbox.com/sc/0inoc1iduux0gsf/AADi8tfKX9S6Tx9S8RndcUE8a?dl=1)
![image](https://user-images.githubusercontent.com/5862206/214489324-8554a996-1876-432b-a686-e1add3b96ec4.png)
##### Amazon Affiliates' Advertisement Tag to Discourse's Site Settings
Only for Product Link and Banner Ads.
![](https://www.dropbox.com/sc/l67fb5c3tl8bq3d/AAAAMmccMW3kkIeBR7cBdWoFa?dl=1)
![image](https://user-images.githubusercontent.com/5862206/214489360-8829291b-8571-4deb-a867-139e823ebdea.png)
##### CodeFund Embed Tag to Discourse's Site Settings
##### Carbon Ads Script Tag to Discourse's Site Settings
![CodeFund Instructions](https://s3-us-west-2.amazonaws.com/codesponsor/discourse-codefund-instructions.png)
![adpluginexample](https://user-images.githubusercontent.com/5862206/214489455-234a3812-3606-47bf-9e49-cdaa3d1e3b9c.png)
##### AdButler Ads Zone URL to Discourse's Site Settings
This plugin only support AdButler "Standard Zones". Text and VAST are not supported.
If you browse to a zone in the AdButler admin, then you can find the Publisher ID (PPPPPP) and the Zone ID (ZZZZZZ) in the URL of your browser's address bar:
`https://admin.adbutler.com/?ID=PPPPPP&p=textadzone.view&zoneID=ZZZZZZ`
Configure the ads in Admin > Settings > AdButler.
Enter the publisher id in the "adbutler publisher id" setting, and enter the Zone IDs in the different
zone id settings as desired.
By default, ads are assumed to be size 728 x 90, or 320 x 50 in mobile view.
To use different size ads, customize using CSS in your site's theme. Override the following CSS:
```css
.adbutler-ad {
width: 728px;
height: 90px;
}
.adbutler-mobile-ad {
width: 320px;
height: 50px;
}
```
### Step 3 - See Your Ad
@@ -97,9 +147,11 @@ Once you've configured your settings and your advertising platform has ads that
In this section, we go into more detail on:
* Available Locations for Ad Display
* Ad Sizes Supported
* Trust Levels
* Languages Supported
* Personal messages
* Groups
* Categories
* Tags
### Available Locations for Ad Display
@@ -112,26 +164,7 @@ The following are available locations along with a description and an image show
| Topic Above Suggested | Ad will appear in the footer above suggested topics of all Discourse forum topics |
| Post Bottom & Nth Post | Ad will appear on the stipulated nth post within a topic. So if you have 5 posts in a topic and you want the ad to display after on the 2nd post, put 2 in ```ad_platform_nth_post_code```. |
![](https://www.dropbox.com/sc/rm5bcn8c85niul1/AAAUVW-hn56XtCl_XTNlE19Ra?dl=1)
### Advertisement Sizes Supported
This plugin supports the following ad sizes for the following locations.
All locations except post bottom | Post bottom location | Mobile
--- | --- | ---
728 x 90 | 728 x 90 | 320 x 50
336 x 280 | 336 x 280 |
300 x 250 | 300 x 250 |
970 x 90 | 970 x 90 |
468 x 60 | 468 x 60 |
234 x 60 | 234 x 60 |
125 x 125 | |
180 x 150 | |
200 x 200 | |
250 x 250 | |
![adplugin2](https://user-images.githubusercontent.com/5862206/214489128-2e0a9520-ffa5-47a9-81f8-27609b2c9975.jpeg)
### Trust Levels
@@ -145,12 +178,21 @@ You can use the ```ad_platform_through_trust_level``` dropdown to disable ads fo
To find more about trust levels in Discourse, refer to [Discourse's posts on trust levels](https://meta.discourse.org/t/what-do-user-trust-levels-do/4924)
### Languages Supported
### Personal messages
* Chinese (Simplified)
* English
* French
* Spanish
By default, ads won't be shown in personal messages. To enable ads in personal messages, use the "no ads for personal messages" setting.
### Groups
To give some users an ad-free experience, put the users in groups and add those groups to the "no ads for groups" setting.
### Categories
To disable ads in certain categories, add them to the "no ads for categories" setting. Also consider using the "no ads for restricted categories" to disable ads in all categories that have read access restrictions.
### Tags
Individual topics can have ads disabled by using tags, and entering those tags in the "no ads for tags" setting. This is useful if some topics violate ad network policies.
## Other Installation
@@ -198,4 +240,4 @@ Open an Issue on this repository to start a chat.
**Our Coaches**: Very special thank you to our coaches and honorary coach - [@georg](https://github.com/georg), [@betaass](https://github.com/betaass), [@adelsmee](https://github.com/adelsmee), [@davich](https://github.com/davich), [@link664](https://github.com/link664), [@tomjadams](https://github.com/tomjadams), [@compactcode](https://github.com/compactcode), [@joffotron](https://github.com/joffotron), [@jocranford](https://github.com/jocranford), [@saramic](https://github.com/saramic), [@madpilot](https://github.com/madpilot), [@catkins](https://github.com/catkins)
**Rails Girls**: Thanks [@sareg0](https://github.com/sareg0) and the Rails Girls Team for the opportunity to participate in Rails Girls Summer of Code 2015.
<p>To create this plugin we referenced the <a href="https://github.com/discourse/discourse-google-dfp">original dfp plugin</a> (created by <a href="https://github.com/search?q=neil+lalonde&ref=opensearch&type=Users">nlalonde</a>) and the <a href="https://meta.discourse.org/t/google-adsense-plugin/11763/133">adsense plugin</a>.</p>
<p>To create this plugin we referenced the <a href="https://github.com/discourse/discourse-google-dfp">original dfp plugin</a> (created by <a href="https://github.com/nlalonde">@nlalonde</a>) and the <a href="https://meta.discourse.org/t/google-adsense-plugin/11763/133">adsense plugin</a>.</p>
@@ -0,0 +1,10 @@
export default {
resource: "admin.adminPlugins",
path: "/plugins",
map() {
this.route("houseAds", { path: "/pluginad/house_creatives" }, function () {
this.route("index", { path: "/" });
this.route("show", { path: "/:ad_id" });
});
},
};
@@ -0,0 +1,7 @@
import CategorySelector from "select-kit/components/category-selector";
export default class HouseAdsCategorySelector extends CategorySelector {
get value() {
return this.selectedCategories.map((c) => c.id);
}
}
@@ -0,0 +1,44 @@
import { action, computed } from "@ember/object";
import { classNames } from "@ember-decorators/component";
import { makeArray } from "discourse-common/lib/helpers";
import MultiSelectComponent from "select-kit/components/multi-select";
@classNames("house-ads-chooser")
export default class HouseAdsChooser extends MultiSelectComponent {
filterable = true;
filterPlaceholder = "admin.adplugin.house_ads.filter_placeholder";
tokenSeparator = "|";
allowCreate = false;
allowAny = false;
settingValue = "";
valueAttribute = null;
nameProperty = null;
@computed("settingValue")
get value() {
return this.settingValue
.toString()
.split(this.tokenSeparator)
.filter(Boolean);
}
// TODO: kept for legacy, remove when Discourse is 2.5
mutateValues(values) {
this.set("settingValue", values.join(this.tokenSeparator));
}
computeValues() {
return this.settingValue.split(this.tokenSeparator).filter(Boolean);
}
@computed("choices")
get content() {
return makeArray(this.choices);
}
@action
onChange(value) {
const settingValue = makeArray(value).join(this.tokenSeparator);
this.onChange?.(settingValue);
}
}
@@ -0,0 +1,13 @@
<label for={{this.name}}>{{this.title}}</label>
{{house-ads-chooser
settingValue=this.adValue
choices=this.adNames
onChange=(action (mut this.adValue))
}}
<div class="setting-controls">
{{#if this.changed}}
<DButton class="ok" @action={{action "save"}} @icon="check" />
<DButton class="cancel" @action={{action "cancel"}} @icon="times" />
{{/if}}
</div>
<p class="help">{{this.help}}</p>
@@ -0,0 +1,8 @@
import { mapBy } from "@ember/object/computed";
import { classNames } from "@ember-decorators/component";
import HouseAdsSetting from "discourse/plugins/discourse-adplugin/discourse/components/house-ads-setting";
@classNames("house-ads-setting house-ads-list-setting")
export default class HouseAdsListSetting extends HouseAdsSetting {
@mapBy("allAds", "name") adNames;
}
@@ -0,0 +1,9 @@
<label for={{this.name}}>{{this.title}}</label>
<TextField @value={{this.adValue}} @classNames="house-ads-text-input" />
<div class="setting-controls">
{{#if this.changed}}
<DButton class="ok" @action={{action "save"}} @icon="check" />
<DButton class="cancel" @action={{action "cancel"}} @icon="times" />
{{/if}}
</div>
<p class="help">{{this.help}}</p>
@@ -0,0 +1,58 @@
import Component from "@ember/component";
import { action } from "@ember/object";
import { classNames } from "@ember-decorators/component";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { i18n, propertyNotEqual } from "discourse/lib/computed";
import I18n from "I18n";
@classNames("house-ads-setting")
export default class HouseAdsSetting extends Component {
adValue = "";
saving = false;
savingStatus = "";
@i18n("name", "admin.adplugin.house_ads.%@.title") title;
@i18n("name", "admin.adplugin.house_ads.%@.description") help;
@propertyNotEqual("adValue", "value") changed;
init() {
super.init(...arguments);
this.set("adValue", this.get("value"));
}
@action
save() {
if (!this.get("saving")) {
this.setProperties({
saving: true,
savingStatus: I18n.t("saving"),
});
ajax(`/admin/plugins/pluginad/house_settings/${this.get("name")}.json`, {
type: "PUT",
data: { value: this.get("adValue") },
})
.then(() => {
const adSettings = this.get("adSettings");
adSettings.set(this.get("name"), this.get("adValue"));
this.setProperties({
value: this.get("adValue"),
savingStatus: I18n.t("saved"),
});
})
.catch(popupAjaxError)
.finally(() => {
this.setProperties({
saving: false,
savingStatus: "",
});
});
}
}
@action
cancel() {
this.set("adValue", this.get("value"));
}
}
@@ -0,0 +1,18 @@
import { htmlSafe } from "@ember/template";
import DModal from "discourse/components/d-modal";
import i18n from "discourse-common/helpers/i18n";
const Preview = <template>
<DModal
@closeModal={{@closeModal}}
@title={{i18n "admin.adplugin.house_ads.preview"}}
>
<:body>
<div class="house-ad-preview">
{{htmlSafe @model.html}}
</div>
</:body>
</DModal>
</template>;
export default Preview;
@@ -0,0 +1,8 @@
import Controller, { inject as controller } from "@ember/controller";
import { alias } from "@ember/object/computed";
export default class AdminPluginsHouseAdsIndexController extends Controller {
@controller("adminPlugins.houseAds") adminPluginsHouseAds;
@alias("adminPluginsHouseAds.model") houseAds;
@alias("adminPluginsHouseAds.houseAdsSettings") adSettings;
}
@@ -0,0 +1,156 @@
import { tracked } from "@glimmer/tracking";
import Controller, { inject as controller } from "@ember/controller";
import EmberObject, { action } from "@ember/object";
import { service } from "@ember/service";
import { TrackedObject } from "@ember-compat/tracked-built-ins";
import { observes } from "@ember-decorators/object";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import Category from "discourse/models/category";
import I18n from "I18n";
import Preview from "../components/modal/preview";
export default class adminPluginsHouseAdsShow extends Controller {
@service router;
@service modal;
@controller("adminPlugins.houseAds") houseAdsController;
@tracked selectedCategories = [];
@tracked selectedGroups = [];
@tracked saving = false;
@tracked savingStatus = "";
@tracked buffered;
@observes("model")
modelChanged() {
this.buffered = new TrackedObject({ ...this.model });
this.selectedCategories = this.model.categories || [];
this.selectedGroups = this.model.group_ids || [];
}
get disabledSave() {
for (const key in this.buffered) {
// we don't want to compare the categories array
if (key !== "categories" && this.buffered[key] !== this.model[key]) {
return false;
}
}
return true;
}
@action
async save() {
if (!this.saving) {
this.saving = true;
this.savingStatus = I18n.t("saving");
const data = {};
const newRecord = !this.buffered.id;
if (!newRecord) {
data.id = this.buffered.id;
}
data.name = this.buffered.name;
data.html = this.buffered.html;
data.visible_to_logged_in_users =
this.buffered.visible_to_logged_in_users;
data.visible_to_anons = this.buffered.visible_to_anons;
data.category_ids = this.buffered.category_ids;
data.group_ids = this.buffered.group_ids;
try {
const ajaxData = await ajax(
newRecord
? `/admin/plugins/pluginad/house_creatives`
: `/admin/plugins/pluginad/house_creatives/${this.buffered.id}`,
{
type: newRecord ? "POST" : "PUT",
data,
}
);
this.savingStatus = I18n.t("saved");
const houseAds = this.houseAdsController.model;
if (newRecord) {
this.buffered.id = ajaxData.house_ad.id;
if (!houseAds.includes(this.buffered)) {
houseAds.pushObject(EmberObject.create(this.buffered));
}
this.router.transitionTo(
"adminPlugins.houseAds.show",
this.buffered.id
);
} else {
houseAds
.find((ad) => ad.id === this.buffered.id)
.setProperties(this.buffered);
}
} catch (error) {
popupAjaxError(error);
} finally {
this.set("model", this.buffered);
this.saving = false;
this.savingStatus = "";
}
}
}
@action
setCategoryIds(categoryArray) {
this.selectedCategories = categoryArray;
this.buffered.category_ids = categoryArray.map((c) => c.id);
this.setCategoriesForBuffered();
}
@action
setGroupIds(groupIds) {
this.selectedGroups = groupIds;
this.buffered.group_ids = groupIds.map((id) => id);
}
@action
cancel() {
this.buffered = new TrackedObject({ ...this.model });
this.selectedCategories = this.model.categories || [];
this.selectedGroups = this.model.group_ids || [];
this.setCategoriesForBuffered();
}
@action
async destroy() {
if (!this.buffered.id) {
this.router.transitionTo("adminPlugins.houseAds.index");
return;
}
try {
await ajax(
`/admin/plugins/pluginad/house_creatives/${this.buffered.id}`,
{
type: "DELETE",
}
);
this.houseAdsController.model.removeObject(
this.houseAdsController.model.findBy("id", this.buffered.id)
);
this.router.transitionTo("adminPlugins.houseAds.index");
} catch (error) {
popupAjaxError(error);
}
}
@action
openPreview() {
this.modal.show(Preview, {
model: {
html: this.buffered.html,
},
});
}
setCategoriesForBuffered() {
// we need to fetch the categories because the serializer is not being used
// to attach the category object to the house ads
this.buffered.categories = this.buffered.category_ids
? this.buffered.category_ids.map((categoryId) =>
Category.findById(categoryId)
)
: [];
}
}
@@ -0,0 +1,5 @@
import Controller from "@ember/controller";
export default class AdminPluginsHouseAdsController extends Controller {
loadingAds = true;
}
@@ -0,0 +1,12 @@
import { action } from "@ember/object";
import { service } from "@ember/service";
import DiscourseRoute from "discourse/routes/discourse";
export default class AdminPluginsHouseAdsIndex extends DiscourseRoute {
@service router;
@action
moreSettings() {
this.router.transitionTo("adminSiteSettingsCategory", "ad_plugin");
}
}
@@ -0,0 +1,23 @@
import { TrackedObject } from "@ember-compat/tracked-built-ins";
import DiscourseRoute from "discourse/routes/discourse";
import I18n from "I18n";
export default class AdminPluginsHouseAdsShow extends DiscourseRoute {
model(params) {
if (params.ad_id === "new") {
return new TrackedObject({
name: I18n.t("admin.adplugin.house_ads.new_name"),
html: "",
visible_to_logged_in_users: true,
visible_to_anons: true,
});
} else {
return new TrackedObject(
this.modelFor("adminPlugins.houseAds").findBy(
"id",
parseInt(params.ad_id, 10)
)
);
}
}
}
@@ -0,0 +1,22 @@
import EmberObject from "@ember/object";
import { ajax } from "discourse/lib/ajax";
import DiscourseRoute from "discourse/routes/discourse";
export default class AdminPluginsHouseAds extends DiscourseRoute {
settings = null;
model() {
return ajax("/admin/plugins/pluginad/house_creatives.json").then((data) => {
this.set("settings", EmberObject.create(data.settings));
return data.house_ads.map((ad) => EmberObject.create(ad));
});
}
setupController(controller, model) {
controller.setProperties({
model,
houseAdsSettings: this.get("settings"),
loadingAds: false,
});
}
}
@@ -0,0 +1,51 @@
<section class="house-ads-settings content-body">
<div>{{i18n "admin.adplugin.house_ads.description"}}</div>
{{#if this.houseAds.length}}
<form class="form-horizontal">
{{house-ads-list-setting
name="topic_list_top"
value=this.adSettings.topic_list_top
allAds=this.houseAds
adSettings=this.adSettings
}}
{{house-ads-list-setting
name="topic_above_post_stream"
value=this.adSettings.topic_above_post_stream
allAds=this.houseAds
adSettings=this.adSettings
}}
{{house-ads-list-setting
name="topic_above_suggested"
value=this.adSettings.topic_above_suggested
allAds=this.houseAds
adSettings=this.adSettings
}}
{{house-ads-list-setting
name="post_bottom"
value=this.adSettings.post_bottom
allAds=this.houseAds
adSettings=this.adSettings
}}
{{house-ads-list-setting
name="topic_list_between"
value=this.adSettings.topic_list_between
allAds=this.houseAds
adSettings=this.adSettings
}}
<DButton
@label="admin.adplugin.house_ads.more_settings"
@icon="cog"
@action={{route-action "moreSettings"}}
class="btn-default"
/>
</form>
{{else}}
<p>
{{#link-to route="adminPlugins.houseAds.show" model="new"}}
{{i18n "admin.adplugin.house_ads.get_started"}}
{{/link-to}}
</p>
{{/if}}
</section>
@@ -0,0 +1,78 @@
<section class="edit-house-ad content-body">
<h1><TextField @value={{this.buffered.name}} class="house-ad-name" /></h1>
<div class="controls">
<AceEditor
@content={{this.buffered.html}}
@onChange={{fn (mut this.buffered.html)}}
@mode="html"
/>
</div>
<div class="controls">
<div class="visibility-settings">
<div>
<Input
@type="checkbox"
@checked={{this.buffered.visible_to_logged_in_users}}
class="visible-to-logged-in-checkbox"
/>
<span>{{i18n "admin.adplugin.house_ads.show_to_logged_in_users"}}</span>
</div>
<div>
<Input
class="visible-to-anonymous-checkbox"
@type="checkbox"
@checked={{this.buffered.visible_to_anons}}
/>
<span>{{i18n "admin.adplugin.house_ads.show_to_anons"}}</span>
</div>
<HouseAdsCategorySelector
@categories={{this.site.categories}}
@selectedCategories={{this.selectedCategories}}
@onChange={{this.setCategoryIds}}
@options={{hash allowAny=true}}
class="house-ads-categories"
/>
<div class="description">
{{i18n "admin.adplugin.house_ads.category_chooser_description"}}
</div>
<GroupChooser
@content={{this.site.groups}}
@onChange={{this.setGroupIds}}
@value={{this.selectedGroups}}
class="banner-groups"
/>
<div class="description">
{{i18n "admin.adplugin.house_ads.group_chooser_description"}}
</div>
</div>
<DButton
@action={{this.save}}
@disabled={{this.disabledSave}}
@label="admin.adplugin.house_ads.save"
class="btn-primary save-button"
/>
{{#if this.saving}}
{{this.savingStatus}}
{{else}}
{{#unless this.disabledSave}}
<DButton @action={{this.cancel}} @label="cancel" />
{{/unless}}
{{/if}}
<DButton
@action={{this.openPreview}}
@label="admin.adplugin.house_ads.preview"
/>
<DButton
@action={{this.destroy}}
@label="admin.adplugin.house_ads.delete"
class="btn-danger delete-button"
/>
</div>
</section>

Some files were not shown because too many files have changed in this diff Show More