Refactor footer message to use a component

This commit is contained in:
Robin Ward 2017-08-13 16:06:26 -04:00
parent f4839da047
commit e568be04e8
2 changed files with 12 additions and 19 deletions

View File

@ -0,0 +1,5 @@
{{#if education}}<div class="education">{{{education}}}</div>{{/if}}
<h3>
{{message}}
{{yield}}
</h3>

View File

@ -64,28 +64,16 @@
{{d-icon "check"}} {{i18n 'topics.bulk.dismiss_new'}}</button>
{{/if}}
{{#if latest}}
<div class="education">
{{{footerEducation}}}
</div>
<h3>
{{footerMessage}}
{{#footer-message education=footerEducation message=footerMessage tagName=""}}
{{#if latest}}
{{#if canCreateTopicOnCategory}}<a href {{action "createTopic"}}>{{i18n 'topic.suggest_create_topic'}}</a>{{/if}}
</h3>
{{else}}
{{#if top}}
<h3>
{{#link-to "discovery.categories"}}{{i18n 'topic.browse_all_categories'}}{{/link-to}}, {{#link-to 'discovery.latest'}}{{i18n 'topic.view_latest_topics'}}{{/link-to}} {{i18n 'or'}} {{i18n 'filters.top.other_periods'}}
{{else if top}}
{{#link-to "discovery.categories"}}{{i18n 'topic.browse_all_categories'}}{{/link-to}}, {{#link-to 'discovery.latest'}}{{i18n 'topic.view_latest_topics'}}{{/link-to}} {{i18n 'or'}} {{i18n 'filters.top.other_periods'}}
{{top-period-buttons period=period action="changePeriod"}}
</h3>
{{else}}
<div class="education">
{{{footerEducation}}}
</div>
<h3>
{{footerMessage}}{{#link-to "discovery.categories"}} {{i18n 'topic.browse_all_categories'}}{{/link-to}} {{i18n 'or'}} {{#link-to 'discovery.latest'}}{{i18n 'topic.view_latest_topics'}}{{/link-to}}
</h3>
{{#link-to "discovery.categories"}} {{i18n 'topic.browse_all_categories'}}{{/link-to}} {{i18n 'or'}} {{#link-to 'discovery.latest'}}{{i18n 'topic.view_latest_topics'}}{{/link-to}}
{{/if}}
{{/if}}
{{/footer-message}}
{{/if}}
</footer>