|
|
@ -0,0 +1,49 @@ |
|
|
|
<script lang="ts" context="module"> |
|
|
|
export interface IDAndName { |
|
|
|
id: number |
|
|
|
name: string |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<script lang="ts"> |
|
|
|
import { projectPrettyId, scopePrettyId } from "$lib/utils/prettyIds"; |
|
|
|
import { getScopeContext } from "../contexts/ScopeContext.svelte"; |
|
|
|
|
|
|
|
export let project: IDAndName |
|
|
|
export let requirement: IDAndName |
|
|
|
|
|
|
|
const {scope} = getScopeContext(); |
|
|
|
|
|
|
|
let projectLink: string |
|
|
|
let requirementLink: string |
|
|
|
|
|
|
|
$: { |
|
|
|
projectLink = `/${scopePrettyId($scope)}/projects/${projectPrettyId(project)}` |
|
|
|
requirementLink = `${projectLink}#${projectPrettyId(requirement)}` |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<div class="reference"> |
|
|
|
<a href={projectLink}>{project.name}</a> |
|
|
|
<span>></span> |
|
|
|
<a href={requirementLink}>{requirement.name}</a> |
|
|
|
</div> |
|
|
|
|
|
|
|
<style lang="sass"> |
|
|
|
@import "../../css/colors" |
|
|
|
|
|
|
|
div.reference |
|
|
|
font-size: 0.8em |
|
|
|
|
|
|
|
> span |
|
|
|
color: $color-entry3 |
|
|
|
|
|
|
|
> a |
|
|
|
color: $color-entry5 |
|
|
|
text-decoration: none |
|
|
|
line-height: 1em |
|
|
|
transition: 250ms |
|
|
|
|
|
|
|
&:hover |
|
|
|
color: $color-entry8 |
|
|
|
</style> |