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

Add gradebook ref to courses; Add Useful to teaching tab; Color panel headings of graduated student profiles; Add html parse to honor code #801

Merged
merged 31 commits into from
Feb 1, 2024

Conversation

Dmi4er4
Copy link
Collaborator

@Dmi4er4 Dmi4er4 commented Feb 1, 2024

Checklist:

  • I have performed a self-review of my own code:
    • Good naming: make sure you would understand your code if you read it a few months from now.
    • No common performance issues (e.g. N + 1 problem)
    • Unrelated code has been removed (unused imports, print statements, unrelated template context variables, commented code, etc)
    • I have commented my code, particularly in hard-to-understand areas
  • I understand that short PRs lead to higher-quality code and faster delivery of features.
  • Linear history: my code has been rebased on the most recent commit in the master branch before opening PR
  • I have followed conventional commits specification for PR title
  • I have referenced YouTrack issue in the PR description for easy access
  • I have added tests that prove my code works

@Dmi4er4 Dmi4er4 requested a review from atolstikov February 1, 2024 15:05
все семестры</a>
{% if user.is_curator or user in course.teachers.all()%}
<br>
<a href="{{request.build_absolute_uri(url('staff:gradebook', **course.url_kwargs))}}">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А почему тут важно именно absolute_uri?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Потому что ссылка ведет из курса на ведомость. То есть совсем в другую ветку. Можно конечно обойтись без этого, но указать абсолютный адрес для ссылки мне кажется самым простым и одновременно лаконичным решением.


class TeachingUsefulListView(PermissionRequiredMixin, generic.ListView):
context_object_name = "faq"
template_name = "learning/study/useful.html"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не вижу этого template в PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Да, я переиспользовал template, который используется для "Полезного" для студентов. Запрос был на то же самое, только с другим контентом. Поэтому изменения в одном шаблоне должно логично касаться и второго.

@@ -53,6 +53,7 @@
path('', RedirectView.as_view(pattern_name='teaching:assignments_check_queue', permanent=False), name='base'),
path('timetable/', TeacherTimetable.as_view(), name='timetable'),
path('calendar/', CalendarPersonalView.as_view(), name='calendar'),
path('useful/', TeachingUsefulListView.as_view(), name='teaching_useful'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Все другие пути содержат имя вью более точно. Переименуем?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

По моему путь выдержан в одном тоне с остальными. Также как TeacherTimetable превратился в timetable/ и CalendarPersonalView в calendar/, новый путь оставил только одно слово, отображающее суть. Также и "Полезное" для студентов при вьюшке UsefulListView использует путь useful/.

@@ -19,7 +19,13 @@ <h2 class="course-main-title">
<a href="{{ url('admin:courses_course_change', object_id=course.pk) }}" target="_blank"><i
class="fa fa-pencil-square-o"></i></a>{% endif %}<br>
<small>{{ course.main_branch.name }} / {{ course.semester }}, <a href="{{ course.meta_course.get_absolute_url() }}">посмотреть
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мне не нравится, что тег <small> не просто вокруг одного блока, а сразу вокруг двух.
Я думаю, что в этом случае лучше каждый тег <a> обрамить отдельным <small>.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

@atolstikov atolstikov merged commit a5804b7 into cscenter:master Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants