Skip to content

Commit c6ea320

Browse files
committed
Merge branch 'master' of github.com:chamilo/chamilo-lms
2 parents d048dbb + 8770e7e commit c6ea320

13 files changed

Lines changed: 380 additions & 192 deletions

File tree

assets/css/scss/_exercise.scss

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,14 @@
3434
font-weight: normal;
3535
}
3636

37+
.question_options .checkbox,
3738
.question_options .radio {
38-
min-height: 18px;
39-
margin-left: 65px;
40-
}
41-
42-
.question_options .checkbox {
43-
margin-left: 65px;
39+
margin-left: 5px;
4440
}
4541

4642
.question_options .radio input[type="radio"], .question_options .checkbox input[type="checkbox"] {
4743
float: left;
48-
margin-left: -25px;
44+
margin-right: 5px;
4945
}
5046

5147
.question_options input[type="text"] {

assets/css/scss/atoms/_checkbox.scss

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,27 @@
9494
.p-checkbox-input:checked + .p-checkbox-box .p-checkbox-icon {
9595
@apply block;
9696
}
97+
.p-checkbox.p-component {
98+
@apply relative inline-flex items-center mr-2;
99+
}
100+
.p-checkbox.p-component input[type="checkbox"] {
101+
@apply absolute top-0 left-0 w-5 h-5 m-0 opacity-0 cursor-pointer;
102+
z-index: 2;
103+
}
104+
.p-checkbox-box {
105+
@apply w-5 h-5 flex items-center justify-center border border-gray-30 rounded;
106+
z-index: 1;
107+
}
108+
.p-checkbox.p-component + label,
109+
.p-checkbox.p-component ~ label {
110+
@apply ml-2;
111+
}
112+
.p-checkbox-box .p-checkbox-icon {
113+
@apply hidden;
114+
}
115+
.p-checkbox.p-component input[type="checkbox"]:checked + .p-checkbox-box {
116+
@apply bg-primary border-primary;
117+
}
118+
.p-checkbox.p-component input[type="checkbox"]:checked + .p-checkbox-box .p-checkbox-icon {
119+
@apply block text-white;
120+
}

assets/vue/components/dropbox/DropboxLayout.vue

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
<template>
22
<div class="dbx">
3-
<BaseToolbar class="dbx-toolbar" :showTopBorder="true">
3+
<BaseToolbar
4+
class="dbx-toolbar"
5+
:showTopBorder="true"
6+
>
47
<template #start>
5-
<h2 class="text-lg font-semibold m-0">Dropbox</h2>
8+
<h2 class="text-lg font-semibold m-0">{{ t("Dropbox") }}</h2>
69
</template>
710

811
<template #end>
912
<RouterLink
1013
class="nav-link"
11-
:to="{ name:'DropboxListSent', params:$route.params, query:$route.query }"
14+
:to="{ name: 'DropboxListReceived', params: $route.params, query: { ...$route.query, tab: 'received' } }"
1215
>
13-
Sent
16+
{{ t("Received") }}
1417
</RouterLink>
1518
<RouterLink
1619
class="nav-link"
17-
:to="{ name:'DropboxListReceived', params:$route.params, query:$route.query }"
20+
:to="{ name: 'DropboxListSent', params: $route.params, query: { ...$route.query, tab: 'sent' } }"
1821
>
19-
Received
22+
{{ t("Sent") }}
2023
</RouterLink>
2124
</template>
2225
</BaseToolbar>
@@ -29,7 +32,11 @@
2932

3033
<script setup>
3134
import BaseToolbar from "../basecomponents/BaseToolbar.vue"
35+
import { useI18n } from "vue-i18n"
36+
37+
const { t } = useI18n()
3238
</script>
39+
3340
<style scoped>
3441
.dbx {
3542
width: 100%;

assets/vue/router/dropbox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
name: "dropbox",
88
component: () => import("../components/dropbox/DropboxLayout.vue"),
99
redirect: (to) => ({
10-
name: "DropboxListSent",
10+
name: "DropboxListReceived",
1111
params: to.params,
1212
query: to.query,
1313
}),

assets/vue/views/dropbox/DropboxCreate.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</div>
1010
</template>
1111
<template #end>
12-
<RouterLink :to="{ name: 'DropboxListSent', params: $route.params, query: $route.query }">
12+
<RouterLink :to="returnRoute">
1313
<BaseButton
1414
type="black"
1515
icon="arrow-left"
@@ -130,7 +130,7 @@
130130
</div>
131131

132132
<div class="flex justify-end gap-2 mt-6">
133-
<RouterLink :to="{ name: 'DropboxListSent', params: $route.params, query: $route.query }">
133+
<RouterLink :to="returnRoute">
134134
<BaseButton
135135
type="black"
136136
icon="xmark"
@@ -178,6 +178,8 @@ import service from "../../services/dropbox"
178178
const { t } = useI18n()
179179
const route = useRoute()
180180
const router = useRouter()
181+
const returnRouteName = computed(() => (route.query?.from === "received" ? "DropboxListReceived" : "DropboxListSent"))
182+
const returnRoute = computed(() => ({ name: returnRouteName.value, params: route.params, query: route.query }))
181183
const uppy = shallowRef(null)
182184
183185
const pickedFiles = ref([])
@@ -304,7 +306,7 @@ async function submit() {
304306
pickedFiles.value = []
305307
306308
// Navigate back to list (sent)
307-
router.push({ name: "DropboxListSent", params: route.params, query: route.query })
309+
router.push(returnRoute.value)
308310
} catch (e) {
309311
console.error(e)
310312
alert(t("Upload failed"))

0 commit comments

Comments
 (0)