diff --git a/vendor/built_in_modules/dictionary/app/assets/images/archive/.gitkeep b/vendor/built_in_modules/dictionary/app/assets/images/dictionary/.gitkeep similarity index 100% rename from vendor/built_in_modules/dictionary/app/assets/images/archive/.gitkeep rename to vendor/built_in_modules/dictionary/app/assets/images/dictionary/.gitkeep diff --git a/vendor/built_in_modules/dictionary/app/assets/javascripts/archive/.gitkeep b/vendor/built_in_modules/dictionary/app/assets/javascripts/dictionary/.gitkeep similarity index 100% rename from vendor/built_in_modules/dictionary/app/assets/javascripts/archive/.gitkeep rename to vendor/built_in_modules/dictionary/app/assets/javascripts/dictionary/.gitkeep diff --git a/vendor/built_in_modules/dictionary/app/assets/stylesheets/archive/archives.css b/vendor/built_in_modules/dictionary/app/assets/stylesheets/archive/archives.css deleted file mode 100644 index 0b42c7a04..000000000 --- a/vendor/built_in_modules/dictionary/app/assets/stylesheets/archive/archives.css +++ /dev/null @@ -1,136 +0,0 @@ -/* General style with default layout */ -.o-archives {} -.o-archives-content {} -.o-archives-group { - margin: 20px 0 0 0; - padding: 20px 0 0 0; - border-top: dashed 1px #eee; -} -.o-archives-group:first-child { - margin: 0; - padding: 0; - border: 0; -} -.o-archives-category { - padding-bottom: 16px; - border-bottom: solid 2px #ccc; - font-weight: bold; -} -.o-archives-list {} -.o-archives-list ul { - margin: 0; - padding: 0; - list-style: none; -} -.o-archives-list li {} -.o-archives-title { - border-left: solid 8px #eee; - border-bottom: solid 1px #eee; - padding: 0 0 0 16px; -} -.o-archives-list-item {} -.o-archives-list-item ol { - list-style-type: decimal; -} -.o-archives-list-item li { - margin: 0 0 10px 0; -} -.o-archives-file {} -.o-archives-file:hover {} -.o-archives-file-type { -display: inline-block; -vertical-align: middle; -margin-left: 8px; -padding: 0 4px; -height: 15px; -font-size: 9px; -text-transform: uppercase; -line-height: 15px; -background-color: #999; -color: #FFF; -border-radius: 3px; --webkit-text-size-adjust: none; -} - -/* Tag list */ -.o-archives-tag-list {} -.o-archives-tag-list ul { - margin: 0 -4px; - padding: 0; - list-style: none; -} -.o-archives-tag-list ul:after { - content: "."; - clear: both; - display: block; - height: 0; - visibility: hidden; -} -.o-archives-tag-list li { - float: left; - margin: 0 4px 8px 4px; -} -.o-archives-tag { - display: block; - border: solid 1px #ccc; - padding: 2px 6px; -} -.o-archives-tag:hover {} - -/* Table layout */ -.o-archives.layout-table {} -.o-archives-search { - overflow: hidden; - margin: 0 0 10px 0; -} -.o-archives-search label { - display: inline-block; - margin: 0 8px 0 0; -} -.o-archives-search-option { - float: right; -} -.o-archives-search-option select { - width: 80px; -} -.o-archives-search-keyword {} -.o-archives-search-keyword input[type=submit] { - display: inline-block; - vertical-align: top; - margin: 0 0 0 8px; -} -.o-archives.layout-table table { - width: 100%; - table-layout: fixed; -} -.o-archives.layout-table tbody td { - vertical-align: top; - border-top: solid 1px #eee; - padding: 8px 4px; -} -.o-archives.layout-table .even {} -.o-archives.layout-table .even td {} -.o-archives.layout-table .column-ctrl { - text-align: left; -} -.o-archives.layout-table .column-ctrl.col-title { width: 30% } -.o-archives.layout-table .column-ctrl.col-file {} -.o-archives.layout-table .column-ctrl.col-category { width: 15%; } -.o-archives.layout-table .column-ctrl.col-tag { width: 20%; } -.o-archives.layout-table .o-archives-title { - font-weight: bold; - border: 0; - padding: 0; -} -.o-archives.layout-table .o-archives-category { - padding: 0; - margin: 0; - border: 0; -} -.o-archives.layout-table .o-archives-tag { - display: inline-block; - margin-bottom: 3px; -} -.o-archives.layout-table .o-archives-category { - font-weight: normal; -} \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/app/assets/stylesheets/archive/.gitkeep b/vendor/built_in_modules/dictionary/app/assets/stylesheets/dictionary/.gitkeep similarity index 100% rename from vendor/built_in_modules/dictionary/app/assets/stylesheets/archive/.gitkeep rename to vendor/built_in_modules/dictionary/app/assets/stylesheets/dictionary/.gitkeep diff --git a/vendor/built_in_modules/dictionary/app/assets/stylesheets/dictionary/dictionary.css b/vendor/built_in_modules/dictionary/app/assets/stylesheets/dictionary/dictionary.css new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/built_in_modules/dictionary/app/models/archive_file.rb b/vendor/built_in_modules/dictionary/app/models/archive_file.rb deleted file mode 100644 index 2edfc8118..000000000 --- a/vendor/built_in_modules/dictionary/app/models/archive_file.rb +++ /dev/null @@ -1,87 +0,0 @@ -# encoding: utf-8 - -class ArchiveFile - include Mongoid::Document - include Mongoid::Timestamps - include Mongoid::MultiParameterAttributes - include Mongoid::Sortable - - BelongsToCategory = :archive_file_category - include OrbitCoreLib::BelongsToCategoryMayDisable - - PAYMENT_TYPES = @site_valid_locales - - include OrbitTag::Taggable - taggable - - field :title, localize: true - - # has_and_belongs_to_many :tags, :class_name => "ArchiveTag" - - field :create_user_id - field :update_user_id - - field :is_top, :type => Boolean, :default => false - field :is_hot, :type => Boolean, :default => false - field :is_hidden, :type => Boolean, :default => false - - scope :can_display,where(is_hidden: false) - - # belongs_to :archive_file_category - - has_many :archive_file_multiples, :autosave => true, :dependent => :destroy - - accepts_nested_attributes_for :archive_file_multiples, :allow_destroy => true - - validates :title, :at_least_one => true - - after_save :save_archive_file_multiples - - # searchable do - # text :titles do - # title_translations.to_a.collect{|t| t[1]} - # end - # boolean :frontend_search do - # !is_hidden - # end - - # end - - def self.search( category_id = nil ) - - if category_id.to_s.size > 0 - - find(:all, :conditions => {archive_file_category_id: category_id}).desc( :is_top, :title ) - - else - - find(:all).desc( :is_top, :title) - - end - - end - - - def self.widget_datas - - where( :is_hidden => false ).desc(:is_top, :title) - - end - - def is_top? - self.is_top - end - - - def get_file_icon( file_data ) - file_icon = "#{file_data.split('.')[-1]}".html_safe - end - - def save_archive_file_multiples - self.archive_file_multiples.each do |t| - if t.should_destroy - t.destroy - end - end - end -end diff --git a/vendor/built_in_modules/dictionary/app/models/archive_file_category.rb b/vendor/built_in_modules/dictionary/app/models/archive_file_category.rb deleted file mode 100644 index 9942c4da2..000000000 --- a/vendor/built_in_modules/dictionary/app/models/archive_file_category.rb +++ /dev/null @@ -1,47 +0,0 @@ -# encoding: utf-8 - -class ArchiveFileCategory - include Mongoid::Document - include Mongoid::Timestamps - include OrbitCoreLib::ObjectAuthable - include OrbitCoreLib::ObjectDisable - include Sunspot::Mongo - # include Mongoid::MultiParameterAttributes - APP_NAME = 'Archive' - ObjectAuthTitlesOptions = %W{submit_new fact_check} - AfterObjectAuthUrl = '/panel/archive/back_end/archive_file_categorys' - - field :disable, type: Boolean, :default => false - field :display - field :key - field :title, localize: true - - has_many :archive_files - - validates :title, :at_least_one => true - - searchable do - text :titles do - title_translations.to_a.collect{|t| t[1]} - end - - boolean :frontend_search do - !disable - end - - text :files do - archive_files.can_display.collect{|t| t.title_translations.to_a.collect{|t| t[1]}} - end - - end - - - def pp_object - title - end - - def self.from_id(id) - ArchiveFileCategory.find(id) rescue nil - end - -end \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/app/models/archive_file_multiple.rb b/vendor/built_in_modules/dictionary/app/models/archive_file_multiple.rb deleted file mode 100644 index d45d34a82..000000000 --- a/vendor/built_in_modules/dictionary/app/models/archive_file_multiple.rb +++ /dev/null @@ -1,27 +0,0 @@ -class ArchiveFileMultiple - - include Mongoid::Document - include Mongoid::Timestamps - include Mongoid::Sortable - - mount_uploader :file, AssetUploader - - field :file_title, localize: true - # field :description - field :choose_lang, :type => Array, :default => nil - - field :should_destroy, :type => Boolean - - default_scope asc(:sort_number) - - def choose_lang_display(lang) - self.choose_lang.include?(lang) - end - - belongs_to :archive_file - - # has_many :archive_file_multiple_langs, :autosave => true, :dependent => :destroy - - # accepts_nested_attributes_for :archive_file_multiple_langs, :allow_destroy => true - -end diff --git a/vendor/built_in_modules/dictionary/app/models/archive_tag.rb b/vendor/built_in_modules/dictionary/app/models/archive_tag.rb deleted file mode 100644 index 48aedc30f..000000000 --- a/vendor/built_in_modules/dictionary/app/models/archive_tag.rb +++ /dev/null @@ -1,10 +0,0 @@ -class ArchiveTag < Tag - - has_and_belongs_to_many :archive_files - - - def get_visible_links(sort = :name) - self.archive_files.where(:is_hidden => false).desc(:is_top, sort) - end - -end \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/lib/archive.rb b/vendor/built_in_modules/dictionary/lib/archive.rb deleted file mode 100644 index 6401c81e1..000000000 --- a/vendor/built_in_modules/dictionary/lib/archive.rb +++ /dev/null @@ -1,4 +0,0 @@ -require "archive/engine" - -module Archive -end diff --git a/vendor/built_in_modules/dictionary/lib/dictionary.rb b/vendor/built_in_modules/dictionary/lib/dictionary.rb new file mode 100644 index 000000000..e0e4e13e3 --- /dev/null +++ b/vendor/built_in_modules/dictionary/lib/dictionary.rb @@ -0,0 +1,4 @@ +require "dictionary/engine" + +module Dictionary +end diff --git a/vendor/built_in_modules/dictionary/lib/archive/engine.rb b/vendor/built_in_modules/dictionary/lib/dictionary/engine.rb similarity index 69% rename from vendor/built_in_modules/dictionary/lib/archive/engine.rb rename to vendor/built_in_modules/dictionary/lib/dictionary/engine.rb index 13c4a73a4..48e0a9602 100644 --- a/vendor/built_in_modules/dictionary/lib/archive/engine.rb +++ b/vendor/built_in_modules/dictionary/lib/dictionary/engine.rb @@ -1,4 +1,4 @@ -module Archive +module Dictionary class Engine < Rails::Engine end end diff --git a/vendor/built_in_modules/dictionary/lib/archive/version.rb b/vendor/built_in_modules/dictionary/lib/dictionary/version.rb similarity index 57% rename from vendor/built_in_modules/dictionary/lib/archive/version.rb rename to vendor/built_in_modules/dictionary/lib/dictionary/version.rb index 052012f6e..7918988f0 100644 --- a/vendor/built_in_modules/dictionary/lib/archive/version.rb +++ b/vendor/built_in_modules/dictionary/lib/dictionary/version.rb @@ -1,3 +1,3 @@ -module Archive +module Dictionary VERSION = "0.0.1" end diff --git a/vendor/built_in_modules/dictionary/lib/tasks/archive_tasks.rake b/vendor/built_in_modules/dictionary/lib/tasks/dictionary_tasks.rake similarity index 75% rename from vendor/built_in_modules/dictionary/lib/tasks/archive_tasks.rake rename to vendor/built_in_modules/dictionary/lib/tasks/dictionary_tasks.rake index dbf17bdca..463672c98 100644 --- a/vendor/built_in_modules/dictionary/lib/tasks/archive_tasks.rake +++ b/vendor/built_in_modules/dictionary/lib/tasks/dictionary_tasks.rake @@ -1,4 +1,4 @@ # desc "Explaining what the task does" -# task :archive do +# task :dictionary do # # Task goes here # end