mirror of
https://github.com/flarum/core.git
synced 2025-07-30 13:10:24 +02:00
Extract EventPost description into separate method
This makes it easier to override in subclasses. In preparation for #428.
This commit is contained in:
@@ -34,7 +34,7 @@ export default class EventPost extends Post {
|
||||
return [
|
||||
icon(this.icon(), {className: 'EventPost-icon'}),
|
||||
<div class="EventPost-info">
|
||||
{app.translator.transChoice(this.descriptionKey(), data.count, data)}
|
||||
{this.description(data)}
|
||||
</div>
|
||||
];
|
||||
}
|
||||
@@ -48,6 +48,16 @@ export default class EventPost extends Post {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the description text for the event.
|
||||
*
|
||||
* @param {Object} data
|
||||
* @return {String|Object} The description to render in the DOM
|
||||
*/
|
||||
description(data) {
|
||||
return app.translator.transChoice(this.descriptionKey(), data.count, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the translation key for the description of the event.
|
||||
*
|
||||
|
Reference in New Issue
Block a user