-
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 #193 from alces-flight/enh/better-cluster-launch-p…
…ages Improvements to cluster launch pages
- Loading branch information
Showing
40 changed files
with
908 additions
and
64 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
114 changes: 99 additions & 15 deletions
114
app/assets/stylesheets/components/_cluster_types_view.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 |
---|---|---|
@@ -1,17 +1,101 @@ | ||
.cluster-types-card-deck { | ||
display: grid; | ||
grid-template-columns: repeat(auto-fill, minmax(28em, 1fr)); | ||
grid-gap: 1rem; | ||
justify-content: space-between; | ||
justify-items: center; | ||
padding: 1.25rem 2.5rem; | ||
} | ||
|
||
|
||
.cluster-type-card { | ||
width: 19rem; | ||
border: darkgray 1px solid; | ||
padding: 0.5em; | ||
margin-left: 0.5rem; | ||
margin-right: 0.5rem; | ||
|
||
.card-divider { | ||
border-bottom: darkgray 1px solid; | ||
} | ||
|
||
.disabled-cluster-link { | ||
color: #63666A; | ||
cursor: not-allowed; | ||
font-weight: bold; | ||
} | ||
border: solid #3b5168 1px; | ||
border-radius: 2px; | ||
padding: 1.5rem; | ||
font-weight: 400; | ||
transition: background 125ms; | ||
} | ||
|
||
.cluster-type-card { | ||
display: grid; | ||
grid-template-rows: [row1-start] auto [row1-end row2-start] auto [row2-end row3-start] auto [row3-end]; | ||
grid-template-columns: 1fr 1fr; | ||
grid-template-areas: "header header" "icon description" ". button"; | ||
|
||
column-gap: 1.2rem; | ||
row-gap: 0.3rem; | ||
|
||
align-items: center; | ||
margin: 0 !important; | ||
width: 100%; | ||
min-height: 14.2rem; | ||
} | ||
|
||
.cluster-type-card-title { | ||
grid-area: header; | ||
text-align: center; | ||
margin: 0; | ||
line-height: 1.8; | ||
font-weight: 400; | ||
} | ||
|
||
.cluster-type-card-icon { | ||
grid-area: icon; | ||
margin: 10px 0 10px 10px; | ||
justify-self: end; | ||
max-height: 10rem; | ||
max-width: calc(100% - 0.5rem) !important; | ||
} | ||
|
||
.cluster-type-card-description { | ||
font-size: larger; | ||
color: #3b5168; | ||
} | ||
|
||
.cluster-type-select-link { | ||
grid-area: button; | ||
justify-self: end; | ||
|
||
.disabled-cluster-link { | ||
color: #63666A; | ||
cursor: not-allowed; | ||
font-weight: bold; | ||
} | ||
} | ||
|
||
.cluster-type-card:hover { | ||
background: $lightest-blue; | ||
.cluster-type-card-title { } | ||
.cluster-type-card-description { } | ||
} | ||
|
||
.cluster-type-card--disabled { | ||
background: $lighter-grey; | ||
&:hover { | ||
background: $lighter-grey; | ||
} | ||
} | ||
|
||
|
||
.cluster-type-header { | ||
display: grid; | ||
grid-template-rows: [row1-start] auto [row1-end row2-start] auto [row2-end]; | ||
grid-template-columns: auto auto; | ||
grid-template-areas: "icon header" "icon description"; | ||
column-gap: 1.2rem; | ||
row-gap: 0.3rem; | ||
justify-content: start; | ||
margin-bottom: 0.625rem; | ||
|
||
.cluster-type-card-title { | ||
justify-self: left; | ||
align-self: end; | ||
max-width: 28em; | ||
} | ||
|
||
.cluster-type-card-description { | ||
justify-self: left; | ||
align-self: start; | ||
max-width: 28em; | ||
} | ||
} |
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,14 @@ | ||
.usage-instructions { | ||
margin-bottom: 2em; | ||
|
||
&:last-child { | ||
margin-bottom: 0; | ||
} | ||
|
||
pre { | ||
background: #fff !important; | ||
code { | ||
background: #2b303b; | ||
} | ||
} | ||
} |
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
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,13 @@ | ||
module MarkdownRenderer | ||
class << self | ||
def render(markdown_text) | ||
Commonmarker.to_html( | ||
markdown_text, | ||
options: { | ||
parse: { smart: true }, | ||
render: { hardbreaks: false }, | ||
} | ||
).html_safe | ||
end | ||
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
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 @@ | ||
class ClusterTypePresenter < Presenter | ||
|
||
delegate :instructions, to: :o | ||
|
||
def instruction(id) | ||
o.instructions.detect do |instruction| | ||
instruction['id'] == id | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,27 @@ | ||
class RackPresenter < Presenter | ||
include Costed | ||
|
||
delegate :instructions, :instruction, | ||
to: :cluster_type, | ||
allow_nil: true | ||
|
||
def creation_output | ||
outputs = o.creation_output.split(', ').map { |output| output.split('=') } | ||
Hash[outputs].tap do |h| | ||
if h.key?('web_access') | ||
h['web_access'] = @view_context.link_to(h['web_access'], h['web_access'], target: '_blank') | ||
end | ||
end | ||
end | ||
|
||
private | ||
|
||
def cluster_type | ||
@cluster_type ||= | ||
begin | ||
cluster_type_id = creation_output['concertim_cluster_type'] | ||
ct = ClusterType.find_by(foreign_id: cluster_type_id) | ||
h.presenter_for(ct) if ct | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.