Skip to content

Commit

Permalink
Adds slugline in event and planning lists
Browse files Browse the repository at this point in the history
  • Loading branch information
vied12 committed Jun 27, 2017
1 parent 45f6dbc commit c6e78e1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
4 changes: 2 additions & 2 deletions client/actions/planning.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ const fetchPlannings = (params={}) => (
// fetch the plannings through the api
let q = {}
if (params.planningIds) {
q = { query: { bool: {} } }
q.query.bool.should = params.planningIds.map(
q = { source: { query: { bool: {} } } }
q.source.query.bool.should = params.planningIds.map(
(pid) => ({ term: { _id: pid } })
)
}
Expand Down
6 changes: 3 additions & 3 deletions client/components/EventItem/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ export const EventItem = ({
}
<PubStatusLabel status={event.pubstatus}/>
<span className="sd-overflow-ellipsis sd-list-item--element-grow event__title">
{event.name}
{(event.definition_short && event.name !== event.definition_short) &&
<span>&nbsp;|&nbsp;{event.definition_short}</span>
{event.slugline &&
<span className="ListItem__slugline">{event.slugline}</span>
}
<span className="ListItem__headline">{event.name}</span>
</span>
<TimeEvent event={event}/>
</div>
Expand Down
2 changes: 2 additions & 0 deletions client/components/EventMetadata/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Datetime } from '../index'
const formatDate = (d) => React.createElement(Datetime, { date: d })
const FIELDS = [
// 'Label', 'key1', 'key2', ['key3', func(value)] etc...
['Slugline', 'slugline'],
['Name', 'name'],
['From', ['dates.start', formatDate]],
['To', ['dates.end', formatDate]],
Expand Down Expand Up @@ -54,6 +55,7 @@ export function EventMetadata ({ event }) {

EventMetadata.propTypes = {
event: React.PropTypes.shape({
slugline: React.PropTypes.string,
name: React.PropTypes.string.isRequired,
dates: React.PropTypes.object.isRequired,
definition_short: React.PropTypes.string,
Expand Down
9 changes: 9 additions & 0 deletions client/components/ListItem/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import '~superdesk-core/styles/sass/variables.scss';

.ListItem__slugline {
color: $sd-keyword;
font-weight: 700;
text-transform: uppercase;
margin-right: 1rem;
}
.ListItem__headline { color: $gray; }
6 changes: 3 additions & 3 deletions client/components/PlanningItem/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ const PlanningItem = ({ item, event, agenda, onClick, active, onSpike, onUnspike
<span className="label label--alert">spiked</span>
}
<span className="sd-overflow-ellipsis sd-list-item--element-grow">
{item.slugline}
{(item.headline && item.slugline !== item.headline) &&
<span>&nbsp;|&nbsp;{item.headline}</span>
{item.slugline &&
<span className="ListItem__slugline">{item.slugline}</span>
}
<span className="ListItem__headline">{item.headline}</span>
</span>
{event &&
<span className="PlanningItem__event">
Expand Down

0 comments on commit c6e78e1

Please sign in to comment.