Commit 17db8dc4 authored by Jiri Strojil's avatar Jiri Strojil

Merge branch 'fix/fix-feedbacks' into 'develop'

Fixed feedbacks

See merge request !997
parents ca947660 642f1044
Pipeline #62733 passed with stage
in 36 minutes and 33 seconds
function volunteerForm() {
show_rejection();
toggleOtherInput($('#other-offer label input').length > 0 ? $('#other-offer label input')[0].checked : false)
toggleOtherInput($('#other-offer label input').length > 0 ? $('#other-offer label input')[0] : null)
$('#volunteer_acceptance').on('change load', ({target}) => show_rejection(target));
......@@ -25,8 +25,12 @@ function volunteerForm() {
$('.checkbox-toggle-collapse').trigger('change');
}
const toggleOtherInput = (checked) =>
const toggleOtherInput = (target) => {
if (!target) return;
const checked = $(target).is(':checked');
$('#volunteer_other_offer_desc').parent().toggle(checked);
}
const hideFormRegions = (hide) => {
hide.forEach(cssClass => $(`.${cssClass}`).hide());
......
module ContactHelper
def self.address_for_pdf(contact)
[
[contact&.street, contact&.extended].compact.join(', '),
[contact&.postal_code, contact&.city].compact.join(' '),
[contact&.street, contact&.extended].reject(&:blank?).join(', '),
[contact&.postal_code, contact&.city].reject(&:blank?).join(' '),
"www.aoz.ch/freiwilligenarbeit"
].compact.join('<br>')
end
......
......@@ -12,8 +12,8 @@ class GroupOfferCategory < ApplicationRecord
scope :house_moving, -> { where('category_name LIKE ?', '%Zürich%') }
scope :without_house_moving, -> { where.not('category_name LIKE ?', '%Zürich%') }
scope :in_group_offer, (-> { joins(:group_offers) })
scope :without_other, -> { where.not('category_name = ?', 'Andere')}
scope :other, -> { where('category_name = ? ', 'Andere')}
scope :without_other, -> { where.not('category_name = ?', 'Anderes / auf Inserat:')}
scope :other, -> { where('category_name = ? ', 'Anderes / auf Inserat:')}
def self.available_categories(exclude_ids)
active.where.not(id: exclude_ids).map { |goc| [goc.category_name, goc.id] }
......
......@@ -19,7 +19,7 @@ nav.navbar.section-navigation#filters
hr
ul.list-inline
li= clear_filter_button
= custom_filter_dropdown('Standort', *Department.filterable)
= custom_filter_dropdown('Standort', *Department.name_asc.filterable)
= list_filter_dropdown(:offer_state, GroupOffer::OFFER_STATES)
= custom_filter_dropdown('Kategorie', *GroupOfferCategory.filterable_group_offer)
= custom_filter_dropdown('Einsatz',
......
class RenameAndereGroupOffer < ActiveRecord::Migration[5.1]
def up
cat = GroupOfferCategory.find_by('category_name = ? ', 'Andere')
cat.update(category_name: 'Anderes / auf Inserat:') if cat
end
end
......@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20191106160032) do
ActiveRecord::Schema.define(version: 20191122122407) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment