Skip to content

Commit

Permalink
fix: using google docs viewer to render pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
pateljannat committed Oct 8, 2024
1 parent 438e9e1 commit 2e4cf02
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/Assessments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const getRowRoute = (row) => {
}
} else {
return {
name: 'Quiz',
name: 'QuizPage',
params: {
quizID: row.assessment_name,
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/LessonContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<iframe
:src="getPDFSource(block)"
width="100%"
height="400"
height="700px"
frameborder="0"
allowfullscreen
></iframe>
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/utils/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ export class Upload {
app.mount(this.wrapper)
return
} else if (file.file_type == 'PDF') {
this.wrapper.innerHTML = `<iframe src="${encodeURI(
this.wrapper.innerHTML = `<iframe src="https://docs.google.com/viewer?url=${
window.location.origin
}${encodeURI(
file.file_url
)}#toolbar=0" width='100%' height='700px' class="mb-4"></iframe>`
)}&embedded=true" width='100%' height='700px' class="mb-4" type="application/pdf"></iframe>`
return
} else {
this.wrapper.innerHTML = `<img class="mb-4" src=${encodeURI(
Expand Down
3 changes: 2 additions & 1 deletion lms/lms/doctype/course_lesson/course_lesson.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"fieldname": "title",
"fieldtype": "Data",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Title",
"reqd": 1
},
Expand Down Expand Up @@ -161,7 +162,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2024-04-03 10:48:17.525859",
"modified": "2024-10-08 11:04:54.748773",
"modified_by": "Administrator",
"module": "LMS",
"name": "Course Lesson",
Expand Down

0 comments on commit 2e4cf02

Please sign in to comment.