Skip to content

Commit

Permalink
Merge pull request #6 from farend/support-redmine6
Browse files Browse the repository at this point in the history
Support redmine6
  • Loading branch information
ishikawa999 authored Nov 12, 2024
2 parents 11e6577 + 52fd436 commit 51f60e0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 144 deletions.
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,26 @@ Redmine用のカスタムテーマです。日本語環境で見やすい画面
* チケット一覧画面において優先度に対応した色分け表示を行うための設定をRedmine標準添付のAlternateテーマから取り込みました
* チケット一覧画面において期限が超過したチケットをオレンジ色で表示するよう変更しました
* チケット一覧画面において担当者・作者欄の自分の名前を太字で表示するよう変更しました
* サイドバーの折り畳み機能を追加しました


## 利用環境

デフォルトテーマを読み込んで必要な部分のみ上書きするようにしているので幅広いバージョンのRedmineで利用できるはずですが、Redmine本体のバージョンアップを行った場合はテーマも最新版に更新してください。


## インストール方法

### 1: テーマが格納されたディレクトリを作成

Redmineのインストールディレクトリで以下のコマンドを実行してください。

```
git clone https://github.com/farend/redmine_theme_farend_basic.git public/themes/farend_basic
git clone https://github.com/farend/redmine_theme_farend_basic.git themes/farend_basic
```

#### RedMica 3.0以降の場合
#### Redmine5.1以前の場合

Redmineのインストールディレクトリで以下のコマンドを実行してください。

```
git clone -b support-propshaft https://github.com/farend/redmine_theme_farend_basic.git themes/farend_basic
git clone -b redmine5.1 https://github.com/farend/redmine_theme_farend_basic.git public/themes/farend_basic
```

### 2: テーマの設定を変更
Expand Down
88 changes: 0 additions & 88 deletions javascripts/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,91 +41,3 @@ $(function(){
$(element).attr("data-absolute-date", element.title);
});
});

// Function based on https://www.redmine.org/issues/21808#note-27 patch.
// collapsible sidebar jQuery plugin
(function($) {
// main container this is applied to
var main;
// triggers show/hide
var button;
// the key to use in local storage
// this will later be expanded using the current controller and action to
// allow for different sidebar states for different pages
var localStorageKey;
// true if local storage is available
var canUseLocalStorage = function(){
try {
if('localStorage' in window){
localStorage.setItem('redmine.test.storage', 'ok');
var item = localStorage.getItem('redmine.test.storage');
localStorage.removeItem('redmine.test.storage');
if(item === 'ok') return true;
}
} catch (err) {}
return false;
}();
// function to set current sidebar state
var setState = function(state){
if(canUseLocalStorage){
localStorage.setItem(localStorageKey, state);
}
};
var applyState = function(){
if(main.hasClass('visible-sidebar')){
setState('visible');
} else {
setState('hidden');
}
};
var setupToggleButton = function(){
button = $('#sidebar-switch-button');
button.click(function(e){
main.addClass("animate");
main.toggleClass('visible-sidebar');
applyState();
e.preventDefault();
return false;
});
applyState();
};
$.fn.collapsibleSidebar = function() {
main = this;
// determine previously stored sidebar state for this page
if(canUseLocalStorage) {
// determine current controller/action pair and use them as storage key
var bodyClass = $('body').attr('class');
if(bodyClass){
try {
localStorageKey = 'redmine-sidebar-state-' + bodyClass.split(/\s+/).filter(function(s){
return s.match(/(action|controller)-.*/);
}).sort().join('-');
} catch(e) {
// in case of error (probably IE8), continue with the default key.
localStorageKey = 'redmine-sidebar-state';
}
}
var storedState = localStorage.getItem(localStorageKey);
main.toggleClass('visible-sidebar', (storedState === 'visible' || !storedState));
} else {
main.toggleClass('visible-sidebar', true);
}
// draw the toggle button once the DOM is complete
$(document).ready(setupToggleButton);
};
}(jQuery));

window.addEventListener('DOMContentLoaded', function () {
if (!$('#main').hasClass('nosidebar')) {
if ($('#sidebar-switch-panel').length == 0) {
$('#content').prepend('<div id="sidebar-switch-panel"><a id="sidebar-switch-button" href="#"><span class="arrow"></span></a></div>');
}
try {
$('#main').collapsibleSidebar();
} catch(e) {
$('#main').toggleClass('visible-sidebar', true);
$('div#sidebar-switch-panel').remove();
console.error(e);
}
}
});
49 changes: 0 additions & 49 deletions stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -468,52 +468,3 @@ table.revision-info a {
table.revision-info a:hover {
color:#D14848;
}

/* Collapse sidebar */
#sidebar { width: 19%; display: none;}
#main.visible-sidebar #sidebar{ display: block; }
@media screen and (max-width: 899px) {
#main.visible-sidebar #sidebar, #main.visible-sidebar #sidebar-switch-panel { display: none; }
}

#content { padding: 14px 14px 14px 14px; }
#sidebar-switch-panel {
float: right;
left: 10px;
top: 2px;
width: 20px;
height: 25px;
position: relative;
padding: 2px;
margin-left: 5px;
}
#sidebar-switch-button {
background-color: #EEEEEE;
border-bottom: 1px solid #ddd;
border-left: 1px solid #ddd;
border-top: 1px solid #ddd;
border-radius: 10px 0px 0px 10px;
display: block;
height: 100%;
padding: 9px 20px 9px 5px;
font-size: 0px;
text-decoration: none;
}
#main #sidebar-switch-button .arrow {
display: inline-block;
width: 6px;
height: 6px;
margin-top: 8px;
border-top: 3px solid gray;
border-right: 3px solid gray;
}
#main:not(.visible-sidebar) #sidebar-switch-button .arrow{
margin-left: 4px;
transform: rotate(-135deg);
}
#main.visible-sidebar #sidebar-switch-button .arrow {
transform: rotate(45deg);
}
@media print {
#main.visible-sidebar #sidebar, #sidebar-switch-panel { display:none; }
}

0 comments on commit 51f60e0

Please sign in to comment.