Skip to content
Snippets Groups Projects
Commit 190d50eb authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

file tables: connect checkboxes with folder/file names, fixes #819

Closes #819

Merge request studip/studip!438
parent 058f46f7
No related branches found
No related tags found
No related merge requests found
...@@ -42,10 +42,11 @@ ...@@ -42,10 +42,11 @@
</colgroup> </colgroup>
<thead> <thead>
<tr class="sortable"> <tr class="sortable">
<th v-if="show_bulk_actions" data-sort="false"> <th v-if="show_bulk_actions" data-sort="false" :aria-label="$gettext('Ordner und Dateien auswählen')">
<studip-proxy-checkbox <studip-proxy-checkbox
v-model="selectedIds" v-model="selectedIds"
:total="allIds" :total="allIds"
:title="$gettext('Alle Ordner und Dateien auswählen')"
></studip-proxy-checkbox> ></studip-proxy-checkbox>
</th> </th>
<th @click="sort('mime_type')" :class="sortClasses('mime_type')"> <th @click="sort('mime_type')" :class="sortClasses('mime_type')">
...@@ -115,10 +116,11 @@ ...@@ -115,10 +116,11 @@
name="ids[]" name="ids[]"
:value="folder.id" :value="folder.id"
v-model="selectedIds" v-model="selectedIds"
:aria-label="getAriaLabelForFolder(folder)"
></studip-proxied-checkbox> ></studip-proxied-checkbox>
</td> </td>
<td class="document-icon"> <td class="document-icon">
<a :href="folder.url"> <a :href="folder.url" :id="`folder-${folder.id}`">
<studip-icon :shape="folder.icon" role="clickable" size="26" class="text-bottom"></studip-icon> <studip-icon :shape="folder.icon" role="clickable" size="26" class="text-bottom"></studip-icon>
</a> </a>
</td> </td>
...@@ -166,6 +168,7 @@ ...@@ -166,6 +168,7 @@
name="ids[]" name="ids[]"
:value="file.id" :value="file.id"
v-model="selectedIds" v-model="selectedIds"
:aria-label="getAriaLabelForFile(file)"
></studip-proxied-checkbox> ></studip-proxied-checkbox>
</td> </td>
<td class="document-icon"> <td class="document-icon">
...@@ -180,8 +183,7 @@ ...@@ -180,8 +183,7 @@
data-lightbox="gallery"></a> data-lightbox="gallery"></a>
</td> </td>
<td :class="{'filter-match': valueMatchesFilter(file.name)}"> <td :class="{'filter-match': valueMatchesFilter(file.name)}">
<a :href="file.details_url" data-dialog :id="`file-${file.id}`">
<a :href="file.details_url" data-dialog>
<span v-html="highlightString(file.name)"></span> <span v-html="highlightString(file.name)"></span>
<studip-icon v-if="file.isAccessible" <studip-icon v-if="file.isAccessible"
shape="accessibility" shape="accessibility"
...@@ -393,6 +395,18 @@ export default { ...@@ -393,6 +395,18 @@ export default {
highlighted = highlighted.replace(regExp, '<span class="filter-match">$&</span>'); highlighted = highlighted.replace(regExp, '<span class="filter-match">$&</span>');
} }
return highlighted; return highlighted;
},
getAriaLabelForFolder(folder) {
return this.$gettextInterpolate(
this.$gettext('Ordner %{name} auswählen'),
{name: folder.name}
);
},
getAriaLabelForFile(file) {
return this.$gettextInterpolate(
this.$gettext('Datei %{name} auswählen'),
{name: file.name}
);
} }
}, },
computed: { computed: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment