Skip to content

Commit

Permalink
N21-1626 ctl data sheet (#246)
Browse files Browse the repository at this point in the history
* add data sheet action button in ctl table

---------

Co-authored-by: Malte Berg <[email protected]>
Co-authored-by: Marvin Öhlerking <[email protected]>
  • Loading branch information
3 people authored Feb 2, 2024
1 parent 219ddd0 commit 4ec61c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions controllers/ctltools.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,21 @@ const getCreateHandler = (req, res, next) => {
};

const getTableActions = (item, path) => {
const baseUrl = process.env.HOST || 'http://localhost:3030';
return [
{
link: path + item.id,
class: 'btn-edit',
icon: 'edit',
title: 'bearbeiten'
},
{
link: baseUrl + '/api/v3/tools/external-tools/' + item.id + '/datasheet',
class: 'btn-data-sheet',
icon: 'file-text-o',
title: 'Datenblatt anzeigen',
target: '_blank'
},
{
link: path + item.id,
class: 'btn-delete',
Expand Down
2 changes: 1 addition & 1 deletion views/lib/components/table.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</button>
</form>
{{else}}
<a class="btn btn-secondary btn-sm {{this.class}}" href="{{this.link}}" title="{{this.title}}">
<a class="btn btn-secondary btn-sm {{this.class}}" href="{{this.link}}" title="{{this.title}}" target="{{this.target}}">
<i class="fa fa-{{this.icon}}"></i> {{this.label}}
</a>
{{/if}}
Expand Down

0 comments on commit 4ec61c3

Please sign in to comment.