Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Restructure Sass-files

Henriette Dinger7cd3b8845aed
diff --git a/modules/ifc_models/app/assets/stylesheets/ifc_viewer/generic.sass b/modules/ifc_models/app/assets/stylesheets/ifc_viewer/generic.sass
new file mode 100644
index 00000000000..10af91e3209
--- /dev/null
+++ b/modules/ifc_models/app/assets/stylesheets/ifc_viewer/generic.sass
@@ -0,0 +1,74 @@
+// -------------------------- GENERIC --------------------------
+
+// The IFC viewer shall fill the viewport to the bottom.
+// This is different to how we style #content else where.
+.controller-ifc_models\/ifc_models
+ &.action-show,
+ &.action-show_defaults
+ #content
+ display: flex
+ flex-direction: column
+ height: 100%
+
+.ifc-model-viewer--container
+ flex-grow: 1
+ position: relative
+ width: 100%
+ height: 100%
+ border-top: 1px solid gray
+ border-bottom: 1px solid gray
+
+ .ifc-model-viewer--model-canvas
+ width: 100%
+ height: 100%
+ background: #ebebeb
+
+
+ .ifc-model-viewer--nav-cube-canvas
+ position: absolute
+ width: 200px
+ height: 200px
+ bottom: 0
+ right: 0
+ z-index: 200000
+
+ .ifc-model-viewer--section-planes-overview-canvas
+ position: absolute
+ width: 250px
+ height: 250px
+ top: 300px
+ right: 50px
+ z-index: 200000
+
+
+// -------------------------- BUTTONS --------------------------
+.xeokit-btn-group
+ position: relative
+ display: inline-flex
+ vertical-align: middle
+ margin-right: .7rem !important
+
+.xeokit-btn
+ position: relative
+ flex: 1 1 auto
+ color: #007bff
+ background-color: transparent
+ text-align: center
+ vertical-align: middle
+ border: 1px solid #007bff
+ padding: .375rem .75rem
+ border-radius: .25rem
+ transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out
+ -webkit-appearance: button
+ overflow: visible
+ margin: 0
+ box-sizing: border-box
+ align-items: flex-start
+
+ &.disabled
+ opacity: .55
+
+ &.active
+ color: #fff
+ background-color: #007bff
+ border-color: #007bff
\ No newline at end of file
diff --git a/modules/ifc_models/app/assets/stylesheets/ifc_models/ifc_models.sass b/modules/ifc_models/app/assets/stylesheets/ifc_viewer/tabs.sass
similarity index 52%
rename from modules/ifc_models/app/assets/stylesheets/ifc_models/ifc_models.sass
rename to modules/ifc_models/app/assets/stylesheets/ifc_viewer/tabs.sass
index 27d9a14a831..fd4ceaec36d 100644
--- a/modules/ifc_models/app/assets/stylesheets/ifc_models/ifc_models.sass
+++ b/modules/ifc_models/app/assets/stylesheets/ifc_viewer/tabs.sass
@@ -1,15 +1,4 @@
-@import "fonts/openproject_icon_definitions"
-
-// The IFC viewer shall fill the viewport to the bottom.
-// This is different to how we style #content else where.
-.controller-ifc_models\/ifc_models
- &.action-show,
- &.action-show_defaults
- #content
- display: flex
- flex-direction: column
- height: 100%
-
+// -------------------------- GENERIC --------------------------
.ifc-model-viewer--tree-panel
color: white
min-width: 320px
@@ -21,95 +10,7 @@
label
color: white
-.ifc-model-viewer--model-canvas
- width: 100%
- height: 100%
- background: #ebebeb
-
-.ifc-model-viewer--container
- flex-grow: 1
- position: relative
- width: 100%
- height: 100%
- border-top: 1px solid gray
- border-bottom: 1px solid gray
-
-.ifc-model-viewer--toolbar-container
- position: fixed
- width: 100%
- align-items: center
- justify-content: center
- padding: 6px
- height: 60px
-
- // Use our own icon font instead of including Xeokit's FontAwesome
- button[class^="fa-"],
- button[class*=" fa-"]
- &::before
- font-family: "openproject-icon-font" !important
- .fa-home::before
- @include icon-mixin-home
- .fa-info-circle::before
- @include icon-mixin-info2
- .fa-cut::before
- @include icon-mixin-cut
- .fa-cube::before
- @include icon-mixin-modules
-
-
-.ifc-model-viewer--nav-cube-canvas
- position: absolute
- width: 200px
- height: 200px
- bottom: 0
- right: 0
- z-index: 200000
-
-.ifc-model-viewer--section-planes-overview-canvas
- position: absolute
- width: 250px
- height: 250px
- top: 300px
- right: 50px
- z-index: 200000
-
-/* Tabs */
-.xeokit-toolbar
- display: flex
- flex-wrap: wrap
- justify-content: flex-start
-
-.xeokit-btn-group
- position: relative
- display: inline-flex
- vertical-align: middle
- margin-right: .7rem !important
-
-.xeokit-btn
- position: relative
- flex: 1 1 auto
- color: #007bff
- background-color: transparent
- text-align: center
- vertical-align: middle
- border: 1px solid #007bff
- padding: .375rem .75rem
- border-radius: .25rem
- transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out
- -webkit-appearance: button
- overflow: visible
- margin: 0
- box-sizing: border-box
- align-items: flex-start
-
- &.disabled
- opacity: .55
-
- &.active
- color: #fff
- background-color: #007bff
- border-color: #007bff
-
+// -------------------------- XEOKIT specific --------------------------
.xeokit-tabs
line-height: 1.5
margin-bottom: 1.5em
@@ -145,7 +46,7 @@
&:hover
color: #477dca
border-bottom: 2px solid white
-
+
&:focus
outline: none
@@ -210,13 +111,13 @@
width: 1.5em
&:active
top: 1px
-
+
a.plus
background-color: #ded
-
+
a.minus
background-color: #eee
-
+
span
display: inline-block
diff --git a/modules/ifc_models/app/assets/stylesheets/ifc_viewer/toolbar.sass b/modules/ifc_models/app/assets/stylesheets/ifc_viewer/toolbar.sass
new file mode 100644
index 00000000000..bc60b30a4d8
--- /dev/null
+++ b/modules/ifc_models/app/assets/stylesheets/ifc_viewer/toolbar.sass
@@ -0,0 +1,31 @@
+@import "fonts/openproject_icon_definitions"
+
+// -------------------------- GENERIC --------------------------
+.ifc-model-viewer--toolbar-container
+ position: fixed
+ width: 100%
+ align-items: center
+ justify-content: center
+ padding: 6px
+ height: 60px
+
+ // Use our own icon font instead of including Xeokit's FontAwesome
+ button[class^="fa-"],
+ button[class*=" fa-"]
+ &::before
+ font-family: "openproject-icon-font" !important
+ .fa-home::before
+ @include icon-mixin-home
+ .fa-info-circle::before
+ @include icon-mixin-info2
+ .fa-cut::before
+ @include icon-mixin-cut
+ .fa-cube::before
+ @include icon-mixin-modules
+
+
+// -------------------------- XEOKIT specific --------------------------
+.xeokit-toolbar
+ display: flex
+ flex-wrap: wrap
+ justify-content: flex-start
\ No newline at end of file
diff --git a/modules/ifc_models/app/views/ifc_models/ifc_models/show.html.erb b/modules/ifc_models/app/views/ifc_models/ifc_models/show.html.erb
index db2a79e61e2..d203d9ebc2e 100644
--- a/modules/ifc_models/app/views/ifc_models/ifc_models/show.html.erb
+++ b/modules/ifc_models/app/views/ifc_models/ifc_models/show.html.erb
@@ -33,7 +33,9 @@ See doc/COPYRIGHT.rdoc for more details.
<% html_title h(@ifc_model.title) -%>
<% content_for :header_tags do %>
- <%= stylesheet_link_tag "ifc_models/ifc_models", media: 'all' %>
+ <%= stylesheet_link_tag "ifc_viewer/generic", media: 'all' %>
+ <%= stylesheet_link_tag "ifc_viewer/tabs", media: 'all' %>
+ <%= stylesheet_link_tag "ifc_viewer/toolbar", media: 'all' %>
<%= include_gon(nonce: content_security_policy_script_nonce) %>
<% end %>
diff --git a/modules/ifc_models/lib/open_project/ifc_models/engine.rb b/modules/ifc_models/lib/open_project/ifc_models/engine.rb
index acf8e1cd5d2..cdd705ec4cd 100644
--- a/modules/ifc_models/lib/open_project/ifc_models/engine.rb
+++ b/modules/ifc_models/lib/open_project/ifc_models/engine.rb
@@ -52,7 +52,11 @@ module OpenProject::IFCModels
end
end
- assets %w(ifc_models/ifc_models.css)
+ assets %w(
+ ifc_viewer/generic.css
+ ifc_viewer/tabs.css
+ ifc_viewer/toolbar.css
+ )
initializer 'ifc_models.menu' do
::Redmine::MenuManager.map(:project_menu) do |menu|