generated from ita-social-projects/DevTemplate
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added notes to constructor #987
Open
alexy78
wants to merge
25
commits into
calculators-constructor
Choose a base branch
from
950-additional-notes
base: calculators-constructor
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 15 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
8d3ead5
Added notes to constructor
alexy78 c7f5226
Added spaces
alexy78 8fde9ed
Fixed some comments
alexy78 5bf308a
updated test
alexy78 8235899
Resolved merge conflicts
alexy78 f53c539
updated partial for showpage and changed validations
alexy78 953013a
Added space to controller
alexy78 bb1bfe5
notes translateble+tests
DanielVajnagi 1f0d03a
cop
DanielVajnagi cf8bd38
Merge branch 'calculators-constructor' into 950-additional-notes
DanielVajnagi 1511258
cop
DanielVajnagi c0fc923
Update spec/models/calculator_spec.rb
DanielVajnagi c63e201
xss
DanielVajnagi 3b01ccb
Merge branch '950-additional-notes' of https://github.com/ita-social-…
DanielVajnagi 0a60823
fix
DanielVajnagi bf3d5f6
moved to helper
DanielVajnagi 371b7d0
fix
DanielVajnagi ac76ba2
Sanitize helper tests
DanielVajnagi dd9271c
rubocop fixes
DanielVajnagi 58f96aa
Merge branch 'calculators-constructor' into 950-additional-notes
DanielVajnagi 477d2b2
remove instance variable in tests
DanielVajnagi 8c7b500
Update calculators_helper_spec.rb
DanielVajnagi 317d9b3
moved tinymce form on top of the page, to the calculators info container
DanielVajnagi 2513033
rails_helper missing fix
DanielVajnagi 1180df7
rubocop fix
DanielVajnagi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,3 +124,4 @@ gem "rails_db", "~> 2.4" | |
gem "meta-tags" | ||
gem "inline_svg" | ||
gem "breadcrumbs_on_rails" | ||
gem "tinymce-rails" |
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,20 @@ | ||
import { Controller } from '@hotwired/stimulus' | ||
|
||
export default class extends Controller { | ||
static targets = ['input'] | ||
|
||
connect() { | ||
tinymce.init(this.tinymceConfig) | ||
} | ||
|
||
disconnect() { | ||
tinymce.remove() | ||
} | ||
|
||
get tinymceConfig() { | ||
return { | ||
target: this.inputTarget, | ||
...TinyMCERails.configuration.default | ||
} | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
app/views/account/calculators/partials/_tinymce_form.html.erb
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,14 @@ | ||
<%= tinymce_assets %> | ||
<div data-controller="tinymce"> | ||
<div class="pt-4"> | ||
<%= f.label :uk_notes, t("account.calculators.new.uk_notes") %> | ||
<%= f.text_area :uk_notes, data: { tinymce_target: "input" }, class: "tinymce", rows: 20, cols: 60 %> | ||
</div> | ||
|
||
<div class="pt-4 pb-4"> | ||
<%= f.label :en_notes, t("account.calculators.new.en_notes") %> | ||
<%= f.text_area :en_notes, data: { tinymce_target: "input" }, class: "tinymce", rows: 20, cols: 60 %> | ||
</div> | ||
</div> | ||
|
||
<%= tinymce %> |
7 changes: 3 additions & 4 deletions
7
app/views/calculators/partials/show/_constructor_calculator_description.erb
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,8 +1,7 @@ | ||
<%# TODO: Delete this if %> | ||
<% if false %> | ||
<% if calculator.uk_notes.present? || calculator.en_notes.present? %> | ||
<section class="description-section"> | ||
<div class="description-block"> | ||
<%# TODO: ADD text here %> | ||
<div class="description-section"> | ||
<%= sanitize(calculator.notes, tags: %w[p strong em ul li a div span img], attributes: %w[href target class src alt style]) %> | ||
</div> | ||
</section> | ||
<% end %> |
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,8 @@ | ||
height: 300 | ||
width: 800 | ||
menubar: false | ||
toolbar: | ||
- undo redo | blocks | bold italic | alignleft aligncenter alignright | bullist numlist outdent indent | removeformat | ||
plugins: | ||
- insertdatetime lists media table code wordcount | ||
license_key: 'gpl' |
8 changes: 8 additions & 0 deletions
8
db/migrate/20241121165300_add_language_notes_to_calculators.rb
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,8 @@ | ||
class AddLanguageNotesToCalculators < ActiveRecord::Migration[7.2] | ||
def change | ||
change_table :calculators, bulk: true do |t| | ||
t.text :uk_notes | ||
t.text :en_notes | ||
end | ||
end | ||
end |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
перенеси це в хелпер
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
і не юзай цей %, то зло