Skip to content

Commit

Permalink
Show cuts on cue edit page, and do not require edit mode for adding cues
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim020 committed Jun 16, 2023
1 parent 6407d3f commit 058c1ca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 30 deletions.
31 changes: 6 additions & 25 deletions client/src/vue_components/show/config/cues/CueEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,7 @@
Next Page
</b-button>
</b-col>
<b-col cols="2">
<b-button-group>
<b-button
v-if="INTERNAL_UUID !== CURRENT_EDITOR"
variant="warning"
:disabled="!CAN_REQUEST_EDIT"
@click="requestEdit"
>
Begin Editing
</b-button>
<b-button
v-else
variant="warning"
@click="stopEditing"
>
Stop Editing
</b-button>
</b-button-group>
</b-col>
<b-col cols="2" />
</b-row>
<b-row class="script-row">
<b-col cols="3">
Expand All @@ -72,7 +54,7 @@
:previous-line="GET_SCRIPT_PAGE(currentEditPage)[index - 1]"
:cue-types="CUE_TYPES"
:cues="getCuesForLine(line)"
:can-edit="canEdit"
:line-part-cuts="SCRIPT_CUTS"
/>
</template>
</b-col>
Expand Down Expand Up @@ -145,6 +127,7 @@ export default {
await this.GET_CHARACTER_GROUP_LIST();
await this.GET_CUE_TYPES();
await this.LOAD_CUES();
await this.GET_CUTS();
// Get the max page of the saved version of the script
await this.getMaxScriptPage();
Expand Down Expand Up @@ -199,7 +182,8 @@ export default {
...mapMutations(['REMOVE_PAGE', 'ADD_BLANK_LINE', 'SET_LINE']),
...mapActions(['GET_SCENE_LIST', 'GET_ACT_LIST', 'GET_CHARACTER_LIST',
'GET_CHARACTER_GROUP_LIST', 'LOAD_SCRIPT_PAGE', 'ADD_BLANK_PAGE', 'GET_SCRIPT_CONFIG_STATUS',
'RESET_TO_SAVED', 'SAVE_NEW_PAGE', 'SAVE_CHANGED_PAGE', 'GET_CUE_TYPES', 'LOAD_CUES']),
'RESET_TO_SAVED', 'SAVE_NEW_PAGE', 'SAVE_CHANGED_PAGE', 'GET_CUE_TYPES', 'LOAD_CUES',
'GET_CUTS']),
},
computed: {
currentEditPageKey() {
Expand All @@ -211,12 +195,9 @@ export default {
}
return 'primary';
},
canEdit() {
return this.INTERNAL_UUID === this.CURRENT_EDITOR;
},
...mapGetters(['CURRENT_SHOW', 'ACT_LIST', 'SCENE_LIST', 'CHARACTER_LIST',
'CHARACTER_GROUP_LIST', 'CAN_REQUEST_EDIT', 'CURRENT_EDITOR', 'INTERNAL_UUID',
'GET_SCRIPT_PAGE', 'DEBUG_MODE_ENABLED', 'CUE_TYPES', 'SCRIPT_CUES']),
'GET_SCRIPT_PAGE', 'DEBUG_MODE_ENABLED', 'CUE_TYPES', 'SCRIPT_CUES', 'SCRIPT_CUTS']),
},
};
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@
class="cue-button"
:style="{backgroundColor: cueBackgroundColour(cue),
color: contrastColor({'bgColor': cueBackgroundColour(cue)})}"
:disabled="!canEdit"
@click.stop="openEditForm(cue)"
>
{{ cueLabel(cue) }}
</b-button>
<b-button
v-if="canEdit"
class="cue-button"
@click.stop="openNewForm"
>
Expand Down Expand Up @@ -60,7 +58,10 @@
{{ characterGroups.find((char) => (char.id === part.character_group_id)).name }}
</b>
</template>
<p class="viewable-line">
<p
class="viewable-line"
:class="{'cut-line-part': linePartCuts.indexOf(part.id) !== -1}"
>
{{ part.line_text }}
</p>
</b-col>
Expand Down Expand Up @@ -223,9 +224,9 @@ export default {
cueTypes: {
required: true,
},
canEdit: {
type: Boolean,
linePartCuts: {
required: true,
type: Array,
},
},
data() {
Expand Down Expand Up @@ -415,4 +416,7 @@ export default {
margin-top: 1rem;
margin-bottom: 1rem;
}
.cut-line-part {
text-decoration: line-through;
}
</style>

0 comments on commit 058c1ca

Please sign in to comment.