-
Notifications
You must be signed in to change notification settings - Fork 3
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
Create trix-editor in project #63
Open
Apachina
wants to merge
6
commits into
master
Choose a base branch
from
add_trix_editor
base: master
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 all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
845d365
Create trix-editor in project
Apachina d79edff
Add trix versions in gemfile
Apachina 6753702
Fix remarks and add TrixField in all text fields
Apachina 64ba951
Fix all mistakes in project for rubocop
Apachina 8b88a2d
Merge branch 'master' into add_trix_editor
Apachina d2fb584
Fix mistake in DictionariesController
Apachina 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
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,7 @@ | ||
//= require jquery | ||
//= require jquery_ujs | ||
//= require selectize | ||
//= require moment | ||
//= require datetime_picker | ||
//= require_tree . | ||
//= require trix |
10 changes: 10 additions & 0 deletions
10
app/assets/javascripts/administrate/components/date_time_picker.js
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,10 @@ | ||
$(function () { | ||
$('[data-type="time"]').datetimepicker({ | ||
debug: false, | ||
format: "HH:mm:ss", | ||
}); | ||
$('[data-type="datetime"]').datetimepicker({ | ||
debug: false, | ||
format: "YYYY-MM-DD HH:mm:ss", | ||
}); | ||
}); |
3 changes: 3 additions & 0 deletions
3
app/assets/javascripts/administrate/components/has_many_form.js
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,3 @@ | ||
$(function() { | ||
$(".field-unit--has-many select").selectize({}); | ||
}); |
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,23 @@ | ||
$(function() { | ||
var keycodes = { space: 32, enter: 13 }; | ||
|
||
var visitDataUrl = function(event) { | ||
if (event.type == "click" || | ||
event.keyCode == keycodes.space || | ||
event.keyCode == keycodes.enter) { | ||
|
||
if (event.target.href) { | ||
return; | ||
} | ||
|
||
var dataUrl = $(event.target).closest("tr").data("url"); | ||
var selection = window.getSelection().toString(); | ||
if (selection.length === 0 && dataUrl) { | ||
window.location = dataUrl; | ||
} | ||
} | ||
}; | ||
|
||
$("table").on("click", ".js-table-row", visitDataUrl); | ||
$("table").on("keydown", ".js-table-row", visitDataUrl); | ||
}); |
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 |
---|---|---|
|
@@ -14,4 +14,7 @@ | |
//= require popper | ||
//= require bootstrap-sprockets | ||
//= require activestorage | ||
//= require_tree . | ||
//= require cable | ||
//= require static_page | ||
//= require cable | ||
//= require trix | ||
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. Add last line |
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 @@ | ||
// = require trix | ||
|
||
@charset "utf-8"; | ||
|
||
@import "reset/normalize"; | ||
|
||
@import "selectize"; | ||
@import "datetime_picker"; | ||
|
||
@import "library/clearfix"; | ||
@import "library/data-label"; | ||
@import "library/variables"; | ||
|
||
@import "base/forms"; | ||
@import "base/layout"; | ||
@import "base/lists"; | ||
@import "base/tables"; | ||
@import "base/typography"; | ||
|
||
@import "components/app-container"; | ||
@import "components/attributes"; | ||
@import "components/buttons"; | ||
@import "components/cells"; | ||
@import "components/field-unit"; | ||
@import "components/flashes"; | ||
@import "components/form-actions"; | ||
@import "components/main-content"; | ||
@import "components/navigation"; | ||
@import "components/pagination"; | ||
@import "components/search"; | ||
|
||
@import "utilities/text-color"; | ||
|
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,107 @@ | ||
fieldset { | ||
background-color: transparent; | ||
border: 0; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
legend { | ||
font-weight: $bold-font-weight; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
label { | ||
display: block; | ||
font-weight: $bold-font-weight; | ||
margin: 0; | ||
} | ||
|
||
input, | ||
select { | ||
display: block; | ||
font-family: $base-font-family; | ||
font-size: $base-font-size; | ||
} | ||
|
||
input, | ||
select, | ||
textarea { | ||
display: block; | ||
font-family: $base-font-family; | ||
font-size: 16px; | ||
} | ||
|
||
[type="color"], | ||
[type="date"], | ||
[type="datetime-local"], | ||
[type="email"], | ||
[type="month"], | ||
[type="number"], | ||
[type="password"], | ||
[type="search"], | ||
[type="tel"], | ||
[type="text"], | ||
[type="time"], | ||
[type="url"], | ||
[type="week"], | ||
input:not([type]), | ||
textarea { | ||
appearance: none; | ||
background-color: $white; | ||
border: $base-border; | ||
border-radius: $base-border-radius; | ||
padding: 0.5em; | ||
transition: border-color $base-duration $base-timing; | ||
width: 100%; | ||
|
||
&:hover { | ||
border-color: mix($black, $base-border-color, 20%); | ||
} | ||
|
||
&:focus { | ||
border-color: $action-color; | ||
outline: none; | ||
} | ||
|
||
&:disabled { | ||
background-color: mix($black, $white, 5%); | ||
cursor: not-allowed; | ||
|
||
&:hover { | ||
border: $base-border; | ||
} | ||
} | ||
|
||
&::placeholder { | ||
font-style: italic; | ||
} | ||
} | ||
|
||
textarea { | ||
resize: vertical; | ||
} | ||
|
||
[type="checkbox"], | ||
[type="radio"] { | ||
display: inline; | ||
margin-right: $small-spacing / 2; | ||
} | ||
|
||
[type="file"] { | ||
width: 100%; | ||
} | ||
|
||
select { | ||
width: 100%; | ||
} | ||
|
||
[type="checkbox"], | ||
[type="radio"], | ||
[type="file"], | ||
select { | ||
&:focus { | ||
outline: $focus-outline; | ||
outline-offset: $focus-outline-offset; | ||
} | ||
} |
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 @@ | ||
html { | ||
background-color: $base-background-color; | ||
box-sizing: border-box; | ||
} | ||
|
||
*, | ||
*::before, | ||
*::after { | ||
box-sizing: inherit; | ||
} | ||
|
||
figure { | ||
margin: 0; | ||
} | ||
|
||
img, | ||
picture { | ||
margin: 0; | ||
max-width: 100%; | ||
} |
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,19 @@ | ||
ul, | ||
ol { | ||
list-style-type: none; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
dl { | ||
margin-bottom: $small-spacing; | ||
|
||
dt { | ||
font-weight: $bold-font-weight; | ||
margin-top: $small-spacing; | ||
} | ||
|
||
dd { | ||
margin: 0; | ||
} | ||
} |
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,55 @@ | ||
table { | ||
border-collapse: collapse; | ||
font-size: 0.9em; | ||
text-align: left; | ||
width: 100%; | ||
|
||
a { | ||
color: inherit; | ||
text-decoration: none; | ||
} | ||
} | ||
|
||
thead { | ||
font-weight: $bold-font-weight; | ||
} | ||
|
||
tr { | ||
border-bottom: $base-border; | ||
} | ||
|
||
tbody tr { | ||
&:hover { | ||
background-color: $base-background-color; | ||
cursor: pointer; | ||
} | ||
|
||
&:focus { | ||
outline: $focus-outline; | ||
outline-offset: -($focus-outline-width); | ||
} | ||
} | ||
|
||
td, | ||
th { | ||
font-feature-settings: "kern", "liga", "clig", "calt", "lnum", "tnum"; | ||
font-kerning: normal; | ||
font-variant-ligatures: common-ligatures, contextual; | ||
font-variant-numeric: lining-nums, tabular-nums; | ||
padding: 0.75rem; | ||
vertical-align: middle; | ||
} | ||
|
||
td:first-child, | ||
th:first-child { | ||
padding-left: 2rem; | ||
} | ||
|
||
td:last-child, | ||
th:last-child { | ||
padding-right: 2rem; | ||
} | ||
|
||
td img { | ||
max-height: 2rem; | ||
} |
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,45 @@ | ||
body { | ||
color: $base-font-color; | ||
font-family: $base-font-family; | ||
font-size: $base-font-size; | ||
line-height: $base-line-height; | ||
} | ||
|
||
h1, | ||
h2, | ||
h3, | ||
h4, | ||
h5, | ||
h6 { | ||
font-family: $heading-font-family; | ||
font-size: $base-font-size; | ||
line-height: $heading-line-height; | ||
margin: 0; | ||
} | ||
|
||
p { | ||
margin: 0 0 $small-spacing; | ||
} | ||
|
||
a { | ||
color: $action-color; | ||
text-decoration-skip: ink; | ||
transition: color $base-duration $base-timing; | ||
|
||
&:hover { | ||
color: mix($black, $action-color, 25%); | ||
} | ||
|
||
&:focus { | ||
outline: $focus-outline; | ||
outline-offset: $focus-outline-offset; | ||
} | ||
} | ||
|
||
hr { | ||
border-bottom: $base-border; | ||
border-left: 0; | ||
border-right: 0; | ||
border-top: 0; | ||
margin: $base-spacing 0; | ||
} |
9 changes: 9 additions & 0 deletions
9
app/assets/stylesheets/administrate/components/_app-container.scss
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,9 @@ | ||
.app-container { | ||
align-items: stretch; | ||
display: flex; | ||
margin-left: auto; | ||
margin-right: auto; | ||
max-width: 100rem; | ||
min-height: 100vh; | ||
padding: $base-spacing; | ||
} |
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.
Did you test how this deletion influences on user interface?
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.
))))