Skip to content
Permalink
Browse files

Moved classic theme CSS and images to theme directory

* Moved all theme specific things to theme directory hierarchy. There is
  no special role for the classic theme anymore.

* Classic theme: Cleaned up the split into several CSS files. The split
  of the files still exists for the SASS files. There is only one final
  theme.css file shipped with Check_MK now.
  This makes the file structure consistent with the modern theme.
  And it allows a lot of similifications of the HTML head rendering
  possible which must not know anymore about individual CSS files to
  be load by the different pages.

* Modern theme: The dependency on the classic theme is now resolved on
  SASS layer by referencing the classic theme theme.scss.

* The modern theme does not rely anymore on the images of the classic
  theme. All images that are needed by the modern theme has been copied
  from the classic theme to the modern theme.

* The code that magically loaded images referenced by the modern theme
  which only existed in the classic theme has been cleaned up.

* Moved CEE/CME specific images to the theme paths to have everything
  in one place. Makes theme editing a lot easier.

CMK-1567

Change-Id: Ibf3ef47ed578b5169327d3d60ec2ba514dd59ae7
  • Loading branch information...
LarsMichelsen committed Feb 8, 2019
1 parent 567ba5b commit f92af289c07145b1b61aabfb42a868f720579b95
Showing 593 changed files with 751 additions and 808 deletions.
@@ -177,7 +177,7 @@ endif
rm -rf check-mk-$(EDITION)-$(OMD_VERSION)

# This tar file is only used by "omd/packages/check_mk/Makefile"
$(DISTNAME).tar.gz: omd/packages/mk-livestatus/mk-livestatus-$(VERSION).tar.gz .werks/werks web/htdocs/js/main_min.js web/htdocs/js/mobile_min.js web/htdocs/js/side_min.js web/htdocs/themes/facelift/theme.css ChangeLog
$(DISTNAME).tar.gz: omd/packages/mk-livestatus/mk-livestatus-$(VERSION).tar.gz .werks/werks web/htdocs/js/main_min.js web/htdocs/js/mobile_min.js web/htdocs/js/side_min.js web/htdocs/themes/facelift/theme.css ChangeLog web/htdocs/themes/classic/theme.css
@echo "Making $(DISTNAME)"
rm -rf $(DISTNAME)
mkdir -p $(DISTNAME)
@@ -315,10 +315,10 @@ node_modules: package.json
npm install

web/htdocs/js/%_min.js: node_modules webpack.config.js $(JAVASCRIPT_SOURCES)
node_modules/.bin/webpack --mode=development
ENTERPRISE=$(ENTERPRISE) MANAGED=$(MANAGED) node_modules/.bin/webpack --mode=development

web/htdocs/themes/%/theme.css: node_modules webpack.config.js postcss.config.js web/htdocs/themes/%/theme.scss web/htdocs/themes/%/scss/*.scss
node_modules/.bin/webpack --mode=development
ENTERPRISE=$(ENTERPRISE) MANAGED=$(MANAGED) node_modules/.bin/webpack --mode=development

# TODO(sp) The target below is not correct, we should not e.g. remove any stuff
# which is needed to run configure, this should live in a separate target. In
@@ -2999,7 +2999,7 @@ def _show_node(self, tree, show_host, mousecode=None, img_class=None):
if mousecode:
if img_class:
html.img(
src="images/tree_black_closed.png",
src=html.theme_url("images/tree_black_closed.png"),
class_=["treeangle", img_class],
onclick=mousecode)

@@ -1199,9 +1199,7 @@ def load_plugins(force):


def theme_choices():
themes = {
"classic": _("Classic"),
}
themes = {}

for base_dir in [Path(cmk.utils.paths.web_dir), Path(cmk.utils.paths.local_web_dir)]:
if not base_dir.exists():
@@ -68,7 +68,7 @@ def page_crashed(what):
# Do not reveal crash context information to unauthenticated users or not permitted
# users to prevent disclosure of internal information
if not config.user.may("general.see_crash_reports"):
html.header(_("Internal error"), stylesheets=["status", "pages"])
html.header(_("Internal error"))
html.show_error("<b>%s:</b> %s" % (_("Internal error"), sys.exc_info()[1]))
html.p(
_("An internal error occurred while processing your request. "
@@ -93,7 +93,7 @@ def page_crashed(what):
else:
title = _("Internal error")

html.header(title, stylesheets=["status", "pages"])
html.header(title)

show_context_buttons(what, tardata)

@@ -668,7 +668,8 @@ def draw_dashboard(name):
elif wato_folder is not None:
title = watolib.get_folder_title(wato_folder) + " - " + title

html.header(title, stylesheets=["pages", "dashboard", "status", "views"])
html.add_body_css_class("dashboard")
html.header(title)

html.open_div(class_=["dashboard_%s" % name], id_="dashboard") # Container of all dashlets

@@ -820,7 +821,7 @@ def dashboard_edit_controls(name, board):
style="display:%s;" % ("block" if html.request.var("edit") == '1' else "none"),
onmouseover="cmk.dashboard.show_submenu(\'control_add\');")
html.open_a(href="javascript:void(0)")
html.img("images/dashboard_menuarrow.png")
html.icon(title=_("Add dashlet"), icon="dashboard_menuarrow")
html.write_text(_("Add dashlet"))
html.close_a()

@@ -844,7 +845,7 @@ def add_url(cls):
url = dashlet_type.add_url()
html.open_li()
html.open_a(href=url)
html.img("images/dashlet_%s.png" % ty)
html.icon(title=dashlet_type.title(), icon="dashlet_%s" % ty)
html.write(dashlet_type.title())
html.close_a()
html.close_li()
@@ -860,7 +861,7 @@ def add_url(cls):
href="edit_dashboard.py?load_name=%s&back=%s" % (name, html.urlencode(html.makeuri(
[]))),
onmouseover="cmk.dashboard.hide_submenus();")
html.img(src="images/trans.png")
html.icon(title="", icon="trans")
html.write(_('Properties'))
html.close_a()
html.close_li()
@@ -875,7 +876,7 @@ def add_url(cls):
href="javascript:void(0)",
onclick="cmk.dashboard.toggle_dashboard_edit(false)",
onmouseover="cmk.dashboard.hide_submenus();")
html.img(src="images/trans.png")
html.icon(title="", icon="trans")
html.write(_('Stop Editing'))
html.close_a()
html.close_li()
@@ -887,7 +888,7 @@ def add_url(cls):
style="display:%s;" % ("none" if html.request.var("edit") == '1' else "block"),
id_="control_edit")
html.open_a(href="javascript:void(0)", onclick="cmk.dashboard.toggle_dashboard_edit(true);")
html.img("images/trans.png")
html.icon(title="", icon="trans")
html.write(_('Edit Dashboard'))
html.close_a()
html.close_li()
@@ -1206,7 +1207,7 @@ def choose_view(name):
sorted=True,
)

html.header(_('Create Dashlet from existing View'), stylesheets=["pages"])
html.header(_('Create Dashlet from existing View'))
html.begin_context_buttons()
back_url = html.get_url_input(
"back", "dashboard.py?edit=1&name=%s" % html.urlencode(html.request.var('name')))
@@ -1315,7 +1316,7 @@ def page_edit_dashlet():
dashlet_type = dashlet_registry[ty]
single_infos = dashlet['single_infos']

html.header(title, stylesheets=["pages", "views"])
html.header(title)

html.begin_context_buttons()
back_url = html.get_url_input('back', 'dashboard.py?name=%s&edit=1' % board)
@@ -1476,7 +1477,7 @@ def page_delete_dashlet():
except IndexError:
raise MKUserError("id", _('The dashlet does not exist.'))

html.header(_('Confirm Dashlet Deletion'), stylesheets=["pages", "views"])
html.header(_('Confirm Dashlet Deletion'))

html.begin_context_buttons()
back_url = html.get_url_input('back', 'dashboard.py?name=%s&edit=1' % board)
@@ -671,9 +671,8 @@ class ActionHandler(object):
delete_job_var = "_delete_job"
acknowledge_job_var = "_acknowledge_job"

def __init__(self, stylesheets=None):
def __init__(self):
super(ActionHandler, self).__init__()
self._stylesheets = stylesheets
self._did_acknowledge_job = False
self._did_stop_job = False
self._did_delete_job = False
@@ -723,7 +722,7 @@ def stop_job(self):
if not job.is_available():
return

html.header("Interuption of job", stylesheets=self._stylesheets)
html.header("Interuption of job")
if self.confirm_dialog_opened() and not job.is_running():
html.message(_("No longer able to stop job. Background job just finished."))
return
@@ -743,7 +742,7 @@ def delete_job(self):
if not job.is_available():
return

html.header("Deletion of job", stylesheets=self._stylesheets)
html.header("Deletion of job")
c = html.confirm(_("Delete job %s%s?") % (job_id, self._get_extra_info(job)))
if c and job.may_delete():
job.delete()
Oops, something went wrong.

0 comments on commit f92af28

Please sign in to comment.
You can’t perform that action at this time.