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

fixed mobile viewing for assignment pages for student and instructors #187

Merged
merged 1 commit into from
Nov 12, 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
27 changes: 22 additions & 5 deletions devU-api/src/migration/1730867565396-publicCourses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,30 @@ export class Migration1730867565396 implements MigrationInterface {
name = 'Migration1730867565396'

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "courses" ADD "is_public" boolean NOT NULL DEFAULT false`);
await queryRunner.query(`ALTER TABLE "courses" ADD "private_data" TIMESTAMP NOT NULL DEFAULT now()`);
//have to use raw SQL to fix queryfailederror for columns that already exist
const isPublicExists = await queryRunner.query(`
SELECT column_name
FROM information_schema.columns
WHERE table_name = 'courses' AND column_name = 'is_public';
`);

if (isPublicExists.length === 0) {
await queryRunner.query(`ALTER TABLE "courses" ADD "is_public" boolean NOT NULL DEFAULT false`);
}

const privateDataExists = await queryRunner.query(`
SELECT column_name
FROM information_schema.columns
WHERE table_name = 'courses' AND column_name = 'private_data';
`);

if (privateDataExists.length === 0) {
await queryRunner.query(`ALTER TABLE "courses" ADD "private_data" TIMESTAMP NOT NULL DEFAULT now()`);
}
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "courses" DROP COLUMN "private_data"`);
await queryRunner.query(`ALTER TABLE "courses" DROP COLUMN "is_public"`);
await queryRunner.query(`ALTER TABLE "courses" DROP COLUMN IF EXISTS "private_data"`);
await queryRunner.query(`ALTER TABLE "courses" DROP COLUMN IF EXISTS "is_public"`);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,61 @@
padding: 10px;
}

@media (max-width: 768px) {
.wrap {
flex-direction: column;
align-items: center;
padding: 15px;
}

.assignment_card {
width: 90%;
max-width: 500px;
margin: 0 auto;
padding: 20px;
}

.options_buttons {
flex-direction: column;
justify-content: center;
width: 100%;
gap: 10px;
}

.buttons {
width: auto;
padding: 10px 20px;
font-size: 15px;
margin: 0;
}
.card {
background-color: $list-item-background;
border-radius: 8px;
padding: 20px;
width: 200px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
margin: 20px;
}
}

@media (max-width: 370px) {
.header {
flex-direction: column;
align-items: center;
width:400px;

align-items: center;
padding: 10px;
}

.card, .assignment_card {
width: 100%;
max-width: 100%;
padding: 15px;
}

.buttons {
width: 100%;
max-width: none;
padding: 10px;
font-size: 14px;
}

.submissionsContainer {
padding: 10px;
}
}