Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.sass-cache
.DS_Store
/images/custom-logo.png
SHA256SUMS
3 changes: 2 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "fonts/vazir"]
path = fonts/vazir
url = https://github.com/rastikerdar/vazir-font
url = https://github.com/rastikerdar/vazir-font
branch = master
26 changes: 1 addition & 25 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,4 @@ pwd = File.dirname(__FILE__)
work_dir = File.absolute_path(pwd + '/../../public/themes/fedmine')

p "Installing Fedmine Theme"

script = <<-EOS
cd #{pwd}
mkdir -p #{work_dir}
EOS

is_git=0 == `echo -n $(git rev-parse >/dev/null 2>&1; echo $?)`.to_i

if is_git
script << <<-EOS
git submodule update --init
git submodule update --remote
GIT_WORK_TREE=#{work_dir} git checkout -f HEAD
EOS
else
script << "cp -r . #{work_dir}\n"
end

script << <<-EOS
if [ ! -f #{work_dir}/images/custom-logo.png ]; then
cp #{work_dir}/images/logo.png #{work_dir}/images/custom-logo.png
fi
EOS

system(script)
system(pwd + '/installer "' + pwd + '" "' + work_dir + '"')
2 changes: 1 addition & 1 deletion fonts/vazir
Submodule vazir updated from d58053 to aa363c
2 changes: 1 addition & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
description 'Fedmine flat theme with rtl support'
version '1.0.0'
requires_redmine :version_or_higher => '3.0.0'
url 'https://github.com/ghasedak/fedmine'
url 'https://github.com/pattack/fedmine'
author_url 'https://github.com/pouyanh'

settings(:partial => 'settings/fedmine')
Expand Down
77 changes: 77 additions & 0 deletions installer
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/bin/bash

pwd=$1
work_dir=$2

mkdir -p $work_dir
cd $pwd

if [ `which git` ] && [ `git rev-parse HEAD` ]; then
git submodule deinit --all --force
git submodule sync
git submodule update --init
git submodule foreach git checkout master
git submodule foreach git pull origin master
else
if [ `which curl` ]; then
DLAPP=`which curl`" -L -o __OUT__ __URL__"
elif [ `which wget` ]; then
DLAPP=`which wget`" --progress=dot -O __OUT__ __URL__"
else
exit 1
fi

modules=$(cat .gitmodules | tr -d '\n' | sed -e "/\[submodule \"[^\"]\+\"\]\s\+/{s//\n/g}" | sed -e "/\(\s*url = \)\?\(.*\?\)\t*path = \([^\t]\+\)\t*\(url = \)\?\(.*\)/{s//\3\t\2\5/g}" | awk '{$1=$1};1')

IFS=$'\n'
for module in $modules;
do
IFS=' ' read -ra repo <<< $module
api_url=${repo[1]/https:\/\/github.com/https:\/\/api.github.com\/repos}"/commits"
repo_sfn=${repo[0]/\//_}.commits
checksums=$pwd/SHA256SUMS
api=${DLAPP/__OUT__/\/tmp\/$repo_sfn}
api=${api/__URL__/$api_url}
eval $api

if [ ! -f $checksums ] || [ ! `grep $repo_sfn $checksums` ]; then
echo `sha256sum /dev/null | awk '{print $1}'`" /tmp/$repo_sfn" >> $checksums
fi

if ! `sha256sum --strict --status -c $checksums`; then
path=$work_dir/${repo[0]}
url=${repo[1]}"/archive/master.zip"

mkdir -p $path

download=${DLAPP/__OUT__/$path.zip}
download=${download/__URL__/$url}

mkdir -p $path
eval $download
unzip -o $path.zip -d $path
mv $path/*/* $path
rm $path.zip
fi

old_checksum=`grep $repo_sfn $checksums | awk '{print $1}'`
new_checksum=`sha256sum /tmp/$repo_sfn | awk '{print $1}'`
sed -i "s/$old_checksum/$new_checksum/" $checksums
rm /tmp/$repo_sfn
done
fi

cp -r . $work_dir/

if [ ! -f $work_dir/images/custom-logo.png ]; then
cp $work_dir/images/logo.png $work_dir/images/custom-logo.png
fi

rm -rf $work_dir/app
rm -rf $work_dir/config
rm -rf $work_dir/.git
rm -rf $work_dir/Gemfile
rm -rf $work_dir/installer
rm -rf $work_dir/lib
rm -rf $work_dir/init.rb

4 changes: 2 additions & 2 deletions lib/fedmine/settings_controller_patch.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Fedmine
module SettingsControllerPatch
def self.included(base)
base.send(:before_filter, :upload_logo, :only => :plugin)
base.send(:before_action, :upload_logo, :only => :plugin)
end

def upload_logo
Expand All @@ -18,4 +18,4 @@ def upload_logo
end
end
end
end
end
2 changes: 1 addition & 1 deletion stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ h1, h2, h3, h4, h5, h6, h7 { font-family: "Open Sans", Verdana, sans-serif; font

#main { background: transparent; margin: 15px 15px 0px 15px; background-color: #fff; }

#top-menu { font-size: 14px; padding: 0px 0px 0px 220px; height: 40px; background: #000 url(../images/logo.png) 10px 5px no-repeat;}
#top-menu { font-size: 14px; padding: 0px 0px 0px 220px; height: 40px; background: #000 url(../images/custom-logo.png) 10px 5px no-repeat;}
#top-menu #loggedas { display: none; color: #FFF; padding: 11px 0 11px 5px; margin: 0; background-color: #E02222; border-left: 2px solid #DD4814; }
#top-menu #account ul li a { background-color: #d84a38; margin-right: 8px; padding: 5px; font-size: 13px; }
#top-menu #account ul li a:hover { background-color: #bb2413 !important; }
Expand Down