Skip to content

Commit 8bdc0ab

Browse files
authored
Merge pull request #2421 from themeum/v4/assignment-fixes
Design fixes and component fixes for v4 assignment
2 parents 0d73474 + eeebe79 commit 8bdc0ab

4 files changed

Lines changed: 42 additions & 8 deletions

File tree

assets/src/js/v3/shared/utils/endpoints.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ const endpoints = {
105105
// ASSIGNMENT
106106
GET_ASSIGNMENT_DETAILS: 'tutor_assignment_details',
107107
SAVE_ASSIGNMENT: 'tutor_assignment_save',
108+
ASSIGNMENT_SUBMIT: 'tutor_assignment_submit',
108109

109110
// TAX SETTINGS
110111
GET_TAX_SETTINGS: 'tutor_get_tax_settings',

assets/src/scss/frontend/learning-area/components/_assignment.scss

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
@include tutor-grid(2, 1fr);
6060
gap: $tutor-spacing-4;
6161

62-
@include tutor-breakpoint-down(sm) {
62+
@include tutor-breakpoint-down(md) {
6363
@include tutor-grid(1, 1fr);
6464
}
6565
}
@@ -72,7 +72,6 @@
7272
&-actions {
7373
@include tutor-flex(row, stretch, flex-end);
7474
gap: $tutor-spacing-4;
75-
margin-top: $tutor-spacing-2;
7675

7776
@include tutor-breakpoint-down(sm) {
7877
justify-content: space-between;
@@ -141,8 +140,6 @@
141140
}
142141

143142
&-table {
144-
@include tutor-card-base();
145-
@include tutor-card-padding(medium);
146143
@include tutor-card-radius(2xl);
147144
@include tutor-flex(column, stretch, flex-start);
148145
gap: $tutor-spacing-6;
@@ -153,7 +150,7 @@
153150
thead {
154151
th {
155152
@include tutor-typography('tiny', 'regular');
156-
width: 14.3%;
153+
width: 20%;
157154

158155
&:first-of-type {
159156
width: 42.5%;
@@ -162,7 +159,22 @@
162159
}
163160

164161
tbody {
162+
tr {
163+
&:hover {
164+
td {
165+
.attempt-list-badge{
166+
.tutor-badge{
167+
display: none;
168+
}
169+
}
170+
.attempt_details_button {
171+
display: block;
172+
}
173+
}
174+
}
175+
}
165176
td {
177+
position: relative;
166178
@include tutor-typography('small', 'regular', 'secondary');
167179
width: 14.3%;
168180

@@ -171,12 +183,19 @@
171183
font-weight: $tutor-font-weight-medium;
172184
width: 42.8%;
173185
}
186+
187+
a.attempt_details_button {
188+
position: absolute;
189+
right: 0;
190+
top: 50%;
191+
transform: translate(-50%, -50%);
192+
display: none;
193+
}
174194
}
175195
}
176196
}
177197

178198
@include tutor-breakpoint-down(sm) {
179-
padding: $tutor-spacing-5;
180199
gap: $tutor-spacing-4;
181200
}
182201
}
@@ -242,3 +261,17 @@
242261
}
243262
}
244263
}
264+
265+
.tutor-assignment-pending-warning {
266+
display: flex;
267+
padding-top: 7px;
268+
padding-bottom: 7px;
269+
padding-left: $tutor-spacing-4;
270+
padding-right: $tutor-spacing-5;
271+
border-radius: $tutor-radius-md;
272+
gap: $tutor-spacing-3;
273+
274+
@include tutor-breakpoint-up(sm) {
275+
max-width: max-content;
276+
}
277+
}

components/AttachmentCard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public function get(): string {
199199

200200
<?php if ( $file_size || $meta_attr ) : ?>
201201
<span class="tutor-attachment-card-meta" <?php echo $meta_attr; // phpcs:ignore --already-escaped WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
202-
<?php echo esc_html( $file_size ); ?>
202+
<?php echo esc_html( size_format( $file_size, 2 ) ); ?>
203203
</span>
204204
<?php endif; ?>
205205
</div>

components/FileUploader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ class="tutor-file-uploader-wrapper"
604604
<?php
605605
AttachmentCard::make()
606606
->title_attr( 'x-text', 'file.name' )
607-
->meta_attr( 'x-text', 'file.size' )
607+
->meta_attr( 'x-text', 'formatBytes(file.size)' )
608608
->action_attr( '@click.stop', 'removeFile(index)' )
609609
->render();
610610
?>

0 commit comments

Comments
 (0)