Commit 9f4609b1 authored by Matija Obreza's avatar Matija Obreza
Browse files

Make HTML Preview public

parent 07f1c7f4
...@@ -266,50 +266,48 @@ class DetailInfo extends React.Component<IDetailInfoProps, any> { ...@@ -266,50 +266,48 @@ class DetailInfo extends React.Component<IDetailInfoProps, any> {
</Properties> </Properties>
</CardContent> </CardContent>
{ !review && (descriptorList._permissions.write || descriptorList._permissions.delete) && ( <CardActions>
<CardActions> { !review && (
{ descriptorList.state === PublishState.PUBLISHED ? <span>
descriptorList._permissions.manage && !oneDayPassed ? { descriptorList.state === PublishState.PUBLISHED ? (descriptorList._permissions.manage && !oneDayPassed) ?
<Button onClick={ this.onUnpublish } type="button">{ t('common:action.un-publish') }</Button> <Button onClick={ this.onUnpublish } type="button">{ t('common:action.un-publish') }</Button>
: :
<Authorize role="ROLE_ADMINISTRATOR"> <Authorize role="ROLE_ADMINISTRATOR">
<Button onClick={ this.onUnpublish } type="button">{ t('common:action.un-publish') }</Button> <Button onClick={ this.onUnpublish } type="button">{ t('common:action.un-publish') }</Button>
</Authorize> </Authorize>
: null : null
} }
{ descriptorList.state === PublishState.DRAFT && { descriptorList.state === PublishState.DRAFT && descriptorList._permissions.write &&
descriptorList._permissions.write &&
<Button onClick={ this.onPublish } type="button"> <Button onClick={ this.onPublish } type="button">
{ t('common:action.publish') } { t('common:action.publish') }
</Button> </Button>
} }
{ descriptorList.state !== PublishState.PUBLISHED && { descriptorList.state !== PublishState.PUBLISHED && descriptorList._permissions.write &&
descriptorList._permissions.write &&
<Button onClick={ this.onReject } type="button"> <Button onClick={ this.onReject } type="button">
{ t('common:action.edit') } { t('common:action.edit') }
</Button> </Button>
} }
{ descriptorList.state === PublishState.REVIEWING && { descriptorList.state === PublishState.REVIEWING &&
<Authorize role="ROLE_ADMINISTRATOR"> <Authorize role="ROLE_ADMINISTRATOR">
<Button onClick={ this.onApprove } type="button"> <Button onClick={ this.onApprove } type="button">
{ t('common:action.approve') } { t('common:action.approve') }
</Button> </Button>
</Authorize> </Authorize>
} }
{ descriptorList.state !== PublishState.PUBLISHED && { descriptorList.state !== PublishState.PUBLISHED && descriptorList._permissions.delete &&
descriptorList._permissions.delete && <Button onClick={ this.onDelete } type="button">
<Button onClick={ this.onDelete } type="button"> { t('common:action.delete') }
{ t('common:action.delete') } </Button>
</Button>
} }
{ descriptorList._permissions.manage && </span>
) }
{ descriptorList._permissions.manage &&
<Permissions clazz={ DescriptorList.clazz } id={ descriptorList.id }/> <Permissions clazz={ DescriptorList.clazz } id={ descriptorList.id }/>
} }
<a target="_blank" href={ `/proxy/api/v1/descriptorlist/${descriptorList.uuid}/html` }> <a target="_blank" href={ `/proxy/api/v1/descriptorlist/${descriptorList.uuid}/html` }>
<Button type="button">{ t('descriptorlists.public.common.html') }</Button> <Button type="button">{ t('descriptorlists.public.common.html') }</Button>
</a> </a>
</CardActions> </CardActions>
) }
</Card> </Card>
</Grid> </Grid>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment