Skip to content

Commit

Permalink
Add link to dfiq.org for questions
Browse files Browse the repository at this point in the history
  • Loading branch information
berggren committed Oct 25, 2023
1 parent bbab8f2 commit f575d06
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions timesketch/api/v1/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ class ResourceMixin(object):
"name": fields.String,
"display_name": fields.String,
"description": fields.String,
"dfiq_identifier": fields.String,
"spec_json": fields.String,
"user": fields.Nested(user_fields),
"approaches": fields.List(fields.Nested(approach_fields)),
Expand All @@ -288,6 +289,7 @@ class ResourceMixin(object):
"name": fields.String,
"display_name": fields.String,
"description": fields.String,
"dfiq_identifier": fields.String,
"spec_json": fields.String,
"user": fields.Nested(user_fields),
"questions": fields.List(fields.Nested(question_fields)),
Expand Down
12 changes: 11 additions & 1 deletion timesketch/frontend-ng/src/components/Scenarios/ContextCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ limitations under the License.
<template>
<v-card outlined rounded class="mt-3 mx-3" v-if="activeContext.question">
<v-toolbar flat dense style="background-color: transparent">
<h3>{{ activeContext.question.display_name }}</h3>
<h3>
{{ activeContext.question.display_name }}
<small>
<a :href="getDfiqQuestionUrl(activeContext.question.dfiq_identifier)" target="_blank" rel="noreferrer"
>({{ activeContext.question.dfiq_identifier }})</a
>
</small>
</h3>
<v-spacer></v-spacer>
<v-btn v-if="activeContext.question.description" small icon @click="expanded = !expanded" class="mr-1">
<v-icon v-if="expanded">mdi-chevron-up</v-icon>
Expand Down Expand Up @@ -123,6 +130,9 @@ export default {
toHtml(markdown) {
return DOMPurify.sanitize(marked(markdown))
},
getDfiqQuestionUrl(id) {
return 'https://dfiq.org/questions/' + id + '/'
},
},
}
</script>
Expand Down

0 comments on commit f575d06

Please sign in to comment.