forked from CGM_Public/pretix_original
add data field edit link
This commit is contained in:
@@ -26,6 +26,9 @@
|
||||
{{ request.event.settings.locales|json_script:"event_locales" }}
|
||||
{{ questionnaire_type_choices|json_script:"questionnaire_type_choices" }}
|
||||
|
||||
{% url "control:event.items.questions.edit" organizer=request.event.organizer.slug event=request.event.slug question=0 as datafield_edit_url %}
|
||||
{{ datafield_edit_url|json_script:"datafield_edit_url" }}
|
||||
|
||||
<div id="questionnaires-editor">
|
||||
<!-- Vue app mount point -->
|
||||
</div>
|
||||
|
||||
@@ -4,6 +4,7 @@ import NativeDialog from './NativeDialog.vue';
|
||||
import I18nTextField from './I18nTextField.vue';
|
||||
import { useId, ref } from 'vue'
|
||||
import { DragHandle } from 'vue-slicksort';
|
||||
import {get_datafield_edit_url} from "./api";
|
||||
|
||||
const id = useId();
|
||||
const props = defineProps(['question', 'datafields', 'editable'])
|
||||
@@ -86,8 +87,13 @@ const editor = ref();
|
||||
</label>
|
||||
<div class="col-md-9">
|
||||
<p class="form-control-static">
|
||||
{{ question.question }}
|
||||
<a href="" target="_blank">Manage data field details</a>
|
||||
<template v-if="typeof question.question === 'number'">
|
||||
{{ df.internal_name }}
|
||||
<a :href="get_datafield_edit_url(df.id)" target="_blank">Manage data field details</a>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ question.question }}
|
||||
</template>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -57,3 +57,7 @@ function get_json_script_value(id) {
|
||||
export function get_event_locales() {
|
||||
return get_json_script_value('event_locales');
|
||||
}
|
||||
|
||||
export function get_datafield_edit_url(datafield_id) {
|
||||
return get_json_script_value('datafield_edit_url').replace('/0/', `/${datafield_id}/`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user