サブスクリプションプラグインページのカスタマイズ

ああ!そうか!できるんだ!できるぞ!!!

しまった!

OK、つまりこんな感じですね。

       <div class="product-purchase">
          {{#if product.subscribed}}
            <span class="purchased">&#x2713; {{i18n 'discourse_subscriptions.subscribe.purchased'}}</span>
            {{#link-to "user.billing.subscriptions" currentUser.username class="billing-link"}}
              {{i18n 'discourse_subscriptions.subscribe.go_to_billing'}}
            {{/link-to}}
            {{plugin-outlet name="after-go-to-billing" args=(hash product=product)}}
          {{else}}
            {{#link-to "s.show" product.id disabled=product.subscribed class="btn btn-primary"}}
              {{i18n 'discourse_subscriptions.subscribe.title'}}
            {{/link-to}}
            {{plugin-outlet name="after-subscribe-title" args=(hash product=product)}}
          {{/if}}
        </div>

そして、以下のような処理が可能です。

<script type="text/x-handlebars" data-template-name="/connectors/after-go-to-billing/foobar">
    <div class="pfaffmanager-product"> {{product.id}} を使ったリンクなど</div>
</script>

あるいは、これらの製品ブロックのほとんどを隠して置き換えることさえできます。

どうやら、ついにプラグイン出口の仕組みを理解できたかもしれません。

CSS の変更

つまり、s.hbs テンプレート全体を <div class="subscription"> で囲むだけで、以下のようなことができます。

.subscription 
  {
    h1 {
    content: "Hello, world";
    background-color: yellow;
  }
}

これで合っていますか?ここに明らかな間違いがなければ、適切な PR を作成できる手応えを感じています。