-
Notifications
You must be signed in to change notification settings - Fork 42
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 #398 from rubytoolbox/co-compare
Project display modes
- Loading branch information
Showing
34 changed files
with
408 additions
and
70 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
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
Empty file.
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,42 @@ | ||
.project-comparison | ||
overflow: auto | ||
table | ||
@extend .table, .is-fullwidth | ||
.heading | ||
@extend .is-size-7 | ||
white-space: nowrap | ||
|
||
thead | ||
th | ||
@extend .has-text-right | ||
|
||
tbody | ||
td | ||
@extend .has-text-right | ||
font-weight: bold | ||
white-space: nowrap | ||
|
||
th.sticky | ||
position: sticky | ||
left: 0 | ||
// Black magic... https://stackoverflow.com/a/45042852 | ||
&:after | ||
content: "" | ||
position: absolute | ||
right: 0 | ||
top: 0 | ||
bottom: 0 | ||
border-right: 1px solid #dbdbdb | ||
|
||
// Bulma sets the striped background on the tr by default, | ||
// which conflicts with the sticky project cells column on the left | ||
tr | ||
td, th | ||
background: white | ||
tr:nth-child(even) | ||
td, th | ||
background: #fafafa | ||
|
||
tbody td, thead th | ||
a | ||
color: $dark |
4 changes: 4 additions & 0 deletions
4
app/assets/stylesheets/components/project_display_picker.sass
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,4 @@ | ||
.project-display-picker | ||
@extend .field, .has-addons | ||
a | ||
@extend .button |
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
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,22 @@ | ||
# frozen_string_literal: true | ||
|
||
# | ||
# A little utility class for picking a display mode based on given param, | ||
# falling back to a customizible default | ||
# | ||
class DisplayMode | ||
attr_accessor :requested, :default, :available | ||
private :requested=, :default=, :available= | ||
|
||
def initialize(requested = nil, default: "full") | ||
self.requested = requested.to_s | ||
self.default = default.to_s | ||
self.available = %w[full compact table] | ||
end | ||
|
||
def current | ||
return requested if available.include? requested | ||
|
||
available.find { |mode| mode == default } || available.first | ||
end | ||
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
Oops, something went wrong.