Skip to content

Commit

Permalink
[Cursus] displays tags in course list
Browse files Browse the repository at this point in the history
  • Loading branch information
Elorfin committed Mar 3, 2021
1 parent 8006ed8 commit f9930bb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/plugin/cursus/Resources/modules/course/components/card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react'
import {PropTypes as T} from 'prop-types'
import classes from 'classnames'
import get from 'lodash/get'
import isEmpty from 'lodash/isEmpty'

import {trans} from '#/main/app/intl/translation'
import {asset} from '#/main/app/config/asset'
Expand All @@ -25,6 +26,16 @@ const CourseCard = props =>
get(props.data, 'restrictions.hidden') && ['fa fa-eye-slash', trans('training_hidden', {}, 'cursus')],
get(props.data, 'registration.selfRegistration') && ['fa fa-globe', trans('training_public_registration', {}, 'cursus')]
].filter(flag => !!flag)}
footer={!isEmpty(props.data.tags) &&
<div className="tags">
{props.data.tags.map(tag =>
<span key={tag} className="tag label label-info">
<span className="fa fa-fw fa-tag icon-with-text-right" />
{tag}
</span>
)}
</div>
}
/>

CourseCard.propTypes = {
Expand Down

0 comments on commit f9930bb

Please # to comment.