-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made price-lists table scrollable and made lists archivable (#911)
* Made price-lists table scrollable and made lists archivable * Fixed trailing whitespace * Fixed scss linting issues
- Loading branch information
1 parent
39d1dd0
commit 465dc99
Showing
8 changed files
with
188 additions
and
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,99 @@ | ||
@import 'theme_sofia'; | ||
|
||
.center-text { | ||
margin: 0 auto; | ||
text-align: center; | ||
} | ||
.price-lists-table { | ||
width: fit-content; | ||
max-height: calc(100vh - 18rem); | ||
|
||
.center-text { | ||
margin: 0 auto; | ||
text-align: center; | ||
} | ||
|
||
th { | ||
&.products-id { | ||
.products-id, | ||
.products-cancel-edit { | ||
left: 0; | ||
width: 1.75rem; | ||
} | ||
|
||
&.products-actions { | ||
width: 4rem; | ||
.products-name { | ||
left: 2.1rem; | ||
width: 6rem; | ||
} | ||
|
||
.products-actions, | ||
.products-new-edit-button, | ||
.products-save-new { | ||
right: 0; | ||
} | ||
|
||
.products-id, | ||
.products-cancel-edit, | ||
.products-name, | ||
.products-new-edit-button, | ||
.products-save-new { | ||
position: sticky; | ||
z-index: 1; | ||
background-color: $body-bg; | ||
} | ||
|
||
.products-actions { | ||
position: sticky; | ||
z-index: 1; | ||
} | ||
|
||
thead { | ||
position: sticky; | ||
top: 0; | ||
z-index: 2; | ||
background-color: $body-bg; | ||
} | ||
|
||
th { | ||
&.products-actions { | ||
width: 4rem; | ||
} | ||
} | ||
} | ||
|
||
.price_lists_table { | ||
tr { | ||
&:last-child { | ||
td { | ||
border-bottom-width: 0; | ||
} | ||
} | ||
} | ||
} | ||
|
||
td { | ||
&.products-new-edit-button { | ||
padding: .5rem 1rem; | ||
} | ||
|
||
&.products-new { | ||
input { | ||
&.form-control { | ||
width: 6rem; | ||
} | ||
td { | ||
&.products-new-edit-button { | ||
padding: .5rem 1rem; | ||
} | ||
|
||
select { | ||
&.form-control { | ||
width: 4rem; | ||
&.products-new { | ||
input { | ||
&.form-control { | ||
width: 6rem; | ||
} | ||
} | ||
|
||
select { | ||
&.form-control { | ||
width: 4rem; | ||
} | ||
} | ||
} | ||
} | ||
|
||
&.products-new-price { | ||
input { | ||
&.form-control { | ||
width: 2rem; | ||
&.products-new-price { | ||
input { | ||
&.form-control { | ||
width: 4rem; | ||
} | ||
} | ||
} | ||
} | ||
|
||
&.products-cancel-new, | ||
&.products-cancel-edit, | ||
&.products-save-new { | ||
vertical-align: middle; | ||
&.products-cancel-new, | ||
&.products-cancel-edit, | ||
&.products-save-new { | ||
vertical-align: middle; | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -15,6 +15,14 @@ def update? | |
create? | ||
end | ||
|
||
def archive? | ||
create? | ||
end | ||
|
||
def unarchive? | ||
create? | ||
end | ||
|
||
def search? | ||
index? | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddArchivedAtToPriceList < ActiveRecord::Migration[7.0] | ||
def change | ||
add_column :price_lists, :archived_at, :datetime | ||
end | ||
end |
Oops, something went wrong.