-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* squash branch * Replace if ! with unless * Remove duplicate keys from translation file * Fix validate_interest helper function, to match rgb or rgba value * Make people skills model set skill level and interest to 1 if they are 0 but not unrated * Bring back missing translation in de.yml * Bring back people skills rating filter * Fix tests after reimplementing people rating filter * Fix specs * Test reset button on people skills edit view * Implement test to test if interest is changed to 1 when level is chagned * disable caching for specifi page * Prevent resorting of skills after updating their value --------- Co-authored-by: Yanick Minder <[email protected]>
- Loading branch information
1 parent
018004c
commit 3e6a5c0
Showing
26 changed files
with
430 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
%label.form-label.text-gray= t "people-skills.interest" | ||
.rate | ||
= ff.radio_button :interest, 5, { checked: ff.object.interest == 5, id: "star5#{ff.object.skill.id}", "data-action": "change->people-skills#rateSkill" } | ||
%label{for: "star5#{ff.object.skill.id}", title: "text", id: "star-label5#{ff.object.skill.id}", class: "star5"} 5 stars | ||
= ff.radio_button :interest, 4, { checked: ff.object.interest == 4, id: "star4#{ff.object.skill.id}", "data-action": "change->people-skills#rateSkill" } | ||
%label{for: "star4#{ff.object.skill.id}", title: "text", id: "star-label4#{ff.object.skill.id}", class: "star4"} 4 stars | ||
= ff.radio_button :interest, 3, { checked: ff.object.interest == 3, id: "star3#{ff.object.skill.id}", "data-action": "change->people-skills#rateSkill" } | ||
%label{for: "star3#{ff.object.skill.id}", title: "text", id: "star-label3#{ff.object.skill.id}", class: "star3"} 3 stars | ||
= ff.radio_button :interest, 2, { checked: ff.object.interest == 2, id: "star2#{ff.object.skill.id}", "data-action": "change->people-skills#rateSkill" } | ||
%label{for: "star2#{ff.object.skill.id}", title: "text", id: "star-label2#{ff.object.skill.id}", class: "star2"} 2 stars | ||
= ff.radio_button :interest, 1, { checked: (ff.object.id.nil? && ff.object.interest.nil?) || ff.object.interest == 1, id: "star1#{ff.object.skill.id}", "data-action": "change->people-skills#rateSkill" } | ||
%label{for: "star1#{ff.object.skill.id}", title: "text", id: "star-label1#{ff.object.skill.id}", class: "star1"} 1 star | ||
= ff.radio_button :interest, 0, id: "default-star-#{ff.object.skill.id}", class: "visually-hidden" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
%label.form-label.text-gray= t "people-skills.interest" | ||
.rate.rate-show | ||
%input{type: "radio", value: 5, id: "star5#{person_skill.id}", | ||
checked: person_skill.interest == 5, disabled: true}/ | ||
%label{for: "star5#{person_skill.id}", title: "text", id: "star-label5#{person_skill.id}"} 5 stars | ||
%input{type: "radio", value: 4, id: "star4#{person_skill.id}", | ||
checked: person_skill.interest == 4, disabled: true}/ | ||
%label{for: "star4#{person_skill.id}", title: "text", id: "star-label4#{person_skill.id}"} 4 stars | ||
%input{type: "radio", value: 3, id: "star3#{person_skill.id}", | ||
checked: person_skill.interest == 3, disabled: true}/ | ||
%label{for: "star3#{person_skill.id}", title: "text", id: "star-label3#{person_skill.id}"} 3 stars | ||
%input{type: "radio", value: 2, id: "star2#{person_skill.id}", | ||
checked: person_skill.interest == 2, disabled: true}/ | ||
%label{for: "star2#{person_skill.id}", title: "text", id: "star-label2#{person_skill.id}"} 2 stars | ||
%input{type: "radio", value: 1, id: "star1#{person_skill.id}", | ||
checked: person_skill.interest == 1, disabled: true}/ | ||
%label{for: "star1#{person_skill.id}", title: "text", id: "star-label1#{person_skill.id}"} 1 star |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
%div.mw-100.border-bottom.text-black.ps-5.border{id: "default-skill-#{ff.object.skill.id}"} | ||
%div.d-flex.flex-row.align-items-center.mt-3.mb-3.w-100{data: {controller: "people-skills"}} | ||
%div.col-2 | ||
= ff.object.skill.title | ||
= ff.hidden_field :interest | ||
= ff.hidden_field :unrated, value: false, id: "unrated-field-#{ff.object.skill.id}" | ||
%div.col-2 | ||
%div.d-flex.flex-column.align-items-center | ||
%label.form-label.text-gray= t "people-skills.levels.level" | ||
%label.form-label.text-gray{"data-people-skills-target": "label"}= t "people-skills.levels.#{ExpertiseTopicSkillValue.skill_levels.key(ff.object.level - 1)}" | ||
- range_min = (ff.object.id.nil? || ff.object.level != 0) ? 1 : 0 | ||
= ff.range_field :level, min: range_min, max: 5, class: "form-range w-75", | ||
"data-action": "change->people-skills#displayLevelLabel people-skills#rateSkill", | ||
"data-people-skills-target": "switch" | ||
%div.col-2 | ||
%div.d-flex.flex-column.align-items-center | ||
= render partial: "edit_interest_stars", locals: { ff: ff } | ||
%div.col-2 | ||
%div.d-flex.flex-row.form-check | ||
= ff.check_box :certificate, { class: "form-check-input me-2", "data-action": "change->people-skills#rateSkill" } | ||
%label.form-label.text-gray= t "people-skills.certificate" | ||
%div.col-2 | ||
%div.d-flex.flex-row.form-check | ||
= ff.check_box :core_competence, { class: "form-check-input me-2", "data-action": "change->people-skills#rateSkill" } | ||
%label.form-label.text-gray= t "people-skills.core-competence" | ||
= ff.hidden_field :skill_id | ||
%div.col-2 | ||
- if ff.object.id.nil? | ||
= ff.submit "Bewerten", { class: "btn btn-link" } | ||
- unless ff.object.unrated | ||
= ff.submit "Nicht bewerten", { class: "btn btn-link", "data-action": "people-skills#unrateSkill"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
%p.d-flex.align-items-center.profile-header | ||
Skills | ||
="(#{@person.people_skills.count})" | ||
|
||
%div.ms-3 | ||
= form_with(url: person_people_skills_path(@person), method: :get, data: {controller: "filter", turbo_frame: "people-skills"}) do |f| | ||
%span.btn-group | ||
- rating = request.query_parameters[:rating] | ||
= f.radio_button :rating, 1, class: "btn-check", checked: rating == "1", | ||
onClick: "this.form.requestSubmit()", data: {action: "change->filter#submit"} | ||
= f.label :rating, t("people-skills.filter.all"), value: 1, class: "btn btn-outline-primary" | ||
|
||
= f.radio_button :rating, 0, class: "btn-check", checked: rating == "0", | ||
onClick: "this.form.requestSubmit()", data: {action: "change->filter#submit"} | ||
= f.label :rating, t("people-skills.filter.rated"), value: 0, class: "btn btn-outline-primary" | ||
|
||
= f.radio_button :rating, -1, class: "btn-check", checked: rating == "-1", | ||
onClick: "this.form.requestSubmit()", data: {action: "change->filter#submit"} | ||
= f.label :rating, t("people-skills.filter.unrated"), value: -1, class: "btn btn-outline-primary" | ||
|
||
= turbo_frame_tag 'people-skills' do | ||
- Category.all_parents.each do |category| | ||
%div.profile-header.mw-100.border-bottom.mt-4{id: category.title, "data-scroll-target": "scrollItem"} | ||
= category.title | ||
- ([category] + category.children.to_a).each do |category_child| | ||
- people_skills_of_category = people_skills_of_category(category_child) | ||
%div.white-header.mw-100.border-bottom.text-gray | ||
=category_child.title + " (#{people_skills_of_category.count})" | ||
- people_skills_of_category.each do |person_skill| | ||
- @person_skill = person_skill | ||
= form_with model: @person, url: people_skills_person_path(@person, rating: params["rating"]) do |form| | ||
= form.fields_for :people_skills, @person_skill do |ff| | ||
= render "people/people_skills/edit_form", ff: ff |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
= turbo_stream.update "default-skill-errors" do | ||
= render "application/error_banners", errors: @person.errors |
Oops, something went wrong.