Skip to content

Commit

Permalink
Merge pull request #13 from felixhahnweilheim/v0.5
Browse files Browse the repository at this point in the history
V0.5.0
  • Loading branch information
felixhahnweilheim committed Jan 16, 2023
2 parents 30063b7 + d179b69 commit 8c95115
Show file tree
Hide file tree
Showing 69 changed files with 394 additions and 128 deletions.
24 changes: 24 additions & 0 deletions Events.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace humhub\modules\themeOrange;

use Yii;
use yii\base\Model;
use humhub\modules\ui\view\helpers\ThemeHelper;
use yii\base\Theme;

class Events
{
/*
* Callback after Module enabled
* @param ModuleEvent $event
*/
public static function onModuleEnabled($event)
{
/*Activate Orange Theme*/
$theme = ThemeHelper::getThemeByName('themeOrange');
if ($theme !== null) {
$theme->activate();
}
}
}
54 changes: 50 additions & 4 deletions Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,56 @@

namespace humhub\modules\themeOrange;

use humhub\modules\ui\view\helpers\ThemeHelper;
use Yii;

class Module extends \humhub\components\Module
{
/**
* * @inheritdoc
* */
public $resourcesPath = 'resources';
/**
* @inheritdoc
*/
public $resourcesPath = 'resources';

/**
* @var string defines the style of comment links (options: icon, text, both)
*/
public $commentLink = 'icon';

/**
* @var string defines the style of like links (options: icon, text, both)
*/
public $likeLink = 'icon';

/**
* @var string defines the like icon (options: heart, thumbsup, star)
*/
public $likeIcon = 'heart';

public static function getCommentLinkSetting() {
return Yii::$app->getModule('theme-orange')->commentLink;
}

public static function getLikeLinkSetting() {
return Yii::$app->getModule('theme-orange')->likeLink;
}

public static function getLikeIcon() {
return Yii::$app->getModule('theme-orange')->likeIcon;
}

/**
* @inheritdoc
*/
public function disable() {

// Deselect theme (select community theme)
if (Yii::$app->view->theme->name == 'themeOrange') {
$theme = ThemeHelper::getThemeByName('HumHub');
if ($theme !== null) {
$theme->activate();
}
}

parent::disable();
}
}
13 changes: 12 additions & 1 deletion config.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
<?php

use yii\base\Event;
use humhub\components\ModuleManager;
use humhub\modules\themeOrange\Events;

return [
'id' => 'theme-orange',
'class' => 'humhub\modules\themeOrange\Module',
'namespace' => 'humhub\modules\themeOrange'
'namespace' => 'humhub\modules\themeOrange',
'events' => [
[
'class' => ModuleManager::class,
'event' => ModuleManager::EVENT_AFTER_MODULE_ENABLE,
'callback' => [Events::class, 'onModuleEnabled']
]
]
];
10 changes: 10 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 0.5.0 (January 16 2023)
- Enh: make comment link and like link configurable (see added [CONFIG.md](CONFIG.md) for explanation)
- like icon: choose between heart, star & thumbs up (new color variable: star-color)
- Enh: add html title to comment and like icons
- Enh: auto-activate theme after module activation (and select community theme after deactivation)
- Enh: Wiki: adjust distance of comment and like icons
- Enh: improve hover of active buttons and of buttons in a dropdown menu
- Enh: some code style improvements
- Fix: add missing icon and image folder

## 0.4.1 (December 10, 2022)
- mobile: wrap menus to prevent horizontal scrolling (new: mobile.less)

Expand Down
25 changes: 25 additions & 0 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Configuration options
## Comment and Like Link
**commentLink**
Options: `icon`, `text`, `both`
Default: `icon`

**likeLink**
Options: `icon`, `text`, `both`
Default: `icon`

**likeIcon**
Options: `heart`, `star`, `thumbsup`
Default: `heart`



For example, add the following to protected/config/common.php

'modules' => [
'theme-orange' => [
'commentLink' => 'both',
'likeLink' => 'both',
'likeIcon' => 'thumbsup',
]
]
1 change: 1 addition & 0 deletions docs/DETAILS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Smaller changes compared to the Community theme
- General Layout: slightly decreased body padding (distance between topbars and content) for desktop and tablets - see `less/mixins.less`
- Editor for tasks, wiki, polls etc.: fixed non-floating menubar lead to a lot of scrolling on mobile, see `less/mixins.less` (solved with max-height)
- Login page: background: @background-color-page instead of @primary, text/h1/h2-color: @primary instead of white, link color: @link instead of white
- E-Mails: Text color in footer: @text-color-soft instead of @text-color-soft2
- E-Mails: Background color of body and table: @default (brighter) instead of @background-color-page
Expand Down
17 changes: 15 additions & 2 deletions docs/INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

1. Upload the module to /protected/modules (or another module loader path) OR use `git clone https://github.com/felixhahnweilheim/humhub-themes-orange.git`
2. Enable the module in Administration > Modules
2. Select the theme at Administration > Settings > Appearance (save at the bottom)

If you try out the theme with another HumHub version than the corresponding one mentioned in the README.md, please rebuild the css file (`themes/themeOrange/css/theme.css`) (see the [HumHub Theming guide](https://docs.humhub.org/docs/theme/css#compile-css-package)).
That's it! Since version 0.5 the theme is automatically activated.

***

Corresponding versions (espacially for the CSS file):

[v0.5.0](https://github.com/felixhahnweilheim/humhub-themes-orange/releases/tag/v0.5.0) / [v0.4.1](https://github.com/felixhahnweilheim/humhub-themes-orange/releases/tag/v0.4.1) / [v0.4](https://github.com/felixhahnweilheim/humhub-themes-orange/releases/tag/v0.4.0) => HumHub 1.13

[v0.3](https://github.com/felixhahnweilheim/humhub-themes-orange/releases/tag/v0.3.0) => HumHub 1.12

[v0.2](https://github.com/felixhahnweilheim/humhub-themes-orange/releases/tag/v0.2.0) => HumHub 1.11

[v0.1](https://github.com/felixhahnweilheim/humhub-themes-orange/releases/tag/v0.1.0) => HumHub 1.10

If you try the theme with another HumHub version than the corresponding one, please rebuild the css file (`themes/themeOrange/css/theme.css`) (see the [HumHub Theming guide](https://docs.humhub.org/docs/theme/css#compile-css-package)).
43 changes: 13 additions & 30 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,33 @@

### A child theme for HumHub

**Version: 0.4.1**

Corresponding versions (espacially for the CSS file):

[v0.4](https://github.com/felixhahnweilheim/humhub-themes-orange/releases/tag/v0.4.1) => HumHub 1.13

[v0.3](https://github.com/felixhahnweilheim/humhub-themes-orange/releases/tag/v0.3.0) => HumHub 1.12

[v0.2](https://github.com/felixhahnweilheim/humhub-themes-orange/releases/tag/v0.2.0) => HumHub 1.11

[v0.1](https://github.com/felixhahnweilheim/humhub-themes-orange/releases/tag/v0.1.0) => HumHub 1.10
**Version: 0.5.0** (for HumHub 1.13)

This is a child [theme module](https://docs.humhub.org/docs/theme/module#theme-module), the changes compared to the community theme are listed below.

**Author:** Felix Hahn, [email protected] - self-learned

## State of development
The theme works fine in my HumHub installations, but I have not tested all possible settings and available modules.
That's why I recommend you to test the module with your settings, modules etc. and/or look through my code before activating it on a production site.
## Changes in comparison to the community theme
### 1. Comment and like icons instead of text (configurable)

Please give me some feedback how it works for you.
You can decide to show icons instead of the text, both or only the text, see [configuration](CONFIG.md).
As like icon you can choose between heart, star and thumbs up.

## Changes in comparison to the community theme
### 1. Topic list in spaces and profiles
<img src="../resources/screenshot-social-controls-2.png" width="200">

### 2. Topic list in spaces and profiles
**Thanks to @raphaeljolivet** (see https://github.com/humhub/humhub/pull/4785) I was able to add a topic list to the left sidebar of spaces (only shown if there is at least one topic)

<img src="../resources/screenshot-space-topic-list.png" width="700">

### 2. Comment and like icons instead of text

<img src="../resources/screenshot-social-controls-2.png" width="200">

### 3. Colors
- bright topbar (added variable @custom-topbar-background and @custom-topbar-contrast)

<img src="../resources/screenshot-header-desktop.png" width="700">

- bright dropdown menus (background same as topbar), text-color: @text-color-highlight instead of white
- bright dropdown menus, text-color: @text-color-highlight instead of white
- color changes in comparison to the HumHub Community theme are mentioned in the file `less/variables.less`
- added color variables (e.g. color for like icons)

#### Added hover effects
- see `less/mixins.less` (added color variable @hover)
Expand All @@ -53,16 +41,11 @@ see `less/button.less`

<img src="../resources/screenshot-people-buttons.png" width="400">

### 6. Added Language Switcher in
### 5. Added Language Switcher in
- Login modal window, at the bottom
- Registration page, beneath the title
- dashboard for guests

### 7. Editor for tasks, wiki, polls etc.: fixed non-floating menubar lead to a lot of scrolling on mobile
see `less/mixins.less` (solved with max-height)

### 8. Modified Dashboard for guests
does not show the widget "New Spaces" in order not to show internal things to the public
shows the language switcher
### 6. Hide "New Spaces" widget from guest dashboar

### 9. [Some smaller things ...](DETAILS.md)
### 7. [Some smaller things ...](DETAILS.md)
18 changes: 13 additions & 5 deletions module.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
{
"id": "theme-orange",
"version": "0.5.0",
"name": "Orange Theme",
"description": "A very simple, light theme for HumHub",
"keywords": [
"child theme", "orange"
],
"version": "0.4.1",
"humhub": {
"minVersion": "1.13"
},
"screenshots": ["resources/screenshot-header-desktop.png", "screenshot-space-topic-list.png", "resources/screenshot-social-controls-2.png", "resources/screenshot-space-header-buttons.png", "resources/screenshot-create-space-button.png", "resources/screenshot-people-buttons.png"]
"keywords": [
"child theme", "orange"
],
"screenshots": ["resources/screenshot-header-desktop.png", "screenshot-space-topic-list.png", "resources/screenshot-social-controls-2.png", "resources/screenshot-space-header-buttons.png", "resources/screenshot-create-space-button.png", "resources/screenshot-people-buttons.png"],
"homepage": "https://github.com/felixhahnweilheim/humhub-themes-orange",
"authors": [
{
"name": "Felix Hahn",
"email": "[email protected]",
"role": "Developer"
}
]
}
2 changes: 1 addition & 1 deletion themes/themeOrange/css/theme.css

Large diffs are not rendered by default.

Binary file added themes/themeOrange/ico/android-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/android-icon-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/android-icon-36x36.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/android-icon-48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/android-icon-72x72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/android-icon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/apple-icon-114x114.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/apple-icon-120x120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/apple-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/apple-icon-152x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/apple-icon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/apple-icon-57x57.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/apple-icon-60x60.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/apple-icon-72x72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/apple-icon-76x76.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/apple-icon-precomposed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/apple-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/favicon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/favicon_1.ico
Binary file not shown.
40 changes: 40 additions & 0 deletions themes/themeOrange/ico/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"icons": [
{
"src": "\/android-icon-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": "0.75"
},
{
"src": "\/android-icon-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": "1.0"
},
{
"src": "\/android-icon-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": "1.5"
},
{
"src": "\/android-icon-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": "2.0"
},
{
"src": "\/android-icon-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": "3.0"
},
{
"src": "\/android-icon-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"
}
]
}
Binary file added themes/themeOrange/ico/ms-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/ms-icon-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/ms-icon-310x310.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/ms-icon-70x70.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/notification-o.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/themeOrange/ico/notification.png
Binary file added themes/themeOrange/img/icon_search16x16.png
Binary file added themes/themeOrange/img/mime/audio.png
Binary file added themes/themeOrange/img/mime/excel.png
Binary file added themes/themeOrange/img/mime/file.png
Binary file added themes/themeOrange/img/mime/illustrator.png
Binary file added themes/themeOrange/img/mime/image.png
Binary file added themes/themeOrange/img/mime/indesign.png
Binary file added themes/themeOrange/img/mime/pdf.png
Binary file added themes/themeOrange/img/mime/photoshop.png
Binary file added themes/themeOrange/img/mime/powerpoint.png
Binary file added themes/themeOrange/img/mime/video.png
Binary file added themes/themeOrange/img/mime/word.png
Binary file added themes/themeOrange/img/mime/zip.png
Binary file added themes/themeOrange/img/picker_add.png
Binary file added themes/themeOrange/img/select_arrow.png
Binary file added themes/themeOrange/img/wmd-buttons.png
2 changes: 1 addition & 1 deletion themes/themeOrange/less/button.less
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
color: @text-color-contrast;
border: none;
}
&.btn-sm.active {
&.active {
&:hover,
&:focus {
background: @primary !important;
Expand Down
1 change: 1 addition & 0 deletions themes/themeOrange/less/dropdown.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
}
}
}

// Navigation dropdown

.nav-pills,
Expand Down
Loading

0 comments on commit 8c95115

Please sign in to comment.