Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EntityLink cleanup #630

Merged
merged 11 commits into from
Mar 28, 2018
4 changes: 2 additions & 2 deletions root/area/layout.tt
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
[%~ WRAPPER 'layout/sidebar/property.tt' label=l("Begin date:") class="begin-date" ~%]
[%~ area.begin_date.format ~%]
[%~ IF area.has_age AND not area.end_date.format ~%]
[%~ bracketed(display_age_ago(area.age)) ~%]
[%~ bracketedWithSpace(display_age_ago(area.age)) ~%]
[%~ END ~%]
[%~ END ~%]
[%~ END ~%]
[%~ IF area.end_date.format ~%]
[%~ WRAPPER 'layout/sidebar/property.tt' label=l("End date:") class="end-date" ~%]
[%~ area.end_date.format ~%]
[%~ IF area.has_age ~%]
[%~ bracketed(display_age(area.age)) ~%]
[%~ bracketedWithSpace(display_age(area.age)) ~%]
[%~ END ~%]
[%~ END ~%]
[%~ ELSIF area.ended ~%]
Expand Down
4 changes: 2 additions & 2 deletions root/artist/layout.tt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
[%~ WRAPPER 'layout/sidebar/property.tt' label=date_period_label ~%]
[%~ artist.begin_date.format ~%]
[%~ IF artist.has_age AND not artist.end_date.format ~%]
[%~ bracketed(display_age_ago(artist.age)) ~%]
[%~ bracketedWithSpace(display_age_ago(artist.age)) ~%]
[%~ END ~%]
[%~ END ~%]
[%~ END ~%]
Expand All @@ -52,7 +52,7 @@
[%~ WRAPPER 'layout/sidebar/property.tt' label=date_period_label ~%]
[%~ artist.end_date.format ~%]
[%~ IF artist.has_age ~%]
[%~ bracketed(display_age(artist.age, artist.type_id == 1)) ~%]
[%~ bracketedWithSpace(display_age(artist.age, artist.type_id == 1)) ~%]
[%~ END ~%]
[%~ END ~%]
[%~ ELSIF artist.ended ~%]
Expand Down
2 changes: 1 addition & 1 deletion root/components/Aliases/AliasTableRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Frag = require('../Frag');
const isolateText = require('../../static/scripts/common/utility/isolateText');
import formatDate from '../../static/scripts/common/utility/formatDate';
const entityHref = require('../../static/scripts/common/utility/entityHref');
const bracketed = require('../../static/scripts/common/utility/bracketed');
import bracketed from '../../static/scripts/common/utility/bracketed';
const locales = require('../../static/scripts/common/constants/locales');
const {l} = require('../../static/scripts/common/i18n');
const {lp_attributes} = require('../../static/scripts/common/i18n/attributes');
Expand Down
12 changes: 6 additions & 6 deletions root/components/common-macros.tt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[%~ MACRO uri_escape(text) BLOCK; text | uri; END ~%]
[%~ MACRO html_escape(text) BLOCK; text | html; END ~%]
[%~ MACRO html_unescape(text) BLOCK; text.replace('&quot;', '"').replace('&lt;', '<').replace('&gt;', '>').replace('&#39;', "'").replace('&amp;', '&'); END -%]
[%~ MACRO bracketed(text) BLOCK; text != '' ? l(' ({text})', { text => text }) : ''; END -%]
[%~ MACRO bracketedWithSpace(text) BLOCK; text != '' ? l(' ({text})', { text => text }) : ''; END -%]
[%~ MACRO js_escape(text) BLOCK; text | js; END ~%]
[%~ MACRO closing_tag_escape(text) BLOCK; text.replace('</', '<\\/'); END ~%]
[%- USE UserDate(c.user.preferences, current_language) -%]
Expand Down Expand Up @@ -327,7 +327,7 @@ END -%]
CASE 'info_link'; # add. parameter: infolink
content _ ' [<a href="' _ html_escape(infolink) _ '">' _ l('info') _ '</a>]';
CASE 'show_dates';
content _ bracketed(dates);
content _ bracketedWithSpace(dates);
CASE 'avatar'; # add. parameter: avatar
'<img src="' _ avatar _ '" height="' _ image_size _ '" width="' _ image_size _ '" class="gravatar" alt="" />' _ content;
END;
Expand Down Expand Up @@ -408,7 +408,7 @@ END -%]
END -%]

[%~ MACRO link_artist(artist, action, text, no_escape) BLOCK;
hover = artist.sort_name _ bracketed(artist.comment);
hover = artist.sort_name _ bracketedWithSpace(artist.comment);
INCLUDE _link_mbid_entity entity=artist type='artist' action=action content=text hover=hover namevar=1 noescape=no_escape;
END -%]

Expand Down Expand Up @@ -743,7 +743,7 @@ END -%]
l('until {date}', { date => relationship.link.end_date.format });
ELSIF relationship.link.ended;
' ';
bracketed(l('ended'));
bracketedWithSpace(l('ended'));
END;
IF relationship.${extra_attributes_field};
' (' _ relationship.${extra_attributes_field} _ ')';
Expand Down Expand Up @@ -934,8 +934,8 @@ END ~%]
ELSE;
descriptive_link(rel.target, rel.target_credit);
END;
bracketed(for_grouping ? rel.extra_grouping_phrase_attributes : rel.extra_phrase_attributes);
bracketed(rel.link.formatted_date);
bracketedWithSpace(for_grouping ? rel.extra_grouping_phrase_attributes : rel.extra_phrase_attributes);
bracketedWithSpace(rel.link.formatted_date);
'</span>' IF rel.edits_pending;
END ~%]

Expand Down
2 changes: 1 addition & 1 deletion root/components/medium.tt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<dt>[% add_colon(relationship.phrase) %]</dt>
<dd>
[%- link_entity(work) %]
[%- bracketed(relationship.link.formatted_date) %]
[%- bracketedWithSpace(relationship.link.formatted_date) %]
[%- grouped_relationships(work) %]
</dd>
[%- END %]
Expand Down
2 changes: 1 addition & 1 deletion root/components/relationship-editor.tt
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
(<!-- ko text: $data --><!-- /ko -->)
<!-- /ko -->
<!-- ko if: relationship.ended() && !relationship.formatDatePeriod() -->
[% bracketed(l('ended')) | html %]
[% bracketedWithSpace(l('ended')) | html %]
<!-- /ko -->
<!-- /ko -->
<!-- ko with: relationship.phraseAndExtraAttributes()[2 + (forGrouping ? 3 : 0)] -->
Expand Down
4 changes: 2 additions & 2 deletions root/label/layout.tt
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
[%~ WRAPPER 'layout/sidebar/property.tt' label=l("Founded:") class="founded" ~%]
[%~ label.begin_date.format ~%]
[%~ IF label.has_age AND not label.end_date.format ~%]
[%~ bracketed(display_age_ago(label.age)) ~%]
[%~ bracketedWithSpace(display_age_ago(label.age)) ~%]
[%~ END ~%]
[%~ END ~%]
[%~ END ~%]
[%~ IF label.end_date.format ~%]
[%~ WRAPPER 'layout/sidebar/property.tt' label=l("Defunct:") class="defunct" ~%]
[%~ label.end_date.format ~%]
[%~ IF label.has_age ~%]
[%~ bracketed(display_age(label.age)) ~%]
[%~ bracketedWithSpace(display_age(label.age)) ~%]
[%~ END ~%]
[%~ END ~%]
[%~ ELSIF label.ended ~%]
Expand Down
4 changes: 2 additions & 2 deletions root/place/layout.tt
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
[%~ WRAPPER 'layout/sidebar/property.tt' label=l("Opened:") class="opened" ~%]
[%~ place.begin_date.format ~%]
[%~ IF place.has_age AND not place.end_date.format ~%]
[%~ bracketed(display_age_ago(place.age)) ~%]
[%~ bracketedWithSpace(display_age_ago(place.age)) ~%]
[%~ END ~%]
[%~ END ~%]
[%~ END ~%]
[%~ IF place.end_date.format ~%]
[%~ WRAPPER 'layout/sidebar/property.tt' label=l("Closed:") class="closed" ~%]
[%~ place.end_date.format ~%]
[%~ IF place.has_age ~%]
[%~ bracketed(display_age(place.age)) ~%]
[%~ bracketedWithSpace(display_age(place.age)) ~%]
[%~ END ~%]
[%~ END ~%]
[%~ ELSIF place.ended ~%]
Expand Down
Loading