forked from fs/task_tracker_itis_2023
-
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 fs#162 from fs/html-views
HTML / CSS / JS (RoR views)
- Loading branch information
Showing
36 changed files
with
516 additions
and
208 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
scss_files: 'app/assets/stylesheets/**/*.scss' | ||
|
||
linters: | ||
BorderZero: | ||
enabled: false | ||
|
||
Indentation: | ||
severity: warning | ||
width: 2 | ||
|
||
PropertySortOrder: | ||
enabled: false |
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,36 @@ | ||
linters: | ||
LineLength: | ||
max: 120 | ||
|
||
RedundantDiv: | ||
enabled: false | ||
|
||
RuboCop: | ||
enabled: true | ||
# These cops are incredibly noisy since the Ruby we extract from Slim | ||
# templates isn't well-formatted, so we ignore them. | ||
ignored_cops: | ||
- Layout/ArgumentAlignment | ||
- Layout/HashAlignment | ||
- Layout/IndentationWidth | ||
- Layout/LineLength | ||
- Layout/TrailingEmptyLines | ||
- Lint/BlockAlignment | ||
- Lint/EndAlignment | ||
- Lint/Void | ||
- Metrics/BlockLength | ||
- Style/AlignParameters | ||
- Style/BlockNesting | ||
- Style/FileName | ||
- Style/FirstParameterIndentation | ||
- Style/FrozenStringLiteralComment | ||
- Style/IfUnlessModifier | ||
- Style/IndentationConsistency | ||
- Style/IndentationWidth | ||
- Style/Next | ||
- Style/TrailingBlankLines | ||
- Style/TrailingWhitespace | ||
- Style/WhileUntilModifier | ||
- Style/NestedTernaryOperator | ||
- Style/StringLiterals | ||
- Style/QuotedSymbols |
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 @@ | ||
$black: #222; | ||
$white: #fff; | ||
$red: #f00; | ||
$green: #008000; | ||
$grey: #ccc; | ||
|
||
$header-bg: #f1f1f1; |
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,30 +1,12 @@ | ||
.center { | ||
text-align: center; | ||
} | ||
|
||
.record { | ||
border: 1px solid #000000; | ||
padding: 10px; | ||
margin-bottom: 10px; | ||
} | ||
|
||
.flash-alert { | ||
color: red; | ||
} | ||
// Bootstrap | ||
@import 'bootstrap/scss/bootstrap'; | ||
|
||
.flash-notice { | ||
color: green; | ||
} | ||
@import 'variables'; | ||
@import 'reset'; | ||
|
||
.sort_links { | ||
place-items: center; | ||
display: flex; | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
|
||
.link { | ||
font-family: "Courier New"; | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
// Custom styles | ||
@import 'base'; | ||
@import 'header'; | ||
@import 'form'; |
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 @@ | ||
.flash-alert { | ||
color: $red; | ||
} | ||
|
||
.flash-notice { | ||
color: $green; | ||
} | ||
|
||
.sort-links { | ||
display: flex; | ||
gap: 1rem; | ||
justify-content: flex-end; | ||
margin: 1rem 0; | ||
|
||
font-size: .75rem; | ||
} | ||
|
||
.link { | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
|
||
.content { | ||
width: 100%; | ||
padding: 1rem 2rem; | ||
} | ||
|
||
.title { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
gap: 1rem; | ||
} | ||
|
||
.table-actions { | ||
display: flex; | ||
justify-content: end; | ||
flex-wrap: wrap; | ||
gap: 1rem; | ||
width: 100%; | ||
} | ||
|
||
.cursor-pointer { | ||
cursor: pointer; | ||
} |
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,15 @@ | ||
.form { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
max-width: 40rem; | ||
|
||
&__field { | ||
width: 100%; | ||
} | ||
|
||
&__actions { | ||
display: flex; | ||
justify-content: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.header { | ||
display: flex; | ||
gap: 1rem; | ||
justify-content: flex-end; | ||
align-items: center; | ||
|
||
padding: 2rem; | ||
background: $header-bg; | ||
border-bottom: 1px solid $grey; | ||
} |
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,40 @@ | ||
* { | ||
box-sizing: border-box; | ||
} | ||
|
||
html, | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
border: 0; | ||
font-size: 100%; | ||
font-family: Trebuchet MS,Lucida Grande,Lucida Sans Unicode,Lucida Sans,Tahoma,sans-serif; | ||
vertical-align: baseline; | ||
} | ||
|
||
footer, | ||
header, | ||
menu, | ||
nav, | ||
section { | ||
display: block; | ||
} | ||
|
||
body { | ||
line-height: 1; | ||
} | ||
|
||
ol, | ||
ul { | ||
list-style: none; | ||
} | ||
|
||
blockquote, | ||
q { | ||
quotes: none; | ||
|
||
&::before, | ||
&::after { | ||
content: ''; | ||
} | ||
} |
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,44 @@ | ||
import _ from 'lodash'; | ||
|
||
class MyFunc { | ||
constructor($el) { | ||
this.$el = $el; | ||
this.list = $el.querySelector('.js-projects-list'); | ||
this.items = this.$el.querySelectorAll('.js-item'); | ||
|
||
this.sortAscButton = this.$el.querySelector('.js-sort-by-title-asc'); | ||
this.sortDescButton = this.$el.querySelector('.js-sort-by-title-desc'); | ||
|
||
this.formattedItems = Array.from(this.items).map((item) => ({ | ||
id: JSON.parse(item.getAttribute('data-id')), | ||
name: item.getAttribute('data-name'), | ||
node: item, | ||
})); | ||
|
||
this.bindEvents(this.formattedItems); | ||
} | ||
|
||
bindEvents() { | ||
this.sortAscButton.addEventListener('click', this.onSortByTitleASC); | ||
this.sortDescButton.addEventListener('click', this.onSortByTitleDESC); | ||
} | ||
|
||
onSortByTitleASC = () => { | ||
const sorteItemsByTitle = _.orderBy(this.formattedItems, ['name'], ['asc']); | ||
|
||
sorteItemsByTitle.forEach((item) => this.list.appendChild(item.node)); | ||
this.sortAscButton.classList.add('d-none'); | ||
this.sortDescButton.classList.remove('d-none'); | ||
} | ||
|
||
onSortByTitleDESC = () => { | ||
const sorteItemsByTitle = _.orderBy(this.formattedItems, ['name'], ['desc']); | ||
|
||
sorteItemsByTitle.forEach((item) => this.list.appendChild(item.node)); | ||
|
||
this.sortDescButton.classList.add('d-none'); | ||
this.sortAscButton.classList.remove('d-none'); | ||
} | ||
} | ||
|
||
export default MyFunc; |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.