Skip to content

Commit

Permalink
Merge pull request #93 from agmps17/master
Browse files Browse the repository at this point in the history
Adding a default TV share with a name TV and a tag TV
  • Loading branch information
cpg committed Jul 18, 2014
2 parents 9f37aad + 040b9f8 commit 038ddc7
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/share.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Share < ActiveRecord::Base
DEFAULT_SHARES_ROOT = '/var/hda/files'

SIGNATURE = "Amahi configuration"
DEFAULT_SHARES = [ "Books", "Pictures", "Movies", "Videos", "Music", "Docs", "Public" ].each {|s| I18n.t s }
DEFAULT_SHARES = [ "Books", "Pictures", "Movies", "Videos", "Music", "Docs", "Public", "TV" ].each {|s| I18n.t s }
PDC_SETTINGS = "/var/hda/domain-settings"

default_scope {order("name")}
Expand Down
27 changes: 27 additions & 0 deletions db/migrate/20140717200213_add_tv_to_shares.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
class AddTvToShares < ActiveRecord::Migration
def self.up
if(Setting.get('initialized') && Setting.get('initialized') == '1')
name = "TV"
sh = Share.where(:name=>name).first
if sh
if !sh.tags.include?("tv")
sh.tags = "#{sh.tags}, tv"
sh.save!
end
else
sh = Share.new
sh.path = Share.default_full_path(name)
sh.name = name
sh.rdonly = false
sh.visible = true
sh.tags = name.downcase
sh.extras = ""
sh.disk_pool_copies = 0
sh.save!
end
end
end

def self.down
end
end
3 changes: 1 addition & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20140627195608) do

ActiveRecord::Schema.define(version: 20140717200213) do
create_table "app_dependencies", force: true do |t|
t.integer "app_id"
t.integer "dependency_id"
Expand Down
2 changes: 1 addition & 1 deletion plugins/020-shares/app/views/shares/_tags.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
= spinner
p[class="shares-fixed-tags"]

- [t('music'), t('pictures'), t('videos'), t('docs')].each_with_index do |tag, i|
- [t('music'), t('pictures'), t('videos'), t('docs'), t('tv'), t('movies')].each_with_index do |tag, i|
= simple_remote_checkbox :id => "share_visible_#{share.id}_#{i}",
:css_class => 'share_tags_checkbox',
:url => update_tags_share_path(:id => share.id, :name => tag),
Expand Down
2 changes: 2 additions & 0 deletions plugins/020-shares/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
'en':
# put here your string symbols and translations
hello_world: Hello World! (yay for the Amahi plugins!)
tv: TV
movies: Movies

0 comments on commit 038ddc7

Please sign in to comment.