Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Author Changes #934

Merged
merged 5 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion assets/css/opencast.scss
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ $action-menu-icon-size: 20px;
text-overflow: ellipsis;
}

.oc--author {
.oc--presenters {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
Expand Down
2 changes: 1 addition & 1 deletion courseware/vueapp/components/CoursewareVideoTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</a>
</th>
<th data-sort="false" class="responsive-hidden">
{{ $gettext('Autor/-in') }}
{{ $gettext('Vortragende') }}
</th>
</tr>
</thead>
Expand Down
8 changes: 4 additions & 4 deletions courseware/vueapp/components/VideoRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
</td>
<td v-else></td>

<td class="oc--author responsive-hidden">
{{ event.author ? event.author : '' }}
<td class="oc--presenters responsive-hidden">
{{ event.presenters ? event.presenters : '' }}
</td>
</tr>
<tr v-else>
Expand Down Expand Up @@ -205,8 +205,8 @@ export default {

getInfoText() {
var txt = '';
if (this.event.author) {
txt += '<div>Author: ' + this.event.author + '</div>';
if (this.event.presenters) {
txt += '<div>Vortragende: ' + this.event.presenters + '</div>';
}
if (this.event.contributors) {
txt += '<div>Mitwirkende: ' + this.event.contributors + '</div>';
Expand Down
2 changes: 1 addition & 1 deletion cronjobs/opencast_worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function execute($last_result, $parameters = array())
$video->duration = $event->duration;

$video->created = date('Y-m-d H:i:s', strtotime($event->created));
$video->author = $event->creator;
$video->presenters = implode(', ', $event->presenter);
$video->contributors = implode(', ', $event->contributor);

$video->store();
Expand Down
2 changes: 1 addition & 1 deletion docs/studip_opencast_routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -1876,7 +1876,7 @@
"type": "string",
"format": "date-time"
},
"author": {
"presenters": {
"type": "string"
},
"contributors": {
Expand Down
2 changes: 1 addition & 1 deletion docs/studip_opencast_routes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ components:
created:
type: string
format: date-time
author:
presenters:
type: string
contributors:
type: string
Expand Down
2 changes: 1 addition & 1 deletion lib/Models/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Filter
$trashed;

private static $ALLOWED_ORDERS = [
'created_desc', 'created_asc', 'title_desc', 'title_asc', 'author_desc', 'author_asc', 'order_desc', 'order_asc', 'mkdate_desc', 'mkdate_asc'
'created_desc', 'created_asc', 'title_desc', 'title_asc', 'presenters_desc', 'presenters_asc', 'order_desc', 'order_asc', 'mkdate_desc', 'mkdate_asc'
];

private static $ALLOWED_FILTERS = [
Expand Down
2 changes: 1 addition & 1 deletion lib/Models/Playlists.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ private static function getFilteredPlaylistsQuery(array $query, Filter $filters)
$courses = [];
$lecturers = [];
$orderable_columns = [
'mkdate', 'chdate', 'id', 'title', 'author'
'mkdate', 'chdate', 'id', 'title', 'presenters'
];

// Apply filters
Expand Down
2 changes: 1 addition & 1 deletion lib/Models/ScheduleHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ public static function createOrUpdateLivestreamVideo($config_id, $course_id, $ev
'duration' => $event->duration,
'state' => 'running',
'created' => date('Y-m-d H:i:s', strtotime($event->created)),
'author' => $event->creator,
'presenters' => $event->creator,
'available' => true,
'publication' => $publication,
'is_livestream' => true,
Expand Down
6 changes: 5 additions & 1 deletion lib/Models/Videos.php
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ public function haveCoursePerm(string $perm)
public function updateMetadata($event)
{
$api_event_client = ApiEventsClient::getInstance($this->config_id);
$allowed_metadata_fields = ['title', 'contributors', 'subject', 'language', 'description', 'startDate'];
$allowed_metadata_fields = ['title', 'presenters', 'contributors', 'subject', 'language', 'description', 'startDate'];
$metadata = [];

foreach ($allowed_metadata_fields as $field_name) {
Expand All @@ -610,6 +610,10 @@ public function updateMetadata($event)
$id = 'subjects';
$value = [$value];
}
if ($field_name == 'presenters') {
$id = 'creator';
$value = [$value];
}
if ($field_name == 'contributors') {
$id = 'contributor';
$value = [$value];
Expand Down
19 changes: 10 additions & 9 deletions lib/Routes/Video/VideoAdd.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,16 @@ public function __invoke(Request $request, Response $response, $args)
else {
$video = new Videos;
$video->setData([
'episode' => $episode_id,
'config_id' => $event['config_id'],
'title' => $event['title'],
'description' => $event['description'],
'duration' => $event['duration'],
'state' => $event['state'],
'created' => date('Y-m-d H:i:s'),
'author' => get_fullname($user->id),
'available' => true
'episode' => $episode_id,
'config_id' => $event['config_id'],
'title' => $event['title'],
'description' => $event['description'],
'duration' => $event['duration'],
'state' => $event['state'],
'created' => date('Y-m-d H:i:s'),
'presenters' => $event['presenters'],
'contributors' => $event['contributors'],
'available' => true
]);
if (!$video->token) {
$video->token = bin2hex(random_bytes(8));
Expand Down
8 changes: 4 additions & 4 deletions locale/en/LC_MESSAGES/opencast.po
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ msgid "Auswirkungen der Videoänderungen"
msgstr "Effects of the video changes"

#: vueapp/components/Videos/VideosTable.vue:147
msgid "Autor/-in"
msgstr "Author"
msgid "Vortragende"
msgstr "Presenters"

#: vueapp/components/Config/EditServer.vue:56
msgid "Basis URL zur Opencast Installation"
Expand Down Expand Up @@ -2806,8 +2806,8 @@ msgstr "Upcoming live events"
#~ "Find a series in the Opencast system that you want to link to the current "
#~ "course."

#~ msgid "Autor : "
#~ msgstr "Author:"
#~ msgid "Vortragende : "
#~ msgstr "Presenters:"

#~ msgid "Beschreibung : "
#~ msgstr "Description:"
Expand Down
31 changes: 31 additions & 0 deletions migrations/091_rename_video_author_to_presenters.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

class RenameVideoAuthorToPresenters extends Migration
{
public function description()
{
return 'Rename author to presenters in video table';
}

public function up()
{
$db = DBManager::get();

$db->exec("ALTER TABLE `oc_video`
CHANGE COLUMN `author` `presenters` varchar(255)
");

SimpleOrMap::expireTableScheme();
}

public function down()
{
$db = DBManager::get();

$db->exec("ALTER TABLE `oc_video`
CHANGE COLUMN `presenters` `author` varchar(255)
");

SimpleOrMap::expireTableScheme();
}
}
7 changes: 7 additions & 0 deletions vueapp/components/Videos/Actions/VideoEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@
name="title" v-model="event.title" required>
</label>

<label>
<span>
{{ $gettext('Vortragende') }}
</span>
<input type="text" maxlength="255" name="presenter" v-model="event.presenters">
</label>

<label>
<span>
{{ $gettext('Mitwirkende') }}
Expand Down
10 changes: 5 additions & 5 deletions vueapp/components/Videos/VideoRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@
</td>
<td v-else></td>

<td class="oc--author responsive-hidden">
{{ event.author ?? '' }}
<td class="oc--presenters responsive-hidden">
{{ event.presenters ?? '' }}
</td>

<td class="oc--tooltips">
Expand Down Expand Up @@ -396,16 +396,16 @@ export default {
var txt = '';
if (this.event.perms !== undefined) {
this.event.perms.forEach(perm => {
txt += '<div>' + perm.fullname + ': ' + this.$filters.permname(perm.perm, this.$gettext) + '</div>'
txt += '<div>' + this.$filters.permname(perm.perm, this.$gettext) + ': ' + perm.fullname + '</div>'
});
}
return txt;
},

getInfoText() {
var txt = '';
if (this.event.author) {
txt += '<div>Author: ' + this.event.author + '</div>';
if (this.event.presenters) {
txt += '<div>Vortragende: ' + this.event.presenters + '</div>';
}
if (this.event.contributors) {
txt += '<div>Mitwirkende: ' + this.event.contributors + '</div>';
Expand Down
16 changes: 13 additions & 3 deletions vueapp/components/Videos/VideoUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@
id="recordDate" v-model="upload.recordDate" required>
</label>

<label>
<span>
{{ $gettext('Vortragende') }}
</span>
<input type="text" maxlength="255" id="presenter" name="presenter"
v-model="upload.creator">
</label>

<label>
<span>
{{ $gettext('Mitwirkende') }}
Expand Down Expand Up @@ -232,8 +240,8 @@ export default {
selectedWorkflow: false,
fileUploadError: false,
upload: {
creator: this.currentUser.username,
contributor: this.currentUser.fullname,
creator: this.currentUser.fullname,
contributor: '',
playlist_token: null,
recordDate: format(new Date(), "yyyy-MM-dd'T'HH:mm", { locale: de}),
subject: this.$gettext('Medienupload, Stud.IP')
Expand Down Expand Up @@ -424,7 +432,9 @@ export default {
'config_id': view.selectedServer.id,
'title': uploadData.title,
'description': uploadData.description,
'state': 'running'
'state': 'running',
'presenters': uploadData.creator,
'contributors': uploadData.contributor
})
.then(({ data }) => {
this.$store.dispatch('addMessage', data.message);
Expand Down
4 changes: 2 additions & 2 deletions vueapp/components/Videos/VideosTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@
{{ $gettext('Datum') }}
</a>
</th>
<th @click="setSort('author')" class="responsive-hidden" :class="sortClasses('author')">
<th @click="setSort('presenters')" class="responsive-hidden" :class="sortClasses('presenters')">
<a href="#" @click.prevent>
{{ $gettext('Autor/-in') }}
{{ $gettext('Vortragende') }}
</a>
</th>
<th></th>
Expand Down
2 changes: 1 addition & 1 deletion vueapp/i18n/translations.json

Large diffs are not rendered by default.

Loading