Skip to content
Open
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
@@ -1,6 +1,7 @@
<template>

<div>
<!-- Header with icon and title -->
<div class="mb-4 mt-4 px-4 title">
<ContentNodeIcon
v-if="node && node.kind"
Expand All @@ -16,16 +17,18 @@
</h2>
</div>

<!-- Preview help text and button -->
<p class="mb-0 px-4">{{ $tr('previewHelpText') }}</p>
<p class="mb-0 px-4">
{{ $tr('previewHelpText') }}
</p>
<p class="mb-0 px-4">
<ActionLink
:text="$tr('showPreviewBtnLabel')"
<KButton
appearance="basic-link"
@click="showResourcePreview = true"
/>
>
{{ $tr('showPreviewBtnLabel') }}
</KButton>
</p>

<!-- Resource preview modal -->
<KModal
v-if="showResourcePreview"
:title="$tr('resourcePreviewDialogTitle')"
Expand All @@ -36,26 +39,21 @@
src="./relatedresources.png"
class="resource-preview"
>
<VLayout mt-3>
<VFlex class="mx-2">
<div class="mt-3">
<div class="mx-2">
<p>{{ $tr('resourcePreviewDialogHelpText') }}</p>
</VFlex>
</VLayout>
</div>
</div>
</KModal>

<VLayout
justify-start
wrap
>
<VFlex
xs12
md5
<!-- Previous / Next Steps sections -->
<div class="steps-container">
<!-- Previous Steps -->
<div
class="step-section"
data-test="previousSteps"
class="px-4"
>
<h3 class="font-weight-bold mt-5 title">
{{ $tr('previousStepsTitle') }}
</h3>
<h3 class="font-weight-bold mt-5 title">{{ $tr('previousStepsTitle') }}</h3>
<p>{{ $tr('previousStepsExplanation') }}</p>

<RelatedResourcesList
Expand All @@ -71,26 +69,21 @@
{{ $tr('tooManyPreviousStepsWarning') }}
</p>

<VBtn
flat
color="primary"
<KButton
appearance="flat"
class="font-weight-bold ml-0"
@click="onAddPreviousStepClick"
>
{{ $tr('addPreviousStepBtnLabel') }}
</VBtn>
</VFlex>
</KButton>
</div>

<VFlex
xs12
md5
offset-md1
<!-- Next Steps -->
<div
class="step-section"
data-test="nextSteps"
class="px-4"
>
<h3 class="font-weight-bold mt-5 title">
{{ $tr('nextStepsTitle') }}
</h3>
<h3 class="font-weight-bold mt-5 title">{{ $tr('nextStepsTitle') }}</h3>
<p>{{ $tr('nextStepsExplanation') }}</p>

<RelatedResourcesList
Expand All @@ -106,16 +99,15 @@
{{ $tr('tooManyNextStepsWarning') }}
</p>

<VBtn
flat
color="primary"
<KButton
appearance="flat"
class="font-weight-bold ml-0"
@click="onAddNextStepClick"
>
{{ $tr('addNextStepBtnLabel') }}
</VBtn>
</VFlex>
</VLayout>
</KButton>
</div>
</div>
</div>

</template>
Expand All @@ -124,9 +116,9 @@
<script>

import { mapGetters, mapActions } from 'vuex';

import KButton from 'kolibri-design-system/lib/buttons-and-links/KButton.vue';
import KModal from 'kolibri-design-system/lib/KModal';
import { RouteNames } from '../../constants';

import RelatedResourcesList from '../RelatedResourcesList/RelatedResourcesList';
import ContentNodeIcon from 'shared/views/ContentNodeIcon';

Expand All @@ -135,6 +127,8 @@
components: {
ContentNodeIcon,
RelatedResourcesList,
KButton,
KModal,
},
props: {
nodeId: {
Expand Down Expand Up @@ -168,9 +162,7 @@
onStepClick(nodeId) {
const route = this.$router.resolve({
name: RouteNames.CONTENTNODE_DETAILS,
params: {
detailNodeIds: nodeId,
},
params: { detailNodeIds: nodeId },
});
window.open(route.href, '_blank');
},
Expand All @@ -187,25 +179,15 @@
onAddPreviousStepClick() {
this.$router.push({
name: RouteNames.ADD_PREVIOUS_STEPS,
params: {
...this.$route.params,
targetNodeId: this.nodeId,
},
query: {
last: this.$route.name,
},
params: { ...this.$route.params, targetNodeId: this.nodeId },
query: { last: this.$route.name },
});
},
onAddNextStepClick() {
this.$router.push({
name: RouteNames.ADD_NEXT_STEPS,
params: {
...this.$route.params,
targetNodeId: this.nodeId,
},
query: {
last: this.$route.name,
},
params: { ...this.$route.params, targetNodeId: this.nodeId },
query: { last: this.$route.name },
});
},
},
Expand Down Expand Up @@ -253,4 +235,16 @@
margin: auto;
}

/* Layout for previous/next steps without Vuetify */
.steps-container {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
}

.step-section {
flex: 1 1 45%;
margin: 0 1rem 2rem 0;
}

</style>