Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap #82

Merged
merged 54 commits into from
Jul 4, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
0573f45
Add ruyb 2.0 to travis
cpg May 13, 2014
15c9616
Add ruby 2.1.0 as well
cpg May 13, 2014
59db304
use settings_engine.themes_path for themes' url
cpg May 22, 2014
571c514
Adapting plugin gerator to rails 4. route definition changed.
May 27, 2014
ac70c98
Merge pull request #55 from agmps18/rails-4
cpg May 27, 2014
a87bfcd
Stray message markup, and search hda routes corrected
May 28, 2014
dc23e75
Merge pull request #58 from agmps18/rails-4
cpg May 28, 2014
1bbad29
Adding Back Debug Page
May 29, 2014
33dd8c9
Attribute should be data confirm
May 29, 2014
53c691d
Merge pull request #59 from agmps18/rails-4
cpg May 29, 2014
655f998
Localized string
agmps17 May 29, 2014
d5723a7
Merge pull request #61 from agmps18/rails-4
cpg May 29, 2014
32d796b
Allowing plugins to be added as a submenu of existing tab
agmps17 May 30, 2014
a6ebb4f
Merge pull request #64 from agmps18/rails-4
cpg May 30, 2014
0e194db
Debug Page for production, typo as development
agmps17 May 31, 2014
53911e7
Edited on master but not in this branch
agmps17 May 31, 2014
ea75440
Merge pull request #66 from agmps18/rails-4
cpg May 31, 2014
0c14727
tab was already used, resolving naming error
agmps17 Jun 1, 2014
0c532f0
Merge pull request #67 from agmps18/rails-4
cpg Jun 1, 2014
93c80b5
Adding changes to allow migration in plugins. Rectifying uninstallati…
agmps17 Jun 4, 2014
f3f62f0
Merge pull request #68 from agmps18/rails-4
cpg Jun 4, 2014
f3e7057
update app description, truncation. fixes #1397
cpg Jun 5, 2014
4735f12
cleanup - removal of unused file
cpg Jun 6, 2014
e46189d
update opensearch icon to current logo
cpg Jun 6, 2014
7168534
Patch for double spinner icons
agmps17 Jun 7, 2014
b406679
Allowing name ans webapp id as attribute accesible
agmps17 Jun 12, 2014
6fecabb
Merge pull request #70 from agmps18/rails-4
cpg Jun 12, 2014
cbb26db
conflicting routes with webapps
agmps17 Jun 13, 2014
4688165
Merge pull request #71 from agmps18/rails-4
cpg Jun 14, 2014
7b94834
Repo changes
agmps17 Jun 16, 2014
69597d0
bundle update, using our the_for_rails, update .ruby-version
cpg Jun 16, 2014
33c100b
Changes based on the generic conf
agmps17 Jun 19, 2014
a2d5085
New changes and merging branch
agmps17 Jun 19, 2014
69edf6f
Introducing hda_access for apps using other kind of templates
agmps17 Jun 20, 2014
3c23656
Adding check for checkboxes bug 1451
agmps17 Jun 23, 2014
90926c5
Merge pull request #73 from agmps17/rails-4
cpg Jun 23, 2014
3f3534d
be_true is renamed to be_truthy
agmps17 Jun 23, 2014
89c7ec4
Merge pull request #74 from agmps17/rails-4
cpg Jun 23, 2014
addeace
Removing webapps code, fix for bug 1398(duplicate spinner)
agmps17 Jun 23, 2014
5d3f5d4
Merge pull request #75 from agmps17/rails-4
cpg Jun 23, 2014
3618fb7
RAILS_DEFAULT_LOGGER is deprecated, use Rails.logger.error instead
tmkasun Jun 24, 2014
269d691
Merge pull request #76 from tmkasun/rails-4_logger_fix
cpg Jun 24, 2014
4451cb4
update bundle, use system bundler to package the gems properly
cpg Jun 25, 2014
6f81782
Merge branch 'rails-4' of github.com:amahi/platform into rails-4
cpg Jun 25, 2014
fe21d88
solving bug 1451
agmps17 Jun 25, 2014
18951e6
Merge pull request #77 from agmps17/rails-4
cpg Jun 25, 2014
d814a2e
aggressive cleanup of gem artifacts not needed at run time. 300 to 40…
cpg Jun 26, 2014
2a0fe0c
Merge branch 'rails-4'
cpg Jun 26, 2014
ceb4ed7
Adding migration for changing custom_options column to text type
agmps17 Jun 27, 2014
5ab3a17
Merge pull request #80 from agmps17/rails-4
cpg Jun 27, 2014
3d2e045
update .ruby-version and update schema.rb to the latest
cpg Jun 28, 2014
17a3577
update bin stubs to rails 4
cpg Jun 28, 2014
597d61f
Changes to adapt the bootstrap theme
agmps17 Jul 4, 2014
d868008
Changes to adapt bootstrap theme
agmps17 Jul 4, 2014
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
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0-p195
2.0.0-p353
2 changes: 0 additions & 2 deletions .rvmrc

This file was deleted.

2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
language: ruby
rvm:
- 1.9.3
- 2.0.0
- 2.1.0
env:
- DB=sqlite
script:
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ gem 'therubyracer'
gem 'uglifier'

gem "activeresource", require: "active_resource"
gem 'protected_attributes'
gem 'protected_attributes'
gem 'actionpack-action_caching'
gem 'rails-observers'

gem 'jbuilder'
gem 'ya2yaml'

gem 'themes_for_rails', :git=>"https://github.com/agmps18/themes_for_rails.git"
gem 'themes_for_rails', :git => "https://github.com/amahi/themes_for_rails.git"

gem 'jquery-rails'
gem 'jquery-ui-rails'
Expand Down
54 changes: 29 additions & 25 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/agmps18/themes_for_rails.git
revision: 8eca26171d864b489678ef94e0c60d75f4954e80
remote: https://github.com/amahi/themes_for_rails.git
revision: e0f2e834ce27f19b287e964f18f027a9b4f172bb
specs:
themes_for_rails (0.5.1)
rails (>= 3.0.0)
Expand Down Expand Up @@ -48,7 +48,7 @@ GEM
request_store (~> 1.0)
bcrypt (3.1.7)
builder (3.2.2)
capybara (2.2.1)
capybara (2.3.0)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
Expand All @@ -67,10 +67,10 @@ GEM
coffee-script-source (1.7.0)
daemons (1.1.9)
diff-lcs (1.2.5)
docile (1.1.3)
docile (1.1.5)
erubis (2.7.0)
eventmachine (1.0.3)
execjs (2.0.2)
execjs (2.2.0)
factory_girl (4.4.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.4.1)
Expand All @@ -82,10 +82,10 @@ GEM
rake
hike (1.2.3)
i18n (0.6.9)
jbuilder (2.0.7)
jbuilder (2.1.1)
activesupport (>= 3.0.0, < 5)
multi_json (~> 1.2)
jquery-rails (3.1.0)
jquery-rails (3.1.1)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (4.2.1)
Expand All @@ -100,21 +100,21 @@ GEM
treetop (~> 1.4.8)
mime-types (1.25.1)
mini_portile (0.6.0)
minitest (5.3.4)
minitest (5.3.5)
multi_json (1.10.1)
mysql2 (0.3.16)
nokogiri (1.6.2.1)
mini_portile (= 0.6.0)
poltergeist (1.5.0)
poltergeist (1.5.1)
capybara (~> 2.1)
cliver (~> 0.3.1)
multi_json (~> 1.0)
websocket-driver (>= 0.2.0)
polyglot (0.3.4)
protected_attributes (1.0.7)
polyglot (0.3.5)
protected_attributes (1.0.8)
activemodel (>= 4.0.1, < 5.0)
psych (2.0.5)
quiet_assets (1.0.2)
quiet_assets (1.0.3)
railties (>= 3.1, < 5.0)
rack (1.5.2)
rack-test (0.6.2)
Expand All @@ -140,19 +140,23 @@ GEM
rake (10.3.2)
rb-readline (0.5.1)
ref (1.0.5)
request_store (1.0.5)
rspec-core (2.14.8)
rspec-expectations (2.14.5)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.6)
rspec-rails (2.14.2)
request_store (1.0.6)
rspec-core (3.0.2)
rspec-support (~> 3.0.0)
rspec-expectations (3.0.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.0.0)
rspec-mocks (3.0.2)
rspec-support (~> 3.0.0)
rspec-rails (3.0.1)
actionpack (>= 3.0)
activemodel (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (~> 3.0.0)
rspec-expectations (~> 3.0.0)
rspec-mocks (~> 3.0.0)
rspec-support (~> 3.0.0)
rspec-support (3.0.2)
sass (3.2.19)
sass-rails (4.0.3)
railties (>= 4.0.0, < 5.0)
Expand Down Expand Up @@ -189,14 +193,14 @@ GEM
eventmachine (>= 1.0.0)
rack (>= 1.0.0)
thor (0.19.1)
thread_safe (0.3.3)
thread_safe (0.3.4)
tilt (1.4.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
tzinfo (1.1.0)
tzinfo (1.2.1)
thread_safe (~> 0.1)
uglifier (2.5.0)
uglifier (2.5.1)
execjs (>= 0.3.0)
json (>= 1.8.0)
unicorn (4.8.3)
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@

bundle:
bundle install --without test --path vendor/bundle --binstubs bin/ --deployment
(cd vendor/bundle/ruby/gems/; find . -type f -exec grep -l '/this/will/be/overwritten/or/wrapped/anyways/do/not/worry/ruby' {} \; | xargs sed -i -e 's|/this/will/be/overwritten/or/wrapped/anyways/do/not/worry/ruby|/usr/bin/ruby|') || true
/usr/bin/bundle install --without test --path vendor/bundle --binstubs bin/ --deployment
(cd vendor/bundle/ruby/ && find . -type f -exec grep -l '/usr/bin/ruby' {} \; | xargs sed -i -e 's|/usr/bin/ruby|/usr/bin/ruby|') || true
# clean up things that are not needed at run time
(cd vendor/bundle/ruby/ && rm -rf cache) || true
(cd vendor/bundle/ruby/gems && rm -rf rails-*/guides */spec */doc */doc-api) || true
(cd vendor/bundle/ruby/gems && rm -rf */test */tests) || true
(cd vendor/bundle/ruby/ && find . \( -name '*.[coa]' -or -name '*.cc' -or -name '*.md' -or -name '.git' \) -exec rm -rf {} \;) || true

distclean: clean
rm -rf vendor/bundle
Expand Down
Binary file modified app/assets/images/logo16x16.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 removed app/assets/images/rails.png
Binary file not shown.
1 change: 1 addition & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
//= require lib/application
//= require lib/templates
//= require lib/smart-links
//= require lib/debug
//= require bootstrap.min
//= require spinner
24 changes: 24 additions & 0 deletions app/assets/javascripts/lib/debug.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Amahi Home Server
# Copyright (C) 2007-2013 Amahi
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License v3
# (29 June 2007), as published in the COPYING file.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# file COPYING for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Amahi
# team at http://www.amahi.org/ under "Contact Us."

# Debug JS functionality


$(document).on "ajax:success", ".debug-form", (event, results) ->
if results.status is "ok"
$('#debug-submit-form').html("<p class='alert alert-info'> Error Log Succesfully Submitted</p>")
else
$('#debug-submit-form').html("<p class='alert alert-danger'>Debug report failed. Please do try again later.</p>")
7 changes: 7 additions & 0 deletions app/assets/themes/default/stylesheets/style.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1585,10 +1585,12 @@ textarea {border: 1px solid #ccc;}
.hide {
display: none;
}

#theme-sshot{
height:100%;
width:100%
}

//Markup for alert boxes
.alert {
padding: 15px;
Expand All @@ -1610,4 +1612,9 @@ border-radius: 4px;
color: #a94442;
background-color: #f2dede;
border-color: #ebccd1;
}
//Debug Tab Design
.debug-form{
margin-top:10px !important;
margin-left: 20px !important;
}
6 changes: 3 additions & 3 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def current_user
def login_required
unless current_user
store_location
flash[:notice] = I18n.t('must_be_logged_in')
flash[:info] = I18n.t('must_be_logged_in')
redirect_to new_user_session_path
return false
end
Expand All @@ -180,7 +180,7 @@ def admin_required
return false if login_required == false
unless current_user.admin?
store_location
flash[:notice] = t('must_be_admin')
flash[:info] = t('must_be_admin')
redirect_to new_user_session_url
return false
end
Expand Down Expand Up @@ -218,4 +218,4 @@ def use_sample_data?
development? || test?
end

end
end
51 changes: 51 additions & 0 deletions app/controllers/debug_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Amahi Home Server
# Copyright (C) 2007-2013 Amahi
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License v3
# (29 June 2007), as published in the COPYING file.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# file COPYING for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Amahi
# team at http://www.amahi.org/ under "Contact Us."

class DebugController < ApplicationController

before_filter :admin_required
layout 'debug'

def index
@page_title = t('debug')
end

def logs
@page_title = t('debug')
end

def system
@page_title = t('debug')
end


def submit
AmahiApi.api_key = Setting.get "api-key"
report = SystemUtils.run 'tail -200 /var/hda/platform/html/log/production.log'
er = AmahiApi::ErrorReport.new(:report => report, :comments => params[:comments], :subject => params[:subject])
begin
if er.save
render :json =>{:status=>'ok'}
else
render :json =>{:status=>'failed',:errors=> er.errors}
end
rescue
render :json =>{:status=>'failed',:errors=> er.errors}
end
end


end
5 changes: 2 additions & 3 deletions app/controllers/front_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License v3
# (29 June 2007), as published in the COPYING file.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# file COPYING for more details.
#
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Amahi
# team at http://www.amahi.org/ under "Contact Us."
Expand All @@ -24,5 +24,4 @@ def index
@apps = App.in_dashboard
@news = AmahiNews.top()
end

end
2 changes: 1 addition & 1 deletion app/controllers/user_sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def create
remember_me = params[:remember_me]
@user_session = UserSession.new(:login => username, :password => password, :remember_me => remember_me)
if @user_session.save
flash[:success] = "Logged in Successfully"
flash[:success] = t 'logged_in_successfully'
redirect_to root_url
else
flash[:danger] = t 'not_a_valid_user_or_password'
Expand Down
15 changes: 12 additions & 3 deletions app/helpers/tabs_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,22 @@
module TabsHelper

def tab_class(tab)
klass = params[:controller] == tab.id ? 'active' : ''
if params[:controller] == tab.id
klass = 'active'
else
subtab = Tab.find(params[:controller])
if subtab==nil
if Tab.ischild(params[:controller],tab)
klass = 'active'
end
end
end
klass += " empty" unless tab.subtabs?
klass
end

def subtab_class(action = nil)
params[:action] == action ? 'active' : ''
def subtab_class(action = nil, tab_id)
((action == params[:action] && params[:controller] == tab_id) or (action == params[:controller] && Tab.find(params[:controller])==nil) ) ? 'active' : ''
end

def nav_class(tabs)
Expand Down
4 changes: 2 additions & 2 deletions app/models/db.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License v3
# (29 June 2007), as published in the COPYING file.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# file COPYING for more details.
#
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Amahi
# team at http://www.amahi.org/ under "Contact Us."
Expand Down
11 changes: 10 additions & 1 deletion app/models/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ def install(installer, source)

# uninstall when the object is destroyed
def before_destroy
location = File.join(Rails.root, "plugins", "#{1000+id}-#{path}")
base = File.basename path
location = File.join(Rails.root, "plugins", "#{1000+id}-#{base}")
array = []
array <<"#{location}/db/migrate"
puts "Reverting the changes to the database made by the plugin"
ActiveRecord::Migrator.down(array,nil)
FileUtils.rm_rf location
# restart the rails stack -- FIXME: this is too much a restart would be best
c = Command.new "touch /var/hda/platform/html/tmp/restart.txt"
Expand All @@ -75,6 +80,10 @@ def dir2plugin(source, config)
FileUtils.rm_rf destination
FileUtils.mv source, destination
# FIXME: eventually we need to do migrations, probably here
array = []
array <<"#{destination}/db/migrate"
puts "Migrating database of the plugin, if applicable"
ActiveRecord::Migrator.up(array, nil)
# restart the rails stack -- FIXME: this is too much a restart would be best
c = Command.new "touch /var/hda/platform/html/tmp/restart.txt"
c.execute
Expand Down
Loading