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

contributions: remove link on source title #695

Merged
merged 1 commit into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,23 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<ng-container *ngIf="record$ | async as record">
<ng-container *ngIf="record$ | async as record">
<h1 class="mb-0">{{ record.metadata | extractSourceField : 'authorized_access_point' }}</h1>
<small *ngVar="icon(record.metadata.type) as icon">
<i class="fa {{ icon.class }}" title="{{ icon.title }}" aria-hidden="true"></i>
<i class="fa {{ icon.class }}" title="{{ icon.title }}" aria-hidden="true"></i>
{{ 'MEF ID' | translate }}: {{ record.metadata.pid }}
</small>

<!-- SOURCES -->
<article class="card my-2" *ngFor="let source of record.metadata.sources.sort()">
<a class="card-link" data-toggle="collapse" data-target="#collapse-rero" aria-expanded="true">
<header class="card-header">
<b class="card-title mb-0">
{{ source | translate | uppercase }}
</b>
</header>
</a>
<header class="card-header">
<b class="card-title mb-0">
{{ source | translate | uppercase }}
</b>
</header>
<article id="contribution-{{ source }}" class="card-body collapse show" [ngSwitch]="record.metadata.type">
<admin-person-detail-view *ngSwitchCase="'bf:Person'" [record]="record.metadata[source]"></admin-person-detail-view>
<admin-corporate-bodies-detail-view *ngSwitchCase="'bf:Organisation'" [record]="record.metadata[source]"></admin-corporate-bodies-detail-view>
<admin-person-detail-view *ngSwitchCase="'bf:Person'" [record]="record.metadata[source]" [source]="source"></admin-person-detail-view>
<admin-corporate-bodies-detail-view *ngSwitchCase="'bf:Organisation'" [record]="record.metadata[source]" [source]="source"></admin-corporate-bodies-detail-view>
<span *ngSwitchDefault>Missing contribution type.</span>
</article>
</article>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,20 @@
</ul>
</dd>
</dl>

<!-- ID -->
<dl class="row mb-0" *ngIf="record.identifier">
<dt class="col-sm-3 offset-sm-2 offset-md-0 label-title" translate>
Id
</dt>
<dd class="col-sm-7 col-md-8 mb-0">
<ng-container *ngIf="disabledLink(source); else noLink">
<a href="{{ record.identifier }}">
{{ record.pid }}
</a>
</ng-container>
<ng-template #noLink>
{{ record.pid }}
</ng-template>
</dd>
</dl>
</ng-container>
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,19 @@ export class CorporateBodiesDetailViewComponent {

/** Record metadata */
@Input() record: any;

/** Record source */
@Input() source: string;

/** Disabled source link */
disabledSourceLink = ['rero'];

/**
* Disabled link
* @param source - string
* @returns boolean
*/
disabledLink(source: string) {
return !this.disabledSourceLink.includes(source);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,6 @@
[innerHtml]="record.biographical_information.join('\n') | urlActive | nl2br"
></dd>
</dl>
<!-- PERMALINK -->
<dl class="row mb-0" *ngIf="record.identifier_for_person">
<dt class="col-sm-3 offset-sm-2 offset-md-0 label-title" translate>
Id
</dt>
<dd class="col-sm-7 col-md-8 mb-0">
<a href="{{ record.identifier_for_person }}">
{{ record.pid }}
</a>
</dd>
</dl>
<!-- NAME -->
<dl class="row mb-0" *ngIf="record.name">
<dt class="col-sm-3 offset-sm-2 offset-md-0 label-title" translate>
Expand Down Expand Up @@ -108,4 +97,20 @@
{{ record.authorized_access_point }}
</dd>
</dl>
<!-- ID -->
<dl class="row mb-0" *ngIf="record.identifier">
<dt class="col-sm-3 offset-sm-2 offset-md-0 label-title" translate>
Id
</dt>
<dd class="col-sm-7 col-md-8 mb-0">
<ng-container *ngIf="disabledLink(source); else noLink">
<a href="{{ record.identifier }}">
{{ record.pid }}
</a>
</ng-container>
<ng-template #noLink>
{{ record.pid }}
</ng-template>
</dd>
</dl>
</ng-container>
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,19 @@ export class PersonDetailViewComponent {

/** record metadata */
@Input() record: any;

/** record source */
@Input() source: string;

/** Disabled source link */
disabledSourceLink = ['rero'];

/**
* Disabled link
* @param source - string
* @returns boolean
*/
disabledLink(source: string) {
return !this.disabledSourceLink.includes(source);
}
}