forked from ontoportal/ontoportal_web_ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from EarthPortal/feature/slice-form-improvement
slice form modifications and restoring original feedback slice
- Loading branch information
Showing
9 changed files
with
2,129 additions
and
81 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,61 @@ | ||
- if params[:pop].eql?("true") | ||
- pop = true | ||
- unless @errors.nil? | ||
%div{style: "color:red;margin-bottom:1em;"} | ||
%div{:style => "color:red;margin-bottom:1em;"} | ||
= t("home.feedback.error_on_form") | ||
%ul | ||
- @errors.each do |error| | ||
- for error in @errors | ||
%li= error | ||
= form_tag('/feedback') do | ||
-# Simulate form_for by providing a hidden field to check for submission | ||
= hidden_field_tag 'sim_submit', 'true' | ||
= hidden_field_tag("pop", pop) | ||
.d-flex.justify-content-center.m-3 | ||
.feedback-form.p-4{style: "max-width: 600px; width: 100%;"} | ||
.feedback-title-container.text-center.mb-4 | ||
.feedback-form | ||
.feedback-title-container | ||
%h2.feedback-title | ||
= t("home.feedback.suggest_a_slice") | ||
%hr#feedback-title-line.mb-4/ | ||
.form-group.mb-3{style: "max-width: 500px; margin: 0 auto;"} | ||
= t("home.feedback.leave_your_feedback") | ||
%hr#feedback-title-line/ | ||
- unless session[:user].nil? | ||
%p.feedback-text | ||
= t("home.feedback.feedback_hi_text") | ||
%font | ||
= session[:user].username | ||
, | ||
%p.feedback-email | ||
= t("home.feedback.feedback_info_text") | ||
%a{:href => "mailto: #{$SUPPORT_EMAIL}"}= $SUPPORT_EMAIL | ||
= t("home.feedback.feedback_info_text_rest") | ||
%a{:href => $GITHUB_ISSUES} | ||
Github issues | ||
- if session[:user].nil? | ||
%p.feedback-input-title | ||
= t("home.feedback.email") | ||
%font{color: "red"} * | ||
- if session[:user] | ||
= hidden_field_tag "email", session[:user].email | ||
%input.feedback-input.w-100{name: "email", type: "email", value: session[:user].email, disabled: true}/ | ||
- else | ||
%input.feedback-input.w-100{name: "email", type: "email"}/ | ||
.form-group.mb-3{style: "max-width: 500px; margin: 0 auto;"} | ||
%font{:color => "red"} * | ||
%input.feedback-input{:name => "email", :type => "email"}/ | ||
%p.feedback-input-title | ||
= t("home.feedback.name") | ||
%font{color: "red"} * | ||
- if session[:user] | ||
= hidden_field_tag "name", session[:user].username | ||
%input.feedback-input.w-100{name: "name", type: "text", value: session[:user].username, disabled: true}/ | ||
- else | ||
%input.feedback-input.w-100{name: "name", type: "text"}/ | ||
.form-group.mb-3{style: "max-width: 500px; margin: 0 auto;"} | ||
%p.feedback-input-title | ||
= t("home.feedback.slice_name") | ||
%font{color: "red"} * | ||
%input.feedback-input.w-100{name: "slice_name", type: "text"}/ | ||
.form-group.mb-3{style: "max-width: 500px; margin: 0 auto;"} | ||
%p.feedback-input-title | ||
= t("search.advanced_options.ontologies") | ||
%font{color: "red"} * | ||
.field.w-100{style: "border: none;"} | ||
= ontologies_selector(id:'feedback_ontologies', | ||
name: 'ontologies[]', | ||
selected: params[:ontologies]&.split(','), | ||
ontologies: onts_for_select(include_views: true)) | ||
.form-group.mb-4{style: "max-width: 500px; margin: 0 auto;"} | ||
%p.feedback-input-title | ||
= t("home.feedback.reason_usage") | ||
%font{color: "red"} * | ||
%textarea.feedback-input.w-100{name: "comment", rows: "3"} | ||
%font.register-optional= t("home.feedback.optional") | ||
%input.feedback-input{:name => "name", :type => "text"}/ | ||
- else | ||
= hidden_field_tag "name", session[:user].username | ||
= hidden_field_tag "email", session[:user].email | ||
%p.feedback-input-title | ||
= t("home.feedback.proposition_url_page") | ||
%font.register-optional= t("home.feedback.optional") | ||
%input.feedback-input{:name => "location", :type => "text", :value => unescape(params[:location] || '')} | ||
%p.feedback-input-title | ||
= t("home.feedback.feedback") | ||
%font{:color => "red"} * | ||
%textarea.feedback-input{:name => "comment", :rows => "6"} | ||
%p.feedback-input-title | ||
= t("home.feedback.tags") | ||
%font.register-optional= t("home.feedback.optional") | ||
.feedback-checks | ||
= render(ChipsComponent.new(name:"bug", value: t("home.feedback.bug"))) | ||
= render(ChipsComponent.new(name:"proposition", value: t("home.feedback.proposition"))) | ||
= render(ChipsComponent.new(name:"question", value: t("home.feedback.question"))) | ||
= render(ChipsComponent.new(name:"ontology_submissions_request", value: t("home.feedback.ontology_submissions_request"))) | ||
- if using_captcha? | ||
.mb-3 | ||
= recaptcha_tags | ||
.text-center | ||
%input.feedback-button{type: "submit", value: t("home.feedback.send")}/ | ||
= recaptcha_tags | ||
%input.feedback-button{:type => "submit", :value => t("home.feedback.send")}/ |
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,46 @@ | ||
- if session[:user] | ||
- unless @errors.nil? | ||
%div{style: "color:red;margin-bottom:1em;"} | ||
= t("home.slice.error_on_form") | ||
%ul | ||
- @errors.each do |error| | ||
%li= error | ||
= form_tag('/slice') do | ||
= hidden_field_tag 'sim_submit', 'true' | ||
.d-flex.justify-content-center.m-3 | ||
.feedback-form.p-4{style: "max-width: 600px; width: 100%;"} | ||
.feedback-title-container.text-center.mb-4 | ||
%h2.feedback-title | ||
= t("home.slice.suggest_a_slice") | ||
%hr#feedback-title-line.mb-4/ | ||
.form-group.mb-3 | ||
= hidden_field_tag "email", session[:user].email | ||
= render Input::TextInputComponent.new(label: label_required(t("home.slice.email")), name: "email", value: session[:user].email, disabled: true) | ||
.form-group.mb-3 | ||
= hidden_field_tag "name", session[:user].username | ||
= render Input::TextInputComponent.new(label: t("home.slice.name"), name: "name", value: session[:user].username, disabled: true) | ||
.form-group.mb-3 | ||
= render Input::TextInputComponent.new(label: label_required(t("home.slice.slice_name")), name: "slice_name") | ||
.form-group.mb-3{style: "margin: 0 auto;"} | ||
%p.feedback-input-title | ||
= t("search.advanced_options.ontologies") | ||
%font{color: "red"} * | ||
.field.w-100{style: "border: none;"} | ||
= ontologies_selector(id:'slice_ontologies', | ||
name: 'ontologies[]', | ||
selected: params[:ontologies]&.split(','), | ||
ontologies: onts_for_select(include_views: true)) | ||
.form-group.mb-4 | ||
= render Input::TextAreaComponent.new(label: label_required(t("home.slice.reason_usage")), name: "comment", value: "", placeholder: "", helper_text: "", rows: 3) | ||
.form-group.text-center{style: "max-width: 500px; margin: 0 auto;"} | ||
%input.feedback-button.w-100{type: "submit", value: t("home.slice.send")} | ||
- else | ||
.d-flex.justify-content-center.align-items-center{style: "height: 300px;"} | ||
.text-center | ||
%h3= t("home.slice.login_required") | ||
= link_to t("home.slice.login"), login_path(redirect: slice_path), class: "btn btn-primary mt-3" |
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,65 @@ | ||
!!! | ||
%html | ||
%head | ||
%meta{content: "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/ | ||
%meta{content: "no-cache", name: "turbo-cache-control"}/ | ||
:css | ||
body { | ||
font-family: Arial, sans-serif; | ||
line-height: 1.6; | ||
color: #333; | ||
max-width: 600px; | ||
margin: 20px auto; | ||
padding: 20px; | ||
} | ||
.header { | ||
border-bottom: 2px solid #eee; | ||
padding-bottom: 15px; | ||
margin-bottom: 20px; | ||
} | ||
.content { | ||
background: #fff; | ||
padding: 20px; | ||
border-radius: 5px; | ||
} | ||
.ontology-list { | ||
background: #f9f9f9; | ||
padding: 15px 30px; | ||
border-radius: 5px; | ||
} | ||
.comment-section { | ||
margin-top: 20px; | ||
padding-top: 20px; | ||
border-top: 1px solid #eee; | ||
} | ||
.label { | ||
color: #666; | ||
font-weight: bold; | ||
} | ||
%body | ||
.content | ||
.header | ||
%h2{style: "color: #2c3e50;"} Slice Request Details | ||
|
||
%p | ||
%span.label= t("slice_mail.name") + ": " | ||
= @name | ||
|
||
%p | ||
%span.label= t("slice_mail.email") + ": " | ||
|
||
%p | ||
%span.label= t("slice_mail.slice_name") + ": " | ||
= @slice_name | ||
|
||
.ontology-list | ||
%h3{style: "color: #2c3e50; margin-top: 0;"}= t("slice_mail.ontologies") | ||
%ul | ||
- @ontologies.split(/\s*,\s*/).each do |ontology| | ||
%li= ontology | ||
.comment-section | ||
%h3{style: "color: #2c3e50; margin-top: 0;"}= t("slice_mail.comment") | ||
.comment-content | ||
= simple_format(@comment) |
Oops, something went wrong.