diff --git a/module_index.json b/module_index.json index e4ed735..12887a8 100755 --- a/module_index.json +++ b/module_index.json @@ -155,7 +155,7 @@ "version": "0.1", "author": "Starbeamrainbowlabs", "description": "Adds a theme gallery page and optional automatic theme updates. Contacts a remote server, where IP addresses are stored in automatic server logs for security and attack mitigation purposes.", - "lastupdate": 1566830789, + "lastupdate": 1566833304, "optional": false, "extra_data": [] }, diff --git a/modules/feature-theme-gallery.php b/modules/feature-theme-gallery.php index 72169ce..59894e4 100644 --- a/modules/feature-theme-gallery.php +++ b/modules/feature-theme-gallery.php @@ -15,7 +15,16 @@ register_module([ */ add_action("theme-gallery", function() { - global $settings; + global $settings, $env; + + if(!$env->is_admin) { + $errorMessage = "

You don't have permission to change $settings->sitename's theme.

\n"; + if(!$env->is_logged_in) + $errorMessage .= "

You could try logging in.

"; + else + $errorMessage .= "

You could try logging out and then logging in again with a different account that has the appropriate privileges..

"; + exit(page_renderer::render_main("Error - $settings->sitename", $errorMessage)); + } $themes_available = []; $gallery_urls = explode(" ", $settings->css_theme_gallery_index_url); @@ -42,17 +51,22 @@ register_module([ }); $content = "

Theme Gallery

-
\n"; + +
+
\n"; foreach($themes_available as $theme) { + $selected = $theme->id == $settings->css_theme_gallery_selected_id ? " selected" : ""; $content .= "
- - - +
+ +

" . str_replace("\n", "

\n

", htmlentities($theme->description)) . "

By " . htmlentities($theme->author) . " (View CSS, View Index)

"; } - $content .= "
"; + $content .= "
+ + "; exit(page_renderer::render_main("Theme Gallery - $settings->sitename", "$content")); diff --git a/themes/default/theme.css b/themes/default/theme.css index 3c43c14..132242d 100644 --- a/themes/default/theme.css +++ b/themes/default/theme.css @@ -18,7 +18,7 @@ nav:not(.nav-more-menu) a { text-decoration: none; font-weight: bolder; color: i .nav-divider { color: transparent; } .nav-more { position: relative; background-color: #442772; min-width: 10em; } -.nav-more label { cursor: pointer; } +label { cursor: pointer; } .nav-more-menu { display: none; z-index: 10000; position: absolute; flex-direction: column; top: 2.6rem; right: -0.2rem; background-color: #8a62a7; border-top: 3px solid #442772; border-bottom: 3px solid #442772; } input[type=checkbox]:checked ~ .nav-more-menu { display: block; box-shadow: 0.4rem 0.4rem 1rem 0 rgba(50, 50, 50, 0.5); } .nav-more-menu span { min-width: 10rem; } @@ -93,6 +93,9 @@ textarea, textarea[name=content] + pre, textarea ~ input[type=submit], #search-b textarea ~ input[type=submit] { margin: 0.5rem 0; padding: 0.5rem; font-weight: bolder; } .editform input[type=text] { width: calc(100% - 0.3rem); box-sizing: border-box; } input.edit-page-button[type='submit'] { width: 49.5%; box-sizing: border-box; } +input[type=radio] { transform: scale(2); } +input[type=submit].large { width: 100%; box-sizing: border-box; padding: 0.5em; font-size: 1.25em; font-weight: bolder; } + .preview-message { text-align: center; } @media (min-width: 800px) { .jump-to-comments { position: absolute; top: 3.5em; right: 2em; display: block; text-align: right; pointer-events: none; } @@ -121,6 +124,11 @@ input.edit-page-button[type='submit'] { width: 49.5%; box-sizing: border-box; } .tag-list li { display: inline-block; margin: 1rem; } .mini-tag { background: #e2d5eb; padding: 0.2rem 0.4rem; color: #fb701a; text-decoration: none; } +.grid-large { display: grid; grid-template-columns: repeat(auto-fit, minmax(25em, 1fr)); grid-auto-rows: min-content; grid-gap: 1em; justify-content: center;} + +.theme-item { justify-self: center; text-align: center; } +.theme-item label { min-width: auto; } + .help-section-header::after { content: "#" attr(id); float: right; color: rgba(0, 0, 0, 0.4); font-size: 0.8rem; font-weight: normal; } .stacked-bar { display: flex; } diff --git a/themes/none/theme.css b/themes/none/theme.css index bed6ace..ac4e15e 100644 --- a/themes/none/theme.css +++ b/themes/none/theme.css @@ -1,7 +1,7 @@ /** * @id none * @name No theme - * @description A special theme with no CSS. Useful if you want to create your own complete new theme! + * @description A special theme with no CSS. Useful if you want to create your own theme from scratch! * @author Starbeamrainbowlabs * @author_link https://starbeamrainbowlabs.com/ * @minversion 0.20