Skip to content

Commit

Permalink
Merge pull request #12 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 89563a6 + 140443d commit 9b417cf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 144 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ Redmineの画面を楽しく親しみやすくすることを目的として、f

## インストール方法

### public/themes以下にテーマを保存
### themes以下にテーマを保存

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

```
git clone https://github.com/farend/redmine_theme_farend_fancy.git public/themes/farend_fancy
git clone https://github.com/farend/redmine_theme_farend_fancy.git themes/farend_fancy
```

gitコマンドが利用できない場合、以下のURLからzipファイルをダウンロードし展開してください。
Expand All @@ -30,14 +30,14 @@ gitコマンドが利用できない場合、以下のURLからzipファイル
https://github.com/farend/redmine_theme_farend_fancy/archive/master.zip
```

アーカイブを展開した結果作成されたディレクトリをRedmineインストールディレクトリ以下のpublic/themesディレクトリにfarend_fancyという名前でコピーしてください
アーカイブを展開した結果作成されたディレクトリをRedmineインストールディレクトリ以下のthemesディレクトリにfarend_fancyという名前でコピーしてください

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

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

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

### 新しいテーマの利用
Expand Down
File renamed without changes
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);
}
}
});
53 changes: 2 additions & 51 deletions stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ h1, h2, h3, h4 {

#main-menu li a.boards, #main-menu li a.boards:hover {
padding-left: 24px;
background-image: url(../images//comments.png)
background-image: url(../images/comments.png)
}

#main-menu li a.files, #main-menu li a.files:hover {
Expand Down Expand Up @@ -511,7 +511,7 @@ div.wiki li {
}

a.atom {
background: url(../images/oxygen/application-rss%2Bxml.png) no-repeat 0px 0px;
background: url(../images/oxygen/application-rss-xml.png) no-repeat 0px 0px;
padding: 2px 0px 3px 16px;
}

Expand Down Expand Up @@ -701,52 +701,3 @@ table.revision-info a:hover {
width: 100%;
}
}

/* 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 9b417cf

Please sign in to comment.