Skip to content

Commit

Permalink
Merge pull request #193 from fs/fix-kamil-group-pr
Browse files Browse the repository at this point in the history
Fix HW14 group pr
  • Loading branch information
NadezhdaShosheva committed Mar 25, 2024
2 parents 99bfa2c + 8f2f84c commit ec2ade3
Show file tree
Hide file tree
Showing 17 changed files with 99 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.16.0
v16.20.1
5 changes: 5 additions & 0 deletions app/assets/stylesheets/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
$black: #222;
$white: #fff;
$red: #f00;
$purple: #9a336a;
$green: #008000;
$grey: #ccc;
$grey-dark: #333;
$blue: #2732ff;
$blue-link: #007bff;
$blue-link-hover: #0056b3;

$header-bg: #f1f1f1;
$border-bg: #f2f2f2;
2 changes: 0 additions & 2 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


// Bootstrap
@import 'bootstrap/scss/bootstrap';

Expand Down
14 changes: 8 additions & 6 deletions app/assets/stylesheets/base.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.flash-message {
%flash-message {
padding: 10px;
border-radius: 5px;
font-weight: bold;
Expand All @@ -8,18 +8,20 @@
}

.flash-alert {
@extend .flash-message;
@extend %flash-message;

color: $red;
}

.flash-notice {
@extend .flash-message;
@extend %flash-message;

color: $green;
}

.error-box {
border: 2px solid red;
padding: 10px;
border: 2px solid $red;
padding: 10px;
}

.error-header {
Expand All @@ -28,7 +30,7 @@
}

.error-body {
color: red;
color: $red;
}

.sort-links {
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@

&__actions {
display: flex;
justify-content: end;
justify-content: start;
}
}
90 changes: 44 additions & 46 deletions app/assets/stylesheets/task_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,39 @@
display: flex;
justify-content: space-between;
place-items: center;
place-items: center;
}

p {
&.link {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
position: relative;
padding: 1rem 2rem;
border: 5px solid #f2f2f2;
text-transform: uppercase;
font-weight: 500;
font-size: 1em;
letter-spacing: 1px;
box-shadow: 1px 1px 20px rgba(0,0,0,.1);
color: #9a336a;
background: transparent;
overflow: hidden;
.link {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
position: relative;
padding: 1rem 2rem;
border: 5px solid $border-bg;
text-transform: uppercase;
font-weight: 500;
font-size: 1em;
letter-spacing: 1px;
box-shadow: 1px 1px 20px rgba($black, .1);
color: $purple;
background: transparent;
overflow: hidden;

a {
color: $green;
text-decoration: none;
transition: color .3s;

a {
color: green;
text-decoration: none;
transition: color 0.3s;
&:hover {
color: blue;
}
}
&:hover {
color: $blue;
}
}
}

h1 {
font-size: 24px;
color: #333;
color: $grey-dark;
margin-bottom: 10px;
display: flex;
justify-content: space-between;
Expand All @@ -46,48 +44,48 @@ h1 {
.button-link {
display: flex;
flex-wrap: wrap;

a {
color: #fff;
background-color: #007bff;
color: $white;
background-color: $blue-link;
padding: 8px 16px;
text-decoration: none;
border-radius: 4px;
transition: background-color 0.3s;
transition: background-color .3s;

&:hover {
background-color: #0056b3;
background-color: $blue-link-hover;
}
}
}


.record {
border: 1px solid #ccc;
border: 1px solid $grey;
padding: 10px;
margin: 10px 0;
display: inline-block;
vertical-align: top;
width: calc(33.33% - 20px); /* Измените эту ширину на то, что вам нужно */
margin-right: 20px; /* Добавьте нужный отступ между блоками */
width: calc(33.33% - 20px);
margin-right: 20px;
box-sizing: border-box;
overflow: hidden;
overflow: hidden;
text-overflow: ellipsis;

p {
margin: 5px 0;
}
}

.edit_links {
a {
display: inline-block;
margin-right: 10px;
color: #007bff;
text-decoration: none;
transition: color 0.3s;
.edit-links {
a {
display: inline-block;
margin-right: 10px;
color: $blue-link;
text-decoration: none;
transition: color .3s;

&:hover {
color: #0056b3;
}
&:hover {
color: $blue-link-hover;
}
}
}
2 changes: 1 addition & 1 deletion app/views/projects/_form.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
| prohibited this project from being saved:
ul
- project.errors.each do |error|
li.error-body
li.error-body
= error.full_message

.form__field
Expand Down
6 changes: 5 additions & 1 deletion app/views/tasks/_form.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@
.field
= form.label :name
= form.text_field :name

.field
= form.label :description
= form.text_area :description

.field
= form.label :status
= form.select :status, Task.status.values

.field
= form.label :deadline_at
= form.datetime_field :deadline_at

.actions
= form.submit
= form.submit
5 changes: 0 additions & 5 deletions app/views/tasks/edit.html.erb

This file was deleted.

4 changes: 4 additions & 0 deletions app/views/tasks/edit.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
h1.title
span Edit Task
= link_to "Back to Tasks", project_tasks_path(@project), class: "link-secondary fs-5"
= render 'form'
27 changes: 16 additions & 11 deletions app/views/tasks/index.html.slim
Original file line number Diff line number Diff line change
@@ -1,50 +1,55 @@
h1
| Tasks for project:
' Tasks for project:
= @project.name

.button-link
= link_to "NEW TASK", new_project_task_path(@project)

.sort-links
p.link
= link_to "Name", :sort => "name asc"
= link_to "Name", sort: "name asc"
p

p.link
= link_to "Name reverse", :sort => "name desc"
= link_to "Name reverse", sort: "name desc"
p

p.link
= link_to "Created", :sort => "id asc"
= link_to "Created", sort: "id asc"
p

p.link
= link_to "Created reverse", :sort => "id desc"
= link_to "Created reverse", sort: "id desc"
p

p.link
= link_to "Deadline", :sort => "deadline_at asc"
= link_to "Deadline", sort: "deadline_at asc"
p

p.link
= link_to "deadline reverse", :sort => "deadline_at desc"
= link_to "deadline reverse", sort: "deadline_at desc"
p

- @tasks.each_with_index do |task, index|
.record
p
= index+1
| .
= index + 1
| .
= task.name
p
= task.description
p
= task.status
p
= task.deadline_at
.edit_links

.edit-links
= link_to "Show", url_for([@project, task])
= link_to "Edit", edit_project_task_path(@project, task)
= link_to "Destroy", url_for([@project, task]), method: :delete, data: { confirm: 'Are you sure?' }

p.link
= paginate @tasks

.button-link
= link_to "Back to Projects", projects_path
= link_to "Back to Projects", projects_path
5 changes: 0 additions & 5 deletions app/views/tasks/new.html.erb

This file was deleted.

4 changes: 4 additions & 0 deletions app/views/tasks/new.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
h1.title
span New Task
= link_to "Back to Tasks", project_tasks_path(@project), class: "link-secondary fs-5"
= render 'form'
7 changes: 6 additions & 1 deletion app/views/users/_form.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,22 @@
- @user.errors.each do |error|
li.error-body
= error.full_message

.field
= form.label :first_name
= form.text_field :first_name

.field
= form.label :last_name
= form.text_field :last_name

.field
= form.label :email
= form.text_field :email

.field
= form.label :password
= form.password_field :password, type: :password

.actions
= form.submit "Sign up"
= form.submit "Sign up"
2 changes: 1 addition & 1 deletion app/views/users/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1>Sign Up</h1>
<h1>Sign Up </h1>

<%= render 'form', user: @user %>
Expand Down
4 changes: 2 additions & 2 deletions config/initializers/cors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
origins(*ENV.fetch("CORS_ORIGINS", "").split(","))

resource "*",
headers: :any,
methods: %i[get post put patch delete options head]
headers: :any,
methods: %i[get post put patch delete options head]
end
end
end
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
"webpack-dev-server": "^3"
},
"engines": {
"node": "16.16.0"
"node": "16.20.1"
}
}

0 comments on commit ec2ade3

Please sign in to comment.