-
Notifications
You must be signed in to change notification settings - Fork 11
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
base: calculators-constructor
Are you sure you want to change the base?
Changes from all commits
8d3ead5
c7f5226
8fde9ed
5bf308a
8235899
f53c539
953013a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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" |
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 | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,14 @@ | ||||||
<%= tinymce_assets %> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. align that all |
||||||
<div data-controller="tinymce"> | ||||||
<div class="pt-4"> | ||||||
<%= f.label :ukranian_additional_notes, t("account.calculators.new.ukranian_additional_notes") %> | ||||||
<%= f.text_area :ukranian_additional_notes, data: { tinymce_target: "input" }, class: "tinymce", rows: 20, cols: 60 %> | ||||||
</div> | ||||||
|
||||||
<div class="pt-4 pb-4"> | ||||||
<%= f.label :english_additional_notes, t("account.calculators.new.english_additional_notes") %> | ||||||
<%= f.text_area :english_additional_notes, data: { tinymce_target: "input" }, class: "tinymce", rows: 20, cols: 60 %> | ||||||
</div> | ||||||
</div> | ||||||
|
||||||
<%= tinymce %> |
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,8 +1,11 @@ | ||||||||||||||
<%# TODO: Delete this if %> | ||||||||||||||
<% if false %> | ||||||||||||||
<% if calculator.ukranian_additional_notes.present? || calculator.english_additional_notes.present? %> | ||||||||||||||
<section class="description-section"> | ||||||||||||||
<div class="description-block"> | ||||||||||||||
<%# TODO: ADD text here %> | ||||||||||||||
<div class="description-section"> | ||||||||||||||
<% if I18n.locale == :uk %> | ||||||||||||||
<%= raw calculator.ukranian_additional_notes %> | ||||||||||||||
<% else %> | ||||||||||||||
<%= raw calculator.english_additional_notes %> | ||||||||||||||
<% end %> | ||||||||||||||
</div> | ||||||||||||||
Comment on lines
+4
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
then you have: |
||||||||||||||
</section> | ||||||||||||||
<% end %> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -361,6 +361,8 @@ uk: | |
prohibited_to_update: " перешкоджають оновленню калькулятора" | ||
prohibited_to_save: " перешкоджають збереженню калькулятора" | ||
error: "помилки" | ||
ukranian_additional_notes: "Додаткові нотатки українською" | ||
english_additional_notes: "Додаткові нотатки англійською" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. у нас же нема основних нотаток) |
||
site_settings: | ||
edit: | ||
meta-title: "Налаштування сайту" | ||
|
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' |
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 :ukranian_additional_notes | ||
t.text :english_additional_notes | ||
end | ||
end | ||
end |
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.
use method to do that and test it