Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
MOOC packages by hacklab
django-courses-legacy
Commits
e2352ccf
Commit
e2352ccf
authored
3 years ago
by
Matheus Miranda
Browse files
Options
Download
Plain Diff
Merge branch 'develop' into 'master'
Fix units with videos and activities See merge request
!145
parents
066cbc81
04ae36b5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
7 deletions
+11
-7
courses_legacy/core/serializers.py
courses_legacy/core/serializers.py
+2
-2
courses_legacy/static/templates/activity_image.html
courses_legacy/static/templates/activity_image.html
+9
-3
courses_legacy/static/templates/activity_reading.html
courses_legacy/static/templates/activity_reading.html
+0
-2
No files found.
courses_legacy/core/serializers.py
View file @
e2352ccf
...
...
@@ -295,8 +295,8 @@ class LessonSerializer(serializers.ModelSerializer):
unit
=
Unit
(
lesson
=
lesson
,
video
=
video
,
**
unit_data
)
unit
.
save
()
activities
=
[]
if
activities_data
:
activities
=
[]
for
activity_data
in
activities_data
:
activity_id
=
activity_data
.
pop
(
'id'
,
None
)
activity
,
_
=
Activity
.
objects
.
get_or_create
(
id
=
activity_id
)
...
...
@@ -313,7 +313,7 @@ class LessonSerializer(serializers.ModelSerializer):
activity
=
Activity
.
objects
.
get
(
id
=
activity
.
id
)
activity
.
save
()
activities
.
append
(
activity
)
unit
.
activities
.
set
(
activities
)
unit
.
activities
.
set
(
activities
)
units
.
append
(
unit
)
return
units
...
...
This diff is collapsed.
Click to expand it.
courses_legacy/static/templates/activity_image.html
View file @
e2352ccf
<div
class=
"slides question"
>
<span
ng-init=
"$parent.answer.given='image'"
></span>
<img
class=
"img-responsive"
ng-src=
"{{ currentActivity.image_url }}"
>
<slide-panel></slide-panel>
<div
class=
"topbar"
>
<button
class=
"btn btn-sm btn-primary next-activity pull-right"
ng-click=
"next_activity_from_image()"
translate
>
Mark as done
</button>
</div>
<div>
<span
ng-init=
"$parent.answer.given='image'"
></span>
<img
class=
"img-responsive"
ng-src=
"{{ currentActivity.image_url }}"
>
<slide-panel></slide-panel>
</div>
</div>
This diff is collapsed.
Click to expand it.
courses_legacy/static/templates/activity_reading.html
View file @
e2352ccf
<div
class=
"open-activity"
>
<div
class=
"topbar"
>
<button
class=
"btn btn-sm btn-primary next-activity pull-right"
ng-click=
"next_activity_from_image()"
translate
>
Mark as done
</button>
</div>
...
...
@@ -8,7 +7,6 @@
<span
ng-bind-html=
"getReadingActivityHtml()"
></span>
<slide-panel></slide-panel>
</div>
</div>
<!--<div class="submit">-->
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment