From 86d68f96f719861a16c3ade334ae3599c0c69de5 Mon Sep 17 00:00:00 2001 From: isubas Date: Sun, 27 Jan 2019 15:14:46 +0300 Subject: [PATCH 001/124] Add new link helper --- app/helpers/link_helper.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/helpers/link_helper.rb b/app/helpers/link_helper.rb index 6d63f8ce9..74eae3751 100644 --- a/app/helpers/link_helper.rb +++ b/app/helpers/link_helper.rb @@ -62,6 +62,21 @@ module LinkHelper end end + # Usage: + # link_to_actions(@cities, + # scope: :admin, + # except: :show, + # edit: { text: 'Edit Text' }) + def link_to_actions(path, options = {}) + actions = (%i[show edit destroy] - [*options[:except]].map(&:to_sym)).inquiry + path = [*options[:scope], *path] + links = [] + links << link_to_show(options.dig(:show, :text), [*path]) if actions.show? + links << link_to_edit(options.dig(:edit, :text), [:edit, *path]) if actions.edit? + links << link_to_destroy(options.dig(:destroy, :text), [*path]) if actions.destroy? + safe_join(links, ' ') + end + private def link_builder(args, configuration) From a974e7ad4c9f87c94e5db8d5a3a97c668a657af6 Mon Sep 17 00:00:00 2001 From: isubas Date: Sun, 27 Jan 2019 15:15:56 +0300 Subject: [PATCH 002/124] Apply new helper to views --- app/views/account/addresses/index.html.erb | 3 +- app/views/account/identities/index.html.erb | 3 +- app/views/admin/cities/show.html.erb | 8 +--- app/views/admin/countries/show.html.erb | 9 +--- .../calendars/index.html.erb | 18 ++++---- .../calendars/show.html.erb | 3 +- .../committee/agenda_types/index.html.erb | 3 +- .../available_courses/_groups.html.erb | 3 +- .../available_courses/index.html.erb | 6 +-- .../available_courses/show.html.erb | 3 +- .../course_group_types/index.html.erb | 5 +-- .../course_groups/index.html.erb | 6 +-- .../course_types/index.html.erb | 5 +-- .../course_management/courses/index.html.erb | 6 +-- .../curriculums/_curriculum_courses.html.erb | 5 +-- .../curriculums/_semesters.html.erb | 7 +-- .../curriculums/index.html.erb | 4 +- .../registration_documents/index.html.erb | 5 +-- app/views/layouts/builders/_index.html.erb | 6 +-- .../references/academic_terms/index.html.erb | 5 +-- app/views/references/terms/index.html.erb | 44 ------------------- app/views/units/index.html.erb | 5 +-- app/views/units/show.html.erb | 3 +- app/views/users/_account.html.erb | 3 +- app/views/users/_addresses.html.erb | 3 +- app/views/users/_employees.html.erb | 15 ++----- app/views/users/_identities.html.erb | 3 +- app/views/users/index.html.erb | 6 +-- 28 files changed, 40 insertions(+), 155 deletions(-) delete mode 100644 app/views/references/terms/index.html.erb diff --git a/app/views/account/addresses/index.html.erb b/app/views/account/addresses/index.html.erb index c36a21af6..bc4fd597a 100644 --- a/app/views/account/addresses/index.html.erb +++ b/app/views/account/addresses/index.html.erb @@ -14,8 +14,7 @@ <% else %> <%= t('.informal_address') %>
- <%= link_to_edit(edit_user_address_path(@user, address)) %> - <%= link_to_destroy(user_address_path(@user, address)) %> + <%= link_to_actions([@user, address], except: :show) %>
<% end %> diff --git a/app/views/account/identities/index.html.erb b/app/views/account/identities/index.html.erb index 5b3edefbc..e302812fd 100644 --- a/app/views/account/identities/index.html.erb +++ b/app/views/account/identities/index.html.erb @@ -15,8 +15,7 @@ <% else %> <%= t('.informal_identity') %>
- <%= link_to_edit(edit_user_identity_path(@user, identity)) %> - <%= link_to_destroy(user_identity_path(@user, identity)) %> + <%= link_to_actions([@user, identity], except: :show) %>
<% end %> diff --git a/app/views/admin/cities/show.html.erb b/app/views/admin/cities/show.html.erb index 13f83c1d7..75c3c443d 100644 --- a/app/views/admin/cities/show.html.erb +++ b/app/views/admin/cities/show.html.erb @@ -4,8 +4,7 @@
<%= fa_icon 'street-view' %><%= @city.name %>
- <%= link_to_edit([:admin, @country, @city]) %> - <%= link_to_destroy([:admin, @country, @city]) %> + <%= link_to_actions([@country, @city], scope: :admin, except: :show) %>
@@ -51,10 +50,7 @@ <%= district.name %> <%= district.mernis_code %> <%= district.active ? t('yes') : t('no') %> - - <%= link_to_edit([:edit, :admin, @country, @city, district]) %> - <%= link_to_destroy([:admin, @country, @city, district]) %> - + <%= link_to_actions([@country, @city, district], scope: :admin, except: :show) %> <% end %> diff --git a/app/views/admin/countries/show.html.erb b/app/views/admin/countries/show.html.erb index 3c3d7b5ab..edee59cfd 100644 --- a/app/views/admin/countries/show.html.erb +++ b/app/views/admin/countries/show.html.erb @@ -4,8 +4,7 @@
<%= fa_icon 'globe' %><%= @country.name %>
- <%= link_to_edit([:edit, :admin, @country]) %> - <%= link_to_destroy([:admin, @country]) %> + <%= link_to_actions(@country, scope: :admin, except: :show) %>
@@ -66,11 +65,7 @@ <%= city.name %> <%= city.alpha_2_code %> - - <%= link_to_show([:admin, @country, city]) %> - <%= link_to_edit([:edit, :admin, @country, city]) %> - <%= link_to_destroy([:admin, @country, city]) %> - + <%= link_to_actions([@country, city], scope: :admin) %> <% end %> diff --git a/app/views/calendar_management/calendars/index.html.erb b/app/views/calendar_management/calendars/index.html.erb index 14252cfd7..c9206babc 100644 --- a/app/views/calendar_management/calendars/index.html.erb +++ b/app/views/calendar_management/calendars/index.html.erb @@ -31,14 +31,16 @@ <%= calendar.timezone %> <%= full_name(calendar.academic_term) %> - <%= link_to fa_icon('file-pdf-o'), [:calendar_management, calendar, format: :pdf], - class: 'btn btn-outline-primary btn-sm' %> - <%= link_to_edit([:edit, :calendar_management, calendar]) %> - <%= link_to_destroy([:calendar_management, calendar]) %> - <%= link_to fa_icon('university', text: t('.assign_to_units')), [:calendar_management, calendar, :units], - class: 'btn btn-outline-primary btn-sm' %> - <%= link_to fa_icon('copy', text: t('.duplicate')), [:calendar_management, calendar, :duplicate], - class: 'btn btn-outline-primary btn-sm' %> + <%= link_to fa_icon('file-pdf-o'), + [:calendar_management, calendar, format: :pdf], + class: 'btn btn-outline-primary btn-sm' %> + <%= link_to_actions(calendar, scope: :calendar_management, except: :show) %> + <%= link_to fa_icon('university', text: t('.assign_to_units')), + [:calendar_management, calendar, :units], + class: 'btn btn-outline-primary btn-sm' %> + <%= link_to fa_icon('copy', text: t('.duplicate')), + [:calendar_management, calendar, :duplicate], + class: 'btn btn-outline-primary btn-sm' %> <% end %> diff --git a/app/views/calendar_management/calendars/show.html.erb b/app/views/calendar_management/calendars/show.html.erb index c899a2098..4226022e5 100644 --- a/app/views/calendar_management/calendars/show.html.erb +++ b/app/views/calendar_management/calendars/show.html.erb @@ -9,8 +9,7 @@ class: 'btn btn-outline-primary btn-sm' %> <%= link_to fa_icon('university', text: t('.assign_to_units')), [:calendar_management, @calendar, :units], class: 'btn btn-outline-primary btn-sm' %> - <%= link_to_edit([:edit, :calendar_management, @calendar]) %> - <%= link_to_destroy([:calendar_management, @calendar]) %> + <%= link_to_actions(@calendar, scope: :calendar_management, except: :show) %> diff --git a/app/views/committee/agenda_types/index.html.erb b/app/views/committee/agenda_types/index.html.erb index 45b0f16c5..bb685a2ab 100644 --- a/app/views/committee/agenda_types/index.html.erb +++ b/app/views/committee/agenda_types/index.html.erb @@ -24,8 +24,7 @@ <%= agenda_type.name %> - <%= link_to_edit(edit_agenda_type_path(agenda_type)) %> - <%= link_to_destroy(agenda_type) %> + <%= link_to_actions(agenda_type, except: :show) %> <% end %> diff --git a/app/views/course_management/available_courses/_groups.html.erb b/app/views/course_management/available_courses/_groups.html.erb index fce2a95e4..a428be64b 100644 --- a/app/views/course_management/available_courses/_groups.html.erb +++ b/app/views/course_management/available_courses/_groups.html.erb @@ -11,8 +11,7 @@
<%= fa_icon 'cube' %><%= group.name %> - <%= link_to_edit(edit_available_course_available_course_group_path(@available_course, group)) %> - <%= link_to_destroy(available_course_available_course_group_path(@available_course, group)) %> + <%= link_to_actions([@available_course, group], except: :show) %>
diff --git a/app/views/course_management/available_courses/index.html.erb b/app/views/course_management/available_courses/index.html.erb index 21394d227..45809b320 100644 --- a/app/views/course_management/available_courses/index.html.erb +++ b/app/views/course_management/available_courses/index.html.erb @@ -33,11 +33,7 @@ - + <% end %> diff --git a/app/views/course_management/available_courses/show.html.erb b/app/views/course_management/available_courses/show.html.erb index 1e4b33932..c632a0bc8 100644 --- a/app/views/course_management/available_courses/show.html.erb +++ b/app/views/course_management/available_courses/show.html.erb @@ -2,8 +2,7 @@
<%= link_to_back available_courses_path %> - <%= link_to_edit edit_available_course_path(@available_course) %> - <%= link_to_destroy available_course_path(@available_course) %> + <%= link_to_actions(@available_course, except: :show) %>
diff --git a/app/views/course_management/course_group_types/index.html.erb b/app/views/course_management/course_group_types/index.html.erb index a659f4157..8abc975ef 100644 --- a/app/views/course_management/course_group_types/index.html.erb +++ b/app/views/course_management/course_group_types/index.html.erb @@ -23,10 +23,7 @@ <% @course_group_types.each do |course_group_type| %>
- + <% end %> diff --git a/app/views/course_management/course_groups/index.html.erb b/app/views/course_management/course_groups/index.html.erb index 6e24a0f48..70e0be59f 100644 --- a/app/views/course_management/course_groups/index.html.erb +++ b/app/views/course_management/course_groups/index.html.erb @@ -28,11 +28,7 @@ - + <% end %> diff --git a/app/views/course_management/course_types/index.html.erb b/app/views/course_management/course_types/index.html.erb index 0a8c23ca6..90583d2ae 100644 --- a/app/views/course_management/course_types/index.html.erb +++ b/app/views/course_management/course_types/index.html.erb @@ -27,10 +27,7 @@ - + <% end %> diff --git a/app/views/course_management/courses/index.html.erb b/app/views/course_management/courses/index.html.erb index c218cfd03..c2f09fc29 100644 --- a/app/views/course_management/courses/index.html.erb +++ b/app/views/course_management/courses/index.html.erb @@ -46,11 +46,7 @@ - + <% end %> diff --git a/app/views/course_management/curriculums/_curriculum_courses.html.erb b/app/views/course_management/curriculums/_curriculum_courses.html.erb index dc05630dc..0f28ff8bb 100644 --- a/app/views/course_management/curriculums/_curriculum_courses.html.erb +++ b/app/views/course_management/curriculums/_curriculum_courses.html.erb @@ -32,10 +32,7 @@ <% if action_visible %> - + <% end %> <% end %> diff --git a/app/views/course_management/curriculums/_semesters.html.erb b/app/views/course_management/curriculums/_semesters.html.erb index 3abcd5a28..4ad93ab38 100644 --- a/app/views/course_management/curriculums/_semesters.html.erb +++ b/app/views/course_management/curriculums/_semesters.html.erb @@ -27,12 +27,7 @@ <% semester.curriculum_course_groups.each do |curriculum_course_group| %> <%= render 'curriculum_courses', klass: 'border-warning', - actions: safe_join([ - link_to_edit(edit_curriculum_semester_curriculum_course_group_path(semester, curriculum_course_group)), - link_to_destroy([semester, curriculum_course_group]) - ], - ' ' - ), + actions: link_to_actions([semester, curriculum_course_group], except: :show), title: "#{t('.elective_courses')} - #{curriculum_course_group.name}", semester: semester, courses: curriculum_course_group.curriculum_courses.order('courses.name'), diff --git a/app/views/course_management/curriculums/index.html.erb b/app/views/course_management/curriculums/index.html.erb index f27cff908..22b246963 100644 --- a/app/views/course_management/curriculums/index.html.erb +++ b/app/views/course_management/curriculums/index.html.erb @@ -27,9 +27,7 @@ <% end %> diff --git a/app/views/first_registration/registration_documents/index.html.erb b/app/views/first_registration/registration_documents/index.html.erb index 3c35bf497..e9463499a 100644 --- a/app/views/first_registration/registration_documents/index.html.erb +++ b/app/views/first_registration/registration_documents/index.html.erb @@ -28,10 +28,7 @@ - + <% end %> diff --git a/app/views/layouts/builders/_index.html.erb b/app/views/layouts/builders/_index.html.erb index cac403c37..2414abe58 100644 --- a/app/views/layouts/builders/_index.html.erb +++ b/app/views/layouts/builders/_index.html.erb @@ -36,11 +36,7 @@ <%= (boolean || enum) ? enum_t(item, parameter.to_sym) : value %> <% end %> <% end %> - + <% end %> diff --git a/app/views/references/academic_terms/index.html.erb b/app/views/references/academic_terms/index.html.erb index a627dffb1..40732d2a7 100644 --- a/app/views/references/academic_terms/index.html.erb +++ b/app/views/references/academic_terms/index.html.erb @@ -28,10 +28,7 @@ - + <% end %> diff --git a/app/views/references/terms/index.html.erb b/app/views/references/terms/index.html.erb deleted file mode 100644 index 98a3a4b03..000000000 --- a/app/views/references/terms/index.html.erb +++ /dev/null @@ -1,44 +0,0 @@ -
- <%= link_to_new t('.new_term_link'), new_term_path %> -
- -
-
-
-
- <%= fa_icon 'street-view', text: t('.card_header') %> -
-
- <%= render 'layouts/shared/smart_search_form', - path: terms_path, - placeholder: t('.name') %> -
<%= available_course.course.name %> <%= available_course.groups_count %> <%= available_course.groups.sum(:quota) %> - <%= link_to_show available_course %> - <%= link_to_edit [:edit, available_course] %> - <%= link_to_destroy available_course %> - <%= link_to_actions(available_course) %>
<%= course_group_type.name %> - <%= link_to_edit(edit_course_group_type_path(course_group_type)) %> - <%= link_to_destroy(course_group_type) %> - <%= link_to_actions(course_group_type, except: :show) %>
<%= course_group.total_ects_condition %> <%= course_group.unit.try(:name) %> <%= course_group.course_group_type.try(:name) %> - <%= link_to_show(course_group_path(course_group)) %> - <%= link_to_edit(edit_course_group_path(course_group)) %> - <%= link_to_destroy(course_group) %> - <%= link_to_actions(course_group) %>
<%= course_type.name %> <%= course_type.code %> <%= course_type.min_credit %> - <%= link_to_edit([:edit, course_type]) %> - <%= link_to_destroy(course_type) %> - <%= link_to_actions(course_type, except: :show) %>
<%= enum_t(course, :program_type) %> <%= course.language.try(:name) %> <%= enum_t(course, :status) %> - <%= link_to_show course %> - <%= link_to_edit [:edit, course] %> - <%= link_to_destroy course %> - <%= link_to_actions(course, except: :show, edit: { text: 'Foo' }) %>
<%= curriculum_course.credit %> <%= curriculum_course.ects %> - <%= link_to_edit edit_curriculum_semester_curriculum_course_path(semester, curriculum_course) %> - <%= link_to_destroy [semester, curriculum_course] %> - <%= link_to_actions([semester, curriculum_course], except: :show) %>
<%= curriculum.semesters_count %> <%= enum_t(curriculum, :status) %> - <%= link_to_show curriculum %> - <%= link_to_edit [:edit, curriculum] %> - <%= link_to_destroy curriculum %> + <%= link_to_actions(curriculum) %>
<%= registration_document.unit.name %> <%= registration_document.document_type.name %> <%= registration_document.description %> - <%= link_to_edit([:edit, :first_registration, registration_document]) %> - <%= link_to_destroy([:first_registration, registration_document]) %> - <%= link_to_actions(registration_document, scope: :first_registration, except: :show) %>
- <%= link_to_show([namespace.to_sym, item]) if actions.include? 'show' %> - <%= link_to_edit([:edit, namespace.to_sym, item]) if actions.include? 'edit' %> - <%= link_to_destroy([namespace.to_sym, item]) if actions.include? 'destroy' %> - <%= link_to_actions([namespace.to_sym, item], except: (%w[show edit destroy] - actions)) %>
<%= academic_term.start_of_term.try(:strftime, '%F %T') %> <%= academic_term.end_of_term.try(:strftime, '%F %T') %> <%= academic_term.active? ? t('active') : t('passive') %> - <%= link_to_edit(edit_academic_term_path(academic_term)) %> - <%= link_to_destroy(academic_term) %> - <%= link_to_actions(academic_term, except: :show) %>
- - - - - - - - - <% @terms.each do |term| %> - - - - - - <% end %> - -
<%= t('.name') %><%= t('.identifier') %><%= t('actions') %>
<%= term.name %><%= term.identifier %> - <%= link_to_edit(edit_term_path(term)) %> - <%= link_to_destroy(term) %> -
- - - - - diff --git a/app/views/units/index.html.erb b/app/views/units/index.html.erb index 8dd87e6d8..4a14ac286 100644 --- a/app/views/units/index.html.erb +++ b/app/views/units/index.html.erb @@ -29,10 +29,7 @@ <%= unit.unit_type.try(:name) %> <%= unit.unit_status.try(:name) %> <%= unit.unit_instruction_type.try(:name) %> - - <%= link_to_edit(edit_unit_path(unit)) %> - <%= link_to_destroy(unit) %> - + <%= link_to_actions(unit, except: :show) %> <% end %> diff --git a/app/views/units/show.html.erb b/app/views/units/show.html.erb index f95f01580..5959e7503 100644 --- a/app/views/units/show.html.erb +++ b/app/views/units/show.html.erb @@ -4,8 +4,7 @@
<%= fa_icon 'university' %><%= @unit.name %>
- <%= link_to_edit(edit_unit_path(@unit)) %> - <%= link_to_destroy(@unit) %> + <%= link_to_actions(@unit, except: :show) %>
diff --git a/app/views/users/_account.html.erb b/app/views/users/_account.html.erb index a1b7bc584..c204e9a93 100644 --- a/app/views/users/_account.html.erb +++ b/app/views/users/_account.html.erb @@ -1,8 +1,7 @@
- <%= link_to_edit(edit_user_path(@user)) %> - <%= link_to_destroy(@user) %> + <%= link_to_actions(@user, except: :show) %>
diff --git a/app/views/users/_addresses.html.erb b/app/views/users/_addresses.html.erb index cf6ef3ab2..f277e09ad 100644 --- a/app/views/users/_addresses.html.erb +++ b/app/views/users/_addresses.html.erb @@ -16,8 +16,7 @@ <% else %> <%= t('.informal_address') %>
- <%= link_to_edit(edit_user_address_path(@user, address)) %> - <%= link_to_destroy(user_address_path(@user, address)) %> + <%= link_to_actions([@user, address], except: :show) %>
<% end %>
diff --git a/app/views/users/_employees.html.erb b/app/views/users/_employees.html.erb index abd341778..e0eadc379 100644 --- a/app/views/users/_employees.html.erb +++ b/app/views/users/_employees.html.erb @@ -24,10 +24,7 @@ <%= employee.active? ? t('yes') : t('no') %> <%= as_date_and_time(employee.created_at) %> <%= as_date_and_time(employee.updated_at) %> - - <%= link_to_edit(edit_user_employee_path(@user, employee)) %> - <%= link_to_destroy(user_employee_path(@user, employee)) %> - + <%= link_to_actions([@user, employee], except: :show) %> <% end %> @@ -60,10 +57,7 @@ <%= duty.temporary? ? t('.temporary') : t('.tenure') %> <%= duty.start_date %> <%= duty.end_date %> - - <%= link_to_edit(edit_user_duty_path(@user, duty)) %> - <%= link_to_destroy(user_duty_path(@user, duty)) %> - + <%= link_to_actions([@user, duty], except: :show) %> <% end %> @@ -96,10 +90,7 @@ <%= position.administrative_function.name %> <%= position.start_date %> <%= position.end_date %> - - <%= link_to_edit(edit_user_position_path(@user, position)) %> - <%= link_to_destroy(user_position_path(@user, position)) %> - + <%= link_to_actions([@user, position], except: :show) %> <% end %> diff --git a/app/views/users/_identities.html.erb b/app/views/users/_identities.html.erb index 611926319..d4dc9d27e 100644 --- a/app/views/users/_identities.html.erb +++ b/app/views/users/_identities.html.erb @@ -17,8 +17,7 @@ <% else %> <%= t('.informal_identity') %>
- <%= link_to_edit(edit_user_identity_path(@user, identity)) %> - <%= link_to_destroy(user_identity_path(@user, identity)) %> + <%= link_to_actions([@user, identity], except: :show) %>
<% end %> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 45a8b230a..4dd26d657 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -31,11 +31,7 @@ <%= user.preferred_language %> <%= user.addresses.count %> <%= user.identities.count %> - - <%= link_to_show(user) %> - <%= link_to_edit(edit_user_path(user)) %> - <%= link_to_destroy(user) %> - + <%= link_to_actions(user) %> <% end %> From 25a30c4bdfbf0ce07678d47af4b8eb2bd1fc226d Mon Sep 17 00:00:00 2001 From: isubas Date: Wed, 30 Jan 2019 17:16:15 +0300 Subject: [PATCH 003/124] =?UTF-8?q?Link=20helper=20yap=C4=B1s=C4=B1n=C4=B1?= =?UTF-8?q?=20iyile=C5=9Ftir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/link_helper.rb | 52 ++++++++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/app/helpers/link_helper.rb b/app/helpers/link_helper.rb index 74eae3751..ad0dc0503 100644 --- a/app/helpers/link_helper.rb +++ b/app/helpers/link_helper.rb @@ -56,39 +56,65 @@ module LinkHelper } }.freeze + # Usage: + # link_to_#{action}(path) + # link_to_#{action}(path, options = {}) + # link_to_#{action}(text, path, options = {}) LINKS.each do |action, configuration| define_method("link_to_#{action}") do |*args| link_builder(args, configuration) end end - # Usage: - # link_to_actions(@cities, + BASE_ACTIONS = %i[show edit destroy].freeze + + # Basic Usage: + # link_to_actions(path) + # link_to_actions(course, except: :show) + # + # Advance Usage: + # link_to_actions(path, # scope: :admin, # except: :show, - # edit: { text: 'Edit Text' }) + # edit: { text: 'Edit Text', options: { class: 'btn btn-danger' } }, + # destroy: { options: { class: 'btn btn-danger' } }) def link_to_actions(path, options = {}) - actions = (%i[show edit destroy] - [*options[:except]].map(&:to_sym)).inquiry - path = [*options[:scope], *path] - links = [] - links << link_to_show(options.dig(:show, :text), [*path]) if actions.show? - links << link_to_edit(options.dig(:edit, :text), [:edit, *path]) if actions.edit? - links << link_to_destroy(options.dig(:destroy, :text), [*path]) if actions.destroy? - safe_join(links, ' ') + actions = BASE_ACTIONS - [*options[:except]].map(&:to_sym) + safe_join( + create_links_for(path, actions, options), + ' ' + ) end private + def create_links_for(path, actions, options = {}) + config = { + edit: { path_prefix: :edit } + } + + actions.map do |action| + send("link_to_#{action}", + options.dig(action, :text), + [*config.dig(action, :path_prefix), *options[:scope], *path], + options.dig(action, :options)) + end + end + def link_builder(args, configuration) - text, path = split_args_for_link_to(args) + text, path, custom_options = split_args_for_link_to(args) + options = configuration.fetch(:options, {}) + options = options.merge(custom_options) if custom_options.is_a?(Hash) + link_to( fa_icon(configuration[:icon], text: text || configuration[:text]), path, - configuration.fetch(:options, {}) + options ) end def split_args_for_link_to(args) - args.length == 1 ? [nil, *args] : args + number_of_args_check = args.last.is_a?(::Hash) ? 2 : 1 + args.length == number_of_args_check ? [nil, *args] : args end end From 1be3171f476c0f45d06607ad69793c6a6111a1d4 Mon Sep 17 00:00:00 2001 From: isubas Date: Wed, 30 Jan 2019 17:18:08 +0300 Subject: [PATCH 004/124] Minor changes from some views --- app/views/course_management/courses/index.html.erb | 2 +- app/views/course_management/curriculums/index.html.erb | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/views/course_management/courses/index.html.erb b/app/views/course_management/courses/index.html.erb index c2f09fc29..988de8e6d 100644 --- a/app/views/course_management/courses/index.html.erb +++ b/app/views/course_management/courses/index.html.erb @@ -46,7 +46,7 @@ <%= enum_t(course, :program_type) %> <%= course.language.try(:name) %> <%= enum_t(course, :status) %> - <%= link_to_actions(course, except: :show, edit: { text: 'Foo' }) %> + <%= link_to_actions(course) %> <% end %> diff --git a/app/views/course_management/curriculums/index.html.erb b/app/views/course_management/curriculums/index.html.erb index 22b246963..4e84f0874 100644 --- a/app/views/course_management/curriculums/index.html.erb +++ b/app/views/course_management/curriculums/index.html.erb @@ -26,9 +26,7 @@ <%= curriculum.unit.try(:name) %> <%= curriculum.semesters_count %> <%= enum_t(curriculum, :status) %> - - <%= link_to_actions(curriculum) %> - + <%= link_to_actions(curriculum) %> <% end %> From ca73543a198a9838bcb3f725b5d0114df07526ad Mon Sep 17 00:00:00 2001 From: isubas Date: Thu, 31 Jan 2019 13:20:50 +0300 Subject: [PATCH 005/124] Minor revisions from link helper --- app/helpers/link_helper.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/helpers/link_helper.rb b/app/helpers/link_helper.rb index ad0dc0503..446ef0348 100644 --- a/app/helpers/link_helper.rb +++ b/app/helpers/link_helper.rb @@ -25,6 +25,13 @@ module LinkHelper class: 'btn btn-outline-success btn-sm' } }, + file: { + icon: 'file-word-o', + text: I18n.t('action_group.file'), + options: { + class: 'btn btn-secondary btn-sm' + } + }, new: { icon: 'plus', text: I18n.t('action_group.add'), @@ -46,13 +53,6 @@ module LinkHelper options: { class: 'btn btn-outline-info btn-sm' } - }, - file: { - icon: 'file-word-o', - text: I18n.t('action_group.file'), - options: { - class: 'btn btn-secondary btn-sm' - } } }.freeze From 82bfeb37197c7bb637dc58dc40f934754c21e275 Mon Sep 17 00:00:00 2001 From: isubas Date: Thu, 31 Jan 2019 13:21:26 +0300 Subject: [PATCH 006/124] Update link helper test --- test/helpers/link_helper_test.rb | 115 ++++++++++++++++++++----------- 1 file changed, 75 insertions(+), 40 deletions(-) diff --git a/test/helpers/link_helper_test.rb b/test/helpers/link_helper_test.rb index 60365cb3b..565be69f7 100644 --- a/test/helpers/link_helper_test.rb +++ b/test/helpers/link_helper_test.rb @@ -5,51 +5,86 @@ class LinkHelperTest < ActionView::TestCase include FontAwesome::Rails::IconHelper - test 'link_to_back method' do - link = <<-HTML.squish - Back - HTML - assert_equal link_to_back('Back', '#'), link - end + LINK = <<-HTML + s href="%s"> %s + HTML - test 'link_to_destroy method' do - link = <<-HTML.squish - Test Destroy - HTML - assert_equal link_to_destroy('Test Destroy', '#'), link - end + LINKS = { + back: { + klass: 'btn btn-secondary btn-sm', + options: '', + icon: 'fa fa-arrow-left', + path: '/path', + text: I18n.t('action_group.back') + }, + destroy: { + klass: 'btn btn-outline-danger btn-sm', + options: "data-confirm='#{I18n.t('are_you_sure')}' rel='nofollow' data-method='delete'", + icon: 'fa fa-trash', + path: '/path', + text: I18n.t('action_group.destroy') + }, + edit: { + klass: 'btn btn-outline-success btn-sm', + options: '', + icon: 'fa fa-pencil', + path: '/path', + text: I18n.t('action_group.edit') + }, + file: { + klass: 'btn btn-secondary btn-sm', + options: '', + icon: 'fa fa-file-word-o', + path: '/path', + text: I18n.t('action_group.file') + }, + new: { + klass: 'btn btn-outline-primary btn-sm', + options: 'id="add-button"', + icon: 'fa fa-plus', + path: '/path', + text: I18n.t('action_group.add') + }, + show: { + klass: 'btn btn-outline-info btn-sm', + options: '', + icon: 'fa fa-eye', + path: '/path', + text: I18n.t('action_group.show') + }, + update: { + klass: 'btn btn-outline-info btn-sm', + options: '', + icon: 'fa fa-pencil-square-o', + path: '/path', + text: I18n.t('action_group.update') + } + }.freeze - test 'link_to_edit method' do - link = <<-HTML.squish - Test Edit - HTML - assert_equal link_to_edit('Test Edit', '#'), link + LINKS.each do |key, options| + test "link_to_#{key} method" do + link = format(LINK, options).squish.tr("'", '"') + assert_equal send("link_to_#{key}", options[:path]), link + assert_equal send("link_to_#{key}", options[:text], options[:path]), link + end end - test 'link_to_new method' do - link = <<-HTML.squish - Test New - HTML - assert_equal link_to_new('Test New', '#'), link - end + test 'link_to_actions method' do + course = Course.last - test 'link_to_show' do - link = <<-HTML.squish - Test Show - HTML - assert_equal link_to_show('Test Show', '#'), link - end + links = { + show: link_to_show(course_path(course)), + edit: link_to_edit(edit_course_path(course)), + destroy: link_to_destroy(course_path(course)) + } - test '#link_to_update' do - link = <<-HTML.squish - Test Update - HTML - assert_equal link_to_update('Test Update', '#'), link + assert_equal link_to_actions(course), links.values.join(' ') + assert_equal link_to_actions(course, except: :show), links.values_at(:edit, :destroy).join(' ') + assert_equal link_to_actions(course, except: %i[show edit]), links.values_at(:destroy).join(' ') + assert_equal link_to_actions(course, except: %i[edit destroy], + show: { + text: 'Show', options: { class: 'btn btn-primary' } + }), + link_to_show('Show', course_path(course), class: 'btn btn-primary') end end From 7c35381369dc1c0bf69ff92aca349ec7504a6c16 Mon Sep 17 00:00:00 2001 From: isubas Date: Thu, 31 Jan 2019 13:22:00 +0300 Subject: [PATCH 007/124] Add document for link helper --- doc/helpers/link_to_helper.md | 75 +++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 doc/helpers/link_to_helper.md diff --git a/doc/helpers/link_to_helper.md b/doc/helpers/link_to_helper.md new file mode 100644 index 000000000..cad9e1152 --- /dev/null +++ b/doc/helpers/link_to_helper.md @@ -0,0 +1,75 @@ +Link Yardımcıları +================= + +Uygulama içerisinde aynı işleve sahip linklerin aynı görünüme sahip olmasını +sağlamak amacıyla geliştirilmişlerdir. Kullanımın bakımından `link_to` metodu ile +benzerlik göstermektedir. + +### Yardımcı Metodlar + +- link_to_back +- link_to_destroy +- link_to_edit +- link_to_file +- link_to_new +- link_to_show +- link_to_update +- **link_to_actions** + +#### Temel Kullanım Örnekleri + +**Not:** Bu örnekler, `link_to_actions` haricindeki diğer yardımcılar için geçerlidir. + +```erb + <%= link_to_show(course_path(course)) %> + <%= link_to_edit('A Dersini Güncelle', edit_course_path(course)) %> +``` + +#### İleri Seviye Kullanım Örnekleri + +```erb + <%= link_to_destroy('Dersi Sil' + edit_course_path(course), + class: 'btn btn-danger') %> + + <%= link_to_destroy(edit_course_path(course), + class: 'btn btn-danger', + id: 'destroy-button', + data: { object_id: 1 } ) %> +``` + +### link_to_actions + +Görüntüleme, düzenleme ve silme işlevleri için gerekli linkleri tek bir metod ile +oluşturmanızı sağlayan yardımcı bir metoddur. + +### Temel Kullanım Örnekleri + +Metoda, yalnızca **path** parametresi gönderilirse, 3 action içinde link üretecektir. +**except** parametresini kullanarak dilediğiniz actionların hariç tutabilirsiniz. Ek olarak **scope** parametresini kullanarak linklerin hangi +kapsam için oluşturulacağını belirleyebilirsiniz. + +```erb + <%= link_to_actions(object) %> + <%= link_to_actions(object, except: %i[show destroy]) %> # object_path + <%= link_to_actions(object, except: :show, scope: :admin) %> # admin_object_path +``` + +#### İleri Seviye Kullanım Örnekleri + +Her bir action için text, icon ve link opsiyonlarını belirleyebilirsiniz. + +```erb + <%= link_to_actions(object, + show: { + text: '', + icon: 'fa fa-pencil', + options: { class: 'btn btn-danger' } + }, + edit: { + text: 'Nesneyi Düzenle', + options: { + data: { confirm: 'Edit Confirm' } + } + }) %> +``` From b98c87e4c8bbdf3bb84aacdff13f55499f17e2eb Mon Sep 17 00:00:00 2001 From: isubas Date: Thu, 31 Jan 2019 13:23:02 +0300 Subject: [PATCH 008/124] Remove redundant keep file --- doc/helpers/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 doc/helpers/.keep diff --git a/doc/helpers/.keep b/doc/helpers/.keep deleted file mode 100644 index e69de29bb..000000000 From 8006489439ce6506141b653cd4f67807eddd4b21 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 31 Jan 2019 16:06:24 +0300 Subject: [PATCH 009/124] =?UTF-8?q?Takvim=20modelinde=20tutulan=20karar=20?= =?UTF-8?q?bilgilerini=20kald=C4=B1r?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...e_senate_decision_columns_from_calendar.rb | 8 +++++++ db/structure.sql | 21 ++++++++++++++----- 2 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 db/migrate/20190130105509_remove_senate_decision_columns_from_calendar.rb diff --git a/db/migrate/20190130105509_remove_senate_decision_columns_from_calendar.rb b/db/migrate/20190130105509_remove_senate_decision_columns_from_calendar.rb new file mode 100644 index 000000000..04902a30c --- /dev/null +++ b/db/migrate/20190130105509_remove_senate_decision_columns_from_calendar.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +class RemoveSenateDecisionColumnsFromCalendar < ActiveRecord::Migration[6.0] + def change + remove_column :calendars, :senate_decision_date, :date + remove_column :calendars, :senate_decision_no, :string + end +end diff --git a/db/structure.sql b/db/structure.sql index f6d739eec..02bd0ac2c 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -8,6 +8,20 @@ SET check_function_bodies = false; SET client_min_messages = warning; SET row_security = off; +-- +-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; + + +-- +-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; + + SET default_tablespace = ''; SET default_with_oids = false; @@ -640,8 +654,6 @@ ALTER SEQUENCE public.calendar_events_id_seq OWNED BY public.calendar_events.id; CREATE TABLE public.calendars ( id bigint NOT NULL, name character varying, - senate_decision_date date, - senate_decision_no character varying, description character varying, timezone character varying DEFAULT 'Istanbul'::character varying, academic_term_id bigint NOT NULL, @@ -650,8 +662,6 @@ CREATE TABLE public.calendars ( CONSTRAINT calendars_description_length CHECK ((length((description)::text) <= 65535)), CONSTRAINT calendars_name_length CHECK ((length((name)::text) <= 255)), CONSTRAINT calendars_name_presence CHECK (((name IS NOT NULL) AND ((name)::text !~ '^\s*$'::text))), - CONSTRAINT calendars_senate_decision_no_length CHECK ((length((senate_decision_no)::text) <= 255)), - CONSTRAINT calendars_senate_decision_no_presence CHECK (((senate_decision_no IS NOT NULL) AND ((senate_decision_no)::text !~ '^\s*$'::text))), CONSTRAINT calendars_timezone_length CHECK ((length((timezone)::text) <= 255)), CONSTRAINT calendars_timezone_presence CHECK (((timezone IS NOT NULL) AND ((timezone)::text !~ '^\s*$'::text))) ); @@ -5171,6 +5181,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20190115100844'), ('20190116104001'), ('20190116115745'), -('20190122203727'); +('20190122203727'), +('20190130105509'); From 0fb444917160d974b1690da4fdedf8b32b661150 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 31 Jan 2019 16:08:53 +0300 Subject: [PATCH 010/124] =?UTF-8?q?Takvimi=20kurul=20kararlar=C4=B1=20ile?= =?UTF-8?q?=20ili=C5=9Fkilendir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../calendars_controller.rb | 2 +- app/models/calendar.rb | 7 +- app/models/calendar_committee_decision.rb | 10 +++ app/models/committee_decision.rb | 1 + .../calendars/_form.html.erb | 14 ++-- .../calendars/index.html.erb | 4 - .../calendars/show.html.erb | 14 ++-- .../calendar_management/calendars.en.yml | 1 + .../calendar_management/calendars.tr.yml | 1 + ...547_create_calendar_committee_decisions.rb | 11 +++ db/structure.sql | 80 ++++++++++++++++++- 11 files changed, 122 insertions(+), 23 deletions(-) create mode 100644 app/models/calendar_committee_decision.rb create mode 100644 db/migrate/20190130114547_create_calendar_committee_decisions.rb diff --git a/app/controllers/calendar_management/calendars_controller.rb b/app/controllers/calendar_management/calendars_controller.rb index 26b84b11f..71b3db8f0 100644 --- a/app/controllers/calendar_management/calendars_controller.rb +++ b/app/controllers/calendar_management/calendars_controller.rb @@ -71,7 +71,7 @@ def calendar_params params.require(:calendar) .permit( :name, :senate_decision_date, :senate_decision_no, :description, :timezone, :academic_term_id, - unit_ids: [], calendar_events_attributes: %i[ + unit_ids: [], committee_decision_ids: [], calendar_events_attributes: %i[ id calendar_event_type_id start_time end_time location timezone visible _destroy ] ) diff --git a/app/models/calendar.rb b/app/models/calendar.rb index c096b91b5..9e12619d7 100644 --- a/app/models/calendar.rb +++ b/app/models/calendar.rb @@ -13,6 +13,8 @@ class Calendar < ApplicationRecord belongs_to :academic_term has_many :calendar_events, dependent: :destroy has_many :calendar_event_types, through: :calendar_events + has_many :calendar_committee_decisions, dependent: :destroy + has_many :committee_decisions, through: :calendar_committee_decisions has_many :unit_calendars, dependent: :destroy has_many :units, through: :unit_calendars, before_add: proc { |calendar, unit| create_sub_calendars(calendar, unit) }, @@ -23,11 +25,10 @@ class Calendar < ApplicationRecord # validations validates :name, presence: true, - uniqueness: { scope: %i[senate_decision_no academic_term_id] }, + uniqueness: { scope: :academic_term_id }, length: { maximum: 255 } + validates :committee_decisions, presence: true validates :timezone, presence: true, length: { maximum: 255 } - validates :senate_decision_date, presence: true, length: { maximum: 255 } - validates :senate_decision_no, presence: true, length: { maximum: 255 } validates :description, length: { maximum: 65_535 } # delegations diff --git a/app/models/calendar_committee_decision.rb b/app/models/calendar_committee_decision.rb new file mode 100644 index 000000000..f85873161 --- /dev/null +++ b/app/models/calendar_committee_decision.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class CalendarCommitteeDecision < ApplicationRecord + # relations + belongs_to :calendar + belongs_to :committee_decision + + # validations + validates :calendar, uniqueness: { scope: :committee_decision } +end diff --git a/app/models/committee_decision.rb b/app/models/committee_decision.rb index 970341f1e..70b93aa02 100644 --- a/app/models/committee_decision.rb +++ b/app/models/committee_decision.rb @@ -4,6 +4,7 @@ class CommitteeDecision < ApplicationRecord # relations belongs_to :meeting_agenda has_one :agenda, through: :meeting_agenda + has_many :calendar_committee_decisions, dependent: :destroy # validations validates :description, presence: true, length: { maximum: 65_535 } diff --git a/app/views/calendar_management/calendars/_form.html.erb b/app/views/calendar_management/calendars/_form.html.erb index 993622a8e..8467ccc3c 100644 --- a/app/views/calendar_management/calendars/_form.html.erb +++ b/app/views/calendar_management/calendars/_form.html.erb @@ -12,14 +12,10 @@ <%= f.input :name, required: true %>
- <%= f.input :senate_decision_date, - as: :date_time_picker, - input_html: { data: { class: 'senate_decision_date'} } %> + <%= f.association :committee_decisions, + collection: CommitteeDecision.all, label_method: :decision_no %>
- <%= f.input :senate_decision_no, required: true %> -
-
<%= f.input :timezone, required: true, collection: timezone_list_with_offset, label_method: :first, @@ -63,3 +59,9 @@ <%= javascript_include_tag 'shared/cocoon' %> <%= render 'flatpickr' %> <%= render 'cocoon' %> + + diff --git a/app/views/calendar_management/calendars/index.html.erb b/app/views/calendar_management/calendars/index.html.erb index 14252cfd7..84b32e4f3 100644 --- a/app/views/calendar_management/calendars/index.html.erb +++ b/app/views/calendar_management/calendars/index.html.erb @@ -15,8 +15,6 @@ <%= t('.name') %> - <%= t('.senate_decision_date') %> - <%= t('.senate_decision_no') %> <%= t('.timezone') %> <%= t('.academic_term') %> <%= t('actions') %> @@ -26,8 +24,6 @@ <% @calendars.each do |calendar| %> <%= link_to("[#{full_name(calendar.academic_term)}] - #{calendar.name}", [:calendar_management, calendar]) %> - <%= calendar.senate_decision_date %> - <%= calendar.senate_decision_no %> <%= calendar.timezone %> <%= full_name(calendar.academic_term) %> diff --git a/app/views/calendar_management/calendars/show.html.erb b/app/views/calendar_management/calendars/show.html.erb index c899a2098..cca1408e2 100644 --- a/app/views/calendar_management/calendars/show.html.erb +++ b/app/views/calendar_management/calendars/show.html.erb @@ -17,14 +17,12 @@
- - - - - - - - + <% @calendar.committee_decisions.each do |decision| %> + + + + + <% end %> diff --git a/config/locales/controllers/calendar_management/calendars.en.yml b/config/locales/controllers/calendar_management/calendars.en.yml index 24d223423..4ffba23a5 100644 --- a/config/locales/controllers/calendar_management/calendars.en.yml +++ b/config/locales/controllers/calendar_management/calendars.en.yml @@ -3,6 +3,7 @@ en: attributes: calendar: &calendar_attributes name: Calendar Title + committee_decisions: Senate Decisions senate_decision_date: Senate Decision Date senate_decision_no: Senate Decision No description: Description diff --git a/config/locales/controllers/calendar_management/calendars.tr.yml b/config/locales/controllers/calendar_management/calendars.tr.yml index 70730b866..2b9ec936c 100644 --- a/config/locales/controllers/calendar_management/calendars.tr.yml +++ b/config/locales/controllers/calendar_management/calendars.tr.yml @@ -3,6 +3,7 @@ tr: attributes: calendar: &calendar_attributes name: Takvim Başlığı + committee_decisions: Senato Kararları senate_decision_date: Senato Karar Tarihi senate_decision_no: Senato Karar Numarası description: Açıklamalar diff --git a/db/migrate/20190130114547_create_calendar_committee_decisions.rb b/db/migrate/20190130114547_create_calendar_committee_decisions.rb new file mode 100644 index 000000000..ff823e240 --- /dev/null +++ b/db/migrate/20190130114547_create_calendar_committee_decisions.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class CreateCalendarCommitteeDecisions < ActiveRecord::Migration[6.0] + def change + create_table :calendar_committee_decisions do |t| + t.references :calendar, foreign_key: true, null: false + t.references :committee_decision, foreign_key: true, null: false + t.timestamps + end + end +end diff --git a/db/structure.sql b/db/structure.sql index 02bd0ac2c..2bf9bc5a9 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -568,6 +568,38 @@ CREATE SEQUENCE public.available_courses_id_seq ALTER SEQUENCE public.available_courses_id_seq OWNED BY public.available_courses.id; +-- +-- Name: calendar_committee_decisions; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.calendar_committee_decisions ( + id bigint NOT NULL, + calendar_id bigint NOT NULL, + committee_decision_id bigint NOT NULL, + created_at timestamp(6) without time zone NOT NULL, + updated_at timestamp(6) without time zone NOT NULL +); + + +-- +-- Name: calendar_committee_decisions_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.calendar_committee_decisions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: calendar_committee_decisions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.calendar_committee_decisions_id_seq OWNED BY public.calendar_committee_decisions.id; + + -- -- Name: calendar_event_types; Type: TABLE; Schema: public; Owner: - -- @@ -2771,6 +2803,13 @@ ALTER TABLE ONLY public.available_course_lecturers ALTER COLUMN id SET DEFAULT n ALTER TABLE ONLY public.available_courses ALTER COLUMN id SET DEFAULT nextval('public.available_courses_id_seq'::regclass); +-- +-- Name: calendar_committee_decisions id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.calendar_committee_decisions ALTER COLUMN id SET DEFAULT nextval('public.calendar_committee_decisions_id_seq'::regclass); + + -- -- Name: calendar_event_types id; Type: DEFAULT; Schema: public; Owner: - -- @@ -3278,6 +3317,14 @@ ALTER TABLE ONLY public.available_courses ADD CONSTRAINT available_courses_pkey PRIMARY KEY (id); +-- +-- Name: calendar_committee_decisions calendar_committee_decisions_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.calendar_committee_decisions + ADD CONSTRAINT calendar_committee_decisions_pkey PRIMARY KEY (id); + + -- -- Name: calendar_event_types calendar_event_types_identifier_unique; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -4101,6 +4148,20 @@ CREATE INDEX index_available_courses_on_curriculum_id ON public.available_course CREATE INDEX index_available_courses_on_unit_id ON public.available_courses USING btree (unit_id); +-- +-- Name: index_calendar_committee_decisions_on_calendar_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_calendar_committee_decisions_on_calendar_id ON public.calendar_committee_decisions USING btree (calendar_id); + + +-- +-- Name: index_calendar_committee_decisions_on_committee_decision_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_calendar_committee_decisions_on_committee_decision_id ON public.calendar_committee_decisions USING btree (committee_decision_id); + + -- -- Name: index_calendar_events_on_calendar_event_type_id; Type: INDEX; Schema: public; Owner: - -- @@ -4773,6 +4834,14 @@ ALTER TABLE ONLY public.course_groups ADD CONSTRAINT fk_rails_4af2ef6ebe FOREIGN KEY (course_group_type_id) REFERENCES public.course_group_types(id); +-- +-- Name: calendar_committee_decisions fk_rails_4f3eb3da94; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.calendar_committee_decisions + ADD CONSTRAINT fk_rails_4f3eb3da94 FOREIGN KEY (calendar_id) REFERENCES public.calendars(id); + + -- -- Name: identities fk_rails_5373344100; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -4805,6 +4874,14 @@ ALTER TABLE ONLY public.units ADD CONSTRAINT fk_rails_5951990ba9 FOREIGN KEY (district_id) REFERENCES public.districts(id); +-- +-- Name: calendar_committee_decisions fk_rails_5d6264c4f2; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.calendar_committee_decisions + ADD CONSTRAINT fk_rails_5d6264c4f2 FOREIGN KEY (committee_decision_id) REFERENCES public.committee_decisions(id); + + -- -- Name: calendar_events fk_rails_64d7b22524; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -5182,6 +5259,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20190116104001'), ('20190116115745'), ('20190122203727'), -('20190130105509'); +('20190130105509'), +('20190130114547'); From e12013c93e44a665c28e35365b6455778498009a Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 31 Jan 2019 16:09:43 +0300 Subject: [PATCH 011/124] =?UTF-8?q?Takvim=20karar=20ili=C5=9Fkilendirmesi?= =?UTF-8?q?=20i=C3=A7in=20testi=20d=C3=BCzenle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../calendars_controller_test.rb | 9 +++------ test/fixtures/calendar_committee_decisions.yml | 9 +++++++++ test/fixtures/calendars.yml | 8 +------- test/models/calendar_committee_decision_test.rb | 15 +++++++++++++++ test/models/calendar_test.rb | 14 +++++++------- 5 files changed, 35 insertions(+), 20 deletions(-) create mode 100644 test/fixtures/calendar_committee_decisions.yml create mode 100644 test/models/calendar_committee_decision_test.rb diff --git a/test/controllers/calendar_management/calendars_controller_test.rb b/test/controllers/calendar_management/calendars_controller_test.rb index 7001d27af..2dd05a28d 100644 --- a/test/controllers/calendar_management/calendars_controller_test.rb +++ b/test/controllers/calendar_management/calendars_controller_test.rb @@ -7,7 +7,7 @@ class CalendarsControllerTest < ActionDispatch::IntegrationTest setup do sign_in users(:john) @calendar = calendars(:uzem_calendar) - @form_params = %w[name senate_decision_date senate_decision_no description timezone academic_term_id] + @form_params = %w[name description timezone academic_term_id] end test 'should get index' do @@ -33,11 +33,10 @@ class CalendarsControllerTest < ActionDispatch::IntegrationTest post calendar_management_calendars_path, params: { calendar: { name: 'Sample Calendar', - senate_decision_date: Time.zone.now.to_date, - senate_decision_no: 'top_secret_meeting', description: 'lorem and ipsum', timezone: 'Istanbul', - academic_term_id: AcademicTerm.first.id + academic_term_id: AcademicTerm.first.id, + committee_decision_ids: [committee_decisions(:one).id] } } end @@ -47,8 +46,6 @@ class CalendarsControllerTest < ActionDispatch::IntegrationTest calendar = Calendar.last assert_equal 'Sample Calendar', calendar.name - assert_equal Time.zone.now.to_date, calendar.senate_decision_date - assert_equal 'top_secret_meeting', calendar.senate_decision_no assert_equal 'lorem and ipsum', calendar.description assert_equal 'Istanbul', calendar.timezone assert_redirected_to calendar_management_calendars_path diff --git a/test/fixtures/calendar_committee_decisions.yml b/test/fixtures/calendar_committee_decisions.yml new file mode 100644 index 000000000..25c18e3b4 --- /dev/null +++ b/test/fixtures/calendar_committee_decisions.yml @@ -0,0 +1,9 @@ +one: + calendar: uzem_calendar + committee_decision: one +two: + calendar: graduate_calendar + committee_decision: one +three: + calendar: calendar_to_delete + committee_decision: one diff --git a/test/fixtures/calendars.yml b/test/fixtures/calendars.yml index 890357b11..15714e99c 100644 --- a/test/fixtures/calendars.yml +++ b/test/fixtures/calendars.yml @@ -1,21 +1,15 @@ uzem_calendar: name: UZEM Takvimi - senate_decision_no: 123456-TR-123 - senate_decision_date: 01.01.2019 description: UZEM için özel takvim academic_term: spring_2018_2019 timezone: Istanbul graduate_calendar: name: Lisansüstü Takvimi - senate_decision_no: 987654s-TR-123 - senate_decision_date: 15.10.2019 description: Lisansüstü etkinlikleri academic_term: summer_2018_2019 timezone: Istanbul calendar_to_delete: name: Some calendar to delete in tests - senate_decision_no: 987654s-SWEDEN-123 - senate_decision_date: 15.10.2019 description: Nothing to describe. academic_term: fall_2018_2019 - timezone: Istanbul \ No newline at end of file + timezone: Istanbul diff --git a/test/models/calendar_committee_decision_test.rb b/test/models/calendar_committee_decision_test.rb new file mode 100644 index 000000000..cdf67ec8e --- /dev/null +++ b/test/models/calendar_committee_decision_test.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +require 'test_helper' + +class CalendarCommitteeDecisionTest < ActiveSupport::TestCase + # relations + %i[ + calendar + committee_decision + ].each do |property| + test "a calendar committee decision can communicate with #{property}" do + assert calendar_committee_decisions(:one).send(property) + end + end +end diff --git a/test/models/calendar_test.rb b/test/models/calendar_test.rb index 0fe7608f8..7494ebbbc 100644 --- a/test/models/calendar_test.rb +++ b/test/models/calendar_test.rb @@ -12,6 +12,7 @@ class CalendarTest < ActiveSupport::TestCase academic_term calendar_events calendar_event_types + calendar_committee_decisions unit_calendars units ].each do |property| @@ -21,15 +22,15 @@ class CalendarTest < ActiveSupport::TestCase end # validations: presence - %i[ - name - timezone - senate_decision_no - ].each do |property| + { + committee_decision_ids: :committee_decisions, + name: :name, + timezone: :timezone + }.each do |property, error_message_key| test "presence validations for #{property} of a calendar" do @calendar.send("#{property}=", nil) assert_not @calendar.valid? - assert_not_empty @calendar.errors[property] + assert_not_empty @calendar.errors[error_message_key] end end @@ -50,7 +51,6 @@ class CalendarTest < ActiveSupport::TestCase %i[ name timezone - senate_decision_no ].each do |property| test "#{property} of calendar can not be longer than 255 characters" do fake = @calendar.dup From ef6f53d14fe6665baa5d89d837ebad4a6c289681 Mon Sep 17 00:00:00 2001 From: msdundar Date: Fri, 1 Feb 2019 05:34:19 +0300 Subject: [PATCH 012/124] Add skylight for free monitoring --- Gemfile | 3 ++- Gemfile.lock | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index ab64e68b9..4afbef5a8 100644 --- a/Gemfile +++ b/Gemfile @@ -54,8 +54,9 @@ gem 'rack-attack' # validators gem 'email_address' -# error tracking +# error tracking & monitoring gem 'rollbar', github: 'rollbar/rollbar-gem' +gem 'skylight' # permalinks gem 'friendly_id', '~> 5.2.0' diff --git a/Gemfile.lock b/Gemfile.lock index b6aff4c02..885792e52 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/rails/rails.git - revision: 535a8b995700a5875a898691b19b88969c22d264 + revision: 6127b8d9203d7ce852d103ff1686621f9aca292f specs: actioncable (6.0.0.beta1) actionpack (= 6.0.0.beta1) @@ -345,6 +345,10 @@ GEM simplecov-html (0.10.2) simpleidn (0.1.1) unf (~> 0.1.4) + skylight (3.1.4) + skylight-core (= 3.1.4) + skylight-core (3.1.4) + activesupport (>= 4.2.0) spring (2.0.2) activesupport (>= 4.2) spring-watcher-listen (2.0.1) @@ -432,6 +436,7 @@ DEPENDENCIES sidekiq simple_form simplecov + skylight spring spring-watcher-listen (~> 2.0.0) uglifier (>= 1.3.0) From bb550bcf5ae862a2fb0c118faf0914891f3bca0c Mon Sep 17 00:00:00 2001 From: msdundar Date: Fri, 1 Feb 2019 15:16:32 +0300 Subject: [PATCH 013/124] Remove skylight from Gemfile --- Gemfile | 3 +-- Gemfile.lock | 7 +------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index 4afbef5a8..ab64e68b9 100644 --- a/Gemfile +++ b/Gemfile @@ -54,9 +54,8 @@ gem 'rack-attack' # validators gem 'email_address' -# error tracking & monitoring +# error tracking gem 'rollbar', github: 'rollbar/rollbar-gem' -gem 'skylight' # permalinks gem 'friendly_id', '~> 5.2.0' diff --git a/Gemfile.lock b/Gemfile.lock index 885792e52..3a4d04604 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/rails/rails.git - revision: 6127b8d9203d7ce852d103ff1686621f9aca292f + revision: eb1fc14d15c53de1c17534c958ddd588c913e203 specs: actioncable (6.0.0.beta1) actionpack (= 6.0.0.beta1) @@ -345,10 +345,6 @@ GEM simplecov-html (0.10.2) simpleidn (0.1.1) unf (~> 0.1.4) - skylight (3.1.4) - skylight-core (= 3.1.4) - skylight-core (3.1.4) - activesupport (>= 4.2.0) spring (2.0.2) activesupport (>= 4.2) spring-watcher-listen (2.0.1) @@ -436,7 +432,6 @@ DEPENDENCIES sidekiq simple_form simplecov - skylight spring spring-watcher-listen (~> 2.0.0) uglifier (>= 1.3.0) From c25c4581fe8a1208e02ddb93e4e28bbf527c4080 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 1 Feb 2019 23:35:41 +0000 Subject: [PATCH 014/124] Bump rollbar from `1411068` to `4a86624` Bumps [rollbar](https://github.com/rollbar/rollbar-gem) from `1411068` to `4a86624`. - [Release notes](https://github.com/rollbar/rollbar-gem/releases) - [Commits](https://github.com/rollbar/rollbar-gem/compare/14110689214edf693758b66211cdedd73458b4e1...4a86624c0e654d3baff06e0ed6c890af44ff0e34) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3a4d04604..84c14b5f7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -98,7 +98,7 @@ GIT GIT remote: https://github.com/rollbar/rollbar-gem.git - revision: 14110689214edf693758b66211cdedd73458b4e1 + revision: 4a86624c0e654d3baff06e0ed6c890af44ff0e34 specs: rollbar (2.18.2) multi_json From f4d8418530d7814cf0516711aef6643055f39dcd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 1 Feb 2019 23:36:06 +0000 Subject: [PATCH 015/124] Bump eslint-plugin-import from 2.14.0 to 2.16.0 Bumps [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) from 2.14.0 to 2.16.0. - [Release notes](https://github.com/benmosher/eslint-plugin-import/releases) - [Changelog](https://github.com/benmosher/eslint-plugin-import/blob/master/CHANGELOG.md) - [Commits](https://github.com/benmosher/eslint-plugin-import/compare/v2.14.0...v2.16.0) Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 68 +++++++++++++++++++++------------------------------- 2 files changed, 28 insertions(+), 42 deletions(-) diff --git a/package.json b/package.json index 519c6d348..6d1df183c 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "devDependencies": { "eslint": "^5.9.0", "eslint-config-standard": "^12.0.0", - "eslint-plugin-import": "^2.14.0", + "eslint-plugin-import": "^2.16.0", "eslint-plugin-node": "^8.0.0", "eslint-plugin-promise": "^4.0.1", "eslint-plugin-standard": "^4.0.0", diff --git a/yarn.lock b/yarn.lock index ce70339ff..3539cc2f1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2303,14 +2303,7 @@ debug@^3.1.0, debug@^3.2.5: dependencies: ms "^2.1.1" -debug@^4.0.1: - version "4.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87" - integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg== - dependencies: - ms "^2.1.1" - -debug@^4.1.0: +debug@^4.0.1, debug@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== @@ -2645,7 +2638,7 @@ eslint-config-standard@^12.0.0: resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-12.0.0.tgz#638b4c65db0bd5a41319f96bba1f15ddad2107d9" integrity sha512-COUz8FnXhqFitYj4DTqHzidjIL/t4mumGZto5c7DrBpvWoie+Sn3P4sLEzUGeYhRElWuFEf8K1S1EfvD1vixCQ== -eslint-import-resolver-node@^0.3.1: +eslint-import-resolver-node@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" integrity sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q== @@ -2653,13 +2646,13 @@ eslint-import-resolver-node@^0.3.1: debug "^2.6.9" resolve "^1.5.0" -eslint-module-utils@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz#b270362cd88b1a48ad308976ce7fa54e98411746" - integrity sha1-snA2LNiLGkitMIl2zn+lTphBF0Y= +eslint-module-utils@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.3.0.tgz#546178dab5e046c8b562bbb50705e2456d7bda49" + integrity sha512-lmDJgeOOjk8hObTysjqH7wyMi+nsHwwvfBykwfhjR1LNdd7C2uFJBvx4OpWYpXOw4df1yE1cDEVd1yLHitk34w== dependencies: debug "^2.6.8" - pkg-dir "^1.0.0" + pkg-dir "^2.0.0" eslint-plugin-es@^1.3.1: version "1.3.2" @@ -2669,21 +2662,21 @@ eslint-plugin-es@^1.3.1: eslint-utils "^1.3.0" regexpp "^2.0.1" -eslint-plugin-import@^2.14.0: - version "2.14.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz#6b17626d2e3e6ad52cfce8807a845d15e22111a8" - integrity sha512-FpuRtniD/AY6sXByma2Wr0TXvXJ4nA/2/04VPlfpmUDPOpOY264x+ILiwnrk/k4RINgDAyFZByxqPUbSQ5YE7g== +eslint-plugin-import@^2.16.0: + version "2.16.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.16.0.tgz#97ac3e75d0791c4fac0e15ef388510217be7f66f" + integrity sha512-z6oqWlf1x5GkHIFgrSvtmudnqM6Q60KM4KvpWi5ubonMjycLjndvd5+8VAZIsTlHC03djdgJuyKG6XO577px6A== dependencies: contains-path "^0.1.0" - debug "^2.6.8" + debug "^2.6.9" doctrine "1.5.0" - eslint-import-resolver-node "^0.3.1" - eslint-module-utils "^2.2.0" - has "^1.0.1" - lodash "^4.17.4" - minimatch "^3.0.3" + eslint-import-resolver-node "^0.3.2" + eslint-module-utils "^2.3.0" + has "^1.0.3" + lodash "^4.17.11" + minimatch "^3.0.4" read-pkg-up "^2.0.0" - resolve "^1.6.0" + resolve "^1.9.0" eslint-plugin-node@^8.0.0: version "8.0.0" @@ -4379,7 +4372,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@^4.0.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.4, lodash@^4.17.5, lodash@~4.17.10: +lodash@^4.0.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.5, lodash@~4.17.10: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== @@ -4592,7 +4585,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= -minimatch@^3.0.3, minimatch@^3.0.4, minimatch@~3.0.2: +minimatch@^3.0.4, minimatch@~3.0.2: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== @@ -5288,7 +5281,7 @@ path-key@^2.0.0, path-key@^2.0.1: resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= -path-parse@^1.0.5, path-parse@^1.0.6: +path-parse@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== @@ -5357,12 +5350,12 @@ pinkie@^2.0.0: resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= -pkg-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" - integrity sha1-ektQio1bstYp1EcFb/TpyTFM89Q= +pkg-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= dependencies: - find-up "^1.0.0" + find-up "^2.1.0" pkg-dir@^3.0.0: version "3.0.0" @@ -6484,20 +6477,13 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.1.7, resolve@^1.3.2: +resolve@^1.1.7, resolve@^1.3.2, resolve@^1.5.0, resolve@^1.8.1, resolve@^1.9.0: version "1.10.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.0.tgz#3bdaaeaf45cc07f375656dfd2e54ed0810b101ba" integrity sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg== dependencies: path-parse "^1.0.6" -resolve@^1.5.0, resolve@^1.6.0, resolve@^1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" - integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA== - dependencies: - path-parse "^1.0.5" - restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" From 2a1aaf5f9c53255ed80e8f7942846f74378846f5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 1 Feb 2019 23:36:34 +0000 Subject: [PATCH 016/124] Bump eslint from 5.10.0 to 5.13.0 Bumps [eslint](https://github.com/eslint/eslint) from 5.10.0 to 5.13.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v5.10.0...v5.13.0) Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 115 ++++++++++++++++----------------------------------- 2 files changed, 36 insertions(+), 81 deletions(-) diff --git a/package.json b/package.json index 519c6d348..5c7e0814a 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "turbolinks": "^5.2.0" }, "devDependencies": { - "eslint": "^5.9.0", + "eslint": "^5.13.0", "eslint-config-standard": "^12.0.0", "eslint-plugin-import": "^2.14.0", "eslint-plugin-node": "^8.0.0", diff --git a/yarn.lock b/yarn.lock index ce70339ff..4389374cc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -967,7 +967,7 @@ ajv-keywords@^3.1.0: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a" integrity sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo= -ajv@^6.1.0, ajv@^6.5.5: +ajv@^6.1.0, ajv@^6.5.3, ajv@^6.5.5, ajv@^6.6.1: version "6.7.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.7.0.tgz#e3ce7bb372d6577bb1839f1dfdfcbf5ad2948d96" integrity sha512-RZXPviBTtfmtka9n9sy1N5M5b82CbxWIR6HIis4s3WQTXDJamc/0gpCWNGz6EWdWp4DOfjzJfhz/AS9zVPjjWg== @@ -977,16 +977,6 @@ ajv@^6.1.0, ajv@^6.5.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^6.5.3, ajv@^6.6.1: - version "6.6.1" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.6.1.tgz#6360f5ed0d80f232cc2b294c362d5dc2e538dd61" - integrity sha512-ZoJjft5B+EJBjUyu9C9Hc0OZyPZSSlOF+plzouTrg6UlA8f+e/n8NIgBFG/9tppJtpPWfthHakK7juJdNDODww== - dependencies: - fast-deep-equal "^2.0.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - almond@~0.3.1: version "0.3.3" resolved "https://registry.yarnpkg.com/almond/-/almond-0.3.3.tgz#a0e7c95ac7624d6417b4494b1e68bff693168a20" @@ -1507,13 +1497,6 @@ caller-callsite@^2.0.0: dependencies: callsites "^2.0.0" -caller-path@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" - integrity sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8= - dependencies: - callsites "^0.2.0" - caller-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" @@ -1521,16 +1504,16 @@ caller-path@^2.0.0: dependencies: caller-callsite "^2.0.0" -callsites@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" - integrity sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo= - callsites@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= +callsites@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.0.0.tgz#fb7eb569b72ad7a45812f93fd9430a3e410b3dd3" + integrity sha512-tWnkwu9YEq2uzlBDI4RcLn8jrFvF9AOi8PxDNU3hZZjJcjkcRAq3vCI+vZcg1SuxISDYe86k9VZFwAxDiJGoAw== + camelcase-keys@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" @@ -1595,7 +1578,7 @@ chalk@^1.1.1: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0, chalk@^2.4.2: +chalk@^2.0, chalk@^2.0.0, chalk@^2.1.0, chalk@^2.4.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -1604,15 +1587,6 @@ chalk@^2.0, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^2.0.0, chalk@^2.1.0, chalk@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" - integrity sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - chardet@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" @@ -2303,14 +2277,7 @@ debug@^3.1.0, debug@^3.2.5: dependencies: ms "^2.1.1" -debug@^4.0.1: - version "4.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87" - integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg== - dependencies: - ms "^2.1.1" - -debug@^4.1.0: +debug@^4.0.1, debug@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== @@ -2725,10 +2692,10 @@ eslint-visitor-keys@^1.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== -eslint@^5.9.0: - version "5.10.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.10.0.tgz#24adcbe92bf5eb1fc2d2f2b1eebe0c5e0713903a" - integrity sha512-HpqzC+BHULKlnPwWae9MaVZ5AXJKpkxCVXQHrFaRw3hbDj26V/9ArYM4Rr/SQ8pi6qUPLXSSXC4RBJlyq2Z2OQ== +eslint@^5.13.0: + version "5.13.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.13.0.tgz#ce71cc529c450eed9504530939aa97527861ede9" + integrity sha512-nqD5WQMisciZC5EHZowejLKQjWGuFS5c70fxqSKlnDME+oz9zmE8KTlX+lHSg+/5wsC/kf9Q9eMkC8qS3oM2fg== dependencies: "@babel/code-frame" "^7.0.0" ajv "^6.5.3" @@ -2747,6 +2714,7 @@ eslint@^5.9.0: glob "^7.1.2" globals "^11.7.0" ignore "^4.0.6" + import-fresh "^3.0.0" imurmurhash "^0.1.4" inquirer "^6.1.0" js-yaml "^3.12.0" @@ -2758,10 +2726,8 @@ eslint@^5.9.0: natural-compare "^1.4.0" optionator "^0.8.2" path-is-inside "^1.0.2" - pluralize "^7.0.0" progress "^2.0.0" regexpp "^2.0.1" - require-uncached "^1.0.3" semver "^5.5.1" strip-ansi "^4.0.0" strip-json-comments "^2.0.1" @@ -3366,16 +3332,11 @@ global-prefix@^1.0.1: is-windows "^1.0.1" which "^1.2.14" -globals@^11.1.0: +globals@^11.1.0, globals@^11.7.0: version "11.10.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.10.0.tgz#1e09776dffda5e01816b3bb4077c8b59c24eaa50" integrity sha512-0GZF1RiPKU97IHUO5TORo9w1PwrH/NBPl+fS7oMLdaTRiYmYbwK4NWoZWrAdd0/abG9R2BU+OiwyQpTpE6pdfQ== -globals@^11.7.0: - version "11.9.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.9.0.tgz#bde236808e987f290768a93d065060d78e6ab249" - integrity sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg== - globby@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" @@ -3672,6 +3633,14 @@ import-fresh@^2.0.0: caller-path "^2.0.0" resolve-from "^3.0.0" +import-fresh@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.0.0.tgz#a3d897f420cab0e671236897f75bc14b4885c390" + integrity sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + import-from@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-from/-/import-from-2.1.0.tgz#335db7f2a7affd53aaa471d4b8021dee36b7f3b1" @@ -4114,15 +4083,7 @@ js-levenshtein@^1.1.3: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@^3.12.0: - version "3.12.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" - integrity sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -js-yaml@^3.12.1, js-yaml@^3.9.0: +js-yaml@^3.12.0, js-yaml@^3.12.1, js-yaml@^3.9.0: version "3.12.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.1.tgz#295c8632a18a23e054cf5c9d3cecafe678167600" integrity sha512-um46hB9wNOKlwkHgiuyEVAybXBjwFUV0Z/RaHJblRd9DXltue9FTYvzCr9ErQrK9Adz5MU4gHWVaNUfdmrC8qA== @@ -5204,6 +5165,13 @@ parallel-transform@^1.1.0: inherits "^2.0.3" readable-stream "^2.1.5" +parent-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.0.tgz#df250bdc5391f4a085fb589dad761f5ad6b865b5" + integrity sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA== + dependencies: + callsites "^3.0.0" + parse-asn1@^5.0.0: version "5.1.3" resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.3.tgz#1600c6cc0727365d68b97f3aa78939e735a75204" @@ -5371,11 +5339,6 @@ pkg-dir@^3.0.0: dependencies: find-up "^3.0.0" -pluralize@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" - integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow== - pnp-webpack-plugin@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/pnp-webpack-plugin/-/pnp-webpack-plugin-1.2.1.tgz#cd9d698df2a6fcf7255093c1c9511adf65b9421b" @@ -6441,14 +6404,6 @@ require-main-filename@^1.0.1: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= -require-uncached@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" - integrity sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM= - dependencies: - caller-path "^0.1.0" - resolve-from "^1.0.0" - requires-port@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" @@ -6469,16 +6424,16 @@ resolve-dir@^1.0.0, resolve-dir@^1.0.1: expand-tilde "^2.0.0" global-modules "^1.0.0" -resolve-from@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" - integrity sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY= - resolve-from@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" integrity sha1-six699nWiBvItuZTM17rywoYh0g= +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" From 0f41280985347edf8dd1e792d877c45e5c389ce7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 1 Feb 2019 23:36:40 +0000 Subject: [PATCH 017/124] Bump rails from `eb1fc14` to `2ccbddb` Bumps [rails](https://github.com/rails/rails) from `eb1fc14` to `2ccbddb`. - [Release notes](https://github.com/rails/rails/releases) - [Commits](https://github.com/rails/rails/compare/eb1fc14d15c53de1c17534c958ddd588c913e203...2ccbddb48c96b0cda9641961541d7266591a3db7) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3a4d04604..4b536935a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/rails/rails.git - revision: eb1fc14d15c53de1c17534c958ddd588c913e203 + revision: 2ccbddb48c96b0cda9641961541d7266591a3db7 specs: actioncable (6.0.0.beta1) actionpack (= 6.0.0.beta1) From 1736328b35f4e10cb5561ade084d905af1c69a7c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 1 Feb 2019 23:36:42 +0000 Subject: [PATCH 018/124] Bump @coreui/coreui-free-bootstrap-admin-template Bumps [@coreui/coreui-free-bootstrap-admin-template](https://github.com/coreui/coreui-free-bootstrap-admin-template) from `90e6992` to `c31b402`. - [Release notes](https://github.com/coreui/coreui-free-bootstrap-admin-template/releases) - [Commits](https://github.com/coreui/coreui-free-bootstrap-admin-template/compare/90e69924556378eb06b871cee638675224dec348...c31b402c6e594110ead3984bea78c1216cc30dcb) Signed-off-by: dependabot[bot] --- yarn.lock | 66 +++++++++++++++++++++++-------------------------------- 1 file changed, 27 insertions(+), 39 deletions(-) diff --git a/yarn.lock b/yarn.lock index ce70339ff..834d6203d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -546,14 +546,6 @@ "@babel/helper-regex" "^7.0.0" regexpu-core "^4.1.3" -"@babel/polyfill@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.0.0.tgz#c8ff65c9ec3be6a1ba10113ebd40e8750fb90bff" - integrity sha512-dnrMRkyyr74CRelJwvgnnSUDh2ge2NCTyHVwpOdvRMHtJUyxLtMAfhBN3s64pY41zdw0kgiLPh6S20eb1NcX6Q== - dependencies: - core-js "^2.5.7" - regenerator-runtime "^0.11.1" - "@babel/polyfill@^7.2.5": version "7.2.5" resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.2.5.tgz#6c54b964f71ad27edddc567d065e57e87ed7fa7d" @@ -652,21 +644,22 @@ to-fast-properties "^2.0.0" "@coreui/coreui-free-bootstrap-admin-template@https://github.com/coreui/coreui-free-bootstrap-admin-template.git": - version "2.1.10" - resolved "https://github.com/coreui/coreui-free-bootstrap-admin-template.git#90e69924556378eb06b871cee638675224dec348" + version "2.1.11" + uid c31b402c6e594110ead3984bea78c1216cc30dcb + resolved "https://github.com/coreui/coreui-free-bootstrap-admin-template.git#c31b402c6e594110ead3984bea78c1216cc30dcb" dependencies: - "@coreui/coreui" "^2.1.3" + "@coreui/coreui" "^2.1.5" "@coreui/coreui-plugin-chartjs-custom-tooltips" "1.2.0" "@coreui/icons" "0.3.0" - bootstrap "4.1.3" + bootstrap "^4.2.1" chart.js "2.7.3" - core-js "^2.5.7" + core-js "^2.6.1" flag-icon-css "^3.2.1" font-awesome "4.7.0" jquery "3.3.1" pace-progress "1.0.2" - perfect-scrollbar "1.4.0" - popper.js "^1.14.5" + perfect-scrollbar "^1.4.0" + popper.js "^1.14.6" simple-line-icons "2.4.1" "@coreui/coreui-plugin-chartjs-custom-tooltips@1.2.0": @@ -681,14 +674,14 @@ resolved "https://registry.yarnpkg.com/@coreui/coreui-plugin-npm-postinstall/-/coreui-plugin-npm-postinstall-1.0.2.tgz#6daeb2ec786580d9c0849b05bc3e8d0222d5c463" integrity sha512-yeeoWp+bNS84nP1977Y8UCiQ9pssO+f4QuVj3i0/gYZFjjvOgxx0dnyWhtowD5sLYnCRMPlPpqyjwXze3SlkYg== -"@coreui/coreui@^2.1.3": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@coreui/coreui/-/coreui-2.1.4.tgz#6b3c091658a07de8248dfa1135a10e7e2d921506" - integrity sha512-Zy+yXaAYFuejYRkz/q5WdKlMEN5UdAmwqWMh9PWT0Zv+PUjIwRn5VPwppOPB2cTVLRSfGwjcp0wxlXKzJNwVTQ== +"@coreui/coreui@^2.1.5": + version "2.1.6" + resolved "https://registry.yarnpkg.com/@coreui/coreui/-/coreui-2.1.6.tgz#e6219297ad74baf9ca9634225b448f5240848e6f" + integrity sha512-04uY01hOXOaED85U/3IrBQpstC6wEE7fOft7nybuFy7uikTgreep6dWeNflKzWbIAMHQRwi5G0B4ZKNhgHG86w== dependencies: - "@babel/polyfill" "^7.0.0" + "@babel/polyfill" "^7.2.5" "@coreui/coreui-plugin-npm-postinstall" "^1.0.2" - bootstrap "^4.1.3" + bootstrap "^4.2.1" "@coreui/icons@0.3.0": version "0.3.0" @@ -1324,10 +1317,10 @@ boolbase@^1.0.0, boolbase@~1.0.0: resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= -bootstrap@4.1.3, bootstrap@^4.1.3: - version "4.1.3" - resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.1.3.tgz#0eb371af2c8448e8c210411d0cb824a6409a12be" - integrity sha512-rDFIzgXcof0jDyjNosjv4Sno77X4KuPeFxG2XZZv1/Kc8DRVGVADdoQyyOVDwPqL36DDmtCQbrpMCqvpPLJQ0w== +bootstrap@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.2.1.tgz#8f8bdca024dbf0e8644da32e918c8a03a90a5757" + integrity sha512-tt/7vIv3Gm2mnd/WeDx36nfGGHleil0Wg8IeB7eMrVkY0fZ5iTaBisSh8oNANc2IBsCc6vCgCNTIM/IEN0+50Q== brace-expansion@^1.1.7: version "1.1.11" @@ -1956,10 +1949,10 @@ copy-descriptor@^0.1.0: resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= -core-js@^2.5.7: - version "2.6.0" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.0.tgz#1e30793e9ee5782b307e37ffa22da0eacddd84d4" - integrity sha512-kLRC6ncVpuEW/1kwrOXYX6KQASCVtrh1gQr/UiaVgFlf9WE5Vp+lNe5+h3LuMr5PAucWnnEXwH0nQHRH/gpGtw== +core-js@^2.5.7, core-js@^2.6.1: + version "2.6.3" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.3.tgz#4b70938bdffdaf64931e66e2db158f0892289c49" + integrity sha512-l00tmFFZOBHtYhN4Cz7k32VM7vTn3rE2ANjQDxdEN6zmXZ/xq1jQuutnmHvMG1ZJ7xd72+TA5YpUK8wz3rWsfQ== core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" @@ -5325,7 +5318,7 @@ pbkdf2@^3.0.3: safe-buffer "^5.0.1" sha.js "^2.4.8" -perfect-scrollbar@1.4.0: +perfect-scrollbar@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/perfect-scrollbar/-/perfect-scrollbar-1.4.0.tgz#5d014ef9775e1f43058a1dbae9ed1daf0e7091f1" integrity sha512-/2Sk/khljhdrsamjJYS5NjrH+GKEHEwh7zFSiYyxROyYKagkE4kSn2zDQDRTOMo8mpT2jikxx6yI1dG7lNP/hw== @@ -5383,10 +5376,10 @@ pnp-webpack-plugin@^1.2.1: dependencies: ts-pnp "^1.0.0" -popper.js@^1.14.5: - version "1.14.6" - resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.14.6.tgz#ab20dd4edf9288b8b3b6531c47c361107b60b4b0" - integrity sha512-AGwHGQBKumlk/MDfrSOf0JHhJCImdDMcGNoqKmKkU+68GFazv3CQ6q9r7Ja1sKDZmYWTckY/uLyEznheTDycnA== +popper.js@^1.14.6: + version "1.14.7" + resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.14.7.tgz#e31ec06cfac6a97a53280c3e55e4e0c860e7738e" + integrity sha512-4q1hNvoUre/8srWsH7hnoSJ5xVmIL4qgz+s4qf2TnJIMyZFUFMGH+9vE7mXynAlHSZ/NdTmmow86muD0myUkVQ== portfinder@^1.0.9: version "1.0.20" @@ -6294,11 +6287,6 @@ regenerate@^1.2.1, regenerate@^1.4.0: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== -regenerator-runtime@^0.11.1: - version "0.11.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" - integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== - regenerator-runtime@^0.12.0: version "0.12.1" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz#fa1a71544764c036f8c49b13a08b2594c9f8a0de" From 04405673c6d1e61e5fe1024cd869204df65e23df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 1 Feb 2019 23:36:58 +0000 Subject: [PATCH 019/124] Bump chalk from 2.4.1 to 2.4.2 Bumps [chalk](https://github.com/chalk/chalk) from 2.4.1 to 2.4.2. - [Release notes](https://github.com/chalk/chalk/releases) - [Commits](https://github.com/chalk/chalk/compare/v2.4.1...v2.4.2) Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 519c6d348..100e2d32a 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "@rails/activestorage": "^6.0.0-alpha", "@rails/ujs": "^6.0.0-alpha", "@rails/webpacker": "https://github.com/rails/webpacker", - "chalk": "^2.4.1", + "chalk": "^2.4.2", "flatpickr": "^4.5.2", "jquery.maskedinput": "^1.4.1", "select2": "^4.0.6-rc.1", diff --git a/yarn.lock b/yarn.lock index ce70339ff..168c8d91e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1595,7 +1595,7 @@ chalk@^1.1.1: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0, chalk@^2.4.2: +chalk@^2.0, chalk@^2.0.0, chalk@^2.1.0, chalk@^2.4.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -1604,15 +1604,6 @@ chalk@^2.0, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^2.0.0, chalk@^2.1.0, chalk@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" - integrity sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - chardet@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" From 4e1eaf3dd54529b7865168545d02f0d1b32f9272 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 1 Feb 2019 23:41:13 +0000 Subject: [PATCH 020/124] Bump @rails/webpacker from `69a6fc1` to `9e671a3` Bumps [@rails/webpacker](https://github.com/rails/webpacker) from `69a6fc1` to `9e671a3`. - [Release notes](https://github.com/rails/webpacker/releases) - [Commits](https://github.com/rails/webpacker/compare/69a6fc102bcab1aac55523a2653919e8fe2f48cf...9e671a3ebe368cfdc624309a9b4a55e998f87186) Signed-off-by: dependabot[bot] --- yarn.lock | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yarn.lock b/yarn.lock index f46194bf1..041fae5ed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -718,8 +718,9 @@ integrity sha512-6AZcab77PeJQv8RdfryDYh6tAGcndcRnqYaciLiFclADBPFE9Ip978pGCPiKcKGgCg8S1P1nZII+1GNIrUrx+g== "@rails/webpacker@https://github.com/rails/webpacker": - version "4.0.0-rc.5" - resolved "https://github.com/rails/webpacker#69a6fc102bcab1aac55523a2653919e8fe2f48cf" + version "4.0.0-rc.7" + uid "9e671a3ebe368cfdc624309a9b4a55e998f87186" + resolved "https://github.com/rails/webpacker#9e671a3ebe368cfdc624309a9b4a55e998f87186" dependencies: "@babel/core" "^7.2.2" "@babel/plugin-proposal-class-properties" "^7.2.3" From 5221bb3f18d09aa3ceaacd58f15a12efccfaec68 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Sat, 2 Feb 2019 11:09:46 +0300 Subject: [PATCH 021/124] =?UTF-8?q?Sadece=20senato=20kararlar=C4=B1n=C4=B1?= =?UTF-8?q?=20getir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/unit.rb | 1 + app/views/calendar_management/calendars/_form.html.erb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/unit.rb b/app/models/unit.rb index 84a1b14a0..d95c019d8 100644 --- a/app/models/unit.rb +++ b/app/models/unit.rb @@ -73,6 +73,7 @@ class Unit < ApplicationRecord scope :administratives, -> { where(unit_type: UnitType.administrative) } scope :programs, -> { where(unit_type: UnitType.program) } scope :without_programs, -> { where.not(unit_type: UnitType.program) } + scope :senates, -> { where(name: 'Senato') } scope :academic, -> { faculties diff --git a/app/views/calendar_management/calendars/_form.html.erb b/app/views/calendar_management/calendars/_form.html.erb index 8467ccc3c..faeb37447 100644 --- a/app/views/calendar_management/calendars/_form.html.erb +++ b/app/views/calendar_management/calendars/_form.html.erb @@ -13,7 +13,7 @@
<%= f.association :committee_decisions, - collection: CommitteeDecision.all, label_method: :decision_no %> + collection: Unit.senates.first.try(:decisions), label_method: :decision_no %>
<%= f.input :timezone, required: true, From 0f348484d37d0aae18de00148b9cbc22790cdcf4 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Sat, 2 Feb 2019 11:24:26 +0300 Subject: [PATCH 022/124] =?UTF-8?q?Kalanlar=C4=B1=20temizle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/calendar_management/calendars_controller.rb | 2 +- app/views/calendar_management/calendars/_flatpickr.html.erb | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/calendar_management/calendars_controller.rb b/app/controllers/calendar_management/calendars_controller.rb index 71b3db8f0..e4c745957 100644 --- a/app/controllers/calendar_management/calendars_controller.rb +++ b/app/controllers/calendar_management/calendars_controller.rb @@ -70,7 +70,7 @@ def set_calendar def calendar_params params.require(:calendar) .permit( - :name, :senate_decision_date, :senate_decision_no, :description, :timezone, :academic_term_id, + :name, :description, :timezone, :academic_term_id, unit_ids: [], committee_decision_ids: [], calendar_events_attributes: %i[ id calendar_event_type_id start_time end_time location timezone visible _destroy ] diff --git a/app/views/calendar_management/calendars/_flatpickr.html.erb b/app/views/calendar_management/calendars/_flatpickr.html.erb index a046fd80f..5eeca4d63 100644 --- a/app/views/calendar_management/calendars/_flatpickr.html.erb +++ b/app/views/calendar_management/calendars/_flatpickr.html.erb @@ -1,5 +1,4 @@ diff --git a/app/views/course_management/available_course_groups/_lecturer_fields.html.erb b/app/views/course_management/available_course_groups/_lecturer_fields.html.erb index 116f5e3b4..bb7af1d9b 100644 --- a/app/views/course_management/available_course_groups/_lecturer_fields.html.erb +++ b/app/views/course_management/available_course_groups/_lecturer_fields.html.erb @@ -1,19 +1,17 @@ -
-
-
-
-
-
- <%= f.association :lecturer, collection: @lecturers, label_method: lambda { |lecturer| full_name(lecturer) } %> -
-
- <%= f.input :coordinator, collection: [[t('yes'), true] ,[t('no'), false]] %> -
+
+
+
+
+
+ <%= f.association :lecturer, collection: @lecturers, label_method: lambda { |lecturer| full_name(lecturer) } %> +
+
+ <%= f.input :coordinator, collection: [[t('yes'), true] ,[t('no'), false]], required: true %>
- +
+
diff --git a/config/locales/controllers/course_management/available_course_groups.en.yml b/config/locales/controllers/course_management/available_course_groups.en.yml index e371d9302..e3d4e0c3a 100644 --- a/config/locales/controllers/course_management/available_course_groups.en.yml +++ b/config/locales/controllers/course_management/available_course_groups.en.yml @@ -7,6 +7,12 @@ en: lecturer: Lecturer title: Title coordinator: Coordinator + errors: + models: + available_course_group: + attributes: + lecturers: + cannot_empty: Lecturer field cannot pass empty. course_management: available_course_groups: create: diff --git a/config/locales/controllers/course_management/available_course_groups.tr.yml b/config/locales/controllers/course_management/available_course_groups.tr.yml index 4a24786f8..6ff461fc4 100644 --- a/config/locales/controllers/course_management/available_course_groups.tr.yml +++ b/config/locales/controllers/course_management/available_course_groups.tr.yml @@ -7,6 +7,12 @@ tr: lecturer: Öğretim Elemanı title: Ünvan coordinator: Koordinatör + errors: + models: + available_course_group: + attributes: + lecturers: + cannot_empty: Öğretim elemanı alanı boş geçilemez. course_management: available_course_groups: create: From 3f854bfeb195bf526243b6e3ce73bf7b6fa6ff4f Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 5 Feb 2019 14:54:26 +0300 Subject: [PATCH 045/124] Refactor course evaluation type validator --- app/validators/course_evaluation_type_validator.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/validators/course_evaluation_type_validator.rb b/app/validators/course_evaluation_type_validator.rb index bd5861f43..503fd4483 100644 --- a/app/validators/course_evaluation_type_validator.rb +++ b/app/validators/course_evaluation_type_validator.rb @@ -3,7 +3,8 @@ class CourseEvaluationTypeValidator < ActiveModel::Validator def validate(record) @evaluation_type = record - check_percentage(@evaluation_type.course_assessment_methods.map(&:percentage)) + assessment_methods(record.course_assessment_methods) + check_percentage(@assessments.map(&:percentage)) end def check_percentage(percentages) @@ -12,6 +13,11 @@ def check_percentage(percentages) @evaluation_type.errors[:base] << message('invalid_percentages') end + def assessment_methods(assessment_methods) + @assessments = + assessment_methods.map { |method| method unless method.marked_for_destruction? }.compact + end + private def message(key) From 4694af71da3e6696169383f3da114d389b7eb8ff Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 5 Feb 2019 14:55:13 +0300 Subject: [PATCH 046/124] Add least one coordinator to available course group --- .../available_course_lecturer_validator.rb | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/app/validators/available_course_lecturer_validator.rb b/app/validators/available_course_lecturer_validator.rb index b8d5798fe..f12e9d5a7 100644 --- a/app/validators/available_course_lecturer_validator.rb +++ b/app/validators/available_course_lecturer_validator.rb @@ -2,9 +2,25 @@ class AvailableCourseLecturerValidator < ActiveModel::Validator def validate(record) - lecturers = record.group.lecturers.reject { |lecturer| lecturer.equal?(record) } - return unless record.coordinator && lecturers.map(&:coordinator).any? + lecturers(record.group.lecturers.reject { |lecturer| lecturer.equal?(record) }) + + return if not_exist_coordinator?(record, @lecturers) || any_coordinator?(record, @lecturers) record.errors[:coordinator] << I18n.t('coordinator', scope: %i[validators available_course_lecturer]) end + + def lecturers(course_lecturers) + @lecturers = + course_lecturers.map { |lecturer| lecturer unless lecturer.marked_for_destruction? }.compact + end + + private + + def any_coordinator?(record, lecturers) + !record.coordinator && lecturers.map(&:coordinator).any? + end + + def not_exist_coordinator?(record, lecturers) + record.coordinator && lecturers.map(&:coordinator).none? + end end From 18eb02bd409868898e58838c7250fc2df2cbae9d Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 5 Feb 2019 14:56:00 +0300 Subject: [PATCH 047/124] Fix available course group controller test --- .../available_course_groups_controller_test.rb | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/controllers/course_management/available_course_groups_controller_test.rb b/test/controllers/course_management/available_course_groups_controller_test.rb index ddc08204c..22f3a0c8c 100644 --- a/test/controllers/course_management/available_course_groups_controller_test.rb +++ b/test/controllers/course_management/available_course_groups_controller_test.rb @@ -19,7 +19,13 @@ class AvailableCourseGroupsControllerTest < ActionDispatch::IntegrationTest assert_difference('AvailableCourseGroup.count') do post available_course_available_course_groups_path(@available_course), params: { available_course_group: { - name: 'Group 4', quota: 10 + name: 'Group 4', quota: 10, + lecturers_attributes: { + '0' => { + lecturer_id: employees(:serhat_active).id, + coordinator: true + } + } } } end @@ -42,7 +48,13 @@ class AvailableCourseGroupsControllerTest < ActionDispatch::IntegrationTest group = AvailableCourseGroup.last patch available_course_available_course_group_path(group.available_course, group), params: { available_course_group: { - name: 'Group 5', quota: 15 + name: 'Group 5', quota: 15, + lecturers_attributes: { + '0' => { + lecturer_id: employees(:chief_john).id, + coordinator: true + } + } } } From 88dfa60ce8125385806ed606cb5610714eb0b137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Recai=20Okta=C5=9F?= Date: Tue, 5 Feb 2019 19:10:50 +0300 Subject: [PATCH 048/124] Upgrade deployment container to 1.13.1 which fixes #765 (Rollbar error) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8b16d1f4c..9e64baf20 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ondokuz/ruby-stretch:1.12.1 +FROM ondokuz/ruby-stretch:1.13.1 ENV PATH=/app/bin:$PATH From 4df4f275a31875e53e9b3f3222f11d5e61445e31 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 6 Feb 2019 00:57:14 +0000 Subject: [PATCH 049/124] Bump pagy from 1.3.2 to 1.3.3 Bumps [pagy](https://github.com/ddnexus/pagy) from 1.3.2 to 1.3.3. - [Release notes](https://github.com/ddnexus/pagy/releases) - [Changelog](https://github.com/ddnexus/pagy/blob/master/CHANGELOG.md) - [Commits](https://github.com/ddnexus/pagy/compare/1.3.2...1.3.3) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 96ddb20bc..65c80bd19 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -259,7 +259,7 @@ GEM nokogiri (1.10.1) mini_portile2 (~> 2.4.0) orm_adapter (0.5.0) - pagy (1.3.2) + pagy (1.3.3) parallel (1.13.0) parser (2.6.0.0) ast (~> 2.4.0) From 5192550fe7a693f654bdcffda189b449aa5658e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 6 Feb 2019 00:57:58 +0000 Subject: [PATCH 050/124] Bump rollbar from `bb56b6f` to `8b49f43` Bumps [rollbar](https://github.com/rollbar/rollbar-gem) from `bb56b6f` to `8b49f43`. - [Release notes](https://github.com/rollbar/rollbar-gem/releases) - [Commits](https://github.com/rollbar/rollbar-gem/compare/bb56b6faedf53e865c494a5267a710ba0b886bc4...8b49f438730876c21cdafe0d2f1db0d7ef4003ff) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 96ddb20bc..9eb2e81a8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -98,7 +98,7 @@ GIT GIT remote: https://github.com/rollbar/rollbar-gem.git - revision: bb56b6faedf53e865c494a5267a710ba0b886bc4 + revision: 8b49f438730876c21cdafe0d2f1db0d7ef4003ff specs: rollbar (2.18.2) multi_json From 0f0e2e4b569e829d7a6aee8159d0bf673be3116b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 6 Feb 2019 00:59:46 +0000 Subject: [PATCH 051/124] Bump rails from `00f7dba` to `9483cde` Bumps [rails](https://github.com/rails/rails) from `00f7dba` to `9483cde`. - [Release notes](https://github.com/rails/rails/releases) - [Commits](https://github.com/rails/rails/compare/00f7dbab7590c6ffd188da186067eb269e11580f...9483cdee0a3ed9c686e338f079b0e369597b1211) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 96ddb20bc..164769358 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/rails/rails.git - revision: 00f7dbab7590c6ffd188da186067eb269e11580f + revision: 9483cdee0a3ed9c686e338f079b0e369597b1211 specs: actioncable (6.0.0.beta1) actionpack (= 6.0.0.beta1) From 48737bdb8cd8f878b80bad77a71f3394adaae4d1 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 6 Feb 2019 13:41:48 +0300 Subject: [PATCH 052/124] Change method name --- app/validators/available_course_lecturer_validator.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/validators/available_course_lecturer_validator.rb b/app/validators/available_course_lecturer_validator.rb index f12e9d5a7..cb89316ee 100644 --- a/app/validators/available_course_lecturer_validator.rb +++ b/app/validators/available_course_lecturer_validator.rb @@ -4,7 +4,7 @@ class AvailableCourseLecturerValidator < ActiveModel::Validator def validate(record) lecturers(record.group.lecturers.reject { |lecturer| lecturer.equal?(record) }) - return if not_exist_coordinator?(record, @lecturers) || any_coordinator?(record, @lecturers) + return if none_coordinator?(record, @lecturers) || any_coordinator?(record, @lecturers) record.errors[:coordinator] << I18n.t('coordinator', scope: %i[validators available_course_lecturer]) end @@ -20,7 +20,7 @@ def any_coordinator?(record, lecturers) !record.coordinator && lecturers.map(&:coordinator).any? end - def not_exist_coordinator?(record, lecturers) + def none_coordinator?(record, lecturers) record.coordinator && lecturers.map(&:coordinator).none? end end From 1d13a8793030d10982fbd6c8efac1b162e1d432b Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 7 Feb 2019 10:03:31 +0300 Subject: [PATCH 053/124] Fix curriculum controller test --- .../course_management/curriculums_controller_test.rb | 2 +- test/fixtures/curriculums.yml | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/test/controllers/course_management/curriculums_controller_test.rb b/test/controllers/course_management/curriculums_controller_test.rb index baeabf102..79fd6f617 100644 --- a/test/controllers/course_management/curriculums_controller_test.rb +++ b/test/controllers/course_management/curriculums_controller_test.rb @@ -70,7 +70,7 @@ class CurriculumsControllerTest < ActionDispatch::IntegrationTest test 'should destroy curriculum' do assert_difference('Curriculum.count', -1) do - delete curriculum_path(Curriculum.last) + delete curriculum_path(curriculums(:curriculum_to_delete)) end assert_redirected_to index_path diff --git a/test/fixtures/curriculums.yml b/test/fixtures/curriculums.yml index d21a84821..25634e1d9 100644 --- a/test/fixtures/curriculums.yml +++ b/test/fixtures/curriculums.yml @@ -16,4 +16,9 @@ three: bilgisayar_muhendisligi_mufredati: name: Bilgisayar Mühendiliği Müfredatı unit: bilgisayar_muhendisligi - status: active \ No newline at end of file + status: active + +curriculum_to_delete: + name: Test Müfredat + unit: cbu + status: passive From 337152d1064f32a5a2bade760b2aafa6bab4d612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Recai=20Okta=C5=9F?= Date: Fri, 8 Feb 2019 09:13:09 +0300 Subject: [PATCH 054/124] Bump base container version to 1.15.1 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9e64baf20..3d24cdfa6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ondokuz/ruby-stretch:1.13.1 +FROM ondokuz/ruby-stretch:1.15.1 ENV PATH=/app/bin:$PATH From 9e28cf8d9c237c106aff9b1b00181a999a956514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Recai=20Okta=C5=9F?= Date: Fri, 8 Feb 2019 09:37:17 +0300 Subject: [PATCH 055/124] Remove foreman dependency --- Vagrantfile | 10 ++++++++++ lib/scripts/deploy.sh | 8 -------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 60ba86b98..4475664b4 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -23,6 +23,16 @@ Vagrant.configure('2') do |config| dev.vm.provision 'shell', name: 'environment', env: env, path: 'lib/scripts/environment.sh' dev.vm.provision 'shell', name: 'deploy', env: env, path: 'lib/scripts/deploy.sh' + + paas.trigger.after :up do |trigger| + trigger.info = 'Starting app...' + trigger.run = { inline: 'app start' } + end + + paas.trigger.before :halt do |trigger| + trigger.info = 'Stopping app...' + trigger.run = { inline: 'app stop' } + end end config.vm.define 'paas', autostart: false do |paas| diff --git a/lib/scripts/deploy.sh b/lib/scripts/deploy.sh index b30191d65..ecd2bb378 100644 --- a/lib/scripts/deploy.sh +++ b/lib/scripts/deploy.sh @@ -28,12 +28,6 @@ else touch "$environment" fi -command -v bundle &>/dev/null || gem install bundler - -gem install foreman -foreman export -p3000 --app "$application" --user "$operator" --env "$environment" systemd /etc/systemd/system/ -systemctl enable "$application".target - systemctl enable --now postgresql systemctl enable --now redis-server @@ -52,5 +46,3 @@ sudo -EH -u "$operator" sh -xs <<-'EOF' bin/rails db:migrate bin/rails db:seed EOF - -systemctl start "$application".target From f7c0f3ff318079b20f9c5148f3681c2fdc6dad1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Recai=20Okta=C5=9F?= Date: Sat, 9 Feb 2019 01:04:14 +0300 Subject: [PATCH 056/124] Fix triggers --- Vagrantfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 4475664b4..a58c5499c 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,6 +1,6 @@ # frozen_string_literal: true -Vagrant.configure('2') do |config| +Vagrant.configure('2') do |config| # rubocop:disable Metrics/BlockLength env = {} if ENV['LOCAL_CACHE_DIR'] @@ -24,14 +24,14 @@ Vagrant.configure('2') do |config| dev.vm.provision 'shell', name: 'environment', env: env, path: 'lib/scripts/environment.sh' dev.vm.provision 'shell', name: 'deploy', env: env, path: 'lib/scripts/deploy.sh' - paas.trigger.after :up do |trigger| + dev.trigger.after :up do |trigger| trigger.info = 'Starting app...' - trigger.run = { inline: 'app start' } + trigger.run_remote = { inline: 'app start' } end - paas.trigger.before :halt do |trigger| + dev.trigger.before :halt do |trigger| trigger.info = 'Stopping app...' - trigger.run = { inline: 'app stop' } + trigger.run_remote = { inline: 'app stop' } end end From 18a78b27c6e516904ebaddf605fa0e6c422887be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Recai=20Okta=C5=9F?= Date: Sat, 9 Feb 2019 01:04:28 +0300 Subject: [PATCH 057/124] Apply workaround for Yarn errors --- lib/scripts/deploy.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/scripts/deploy.sh b/lib/scripts/deploy.sh index ecd2bb378..1326e8c26 100644 --- a/lib/scripts/deploy.sh +++ b/lib/scripts/deploy.sh @@ -39,7 +39,17 @@ EOF sudo -EH -u "$operator" sh -xs <<-'EOF' bundle install -j4 --path "${BUNDLE_PATH:-vendor/bundle}" - [ -z $NODE_MODULES_FOLDER ] || yarn config set -- --modules-folder "$NODE_MODULES_FOLDER" + # XXX: ./node_modules seems to be an almost constant location. The ugly + # kludge below applies a brute force solution for using a different + # node_modules path (via NODE_MODULES_FOLDER environment variable) + # without playing with (buggy or unsupported) configuration settings. + + # Overwrite existing node_modules if it's a symlink + [[ -z $NODE_MODULES_FOLDER ]] || [[ ! -L node_modules ]] || ln -sf "$NODE_MODULES_FOLDER" node_modules + + # Avoid creating a node_modules symlink if a node_module file/directory already exists + [[ -z $NODE_MODULES_FOLDER ]] || [[ -e node_modules ]] || ln -s "$NODE_MODULES_FOLDER" node_modules + yarn install bin/rails db:create From 18eb16027e6ff2ab21c44ebf346364f1de87a3bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Recai=20Okta=C5=9F?= Date: Sat, 9 Feb 2019 01:06:37 +0300 Subject: [PATCH 058/124] Arrange environment variables --- lib/scripts/environment.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/scripts/environment.sh b/lib/scripts/environment.sh index 02ebb7704..ed52440e4 100644 --- a/lib/scripts/environment.sh +++ b/lib/scripts/environment.sh @@ -20,13 +20,17 @@ environment=/etc/environment if [[ -d ${LOCAL_CACHE_DIR:-} ]]; then cat >"$environment" <<-EOF - BUNDLE_PATH='$LOCAL_CACHE_DIR/bundle' - BUNDLE_APP_CONFIG='$LOCAL_CACHE_DIR/bundle' + LOCAL_CACHE_DIR_BUNDLE='$LOCAL_CACHE_DIR/bundle' + LOCAL_CACHE_DIR_BOOTSNAP='$LOCAL_CACHE_DIR/bootsnap' + LOCAL_CACHE_DIR_YARN='$LOCAL_CACHE_DIR/yarn' - BOOTSNAP_CACHE_DIR='$LOCAL_CACHE_DIR/bootsnap' + BUNDLE_PATH=\$LOCAL_CACHE_DIR_BUNDLE + BUNDLE_APP_CONFIG=\$LOCAL_CACHE_DIR_BUNDLE - YARN_CACHE_FOLDER='$LOCAL_CACHE_DIR/yarn/cache' - NODE_MODULES_FOLDER='$LOCAL_CACHE_DIR/yarn/node_modules' + BOOTSNAP_CACHE_DIR=\$LOCAL_CACHE_DIR_BOOTSNAP + + YARN_CACHE_FOLDER=\$LOCAL_CACHE_DIR_YARN/cache + NODE_MODULES_FOLDER=\$LOCAL_CACHE_DIR_YARN/node_modules EOF fi From 4c432f16cb73b6f6e386b4c5181d2d776dbd424a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Recai=20Okta=C5=9F?= Date: Sat, 9 Feb 2019 01:14:51 +0300 Subject: [PATCH 059/124] Use bash --- lib/scripts/deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/scripts/deploy.sh b/lib/scripts/deploy.sh index 1326e8c26..05fd5906d 100644 --- a/lib/scripts/deploy.sh +++ b/lib/scripts/deploy.sh @@ -36,7 +36,7 @@ sudo -EH -u postgres psql <<-EOF ALTER ROLE $application LOGIN CREATEDB SUPERUSER; EOF -sudo -EH -u "$operator" sh -xs <<-'EOF' +sudo -EH -u "$operator" bash -xs <<-'EOF' bundle install -j4 --path "${BUNDLE_PATH:-vendor/bundle}" # XXX: ./node_modules seems to be an almost constant location. The ugly From 70c35b009feaf85ab3b4b269f1818380e76362c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Recai=20Okta=C5=9F?= Date: Sat, 9 Feb 2019 01:56:38 +0300 Subject: [PATCH 060/124] Fix variables --- lib/scripts/environment.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/scripts/environment.sh b/lib/scripts/environment.sh index ed52440e4..6e98fb52a 100644 --- a/lib/scripts/environment.sh +++ b/lib/scripts/environment.sh @@ -19,18 +19,22 @@ operator=${operator:-$(id -rnu 1000 2>/dev/null)} environment=/etc/environment if [[ -d ${LOCAL_CACHE_DIR:-} ]]; then + LOCAL_CACHE_DIR_BUNDLE=$LOCAL_CACHE_DIR/bundle + LOCAL_CACHE_DIR_BOOTSNAP=$LOCAL_CACHE_DIR/bootsnap + LOCAL_CACHE_DIR_YARN=$LOCAL_CACHE_DIR/yarn + cat >"$environment" <<-EOF - LOCAL_CACHE_DIR_BUNDLE='$LOCAL_CACHE_DIR/bundle' - LOCAL_CACHE_DIR_BOOTSNAP='$LOCAL_CACHE_DIR/bootsnap' - LOCAL_CACHE_DIR_YARN='$LOCAL_CACHE_DIR/yarn' + LOCAL_CACHE_DIR_BUNDLE=$LOCAL_CACHE_DIR_BUNDLE + LOCAL_CACHE_DIR_BOOTSNAP=$LOCAL_CACHE_DIR_BOOTSNAP + LOCAL_CACHE_DIR_YARN=$LOCAL_CACHE_DIR_YARN - BUNDLE_PATH=\$LOCAL_CACHE_DIR_BUNDLE - BUNDLE_APP_CONFIG=\$LOCAL_CACHE_DIR_BUNDLE + BUNDLE_PATH=$LOCAL_CACHE_DIR_BUNDLE + BUNDLE_APP_CONFIG=$LOCAL_CACHE_DIR_BUNDLE - BOOTSNAP_CACHE_DIR=\$LOCAL_CACHE_DIR_BOOTSNAP + BOOTSNAP_CACHE_DIR=$LOCAL_CACHE_DIR_BOOTSNAP - YARN_CACHE_FOLDER=\$LOCAL_CACHE_DIR_YARN/cache - NODE_MODULES_FOLDER=\$LOCAL_CACHE_DIR_YARN/node_modules + YARN_CACHE_FOLDER=$LOCAL_CACHE_DIR_YARN/cache + NODE_MODULES_FOLDER=$LOCAL_CACHE_DIR_YARN/node_modules EOF fi From 52ef2a4aa4d0427ebcbb377089a8c8692d1f6003 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Recai=20Okta=C5=9F?= Date: Sat, 9 Feb 2019 10:08:40 +0300 Subject: [PATCH 061/124] Fix Yarn hack logic --- lib/scripts/deploy.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/scripts/deploy.sh b/lib/scripts/deploy.sh index 05fd5906d..3656f3be1 100644 --- a/lib/scripts/deploy.sh +++ b/lib/scripts/deploy.sh @@ -44,11 +44,16 @@ sudo -EH -u "$operator" bash -xs <<-'EOF' # node_modules path (via NODE_MODULES_FOLDER environment variable) # without playing with (buggy or unsupported) configuration settings. - # Overwrite existing node_modules if it's a symlink - [[ -z $NODE_MODULES_FOLDER ]] || [[ ! -L node_modules ]] || ln -sf "$NODE_MODULES_FOLDER" node_modules + if [[ -n ${NODE_MODULES_FOLDER:-} ]]; then + # Create the real node_modules folder if not exist + mkdir -p "$NODE_MODULES_FOLDER" - # Avoid creating a node_modules symlink if a node_module file/directory already exists - [[ -z $NODE_MODULES_FOLDER ]] || [[ -e node_modules ]] || ln -s "$NODE_MODULES_FOLDER" node_modules + # Remove an existing node_modules symlink + [[ ! -L node_modules ]] || rm -f node_modules + + # Create node_modules symlink unless a node_module file/directory already exists + [[ -e node_modules ]] || ln -s "$NODE_MODULES_FOLDER" node_modules + fi yarn install From 44063cda12f8e8cee4f0e99269171670a636c823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Recai=20Okta=C5=9F?= Date: Sat, 9 Feb 2019 10:11:51 +0300 Subject: [PATCH 062/124] Add reload trigger --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index a58c5499c..bba282f39 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -24,7 +24,7 @@ Vagrant.configure('2') do |config| # rubocop:disable Metrics/BlockLength dev.vm.provision 'shell', name: 'environment', env: env, path: 'lib/scripts/environment.sh' dev.vm.provision 'shell', name: 'deploy', env: env, path: 'lib/scripts/deploy.sh' - dev.trigger.after :up do |trigger| + dev.trigger.after [:up, :reload] do |trigger| trigger.info = 'Starting app...' trigger.run_remote = { inline: 'app start' } end From 05246179211226c36c56caa8e24dc87128aca88c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Recai=20Okta=C5=9F?= Date: Sat, 9 Feb 2019 10:25:16 +0300 Subject: [PATCH 063/124] Add DEPLOY_SKIP_SEED variable to skip db:seed step on deploy --- Vagrantfile | 10 ++++++---- lib/scripts/deploy.sh | 3 ++- lib/scripts/environment.sh | 8 ++++---- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index bba282f39..e5e61a914 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,15 +1,17 @@ # frozen_string_literal: true Vagrant.configure('2') do |config| # rubocop:disable Metrics/BlockLength - env = {} + env = { + 'deploy_skip_seed' => ENV['DEPLOY_SKIP_SEED'] + } if ENV['LOCAL_CACHE_DIR'] FileUtils.mkdir_p ENV['LOCAL_CACHE_DIR'] unless Dir.exist?(ENV['LOCAL_CACHE_DIR']) - app_cache_dir = '/var/cache/app' + deploy_cache_dir = '/var/cache/app' - config.vm.synced_folder ENV['LOCAL_CACHE_DIR'], app_cache_dir + config.vm.synced_folder ENV['LOCAL_CACHE_DIR'], deploy_cache_dir - env['LOCAL_CACHE_DIR'] = app_cache_dir + env['deploy_cache_dir'] = deploy_cache_dir end config.vm.define 'dev', primary: true do |dev| diff --git a/lib/scripts/deploy.sh b/lib/scripts/deploy.sh index 3656f3be1..8219d3a31 100644 --- a/lib/scripts/deploy.sh +++ b/lib/scripts/deploy.sh @@ -59,5 +59,6 @@ sudo -EH -u "$operator" bash -xs <<-'EOF' bin/rails db:create bin/rails db:migrate - bin/rails db:seed + + [[ -n ${deploy_skip_seed:-} ]] || bin/rails db:seed EOF diff --git a/lib/scripts/environment.sh b/lib/scripts/environment.sh index 6e98fb52a..62bc207bb 100644 --- a/lib/scripts/environment.sh +++ b/lib/scripts/environment.sh @@ -18,10 +18,10 @@ application=${application:-$(jq -r '.name' "$manifest")} operator=${operator:-$(id -rnu 1000 2>/dev/null)} environment=/etc/environment -if [[ -d ${LOCAL_CACHE_DIR:-} ]]; then - LOCAL_CACHE_DIR_BUNDLE=$LOCAL_CACHE_DIR/bundle - LOCAL_CACHE_DIR_BOOTSNAP=$LOCAL_CACHE_DIR/bootsnap - LOCAL_CACHE_DIR_YARN=$LOCAL_CACHE_DIR/yarn +if [[ -d ${deploy_cache_dir:-} ]]; then + LOCAL_CACHE_DIR_BUNDLE=$deploy_cache_dir/bundle + LOCAL_CACHE_DIR_BOOTSNAP=$deploy_cache_dir/bootsnap + LOCAL_CACHE_DIR_YARN=$deploy_cache_dir/yarn cat >"$environment" <<-EOF LOCAL_CACHE_DIR_BUNDLE=$LOCAL_CACHE_DIR_BUNDLE From a2eb313a3a5e8d63545682d59a775baaa59930ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 11 Feb 2019 00:17:44 +0000 Subject: [PATCH 064/124] Bump rails from `9483cde` to `38f9e41` Bumps [rails](https://github.com/rails/rails) from `9483cde` to `38f9e41`. - [Release notes](https://github.com/rails/rails/releases) - [Commits](https://github.com/rails/rails/compare/9483cdee0a3ed9c686e338f079b0e369597b1211...38f9e41f2c4b64377ffb036c53873dbfb51546cf) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ff9a43afd..89df69522 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/rails/rails.git - revision: 9483cdee0a3ed9c686e338f079b0e369597b1211 + revision: 38f9e41f2c4b64377ffb036c53873dbfb51546cf specs: actioncable (6.0.0.beta1) actionpack (= 6.0.0.beta1) From a5d89571e6db8d036d40838f992e6131c065f979 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 11 Feb 2019 00:18:03 +0000 Subject: [PATCH 065/124] Bump rubocop from 0.63.1 to 0.64.0 Bumps [rubocop](https://github.com/rubocop-hq/rubocop) from 0.63.1 to 0.64.0. - [Release notes](https://github.com/rubocop-hq/rubocop/releases) - [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop-hq/rubocop/compare/v0.63.1...v0.64.0) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ff9a43afd..1d1674d09 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -304,7 +304,7 @@ GEM responders (2.4.1) actionpack (>= 4.2.0, < 6.0) railties (>= 4.2.0, < 6.0) - rubocop (0.63.1) + rubocop (0.64.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) parser (>= 2.5, != 2.5.1.1) From 475c156b9fa9f06d29d5554cd9f122ba3723d263 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 11 Feb 2019 00:18:09 +0000 Subject: [PATCH 066/124] Bump devise from 4.5.0 to 4.6.0 Bumps [devise](https://github.com/plataformatec/devise) from 4.5.0 to 4.6.0. - [Release notes](https://github.com/plataformatec/devise/releases) - [Changelog](https://github.com/plataformatec/devise/blob/master/CHANGELOG.md) - [Commits](https://github.com/plataformatec/devise/compare/v4.5.0...v4.6.0) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ff9a43afd..3946e2761 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -187,7 +187,7 @@ GEM crack (0.4.3) safe_yaml (~> 1.0.0) crass (1.0.4) - devise (4.5.0) + devise (4.6.0) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0, < 6.0) From 2fefd559597a300be5494c80e210d3c8936e2f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Mon, 11 Feb 2019 13:46:12 +0300 Subject: [PATCH 067/124] Use only one method for verifications --- app/services/xokul/kps.rb | 48 -------------------------- app/services/xokul/kps/verification.rb | 37 ++++++++++++++++++++ 2 files changed, 37 insertions(+), 48 deletions(-) delete mode 100644 app/services/xokul/kps.rb create mode 100644 app/services/xokul/kps/verification.rb diff --git a/app/services/xokul/kps.rb b/app/services/xokul/kps.rb deleted file mode 100644 index cdc45848e..000000000 --- a/app/services/xokul/kps.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -module Xokul - module Kps - module_function - - def verify_foreign_national(**option) - Connection.request( - '/kps/verifications/foreign_nationals', params: { - id_number: option.fetch(:id_number), - first_name: option.fetch(:first_name), - last_name: option.fetch(:last_name), - day_of_birth: option.fetch(:day_of_birth), - month_of_birth: option.fetch(:month_of_birth), - year_of_birth: option.fetch(:year_of_birth) - } - )[:status] - end - - # rubocop:disable Metrics/MethodLength - def verify_identity_card(**option) - Connection.request( - '/kps/verifications/identity_cards', params: { - id_number: option.fetch(:id_number), - first_name: option.fetch(:first_name), - last_name: option.fetch(:last_name), - day_of_birth: option.fetch(:day_of_birth), - month_of_birth: option.fetch(:month_of_birth), - year_of_birth: option.fetch(:year_of_birth), - card_serial_code: option.fetch(:card_serial_code), - card_number: option.fetch(:card_number) - } - )[:status] - end - # rubocop:enable Metrics/MethodLength - - def verify_identity_number(**option) - Connection.request( - '/kps/verifications/identity_numbers', params: { - id_number: option.fetch(:id_number), - first_name: option.fetch(:first_name), - last_name: option.fetch(:last_name), - year_of_birth: option.fetch(:year_of_birth) - } - )[:status] - end - end -end diff --git a/app/services/xokul/kps/verification.rb b/app/services/xokul/kps/verification.rb new file mode 100644 index 000000000..a764d63b1 --- /dev/null +++ b/app/services/xokul/kps/verification.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Xokul + module Kps + module Verification + module_function + + # rubocop:disable Metrics/MethodLength + def id_card(**option) + Connection.request( + '/kps/verifications/id_cards', params: { + id_number: option.fetch(:id_number), + first_name: option.fetch(:first_name), + last_name: option.fetch(:last_name), + day_of_birth: option.fetch(:day_of_birth), + month_of_birth: option.fetch(:month_of_birth), + year_of_birth: option.fetch(:year_of_birth), + card_serial: option[:card_serial], + card_number: option[:card_number] + } + )[:status] + end + # rubocop:enable Metrics/MethodLength + + def id_number(**option) + Connection.request( + '/kps/verifications/id_numbers', params: { + id_number: option.fetch(:id_number), + first_name: option.fetch(:first_name), + last_name: option.fetch(:last_name), + year_of_birth: option.fetch(:year_of_birth) + } + )[:status] + end + end + end +end From a0a186ca394cd202b80b83e93898fe6dfbfb81ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Mon, 11 Feb 2019 14:56:19 +0300 Subject: [PATCH 068/124] Make argument names consistent with Xokul --- app/services/xokul/kps/verification.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/services/xokul/kps/verification.rb b/app/services/xokul/kps/verification.rb index a764d63b1..64a2bc858 100644 --- a/app/services/xokul/kps/verification.rb +++ b/app/services/xokul/kps/verification.rb @@ -15,8 +15,9 @@ def id_card(**option) day_of_birth: option.fetch(:day_of_birth), month_of_birth: option.fetch(:month_of_birth), year_of_birth: option.fetch(:year_of_birth), - card_serial: option[:card_serial], - card_number: option[:card_number] + serial: option[:serial], + number: option[:number], + document_number: option[:document_number] } )[:status] end From 9f224cb12c158739a69fb1c1e562877bcd96c5b0 Mon Sep 17 00:00:00 2001 From: msdundar Date: Wed, 13 Feb 2019 05:35:45 +0300 Subject: [PATCH 069/124] Fix ERB offenses --- app/views/account/addresses/index.html.erb | 2 +- app/views/account/duties/_form.html.erb | 8 +-- app/views/account/employees/_form.html.erb | 6 +- app/views/account/identities/index.html.erb | 2 +- app/views/account/positions/_form.html.erb | 2 +- app/views/active_storage/blobs/_blob.html.erb | 4 +- .../admin/assessment_methods/_form.html.erb | 12 ++-- .../admin/assessment_methods/index.html.erb | 2 +- app/views/admin/cities/_form.html.erb | 20 +++---- app/views/admin/countries/_form.html.erb | 56 +++++++++---------- app/views/admin/countries/index.html.erb | 4 +- app/views/admin/districts/_form.html.erb | 18 +++--- app/views/admin/document_types/_form.html.erb | 20 +++---- app/views/admin/document_types/index.html.erb | 4 +- .../admin/evaluation_types/_form.html.erb | 12 ++-- .../admin/evaluation_types/index.html.erb | 2 +- .../admin/high_school_types/_form.html.erb | 20 +++---- .../admin/high_school_types/index.html.erb | 4 +- app/views/admin/languages/_form.html.erb | 20 +++---- app/views/admin/languages/index.html.erb | 4 +- .../student_disability_types/_form.html.erb | 20 +++---- .../student_disability_types/index.html.erb | 4 +- .../student_drop_out_types/_form.html.erb | 20 +++---- .../student_drop_out_types/index.html.erb | 4 +- .../student_education_levels/_form.html.erb | 20 +++---- .../student_education_levels/index.html.erb | 4 +- .../_form.html.erb | 20 +++---- .../index.html.erb | 4 +- .../student_entrance_types/_form.html.erb | 20 +++---- .../student_entrance_types/index.html.erb | 4 +- app/views/admin/student_grades/_form.html.erb | 20 +++---- app/views/admin/student_grades/index.html.erb | 4 +- .../student_grading_systems/_form.html.erb | 20 +++---- .../student_grading_systems/index.html.erb | 4 +- .../student_punishment_types/_form.html.erb | 20 +++---- .../student_punishment_types/index.html.erb | 4 +- .../_form.html.erb | 20 +++---- .../index.html.erb | 4 +- app/views/admin/titles/_form.html.erb | 30 +++++----- app/views/admin/titles/index.html.erb | 4 +- .../unit_instruction_languages/_form.html.erb | 20 +++---- .../unit_instruction_languages/index.html.erb | 4 +- .../unit_instruction_types/_form.html.erb | 20 +++---- .../unit_instruction_types/index.html.erb | 4 +- app/views/admin/unit_statuses/_form.html.erb | 20 +++---- app/views/admin/unit_statuses/index.html.erb | 4 +- app/views/admin/unit_types/_form.html.erb | 32 +++++------ app/views/admin/unit_types/index.html.erb | 4 +- .../admin/university_types/_form.html.erb | 20 +++---- .../admin/university_types/index.html.erb | 4 +- .../admin/yoksis_dashboard/_card.html.erb | 2 +- .../admin/yoksis_dashboard/index.html.erb | 32 +++++------ .../calendar_event_types/_form.html.erb | 32 +++++------ .../calendar_event_types/index.html.erb | 4 +- .../calendars/_calendar_event_fields.html.erb | 12 ++-- .../calendars/index.html.erb | 4 +- .../calendars/show.html.erb | 2 +- .../calendars/units.html.erb | 4 +- app/views/committee/agendas/_search.html.erb | 6 +- app/views/committee/decisions/_form.html.erb | 2 +- app/views/committee/decisions/show.html.erb | 2 +- app/views/committee/meetings/_form.html.erb | 4 +- app/views/committee/meetings/show.html.erb | 2 +- .../_lecturer_fields.html.erb | 2 +- .../available_courses/_groups.html.erb | 2 +- .../available_courses/_search.html.erb | 30 +++++----- .../course_evaluation_types/new.html.erb | 2 +- .../course_groups/_search.html.erb | 22 ++++---- .../courses/_search.html.erb | 48 ++++++++-------- .../course_management/courses/show.html.erb | 2 +- .../curriculum_course_groups/_form.html.erb | 6 +- .../curriculum_course_groups/new.html.erb | 4 +- .../curriculums/_curriculum_courses.html.erb | 2 +- .../curriculums/_semesters.html.erb | 25 ++++----- app/views/devise/passwords/edit.html.erb | 2 +- app/views/devise/registrations/new.html.erb | 4 +- .../prospective_students/_search.html.erb | 1 - .../prospective_students/show.html.erb | 4 +- .../registration_documents/_form.html.erb | 52 ++++++++--------- .../registration_documents/index.html.erb | 4 +- app/views/home/templates/_academic.html.erb | 2 +- app/views/home/templates/_staff.html.erb | 2 +- app/views/home/templates/_student.html.erb | 2 +- app/views/layouts/application.html.erb | 8 +-- app/views/layouts/builders/_index.html.erb | 14 ++--- app/views/layouts/mailer.html.erb | 4 +- app/views/layouts/pdf.html.erb | 2 +- app/views/layouts/shared/_aside.html.erb | 20 +++---- app/views/layouts/shared/_meta.html.erb | 10 ++-- .../shared/_smart_search_form.html.erb | 6 +- app/views/layouts/shared/_toastr.html.erb | 4 +- app/views/public_profile/_articles.html.erb | 2 +- .../public_profile/_certifications.html.erb | 4 +- app/views/public_profile/_info.html.erb | 2 +- app/views/public_profile/_projects.html.erb | 2 +- app/views/public_profile/_resume.html.erb | 6 +- app/views/public_profile/_search.html.erb | 2 +- app/views/public_profile/index.html.erb | 2 +- app/views/public_profile/show.html.erb | 2 +- .../references/academic_terms/_form.html.erb | 2 +- app/views/studies/articles/index.html.erb | 1 - app/views/units/_form.html.erb | 12 ++-- app/views/units/_search.html.erb | 4 +- app/views/users/_addresses.html.erb | 2 +- app/views/users/_identities.html.erb | 2 +- 105 files changed, 519 insertions(+), 524 deletions(-) diff --git a/app/views/account/addresses/index.html.erb b/app/views/account/addresses/index.html.erb index bc4fd597a..eb5cfcf2a 100644 --- a/app/views/account/addresses/index.html.erb +++ b/app/views/account/addresses/index.html.erb @@ -1,7 +1,7 @@
<%= link_to_back user_path(@user) %> <%= link_to_new(t('.new_address'), new_user_address_path(@user)) unless @user.addresses.informal.present? %> - <%= link_to (@addresses.formal.present? ? t('.update_from_mernis') : t('.create_from_mernis') ), save_from_mernis_user_addresses_path, class: "btn btn-outline-primary btn-sm" %> + <%= link_to (@addresses.formal.present? ? t('.update_from_mernis') : t('.create_from_mernis')), save_from_mernis_user_addresses_path, class: 'btn btn-outline-primary btn-sm' %>
diff --git a/app/views/account/duties/_form.html.erb b/app/views/account/duties/_form.html.erb index 23fe3d6af..483f4a297 100644 --- a/app/views/account/duties/_form.html.erb +++ b/app/views/account/duties/_form.html.erb @@ -17,9 +17,9 @@
<%= f.input :unit_id, - collection: Unit.active.without_programs.order(:name), - required: true, - label_method: :names_depth_cache %> + collection: Unit.active.without_programs.order(:name), + required: true, + label_method: :names_depth_cache %>
<%= f.input :start_date, required: true %> @@ -41,4 +41,4 @@
-<%= render 'select2' %> \ No newline at end of file +<%= render 'select2' %> diff --git a/app/views/account/employees/_form.html.erb b/app/views/account/employees/_form.html.erb index 144871bfe..e028ad49a 100644 --- a/app/views/account/employees/_form.html.erb +++ b/app/views/account/employees/_form.html.erb @@ -14,10 +14,10 @@
<%= f.input :title_id, collection: Title.order(:name), required: true, - label_method: lambda { |title| title.name + ' - ' + title.branch } %> + label_method: lambda { |title| title.name + ' - ' + title.branch } %>
- <%= f.input :active, label: t('active') %> + <%= f.input :active, label: t('active') %>
<%= f.button :submit, class: 'btn btn-outline-success btn-sm' %> @@ -30,4 +30,4 @@
-<%= render 'select2' %> \ No newline at end of file +<%= render 'select2' %> diff --git a/app/views/account/identities/index.html.erb b/app/views/account/identities/index.html.erb index e302812fd..00f292678 100644 --- a/app/views/account/identities/index.html.erb +++ b/app/views/account/identities/index.html.erb @@ -1,7 +1,7 @@
<%= link_to_back user_path(@user) %> <%= link_to_new(t('.new_identity'), new_user_identity_path(@user)) unless @user.identities.informal.present? %> - <%= link_to (@identities.formal.present? ? t('.update_from_mernis') : t('.create_from_mernis') ), save_from_mernis_user_identities_path, class: "btn btn-outline-primary btn-sm" %> + <%= link_to (@identities.formal.present? ? t('.update_from_mernis') : t('.create_from_mernis')), save_from_mernis_user_identities_path, class: 'btn btn-outline-primary btn-sm' %>
diff --git a/app/views/account/positions/_form.html.erb b/app/views/account/positions/_form.html.erb index 274d18290..944e6e723 100644 --- a/app/views/account/positions/_form.html.erb +++ b/app/views/account/positions/_form.html.erb @@ -35,4 +35,4 @@
-<%= render 'select2' %> \ No newline at end of file +<%= render 'select2' %> diff --git a/app/views/active_storage/blobs/_blob.html.erb b/app/views/active_storage/blobs/_blob.html.erb index 049f57e80..b7af71c76 100644 --- a/app/views/active_storage/blobs/_blob.html.erb +++ b/app/views/active_storage/blobs/_blob.html.erb @@ -1,6 +1,6 @@ -
attachment--<%= blob.filename.extension %>"> +
<% if blob.representable? %> - <%= image_tag blob.representation(resize_to_fit: local_assigns[:in_gallery] ? [ 800, 600 ] : [ 1024, 768 ]) %> + <%= image_tag blob.representation(resize_to_fit: local_assigns[:in_gallery] ? [800, 600] : [1024, 768]) %> <% end %>
diff --git a/app/views/admin/assessment_methods/_form.html.erb b/app/views/admin/assessment_methods/_form.html.erb index d30f2dd00..9a475b774 100644 --- a/app/views/admin/assessment_methods/_form.html.erb +++ b/app/views/admin/assessment_methods/_form.html.erb @@ -1,10 +1,10 @@ <%= render 'layouts/builders/form', - namespace: 'admin', + namespace: 'admin', klass: @assessment_method, params: [ - { - field: 'name', - width: 12, - required: true - } + { + field: 'name', + width: 12, + required: true + } ] %> diff --git a/app/views/admin/assessment_methods/index.html.erb b/app/views/admin/assessment_methods/index.html.erb index 3794e1018..248b09bca 100644 --- a/app/views/admin/assessment_methods/index.html.erb +++ b/app/views/admin/assessment_methods/index.html.erb @@ -5,4 +5,4 @@ pagy: @pagy, card_header: t('.card_header'), params: ['name'], - actions: ['edit', 'destroy'] %> + actions: %w[edit destroy] %> diff --git a/app/views/admin/cities/_form.html.erb b/app/views/admin/cities/_form.html.erb index ff9f45d76..b75f42282 100644 --- a/app/views/admin/cities/_form.html.erb +++ b/app/views/admin/cities/_form.html.erb @@ -2,14 +2,14 @@ namespace: 'admin', klass: [@country, @city], params: [ - { - field: 'name', - width: 12, - required: true - }, - { - field: 'alpha_2_code', - width: 12, - required: true - } + { + field: 'name', + width: 12, + required: true + }, + { + field: 'alpha_2_code', + width: 12, + required: true + } ] %> diff --git a/app/views/admin/countries/_form.html.erb b/app/views/admin/countries/_form.html.erb index 7187e24e9..770ae3168 100644 --- a/app/views/admin/countries/_form.html.erb +++ b/app/views/admin/countries/_form.html.erb @@ -2,32 +2,32 @@ namespace: 'admin', klass: @country, params: [ - { - field: 'name', - width: 12, - required: true - }, - { - field: 'alpha_2_code', - width: 3, - required: true - }, - { - field: 'alpha_3_code', - width: 3, - required: true - }, - { - field: 'numeric_code', - width: 3, - required: true - }, - { - field: 'mernis_code', - width: 3 - }, - { - field: 'yoksis_code', - width: 3 - } + { + field: 'name', + width: 12, + required: true + }, + { + field: 'alpha_2_code', + width: 3, + required: true + }, + { + field: 'alpha_3_code', + width: 3, + required: true + }, + { + field: 'numeric_code', + width: 3, + required: true + }, + { + field: 'mernis_code', + width: 3 + }, + { + field: 'yoksis_code', + width: 3 + } ] %> diff --git a/app/views/admin/countries/index.html.erb b/app/views/admin/countries/index.html.erb index da5f9b17c..381630f9c 100644 --- a/app/views/admin/countries/index.html.erb +++ b/app/views/admin/countries/index.html.erb @@ -4,5 +4,5 @@ collection: @countries, pagy: @pagy, card_header: t('.card_header'), - params: ['name', 'alpha_2_code', 'alpha_3_code', 'numeric_code', 'mernis_code', 'yoksis_code'], - actions: ['show', 'edit', 'destroy'] %> + params: %w[name alpha_2_code alpha_3_code numeric_code mernis_code yoksis_code], + actions: %w[show edit destroy] %> diff --git a/app/views/admin/districts/_form.html.erb b/app/views/admin/districts/_form.html.erb index e0d573280..b42bc8c70 100644 --- a/app/views/admin/districts/_form.html.erb +++ b/app/views/admin/districts/_form.html.erb @@ -2,13 +2,13 @@ namespace: 'admin', klass: [@city.country, @city, @district], params: [ - { - field: 'name', - width: 12, - required: true - }, - { - field: 'mernis_code', - width: 12 - } + { + field: 'name', + width: 12, + required: true + }, + { + field: 'mernis_code', + width: 12 + } ] %> diff --git a/app/views/admin/document_types/_form.html.erb b/app/views/admin/document_types/_form.html.erb index 977bc70c2..236264897 100644 --- a/app/views/admin/document_types/_form.html.erb +++ b/app/views/admin/document_types/_form.html.erb @@ -2,14 +2,14 @@ namespace: 'admin', klass: @document_type, params: [ - { - field: 'name', - width: 12, - required: true - }, - { - field: 'active', - width: 12, - required: true - } + { + field: 'name', + width: 12, + required: true + }, + { + field: 'active', + width: 12, + required: true + } ] %> diff --git a/app/views/admin/document_types/index.html.erb b/app/views/admin/document_types/index.html.erb index 11d233e68..4084e4888 100644 --- a/app/views/admin/document_types/index.html.erb +++ b/app/views/admin/document_types/index.html.erb @@ -4,5 +4,5 @@ collection: @document_types, pagy: @pagy, card_header: t('.card_header'), - params: ['name', 'active'], - actions: ['edit', 'destroy'] %> + params: %w[name active], + actions: %w[edit destroy] %> diff --git a/app/views/admin/evaluation_types/_form.html.erb b/app/views/admin/evaluation_types/_form.html.erb index 1a64b1df9..c95379c85 100644 --- a/app/views/admin/evaluation_types/_form.html.erb +++ b/app/views/admin/evaluation_types/_form.html.erb @@ -1,10 +1,10 @@ <%= render 'layouts/builders/form', - namespace: 'admin', + namespace: 'admin', klass: @evaluation_type, params: [ - { - field: 'name', - width: 12, - required: true - } + { + field: 'name', + width: 12, + required: true + } ] %> diff --git a/app/views/admin/evaluation_types/index.html.erb b/app/views/admin/evaluation_types/index.html.erb index 8cc9cf1b6..4106fc586 100644 --- a/app/views/admin/evaluation_types/index.html.erb +++ b/app/views/admin/evaluation_types/index.html.erb @@ -5,4 +5,4 @@ pagy: @pagy, card_header: t('.card_header'), params: ['name'], - actions: ['edit', 'destroy'] %> + actions: %w[edit destroy] %> diff --git a/app/views/admin/high_school_types/_form.html.erb b/app/views/admin/high_school_types/_form.html.erb index 48cb0bb0e..cf29ac653 100644 --- a/app/views/admin/high_school_types/_form.html.erb +++ b/app/views/admin/high_school_types/_form.html.erb @@ -2,14 +2,14 @@ namespace: 'admin', klass: @high_school_type, params: [ - { - field: 'name', - width: 12, - required: true - }, - { - field: 'code', - width: 12, - required: true - } + { + field: 'name', + width: 12, + required: true + }, + { + field: 'code', + width: 12, + required: true + } ] %> diff --git a/app/views/admin/high_school_types/index.html.erb b/app/views/admin/high_school_types/index.html.erb index ca753fb0b..2fb13f97c 100644 --- a/app/views/admin/high_school_types/index.html.erb +++ b/app/views/admin/high_school_types/index.html.erb @@ -4,5 +4,5 @@ collection: @high_school_types, pagy: @pagy, card_header: t('.card_header'), - params: ['name', 'code'], - actions: ['edit', 'destroy'] %> + params: %w[name code], + actions: %w[edit destroy] %> diff --git a/app/views/admin/languages/_form.html.erb b/app/views/admin/languages/_form.html.erb index 140521bf1..5c3d563ad 100644 --- a/app/views/admin/languages/_form.html.erb +++ b/app/views/admin/languages/_form.html.erb @@ -2,14 +2,14 @@ namespace: 'admin', klass: @language, params: [ - { - field: 'name', - width: 12, - required: true - }, - { - field: 'iso', - width: 12, - required: true - } + { + field: 'name', + width: 12, + required: true + }, + { + field: 'iso', + width: 12, + required: true + } ] %> diff --git a/app/views/admin/languages/index.html.erb b/app/views/admin/languages/index.html.erb index 63155c0f1..b3cb0823b 100644 --- a/app/views/admin/languages/index.html.erb +++ b/app/views/admin/languages/index.html.erb @@ -4,5 +4,5 @@ collection: @languages, pagy: @pagy, card_header: t('.card_header'), - params: ['name', 'iso'], - actions: ['edit', 'destroy'] %> + params: %w[name iso], + actions: %w[edit destroy] %> diff --git a/app/views/admin/student_disability_types/_form.html.erb b/app/views/admin/student_disability_types/_form.html.erb index 67478c2a9..48e593b78 100644 --- a/app/views/admin/student_disability_types/_form.html.erb +++ b/app/views/admin/student_disability_types/_form.html.erb @@ -2,14 +2,14 @@ namespace: 'admin', klass: @student_disability_type, params: [ - { - field: 'name', - width: 12, - required: true - }, - { - field: 'code', - width: 12, - required: true - } + { + field: 'name', + width: 12, + required: true + }, + { + field: 'code', + width: 12, + required: true + } ] %> diff --git a/app/views/admin/student_disability_types/index.html.erb b/app/views/admin/student_disability_types/index.html.erb index 7801affe0..e264e9e65 100644 --- a/app/views/admin/student_disability_types/index.html.erb +++ b/app/views/admin/student_disability_types/index.html.erb @@ -4,5 +4,5 @@ collection: @student_disability_types, pagy: @pagy, card_header: t('.card_header'), - params: ['name', 'code'], - actions: ['edit', 'destroy'] %> + params: %w[name code], + actions: %w[edit destroy] %> diff --git a/app/views/admin/student_drop_out_types/_form.html.erb b/app/views/admin/student_drop_out_types/_form.html.erb index 5a48ccd35..db67de5e2 100644 --- a/app/views/admin/student_drop_out_types/_form.html.erb +++ b/app/views/admin/student_drop_out_types/_form.html.erb @@ -2,14 +2,14 @@ namespace: 'admin', klass: @student_drop_out_type, params: [ - { - field: 'name', - width: 12, - required: true - }, - { - field: 'code', - width: 12, - required: true - } + { + field: 'name', + width: 12, + required: true + }, + { + field: 'code', + width: 12, + required: true + } ] %> diff --git a/app/views/admin/student_drop_out_types/index.html.erb b/app/views/admin/student_drop_out_types/index.html.erb index 1781e55c9..7bdba6f82 100644 --- a/app/views/admin/student_drop_out_types/index.html.erb +++ b/app/views/admin/student_drop_out_types/index.html.erb @@ -4,5 +4,5 @@ collection: @student_drop_out_types, pagy: @pagy, card_header: t('.card_header'), - params: ['name', 'code'], - actions: ['edit', 'destroy'] %> + params: %w[name code], + actions: %w[edit destroy] %> diff --git a/app/views/admin/student_education_levels/_form.html.erb b/app/views/admin/student_education_levels/_form.html.erb index 3c85a5b10..c96ebd8ed 100644 --- a/app/views/admin/student_education_levels/_form.html.erb +++ b/app/views/admin/student_education_levels/_form.html.erb @@ -2,14 +2,14 @@ namespace: 'admin', klass: @student_education_level, params: [ - { - field: 'name', - width: 12, - required: true - }, - { - field: 'code', - width: 12, - required: true - } + { + field: 'name', + width: 12, + required: true + }, + { + field: 'code', + width: 12, + required: true + } ] %> diff --git a/app/views/admin/student_education_levels/index.html.erb b/app/views/admin/student_education_levels/index.html.erb index 8213d4981..ea843e1f2 100644 --- a/app/views/admin/student_education_levels/index.html.erb +++ b/app/views/admin/student_education_levels/index.html.erb @@ -4,5 +4,5 @@ collection: @student_education_levels, pagy: @pagy, card_header: t('.card_header'), - params: ['name', 'code'], - actions: ['edit', 'destroy'] %> + params: %w[name code], + actions: %w[edit destroy] %> diff --git a/app/views/admin/student_entrance_point_types/_form.html.erb b/app/views/admin/student_entrance_point_types/_form.html.erb index 80ecdfd17..b00c9cc5d 100644 --- a/app/views/admin/student_entrance_point_types/_form.html.erb +++ b/app/views/admin/student_entrance_point_types/_form.html.erb @@ -2,14 +2,14 @@ namespace: 'admin', klass: @student_entrance_point_type, params: [ - { - field: 'name', - width: 12, - required: true - }, - { - field: 'code', - width: 12, - required: true - } + { + field: 'name', + width: 12, + required: true + }, + { + field: 'code', + width: 12, + required: true + } ] %> diff --git a/app/views/admin/student_entrance_point_types/index.html.erb b/app/views/admin/student_entrance_point_types/index.html.erb index 0cac7f850..7a7354f8b 100644 --- a/app/views/admin/student_entrance_point_types/index.html.erb +++ b/app/views/admin/student_entrance_point_types/index.html.erb @@ -4,5 +4,5 @@ collection: @student_entrance_point_types, pagy: @pagy, card_header: t('.card_header'), - params: ['name', 'code'], - actions: ['edit', 'destroy'] %> + params: %w[name code], + actions: %w[edit destroy] %> diff --git a/app/views/admin/student_entrance_types/_form.html.erb b/app/views/admin/student_entrance_types/_form.html.erb index b03f88231..08d7cb89e 100644 --- a/app/views/admin/student_entrance_types/_form.html.erb +++ b/app/views/admin/student_entrance_types/_form.html.erb @@ -2,14 +2,14 @@ namespace: 'admin', klass: @student_entrance_type, params: [ - { - field: 'name', - width: 12, - required: true - }, - { - field: 'code', - width: 12, - required: true - } + { + field: 'name', + width: 12, + required: true + }, + { + field: 'code', + width: 12, + required: true + } ] %> diff --git a/app/views/admin/student_entrance_types/index.html.erb b/app/views/admin/student_entrance_types/index.html.erb index c1e95a1d1..571a7b00a 100644 --- a/app/views/admin/student_entrance_types/index.html.erb +++ b/app/views/admin/student_entrance_types/index.html.erb @@ -4,5 +4,5 @@ collection: @student_entrance_types, pagy: @pagy, card_header: t('.card_header'), - params: ['name', 'code'], - actions: ['edit', 'destroy'] %> + params: %w[name code], + actions: %w[edit destroy] %> diff --git a/app/views/admin/student_grades/_form.html.erb b/app/views/admin/student_grades/_form.html.erb index c07a62fa8..9a285bca4 100644 --- a/app/views/admin/student_grades/_form.html.erb +++ b/app/views/admin/student_grades/_form.html.erb @@ -2,14 +2,14 @@ namespace: 'admin', klass: @student_grade, params: [ - { - field: 'name', - width: 12, - required: true - }, - { - field: 'code', - width: 12, - required: true - } + { + field: 'name', + width: 12, + required: true + }, + { + field: 'code', + width: 12, + required: true + } ] %> diff --git a/app/views/admin/student_grades/index.html.erb b/app/views/admin/student_grades/index.html.erb index 1ad38256e..66126c429 100644 --- a/app/views/admin/student_grades/index.html.erb +++ b/app/views/admin/student_grades/index.html.erb @@ -4,5 +4,5 @@ collection: @student_grades, pagy: @pagy, card_header: t('.card_header'), - params: ['name', 'code'], - actions: ['edit', 'destroy'] %> + params: %w[name code], + actions: %w[edit destroy] %> diff --git a/app/views/admin/student_grading_systems/_form.html.erb b/app/views/admin/student_grading_systems/_form.html.erb index 05984e715..53ea7d913 100644 --- a/app/views/admin/student_grading_systems/_form.html.erb +++ b/app/views/admin/student_grading_systems/_form.html.erb @@ -2,14 +2,14 @@ namespace: 'admin', klass: @student_grading_system, params: [ - { - field: 'name', - width: 12, - required: true - }, - { - field: 'code', - width: 12, - required: true - } + { + field: 'name', + width: 12, + required: true + }, + { + field: 'code', + width: 12, + required: true + } ] %> diff --git a/app/views/admin/student_grading_systems/index.html.erb b/app/views/admin/student_grading_systems/index.html.erb index 157ac0a14..1bf0ea1f4 100644 --- a/app/views/admin/student_grading_systems/index.html.erb +++ b/app/views/admin/student_grading_systems/index.html.erb @@ -4,5 +4,5 @@ collection: @student_grading_systems, pagy: @pagy, card_header: t('.card_header'), - params: ['name', 'code'], - actions: ['edit', 'destroy'] %> + params: %w[name code], + actions: %w[edit destroy] %> diff --git a/app/views/admin/student_punishment_types/_form.html.erb b/app/views/admin/student_punishment_types/_form.html.erb index 3cb20a80d..f008286ec 100644 --- a/app/views/admin/student_punishment_types/_form.html.erb +++ b/app/views/admin/student_punishment_types/_form.html.erb @@ -2,14 +2,14 @@ namespace: 'admin', klass: @student_punishment_type, params: [ - { - field: 'name', - width: 12, - required: true - }, - { - field: 'code', - width: 12, - required: true - } + { + field: 'name', + width: 12, + required: true + }, + { + field: 'code', + width: 12, + required: true + } ] %> diff --git a/app/views/admin/student_punishment_types/index.html.erb b/app/views/admin/student_punishment_types/index.html.erb index 377c7c1f3..dbb8d8dde 100644 --- a/app/views/admin/student_punishment_types/index.html.erb +++ b/app/views/admin/student_punishment_types/index.html.erb @@ -4,5 +4,5 @@ collection: @student_punishment_types, pagy: @pagy, card_header: t('.card_header'), - params: ['name', 'code'], - actions: ['edit', 'destroy'] %> + params: %w[name code], + actions: %w[edit destroy] %> diff --git a/app/views/admin/student_studentship_statuses/_form.html.erb b/app/views/admin/student_studentship_statuses/_form.html.erb index 29ac1447d..eff098228 100644 --- a/app/views/admin/student_studentship_statuses/_form.html.erb +++ b/app/views/admin/student_studentship_statuses/_form.html.erb @@ -2,14 +2,14 @@ namespace: 'admin', klass: @student_studentship_status, params: [ - { - field: 'name', - width: 12, - required: true, - }, - { - field: 'code', - width: 12, - required: true - } + { + field: 'name', + width: 12, + required: true + }, + { + field: 'code', + width: 12, + required: true + } ] %> diff --git a/app/views/admin/student_studentship_statuses/index.html.erb b/app/views/admin/student_studentship_statuses/index.html.erb index 7fba7e9b3..1a0e9e8e6 100644 --- a/app/views/admin/student_studentship_statuses/index.html.erb +++ b/app/views/admin/student_studentship_statuses/index.html.erb @@ -4,5 +4,5 @@ collection: @student_studentship_statuses, pagy: @pagy, card_header: t('.card_header'), - params: ['name', 'code'], - actions: ['edit', 'destroy'] %> + params: %w[name code], + actions: %w[edit destroy] %> diff --git a/app/views/admin/titles/_form.html.erb b/app/views/admin/titles/_form.html.erb index 4c3908f4b..febcc1d5a 100644 --- a/app/views/admin/titles/_form.html.erb +++ b/app/views/admin/titles/_form.html.erb @@ -2,19 +2,19 @@ namespace: 'admin', klass: @title, params: [ - { - field: 'name', - width: 12, - required: true - }, - { - field: 'code', - width: 6, - required: true - }, - { - field: 'branch', - width: 6, - required: true - } + { + field: 'name', + width: 12, + required: true + }, + { + field: 'code', + width: 6, + required: true + }, + { + field: 'branch', + width: 6, + required: true + } ] %> diff --git a/app/views/admin/titles/index.html.erb b/app/views/admin/titles/index.html.erb index 1aabc8a3e..adc19d5fe 100644 --- a/app/views/admin/titles/index.html.erb +++ b/app/views/admin/titles/index.html.erb @@ -4,5 +4,5 @@ collection: @titles, pagy: @pagy, card_header: t('.card_header'), - params: ['name', 'code', 'branch'], - actions: ['edit', 'destroy'] %> + params: %w[name code branch], + actions: %w[edit destroy] %> diff --git a/app/views/admin/unit_instruction_languages/_form.html.erb b/app/views/admin/unit_instruction_languages/_form.html.erb index 51a9a5363..3e42edf39 100644 --- a/app/views/admin/unit_instruction_languages/_form.html.erb +++ b/app/views/admin/unit_instruction_languages/_form.html.erb @@ -2,14 +2,14 @@ namespace: 'admin', klass: @unit_instruction_language, params: [ - { - field: 'name', - width: 12, - required: true - }, - { - field: 'code', - width: 12, - required: true - } + { + field: 'name', + width: 12, + required: true + }, + { + field: 'code', + width: 12, + required: true + } ] %> diff --git a/app/views/admin/unit_instruction_languages/index.html.erb b/app/views/admin/unit_instruction_languages/index.html.erb index f27c859e4..959bb8c3a 100644 --- a/app/views/admin/unit_instruction_languages/index.html.erb +++ b/app/views/admin/unit_instruction_languages/index.html.erb @@ -4,5 +4,5 @@ collection: @unit_instruction_languages, pagy: @pagy, card_header: t('.card_header'), - params: ['name', 'code'], - actions: ['edit', 'destroy'] %> + params: %w[name code], + actions: %w[edit destroy] %> diff --git a/app/views/admin/unit_instruction_types/_form.html.erb b/app/views/admin/unit_instruction_types/_form.html.erb index f3b80597f..0a2882443 100644 --- a/app/views/admin/unit_instruction_types/_form.html.erb +++ b/app/views/admin/unit_instruction_types/_form.html.erb @@ -2,14 +2,14 @@ namespace: 'admin', klass: @unit_instruction_type, params: [ - { - field: 'name', - width: 12, - required: true - }, - { - field: 'code', - width: 12, - required: true - } + { + field: 'name', + width: 12, + required: true + }, + { + field: 'code', + width: 12, + required: true + } ] %> diff --git a/app/views/admin/unit_instruction_types/index.html.erb b/app/views/admin/unit_instruction_types/index.html.erb index 8160d8075..91296e39c 100644 --- a/app/views/admin/unit_instruction_types/index.html.erb +++ b/app/views/admin/unit_instruction_types/index.html.erb @@ -4,5 +4,5 @@ collection: @unit_instruction_types, pagy: @pagy, card_header: t('.card_header'), - params: ['name', 'code'], - actions: ['edit', 'destroy'] %> + params: %w[name code], + actions: %w[edit destroy] %> diff --git a/app/views/admin/unit_statuses/_form.html.erb b/app/views/admin/unit_statuses/_form.html.erb index bf4861789..679e71872 100644 --- a/app/views/admin/unit_statuses/_form.html.erb +++ b/app/views/admin/unit_statuses/_form.html.erb @@ -2,14 +2,14 @@ namespace: 'admin', klass: @unit_status, params: [ - { - field: 'name', - width: 12, - required: true - }, - { - field: 'code', - width: 12, - required: true - } + { + field: 'name', + width: 12, + required: true + }, + { + field: 'code', + width: 12, + required: true + } ] %> diff --git a/app/views/admin/unit_statuses/index.html.erb b/app/views/admin/unit_statuses/index.html.erb index 546cb9f06..513f4bba5 100644 --- a/app/views/admin/unit_statuses/index.html.erb +++ b/app/views/admin/unit_statuses/index.html.erb @@ -4,5 +4,5 @@ collection: @unit_statuses, pagy: @pagy, card_header: t('.card_header'), - params: ['name', 'code'], - actions: ['edit', 'destroy'] %> + params: %w[name code], + actions: %w[edit destroy] %> diff --git a/app/views/admin/unit_types/_form.html.erb b/app/views/admin/unit_types/_form.html.erb index 263b8c9cc..212881418 100644 --- a/app/views/admin/unit_types/_form.html.erb +++ b/app/views/admin/unit_types/_form.html.erb @@ -2,20 +2,20 @@ namespace: 'admin', klass: @unit_type, params: [ - { - field: 'name', - width: 12, - required: true - }, - { - field: 'code', - width: 12, - required: true - }, - { - field: 'group', - width: 12, - required: true, - collection: UnitType.groups.keys.sort - } + { + field: 'name', + width: 12, + required: true + }, + { + field: 'code', + width: 12, + required: true + }, + { + field: 'group', + width: 12, + required: true, + collection: UnitType.groups.keys.sort + } ] %> diff --git a/app/views/admin/unit_types/index.html.erb b/app/views/admin/unit_types/index.html.erb index 1e3e1731a..3abaef950 100644 --- a/app/views/admin/unit_types/index.html.erb +++ b/app/views/admin/unit_types/index.html.erb @@ -4,5 +4,5 @@ collection: @unit_types, pagy: @pagy, card_header: t('.card_header'), - params: ['name', 'code', 'group'], - actions: ['edit', 'destroy'] %> + params: %w[name code group], + actions: %w[edit destroy] %> diff --git a/app/views/admin/university_types/_form.html.erb b/app/views/admin/university_types/_form.html.erb index 935355664..331b5ab41 100644 --- a/app/views/admin/university_types/_form.html.erb +++ b/app/views/admin/university_types/_form.html.erb @@ -2,14 +2,14 @@ namespace: 'admin', klass: @university_type, params: [ - { - field: 'name', - width: 12, - required: true - }, - { - field: 'code', - width: 12, - required: true - } + { + field: 'name', + width: 12, + required: true + }, + { + field: 'code', + width: 12, + required: true + } ] %> diff --git a/app/views/admin/university_types/index.html.erb b/app/views/admin/university_types/index.html.erb index 3b33fe3c8..7bf2d78b7 100644 --- a/app/views/admin/university_types/index.html.erb +++ b/app/views/admin/university_types/index.html.erb @@ -4,5 +4,5 @@ collection: @university_types, pagy: @pagy, card_header: t('.card_header'), - params: ['name', 'code'], - actions: ['edit', 'destroy'] %> + params: %w[name code], + actions: %w[edit destroy] %> diff --git a/app/views/admin/yoksis_dashboard/_card.html.erb b/app/views/admin/yoksis_dashboard/_card.html.erb index 0fdf6c721..aaf27698e 100644 --- a/app/views/admin/yoksis_dashboard/_card.html.erb +++ b/app/views/admin/yoksis_dashboard/_card.html.erb @@ -11,4 +11,4 @@ <% end %>
- \ No newline at end of file + diff --git a/app/views/admin/yoksis_dashboard/index.html.erb b/app/views/admin/yoksis_dashboard/index.html.erb index 19e6db76a..3883ea293 100644 --- a/app/views/admin/yoksis_dashboard/index.html.erb +++ b/app/views/admin/yoksis_dashboard/index.html.erb @@ -1,21 +1,21 @@
<% yoksis_klasses = %w[ - HighSchoolType - StudentDisabilityType - StudentDropOutType - StudentEducationLevel - StudentEntrancePointType - StudentEntranceType - StudentGrade - StudentGradingSystem - StudentPunishmentType - StudentStudentshipStatus - UnitInstructionLanguage - UnitInstructionType - UnitStatus - UnitType - UniversityType - ] %> + HighSchoolType + StudentDisabilityType + StudentDropOutType + StudentEducationLevel + StudentEntrancePointType + StudentEntranceType + StudentGrade + StudentGradingSystem + StudentPunishmentType + StudentStudentshipStatus + UnitInstructionLanguage + UnitInstructionType + UnitStatus + UnitType + UniversityType + ] %> <% yoksis_klasses.each do |klass| %> <%= render 'card', diff --git a/app/views/calendar_management/calendar_event_types/_form.html.erb b/app/views/calendar_management/calendar_event_types/_form.html.erb index 9aa357340..a212ad2a2 100644 --- a/app/views/calendar_management/calendar_event_types/_form.html.erb +++ b/app/views/calendar_management/calendar_event_types/_form.html.erb @@ -2,20 +2,20 @@ namespace: 'calendar_management', klass: @calendar_event_type, params: [ - { - field: 'name', - width: 12, - required: true - }, - { - field: 'category', - width: 12, - required: true, - collection: CalendarEventType.categories.keys.sort - }, - { - field: 'identifier', - width: 12, - required: true - } + { + field: 'name', + width: 12, + required: true + }, + { + field: 'category', + width: 12, + required: true, + collection: CalendarEventType.categories.keys.sort + }, + { + field: 'identifier', + width: 12, + required: true + } ] %> diff --git a/app/views/calendar_management/calendar_event_types/index.html.erb b/app/views/calendar_management/calendar_event_types/index.html.erb index 68b686ba6..74bd6c733 100644 --- a/app/views/calendar_management/calendar_event_types/index.html.erb +++ b/app/views/calendar_management/calendar_event_types/index.html.erb @@ -4,5 +4,5 @@ collection: @calendar_event_types, pagy: @pagy, card_header: t('.card_header'), - params: ['name', 'category', 'identifier'], - actions: ['edit', 'destroy'] %> + params: %w[name category identifier], + actions: %w[edit destroy] %> diff --git a/app/views/calendar_management/calendars/_calendar_event_fields.html.erb b/app/views/calendar_management/calendars/_calendar_event_fields.html.erb index b05761795..02583cb25 100644 --- a/app/views/calendar_management/calendars/_calendar_event_fields.html.erb +++ b/app/views/calendar_management/calendars/_calendar_event_fields.html.erb @@ -4,18 +4,18 @@
<%= f.input :calendar_event_type_id, required: true, - collection: CalendarEventType.order(:name), - input_html: { class: 'select_search_class' } %> + collection: CalendarEventType.order(:name), + input_html: { class: 'select_search_class' } %>
<%= f.input :start_time, required: true, - as: :date_time_picker, - input_html: { data: { class: 'event-date'} } %> + as: :date_time_picker, + input_html: { data: { class: 'event-date' } } %>
<%= f.input :end_time, required: true, - as: :date_time_picker, - input_html: { data: { class: 'event-date'} } %> + as: :date_time_picker, + input_html: { data: { class: 'event-date' } } %>
<%= f.input :location %> diff --git a/app/views/calendar_management/calendars/index.html.erb b/app/views/calendar_management/calendars/index.html.erb index 434ee6ebf..c129eaa73 100644 --- a/app/views/calendar_management/calendars/index.html.erb +++ b/app/views/calendar_management/calendars/index.html.erb @@ -4,12 +4,12 @@
<%= fa_icon 'street-view', text: t('.card_header') %>
- <%= link_to_new t('.new_calendar_link'), [:new, :calendar_management, :calendar] %> + <%= link_to_new t('.new_calendar_link'), %i[new calendar_management calendar] %>
<%= render 'layouts/shared/smart_search_form', - path: [:calendar_management, :calendars], + path: %i[calendar_management calendars], placeholder: t('.name') %>
<%= t('.senate_decision_date') %><%= @calendar.senate_decision_date %>
<%= t('.senate_decision_no') %><%= @calendar.senate_decision_no %>
<%= t('.senate_decision_no') %><%= decision.decision_no %>
<%= t('.timezone') %> <%= @calendar.timezone %>
diff --git a/app/views/calendar_management/calendars/show.html.erb b/app/views/calendar_management/calendars/show.html.erb index 9c557b115..8c10885ac 100644 --- a/app/views/calendar_management/calendars/show.html.erb +++ b/app/views/calendar_management/calendars/show.html.erb @@ -8,7 +8,7 @@ <%= link_to fa_icon('file-pdf-o'), [:calendar_management, @calendar, format: :pdf], class: 'btn btn-outline-primary btn-sm' %> <%= link_to fa_icon('university', text: t('.assign_to_units')), [:calendar_management, @calendar, :units], - class: 'btn btn-outline-primary btn-sm' %> + class: 'btn btn-outline-primary btn-sm' %> <%= link_to_actions(@calendar, scope: :calendar_management, except: :show) %> diff --git a/app/views/calendar_management/calendars/units.html.erb b/app/views/calendar_management/calendars/units.html.erb index 361196540..5d4566604 100644 --- a/app/views/calendar_management/calendars/units.html.erb +++ b/app/views/calendar_management/calendars/units.html.erb @@ -12,7 +12,7 @@
-<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/committee/agendas/_search.html.erb b/app/views/committee/agendas/_search.html.erb index ba8183c7d..33e0a2a05 100644 --- a/app/views/committee/agendas/_search.html.erb +++ b/app/views/committee/agendas/_search.html.erb @@ -45,9 +45,9 @@
<%= label_tag(:agenda_type_id, t('.agenda_type_id')) %> <%= select_tag(:agenda_type_id, - options_from_collection_for_select(AgendaType.all, :id, :name, params[:agenda_type_id]), - include_blank: true, - class: 'form-control') %> + options_from_collection_for_select(AgendaType.all, :id, :name, params[:agenda_type_id]), + include_blank: true, + class: 'form-control') %>
diff --git a/app/views/committee/decisions/_form.html.erb b/app/views/committee/decisions/_form.html.erb index 3d751c933..5d76e96ad 100644 --- a/app/views/committee/decisions/_form.html.erb +++ b/app/views/committee/decisions/_form.html.erb @@ -6,7 +6,7 @@ <%= form_title %>
- <%= simple_form_for(decision, url: url, method: method ) do |f| %> + <%= simple_form_for(decision, url: url, method: method) do |f| %>
<%= f.error_notification %> diff --git a/app/views/committee/decisions/show.html.erb b/app/views/committee/decisions/show.html.erb index bd50ce0e2..f21918657 100644 --- a/app/views/committee/decisions/show.html.erb +++ b/app/views/committee/decisions/show.html.erb @@ -28,7 +28,7 @@
- + diff --git a/app/views/committee/meetings/_form.html.erb b/app/views/committee/meetings/_form.html.erb index e9fd4f69f..9531979db 100644 --- a/app/views/committee/meetings/_form.html.erb +++ b/app/views/committee/meetings/_form.html.erb @@ -44,6 +44,6 @@ <%= javascript_include_tag 'shared/cocoon' %> - \ No newline at end of file + diff --git a/app/views/committee/meetings/show.html.erb b/app/views/committee/meetings/show.html.erb index 7ccb215d1..006a28f64 100644 --- a/app/views/committee/meetings/show.html.erb +++ b/app/views/committee/meetings/show.html.erb @@ -43,7 +43,7 @@ - + diff --git a/app/views/course_management/available_course_groups/_lecturer_fields.html.erb b/app/views/course_management/available_course_groups/_lecturer_fields.html.erb index bb7af1d9b..18c934014 100644 --- a/app/views/course_management/available_course_groups/_lecturer_fields.html.erb +++ b/app/views/course_management/available_course_groups/_lecturer_fields.html.erb @@ -6,7 +6,7 @@ <%= f.association :lecturer, collection: @lecturers, label_method: lambda { |lecturer| full_name(lecturer) } %>
- <%= f.input :coordinator, collection: [[t('yes'), true] ,[t('no'), false]], required: true %> + <%= f.input :coordinator, collection: [[t('yes'), true], [t('no'), false]], required: true %>
diff --git a/app/views/course_management/available_courses/_groups.html.erb b/app/views/course_management/available_courses/_groups.html.erb index a428be64b..ca81c78aa 100644 --- a/app/views/course_management/available_courses/_groups.html.erb +++ b/app/views/course_management/available_courses/_groups.html.erb @@ -33,7 +33,7 @@
<%= @agenda.agenda_type.name %>
<%= t('.decision_no')%><%= t('.decision_no') %> <%= @agenda.decision.try(:decision_no) %>
<%= t('.description') %> <%= t('.status') %> <%= t('.agenda_type') %><%= t('.decision_no')%><%= t('.decision_no') %> <%= t('actions') %>
- <%= t('.quota')%>
+ <%= t('.quota') %>
<%= group.quota %>
<% end %> diff --git a/app/views/course_management/available_courses/_search.html.erb b/app/views/course_management/available_courses/_search.html.erb index e98334816..fb5c828d5 100644 --- a/app/views/course_management/available_courses/_search.html.erb +++ b/app/views/course_management/available_courses/_search.html.erb @@ -26,32 +26,32 @@
<%= label_tag :term, t('smart_search') %> <%= text_field_tag :term, - params[:term], - placeholder: t('.smart_search_placeholder'), - class: 'form-control' %> + params[:term], + placeholder: t('.smart_search_placeholder'), + class: 'form-control' %>
<%= label_tag(:unit_id, t('.unit')) %> <%= select_tag(:unit_id, - options_from_collection_for_select(Unit.active.coursable.order(:name), :id, :names_depth_cache, params[:unit_id]), - include_blank: true, - class: 'form-control', - style: 'width: 100%') %> + options_from_collection_for_select(Unit.active.coursable.order(:name), :id, :names_depth_cache, params[:unit_id]), + include_blank: true, + class: 'form-control', + style: 'width: 100%') %>
<%= label_tag(:curriculum_id, t('.curriculum')) %> <%= select_tag(:curriculum_id, - include_blank: true, - class: 'form-control', - style: 'width: 100%') %> + include_blank: true, + class: 'form-control', + style: 'width: 100%') %>
<%= label_tag(:academic_term_id, t('.academic_term')) %> <%= select_tag(:academic_term_id, - options_from_collection_for_select(AcademicTerm.all, :id, lambda { |term| full_name(term) }, params[:academic_term_id]), - include_blank: true, - class: 'form-control', - style: 'width: 100%') %> + options_from_collection_for_select(AcademicTerm.all, :id, lambda { |term| full_name(term) }, params[:academic_term_id]), + include_blank: true, + class: 'form-control', + style: 'width: 100%') %>
@@ -80,7 +80,7 @@ placeholder: 'Müfredat Seçiniz', after_initialize: function(){ var el = $(this['el']) - if(el.val() !== '') el.trigger('change', "<%= params[:curriculum_id]%>") + if(el.val() !== '') el.trigger('change', "<%= params[:curriculum_id] %>") } } ] diff --git a/app/views/course_management/course_evaluation_types/new.html.erb b/app/views/course_management/course_evaluation_types/new.html.erb index 11002c7aa..2e6b802d6 100644 --- a/app/views/course_management/course_evaluation_types/new.html.erb +++ b/app/views/course_management/course_evaluation_types/new.html.erb @@ -1,4 +1,4 @@ <%= render 'form', evaluation_type: @evaluation_type, form_title: t('.form_title', course: @available_course.name), url: available_course_evaluation_types_path(@available_course), - method: :post %> + method: :post %> diff --git a/app/views/course_management/course_groups/_search.html.erb b/app/views/course_management/course_groups/_search.html.erb index 7bb6d576f..d33052138 100644 --- a/app/views/course_management/course_groups/_search.html.erb +++ b/app/views/course_management/course_groups/_search.html.erb @@ -27,29 +27,29 @@
<%= label_tag :term, t('smart_search') %> <%= text_field_tag :term, - params[:term], - placeholder: t('.smart_search_placeholder'), - class: 'form-control' %> + params[:term], + placeholder: t('.smart_search_placeholder'), + class: 'form-control' %>
<%= label_tag(:unit_id, t('.unit')) %> <%= select_tag(:unit_id, - options_from_collection_for_select(Unit.active.coursable.order(:name), :id, :names_depth_cache, params[:unit_id]), - include_blank: true, - class: 'form-control', - style: 'width: 100%') %> + options_from_collection_for_select(Unit.active.coursable.order(:name), :id, :names_depth_cache, params[:unit_id]), + include_blank: true, + class: 'form-control', + style: 'width: 100%') %>
<%= label_tag(:course_group_type_id, t('.course_group_type')) %> <%= select_tag(:course_group_type_id, - options_from_collection_for_select(CourseGroupType.all, :id, :name, params[:course_group_type_id]), - include_blank: true, - class: 'form-control', - style: 'width: 100%') %> + options_from_collection_for_select(CourseGroupType.all, :id, :name, params[:course_group_type_id]), + include_blank: true, + class: 'form-control', + style: 'width: 100%') %>
diff --git a/app/views/course_management/courses/_search.html.erb b/app/views/course_management/courses/_search.html.erb index 5af20df44..b67789e7f 100644 --- a/app/views/course_management/courses/_search.html.erb +++ b/app/views/course_management/courses/_search.html.erb @@ -27,59 +27,59 @@
<%= label_tag :term, t('smart_search') %> <%= text_field_tag :term, - params[:term], - placeholder: t('.smart_search_placeholder'), - class: 'form-control' %> + params[:term], + placeholder: t('.smart_search_placeholder'), + class: 'form-control' %>
<%= label_tag(:unit_id, t('.unit')) %> <%= select_tag(:unit_id, - options_from_collection_for_select(Unit.active.coursable.order(:name), :id, :names_depth_cache, params[:unit_id]), - include_blank: true, - class: 'form-control', - style: 'width: 100%') %> + options_from_collection_for_select(Unit.active.coursable.order(:name), :id, :names_depth_cache, params[:unit_id]), + include_blank: true, + class: 'form-control', + style: 'width: 100%') %>
<%= label_tag(:program_type, t('.program_type')) %> <%= select_tag(:program_type, - options_for_select(enum_options_for_select(Course, :program_type), params[:program_type]), - include_blank: true, - class: 'form-control', - style: 'width: 100%') %> + options_for_select(enum_options_for_select(Course, :program_type), params[:program_type]), + include_blank: true, + class: 'form-control', + style: 'width: 100%') %>
<%= label_tag(:language_id, t('.language')) %> <%= select_tag(:language_id, - options_from_collection_for_select(Language.all, :id, :name, params[:language_id]), - include_blank: true, - class: 'form-control', - style: 'width: 100%') %> + options_from_collection_for_select(Language.all, :id, :name, params[:language_id]), + include_blank: true, + class: 'form-control', + style: 'width: 100%') %>
<%= label_tag(:course_type_id, t('.course_type')) %> <%= select_tag(:course_type_id, - options_from_collection_for_select(CourseType.all, :id, :name, params[:course_type_id]), - include_blank: true, - class: 'form-control', - style: 'width: 100%') %> + options_from_collection_for_select(CourseType.all, :id, :name, params[:course_type_id]), + include_blank: true, + class: 'form-control', + style: 'width: 100%') %>
<%= label_tag(:status, t('.status')) %> <%= select_tag(:status, - options_for_select(enum_options_for_select(Course, :status), params[:status]), - include_blank: true, - class: 'form-control', - style: 'width: 100%') %> + options_for_select(enum_options_for_select(Course, :status), params[:status]), + include_blank: true, + class: 'form-control', + style: 'width: 100%') %>
@@ -98,4 +98,4 @@ $(document).ready(function() { $('#course_type_id, #unit_id, #program_type, #language_id, #status').select2(); }); - \ No newline at end of file + diff --git a/app/views/course_management/courses/show.html.erb b/app/views/course_management/courses/show.html.erb index 9202d587c..d5ce38db8 100644 --- a/app/views/course_management/courses/show.html.erb +++ b/app/views/course_management/courses/show.html.erb @@ -57,4 +57,4 @@ - \ No newline at end of file + diff --git a/app/views/course_management/curriculum_course_groups/_form.html.erb b/app/views/course_management/curriculum_course_groups/_form.html.erb index d13207f07..da6c07956 100644 --- a/app/views/course_management/curriculum_course_groups/_form.html.erb +++ b/app/views/course_management/curriculum_course_groups/_form.html.erb @@ -22,14 +22,14 @@
-

<%= t('.courses')%>

-
+

<%= t('.courses') %>

+
<%= f.simple_fields_for :curriculum_courses do |p| %> <%= p.input :curriculum_semester_id, as: :hidden %>
<%= p.association :course, - collection: [ p.object.course ], + collection: [p.object.course], include_blank: false, readonly: true %>
diff --git a/app/views/course_management/curriculum_course_groups/new.html.erb b/app/views/course_management/curriculum_course_groups/new.html.erb index 4dcf56d6d..536349be7 100644 --- a/app/views/course_management/curriculum_course_groups/new.html.erb +++ b/app/views/course_management/curriculum_course_groups/new.html.erb @@ -21,7 +21,7 @@
diff --git a/app/views/course_management/curriculums/_semesters.html.erb b/app/views/course_management/curriculums/_semesters.html.erb index 4ad93ab38..ef1bc6e6e 100644 --- a/app/views/course_management/curriculums/_semesters.html.erb +++ b/app/views/course_management/curriculums/_semesters.html.erb @@ -1,6 +1,6 @@
<% semesters.each do |semester| %> -
+
<%= fa_icon 'book' %><%= "#{semester.sequence}. #{t('semester')} (#{enum_t(semester, :term)})" %> @@ -21,21 +21,20 @@ additional_info: "
#{t('.total_ects')}
#{semester.curriculum_courses.compulsory.sum(:ects)} -
".html_safe - %> +
".html_safe %> <% semester.curriculum_course_groups.each do |curriculum_course_group| %> <%= render 'curriculum_courses', - klass: 'border-warning', - actions: link_to_actions([semester, curriculum_course_group], except: :show), - title: "#{t('.elective_courses')} - #{curriculum_course_group.name}", - semester: semester, - courses: curriculum_course_group.curriculum_courses.order('courses.name'), - action_visible: false, - additional_info: "
- #{t('.selectable_total_ects')}
- #{curriculum_course_group.ects} -
".html_safe %> + klass: 'border-warning', + actions: link_to_actions([semester, curriculum_course_group], except: :show), + title: "#{t('.elective_courses')} - #{curriculum_course_group.name}", + semester: semester, + courses: curriculum_course_group.curriculum_courses.order('courses.name'), + action_visible: false, + additional_info: "
+ #{t('.selectable_total_ects')}
+ #{curriculum_course_group.ects} +
".html_safe %> <% end %>
- <%= f.input :password_confirmation, required: true, label: false, wrapper: false %> + <%= f.input :password_confirmation, required: true, label: false, wrapper: false %>
<%= f.button :submit, t('.reset_my_password'), class: 'btn btn-block btn-primary' %> diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index 4065a34e3..f1d76be46 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -29,7 +29,7 @@ <%= fa_icon('lock') %>
- <%= f.input :password, required: true, label: false, wrapper: false %> + <%= f.input :password, required: true, label: false, wrapper: false %>
@@ -38,7 +38,7 @@ <%= fa_icon('lock') %>
- <%= f.input :password_confirmation, required: true, label: false, wrapper: false %> + <%= f.input :password_confirmation, required: true, label: false, wrapper: false %> <%= f.button :submit, t('devise.common.register'), class: 'btn btn-block btn-success' %> diff --git a/app/views/first_registration/prospective_students/_search.html.erb b/app/views/first_registration/prospective_students/_search.html.erb index 9d483bbf3..6357bc0cd 100644 --- a/app/views/first_registration/prospective_students/_search.html.erb +++ b/app/views/first_registration/prospective_students/_search.html.erb @@ -130,4 +130,3 @@ dynamic_select.init() }); - diff --git a/app/views/first_registration/prospective_students/show.html.erb b/app/views/first_registration/prospective_students/show.html.erb index 9d4e22a5a..c065e76c9 100644 --- a/app/views/first_registration/prospective_students/show.html.erb +++ b/app/views/first_registration/prospective_students/show.html.erb @@ -48,7 +48,7 @@ <%= registration_document.name %> @@ -77,7 +77,7 @@ <% if @prospective_student.temporary_registrable? %> <%= link_to(t('.temporarily_register'), %i[register first_registration prospective_student], - class: "btn btn-block btn-success registration-button", + class: 'btn btn-block btn-success registration-button', disabled: @prospective_student.unit.registration_documents.present?) %> <% else %>