Remove legacy forum search and search buttons
This commit is contained in:
@ -1010,27 +1010,6 @@ var CodeOceanEditor = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
initializeSearchButton: function () {
|
|
||||||
$('#btn-search-col').button().click(function () {
|
|
||||||
var search = $('#search-input-text').val();
|
|
||||||
var course_token = $('#editor').data('course_token')
|
|
||||||
var save_search_url = $('#editor').data('search-save-url')
|
|
||||||
window.open("https://open.hpi.de/courses/" + course_token + "/pinboard?query=" + search, '_blank');
|
|
||||||
// save search
|
|
||||||
$.ajax({
|
|
||||||
data: {
|
|
||||||
search_text: search
|
|
||||||
},
|
|
||||||
dataType: 'json',
|
|
||||||
type: 'POST',
|
|
||||||
url: save_search_url
|
|
||||||
});
|
|
||||||
})
|
|
||||||
|
|
||||||
$('#sidebar-search-collapsed').on('click', this.handleSideBarToggle.bind(this));
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
initializeEverything: function () {
|
initializeEverything: function () {
|
||||||
CodeOceanEditor.editors = [];
|
CodeOceanEditor.editors = [];
|
||||||
this.initializeRegexes();
|
this.initializeRegexes();
|
||||||
@ -1044,7 +1023,6 @@ var CodeOceanEditor = {
|
|||||||
this.initializeDescriptionToggle();
|
this.initializeDescriptionToggle();
|
||||||
this.initializeSideBarTooltips();
|
this.initializeSideBarTooltips();
|
||||||
this.initializeInterventionTimer();
|
this.initializeInterventionTimer();
|
||||||
this.initializeSearchButton();
|
|
||||||
this.initPrompt();
|
this.initPrompt();
|
||||||
this.renderScore();
|
this.renderScore();
|
||||||
this.showFirstFile();
|
this.showFirstFile();
|
||||||
|
@ -16,7 +16,6 @@ class ExercisesController < ApplicationController
|
|||||||
before_action :collect_set_and_unset_exercise_tags, only: MEMBER_ACTIONS
|
before_action :collect_set_and_unset_exercise_tags, only: MEMBER_ACTIONS
|
||||||
before_action :set_external_user_and_authorize, only: [:external_user_statistics]
|
before_action :set_external_user_and_authorize, only: [:external_user_statistics]
|
||||||
before_action :set_file_types, only: %i[create edit new update]
|
before_action :set_file_types, only: %i[create edit new update]
|
||||||
before_action :set_course_token, only: [:implement]
|
|
||||||
before_action :set_available_tips, only: %i[implement show new edit]
|
before_action :set_available_tips, only: %i[implement show new edit]
|
||||||
|
|
||||||
skip_before_action :verify_authenticity_token, only: %i[import_task import_uuid_check]
|
skip_before_action :verify_authenticity_token, only: %i[import_task import_uuid_check]
|
||||||
@ -344,26 +343,6 @@ class ExercisesController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_course_token
|
|
||||||
lti_parameters = LtiParameter.where(external_users_id: current_user.id,
|
|
||||||
exercises_id: @exercise.id).last
|
|
||||||
if lti_parameters
|
|
||||||
lti_json = lti_parameters.lti_parameters['launch_presentation_return_url']
|
|
||||||
|
|
||||||
@course_token =
|
|
||||||
if lti_json.present? && (match = lti_json.match(%r{^.*courses/([a-z0-9-]+)/sections}))
|
|
||||||
match.captures.first
|
|
||||||
else
|
|
||||||
''
|
|
||||||
end
|
|
||||||
else
|
|
||||||
# no consumer, therefore implementation with internal user
|
|
||||||
@course_token = '702cbd2a-c84c-4b37-923a-692d7d1532d0'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
private :set_course_token
|
|
||||||
|
|
||||||
def set_available_tips
|
def set_available_tips
|
||||||
# Order of elements is important and will be kept
|
# Order of elements is important and will be kept
|
||||||
available_tips = ExerciseTip.where(exercise: @exercise).order(rank: :asc).includes(:tip)
|
available_tips = ExerciseTip.where(exercise: @exercise).order(rank: :asc).includes(:tip)
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
- show_tips_interventions = @show_tips_interventions || "false"
|
- show_tips_interventions = @show_tips_interventions || "false"
|
||||||
- hide_rfc_button = @hide_rfc_button || false
|
- hide_rfc_button = @hide_rfc_button || false
|
||||||
|
|
||||||
#editor.row data-exercise-id=@exercise.id data-message-depleted=t('exercises.editor.depleted') data-message-timeout=t('exercises.editor.timeout', permitted_execution_time: @exercise.execution_environment.permitted_execution_time) data-message-out-of-memory=t('exercises.editor.out_of_memory', memory_limit: @exercise.execution_environment.memory_limit) data-submissions-url=submissions_path data-user-id=current_user.id data-user-external-id=external_user_external_id data-working-times-url=working_times_exercise_path(@exercise) data-intervention-save-url=intervention_exercise_path(@exercise) data-rfc-interventions=show_rfc_interventions data-break-interventions=show_break_interventions data-tips-interventions=show_tips_interventions data-course_token=@course_token data-search-save-url=search_exercise_path(@exercise)
|
#editor.row data-exercise-id=@exercise.id data-message-depleted=t('exercises.editor.depleted') data-message-timeout=t('exercises.editor.timeout', permitted_execution_time: @exercise.execution_environment.permitted_execution_time) data-message-out-of-memory=t('exercises.editor.out_of_memory', memory_limit: @exercise.execution_environment.memory_limit) data-submissions-url=submissions_path data-user-id=current_user.id data-user-external-id=external_user_external_id data-working-times-url=working_times_exercise_path(@exercise) data-intervention-save-url=intervention_exercise_path(@exercise) data-rfc-interventions=show_rfc_interventions data-break-interventions=show_break_interventions data-tips-interventions=show_tips_interventions data-search-save-url=search_exercise_path(@exercise)
|
||||||
- unless @embed_options[:hide_sidebar]
|
- unless @embed_options[:hide_sidebar]
|
||||||
- additional_classes = 'sidebar-col'
|
- additional_classes = 'sidebar-col'
|
||||||
- if @tips.blank?
|
- if @tips.blank?
|
||||||
|
@ -4,9 +4,6 @@ div.d-grid.gap-2 id='sidebar-collapsed' class=(@exercise.hide_file_tree && @tips
|
|||||||
- unless @embed_options[:disable_hints] or @tips.blank?
|
- unless @embed_options[:disable_hints] or @tips.blank?
|
||||||
= render('editor_button', classes: 'btn-secondary btn mb-4', data: {:'data-bs-toggle' => 'tooltip', :'data-bs-placement' => 'right'}, icon: 'fa-solid fa-lightbulb', id: 'tips-collapsed', label:'', title: t('exercises.form.tips'))
|
= render('editor_button', classes: 'btn-secondary btn mb-4', data: {:'data-bs-toggle' => 'tooltip', :'data-bs-placement' => 'right'}, icon: 'fa-solid fa-lightbulb', id: 'tips-collapsed', label:'', title: t('exercises.form.tips'))
|
||||||
|
|
||||||
//- if !@course_token.blank?
|
|
||||||
= render('editor_button', classes: 'btn-primary btn enforce-top-margin', data: {:'data-bs-toggle' => 'tooltip', :'data-bs-placement' => 'right'}, icon: 'fa-solid fa-magnifying-glass', id: 'sidebar-search-collapsed', label: '', title: t('search.search_in_forum'))
|
|
||||||
|
|
||||||
div.d-grid.enforce-bottom-margin id='sidebar-uncollapsed' class=(@exercise.hide_file_tree && @tips.blank? ? 'd-none' : '')
|
div.d-grid.enforce-bottom-margin id='sidebar-uncollapsed' class=(@exercise.hide_file_tree && @tips.blank? ? 'd-none' : '')
|
||||||
= render('editor_button', classes: 'btn-outline-dark overflow-hidden mb-2', icon: 'fa-solid fa-square-minus', id: 'sidebar-collapse', label: t('exercises.editor.collapse_action_sidebar'))
|
= render('editor_button', classes: 'btn-outline-dark overflow-hidden mb-2', icon: 'fa-solid fa-square-minus', id: 'sidebar-collapse', label: t('exercises.editor.collapse_action_sidebar'))
|
||||||
#content-left-sidebar.overflow-scroll
|
#content-left-sidebar.overflow-scroll
|
||||||
@ -32,13 +29,5 @@ div.d-grid.enforce-bottom-margin id='sidebar-uncollapsed' class=(@exercise.hide_
|
|||||||
- unless @embed_options[:disable_hints] or @tips.blank?
|
- unless @embed_options[:disable_hints] or @tips.blank?
|
||||||
= render(partial: 'tips_content')
|
= render(partial: 'tips_content')
|
||||||
|
|
||||||
//- if !@course_token.blank?
|
|
||||||
.input-group.enforce-top-margin
|
|
||||||
.enforce-right-margin
|
|
||||||
= text_field_tag 'search-input-text', nil, placeholder: t('search.search_in_forum'), class: 'form-control'
|
|
||||||
.input-group-btn
|
|
||||||
= button_tag(class: 'btn btn-primary', id: 'btn-search-col') do
|
|
||||||
i.fa-solid.fa-magnifying-glass
|
|
||||||
|
|
||||||
- if @exercise.allow_file_creation?
|
- if @exercise.allow_file_creation?
|
||||||
= render('shared/modal', id: 'modal-file', template: 'code_ocean/files/_form', title: t('exercises.editor.create_file'))
|
= render('shared/modal', id: 'modal-file', template: 'code_ocean/files/_form', title: t('exercises.editor.create_file'))
|
||||||
|
Reference in New Issue
Block a user