diff --git a/vendor/built_in_modules/dictionary/.gitignore b/vendor/built_in_modules/dictionary/.gitignore new file mode 100644 index 000000000..1463de6df --- /dev/null +++ b/vendor/built_in_modules/dictionary/.gitignore @@ -0,0 +1,6 @@ +.bundle/ +log/*.log +pkg/ +test/dummy/db/*.sqlite3 +test/dummy/log/*.log +test/dummy/tmp/ \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/Gemfile b/vendor/built_in_modules/dictionary/Gemfile new file mode 100644 index 000000000..f92bd9029 --- /dev/null +++ b/vendor/built_in_modules/dictionary/Gemfile @@ -0,0 +1,17 @@ +source "http://rubygems.org" + +# Declare your gem's dependencies in archive.gemspec. +# Bundler will treat runtime dependencies like base dependencies, and +# development dependencies will be added by default to the :development group. +gemspec + +# jquery-rails is used by the dummy application +gem "jquery-rails" + +# Declare any dependencies that are still in development here instead of in +# your gemspec. These might include edge Rails or gems from your path or +# Git. Remember to move these dependencies to your gemspec before releasing +# your gem to rubygems.org. + +# To use debugger +# gem 'ruby-debug19', :require => 'ruby-debug' diff --git a/vendor/built_in_modules/dictionary/MIT-LICENSE b/vendor/built_in_modules/dictionary/MIT-LICENSE new file mode 100644 index 000000000..406f17b70 --- /dev/null +++ b/vendor/built_in_modules/dictionary/MIT-LICENSE @@ -0,0 +1,20 @@ +Copyright 2012 YOURNAME + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/built_in_modules/dictionary/README.rdoc b/vendor/built_in_modules/dictionary/README.rdoc new file mode 100644 index 000000000..2a19864e6 --- /dev/null +++ b/vendor/built_in_modules/dictionary/README.rdoc @@ -0,0 +1,3 @@ += Archive + +This project rocks and uses MIT-LICENSE. \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/Rakefile b/vendor/built_in_modules/dictionary/Rakefile new file mode 100644 index 000000000..b57290d4e --- /dev/null +++ b/vendor/built_in_modules/dictionary/Rakefile @@ -0,0 +1,39 @@ +#!/usr/bin/env rake +begin + require 'bundler/setup' +rescue LoadError + puts 'You must `gem install bundler` and `bundle install` to run rake tasks' +end +begin + require 'rdoc/task' +rescue LoadError + require 'rdoc/rdoc' + require 'rake/rdoctask' + RDoc::Task = Rake::RDocTask +end + +RDoc::Task.new(:rdoc) do |rdoc| + rdoc.rdoc_dir = 'rdoc' + rdoc.title = 'Archive' + rdoc.options << '--line-numbers' + rdoc.rdoc_files.include('README.rdoc') + rdoc.rdoc_files.include('lib/**/*.rb') +end + +APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__) +load 'rails/tasks/engine.rake' + + +Bundler::GemHelper.install_tasks + +require 'rake/testtask' + +Rake::TestTask.new(:test) do |t| + t.libs << 'lib' + t.libs << 'test' + t.pattern = 'test/**/*_test.rb' + t.verbose = false +end + + +task :default => :test diff --git a/vendor/built_in_modules/dictionary/app/assets/images/archive/.gitkeep b/vendor/built_in_modules/dictionary/app/assets/images/archive/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/built_in_modules/dictionary/app/assets/javascripts/archive/.gitkeep b/vendor/built_in_modules/dictionary/app/assets/javascripts/archive/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/built_in_modules/dictionary/app/assets/stylesheets/archive/.gitkeep b/vendor/built_in_modules/dictionary/app/assets/stylesheets/archive/.gitkeep new file mode 100644 index 000000000..e69de29bb 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 new file mode 100644 index 000000000..0b42c7a04 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/assets/stylesheets/archive/archives.css @@ -0,0 +1,136 @@ +/* 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/controllers/.gitkeep b/vendor/built_in_modules/dictionary/app/controllers/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/built_in_modules/dictionary/app/controllers/application_controller.rb b/vendor/built_in_modules/dictionary/app/controllers/application_controller.rb new file mode 100644 index 000000000..307a4acd8 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/controllers/application_controller.rb @@ -0,0 +1,23 @@ +class ApplicationController < ActionController::Base + protect_from_forgery + before_filter :set_locale + + # Set I18n.locale + def set_locale + # update session if passed + session[:locale] = params[:locale] if params[:locale] + + # set locale based on session or default + begin + # check if locale is valid for non site pages + if !VALID_LOCALES.include?(session[:locale]) + I18n.locale = I18n.default_locale + else + I18n.locale = session[:locale] + end + rescue + I18n.locale = I18n.default_locale + end + end + +end diff --git a/vendor/built_in_modules/dictionary/app/controllers/panel/archive/back_end/archive_file_categorys_controller.rb b/vendor/built_in_modules/dictionary/app/controllers/panel/archive/back_end/archive_file_categorys_controller.rb new file mode 100644 index 000000000..d96eaa0d3 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/controllers/panel/archive/back_end/archive_file_categorys_controller.rb @@ -0,0 +1,147 @@ +class Panel::Archive::BackEnd::ArchiveFileCategorysController < OrbitBackendController + include OrbitControllerLib::DivisionForDisable + + before_filter :for_app_manager,:except => [:index,:get_categorys_json,:get_archive_files_json] + + before_filter :force_order_for_visitor,:only=>[:index,:get_categorys_json,:get_archive_files_json] + before_filter :force_order_for_user,:except => [:index,:get_categorys_json,:get_archive_files_json] + before_filter :for_app_sub_manager,:except => [:index,:get_categorys_json,:get_archive_files_json] + + def index + @archive_file_categorys = get_categories_for_index("ArchiveFileCategory") + # @archive_file_categorys = ArchiveFileCategory.all + @archive_file_category = ArchiveFileCategory.new(:display => 'List') + + @url = panel_archive_back_end_archive_file_categorys_path + + respond_to do |format| + format.html # index.html.erb + format.js + end + end + + def get_categorys_json + categorys = ArchiveFileCategory.all + data = Array.new + + categorys.each do |c| + data << { + category: c.title, + link: "#{url_for( :action => "index", + :controller => "panel/archive/front_end/archive_files", + :format => :rss, + :only_path => false, + :inner=>true, + :category_id => c )}" + } + end + + render :json => JSON.pretty_generate(data) + end + + def get_archive_files_json + archive_file = ArchiveFileCategory.find(params[:archive_file_category_id]).archive_files + p archive_file + data = Array.new + + archive_file.each do |b| + + data << { + title: b.title, + link: "http://#{request.host_with_port}#{panel_archive_front_end_archive_file_path(b, :category_id => b.archive_file_category.id)}", + tag: b.sorted_tags.to_a, + } + end + + render :json => JSON.pretty_generate(data) + end + + # GET /archive_files/1 + # GET /archive_files/1.xml + def show + @archive_file_category = ArchiveFileCategory.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.js + end + end + + # GET /archive_files/new + # GET /archive_files/new.xml + def new + @archive_file_category = ArchiveFileCategory.new(:display => 'List') + + respond_to do |format| + format.html # new.html.erb + format.js + end + end + + # GET /archive_files/1/edit + def edit + @archive_file_category = ArchiveFileCategory.find(params[:id]) + + @url = panel_archive_back_end_archive_file_category_path(@archive_file_category) + + respond_to do |format| + format.html + format.js + end + end + + # POST /archive_files + # POST /archive_files.xml + def create + @archive_file_category = ArchiveFileCategory.new(params[:archive_file_category]) + + respond_to do |format| + if @archive_file_category.save + format.html { redirect_to(panel_archive_back_end_archive_file_categorys_url, :notice => t('archive_file_category.create_archive_file_category_success')) } + format.js + else + format.html { render :action => "new" } + format.js { render action: "new" } + end + end + end + + # PUT /archive_files/1 + # PUT /archive_files/1.xml + def update + @archive_file_category = ArchiveFileCategory.find(params[:id]) + + @url = panel_archive_back_end_archive_file_category_path(@archive_file_category) + + respond_to do |format| + if @archive_file_category.update_attributes(params[:archive_file_category]) + format.html { redirect_to(panel_archive_back_end_archive_file_categorys_url, :notice => t('archive_file_category.update_archive_file_category_success')) } + # format.xml { head :ok } + format.js + else + format.html { render :action => "edit" } + format.js { render :action => "edit" } + end + end + end + + # DELETE /archive_files/1 + # DELETE /archive_files/1.xml + def destroy + @archive_file_category = ArchiveFileCategory.find(params[:id]) + @archive_file_category.disable = @archive_file_category.disable ? false : true + + if @archive_file_category.save! + respond_to do |format| + flash[:notice] = t("update.success_") + # flash[:error] += @archive_file_category.disable ? t(:enable) : t(disable) + format.html { redirect_to(panel_archive_back_end_archive_file_categorys_url) } + # format.xml { head :ok } + format.js + end + else + flash[:error] = t("update.fail") + format.html { render :action => "index" } + end + end +end diff --git a/vendor/built_in_modules/dictionary/app/controllers/panel/archive/back_end/archive_files_controller.rb b/vendor/built_in_modules/dictionary/app/controllers/panel/archive/back_end/archive_files_controller.rb new file mode 100644 index 000000000..79712fbf7 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/controllers/panel/archive/back_end/archive_files_controller.rb @@ -0,0 +1,142 @@ +class Panel::Archive::BackEnd::ArchiveFilesController < OrbitBackendController + # before_filter :for_app_manager,:except => [:index,:show] + include OrbitControllerLib::DivisionForDisable + + before_filter :force_order_for_visitor,:only=>[:index] + before_filter :force_order_for_user,:except => [:index] + + before_filter :for_app_sub_manager,:except => [:index] + before_filter :only => [ :new,:edit,:update,:create] do |controller| + controller.get_categorys('ArchiveFileCategory') + end + + def index + + get_categorys("ArchiveFileCategory",params[:archive_file_category_id]) + @filter = params[:filter] + new_filter = params[:new_filter] + + if @filter && params[:clear] + @filter.delete(params[:type]) + elsif @filter && new_filter + if @filter.has_key?(new_filter[:type]) && @filter[new_filter[:type]].include?(new_filter[:id].to_s) + @filter[new_filter[:type]].delete(new_filter[:id].to_s) + elsif @filter.has_key?(new_filter[:type]) + @filter[new_filter[:type]] << new_filter[:id].to_s + else + @filter.merge!({new_filter[:type] => [new_filter[:id].to_s]}) + end + elsif new_filter + @filter = {new_filter[:type] => [new_filter[:id].to_s]} + end + @archive_filecategories = get_categories_for_index("ArchiveFileCategory") + @archive_file_category_ids = @archive_file_categories.collect{|t| t.id.to_s} + [nil] + + @archive_files = (params[:sort] || @filter) ? get_sorted_and_filtered("archive_file",:archive_file_category_id.in => @archive_file_category_ids) : get_viewable("archive_file",:archive_file_category_id.in => @archive_file_category_ids) + + @tags = get_tags + + respond_to do |format| + format.html # index.html.erb + format.xml { render :xml => @archive_files } + format.js + end + end + + # GET /archive_files/1 + # GET /archive_files/1.xml + def show + @archive_file = ArchiveFile.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.xml { render :xml => @archive_file } + end + end + + # GET /archive_files/new + # GET /archive_files/new.xml + def new + @archive_file = ArchiveFile.new + + @tags = get_tags + + respond_to do |format| + format.html # new.html.erb + format.xml { render :xml => @archive_file } + end + end + + # GET /archive_files/1/edit + def edit + @archive_file = ArchiveFile.find(params[:id]) + + @tags = get_tags + end + + # POST /archive_files + # POST /archive_files.xml + def create + @archive_file = ArchiveFile.new(params[:archive_file]) + @archive_file.create_user_id = current_user.id + @archive_file.update_user_id = current_user.id + + respond_to do |format| + if @archive_file.save + format.html { redirect_to(panel_archive_back_end_archive_files_url) } + format.xml { render :xml => @archive_file, :status => :created, :location => @archive_file } + else + @tags = get_tags + format.html { render :action => "new" } + format.xml { render :xml => @archive_file.errors, :status => :unprocessable_entity } + end + end + end + + # PUT /archive_files/1 + # PUT /archive_files/1.xml + def update + @archive_file = ArchiveFile.find(params[:id]) + + @archive_file.update_user_id = current_user.id + + params[:archive_file][:tag_ids] ||=[] + + respond_to do |format| + if @archive_file.update_attributes(params[:archive_file]) + format.html { redirect_to(panel_archive_back_end_archive_files_url(:page => params[:page])) } + format.xml { head :ok } + else + format.html { render :action => "edit" } + format.xml { render :xml => @archive_file.errors, :status => :unprocessable_entity } + end + end + end + + # DELETE /archive_files/1 + # DELETE /archive_files/1.xml + def destroy + @archive_file = ArchiveFile.find(params[:id]) + @archive_file.destroy + + respond_to do |format| + format.html { redirect_to(panel_archive_back_end_archive_files_url) } + # format.xml { head :ok } + format.js + end + end + + def delete + if params[:ids] + archive_files = ArchiveFile.any_in(:_id => params[:ids]).destroy_all + end + redirect_to panel_archive_back_end_archive_files_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]) + end + + protected + + # def get_categorys(id = nil) + # @archive_file_categorys = (id ? ArchiveFileCategory.find(id).to_a : ArchiveFileCategory.excludes('disabled' => true)) + # end + +end diff --git a/vendor/built_in_modules/dictionary/app/controllers/panel/archive/back_end/tags_controller.rb b/vendor/built_in_modules/dictionary/app/controllers/panel/archive/back_end/tags_controller.rb new file mode 100644 index 000000000..8dc1d4f3d --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/controllers/panel/archive/back_end/tags_controller.rb @@ -0,0 +1,8 @@ +class Panel::Archive::BackEnd::TagsController < Admin::TagsController + + def initialize + super + @app_title = 'archive' + end + +end diff --git a/vendor/built_in_modules/dictionary/app/controllers/panel/archive/front_end/archive_files_controller.rb b/vendor/built_in_modules/dictionary/app/controllers/panel/archive/front_end/archive_files_controller.rb new file mode 100644 index 000000000..03ada60ff --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/controllers/panel/archive/front_end/archive_files_controller.rb @@ -0,0 +1,91 @@ +class Panel::Archive::FrontEnd::ArchiveFilesController < OrbitWidgetController + include AdminHelper + + def initialize + super + @app_title = 'archive_files' + end + + def get_search_result + @search = ArchiveFileCategory.solr_search do + fulltext params[:search_query] + with(:frontend_search,true) + end + + search_result = @search.results.collect{|result| result.id} + params[:category_id] = @search.results.collect{|result| result.id} + + @archive_file_categorys = ArchiveFileCategory.any_in(_id:search_result).page( params[:page_main]).per(@page_num) + end + + def index + @item = Page.find(params[:page_id]) + @title = @item.title + if !@item.frontend_data_count.blank? + @page_num = @item.frontend_data_count + else + @page_num = 10 + end + + date_now = Time.now + @archive_file_categorys = ArchiveFileCategory.all + # @archive_files = ArchiveFile.where( :is_hidden => false ).desc(:is_top).page(params[:page]).per(@page_num) + + if !params[:category_id].blank? && !params[:tag_id].blank? + @archive_files = @archive_files.default_sort(params[:sort]).can_display.where(:archive_file_category_id.in => params[:category_id], :tagged_ids.in => params[:tag_id]).desc( :is_top ).page( params[:page_main] ).per(@page_num) + + @current_category = ArchiveFileCategory.from_id(params[:category_id]) rescue nil + + elsif !params[:category_id].blank? + @archive_files = ArchiveFile.default_sort(params[:sort]).can_display.where(:archive_file_category_id.in => params[:category_id]).desc( :is_top ).page( params[:page_main] ).per(@page_num) + @current_category = ArchiveFileCategory.from_id(params[:category_id]) rescue nil + elsif !params[:tag_id].blank? + @archive_files = ArchiveFile.default_sort(params[:sort]).can_display.where(:tagged_ids.in => params[:tag_id]).desc( :is_top ).page( params[:page_main] ).per(@page_num) + else + @archive_files = ArchiveFile.default_sort(params[:sort]).can_display.desc( :is_top ).page( params[:page_main] ).per(@page_num) + end + + + get_categorys + + if params[:sort] + @archive_files = get_sorted_and_filtered('archive_file', nil, @archive_files) + end + end + + def show + @item = Page.find(params[:page_id]) + @title = @item.title + @archive_file = ArchiveFile.find(params[:id]) + get_categorys + end + + protected + + def reload_archive_files + @item = Page.find(params[:page_id]) + @title = @item.title + if @item.frontend_data_count + @page_num = @item.frontend_data_count + else + @page_num = 0 + end + date_now = Time.now + @archive_file_categorys = ArchiveFileCategory.all + # @archive_files = ArchiveFile.where( :is_hidden => false ).desc(:is_top).page(params[:page]).per(@page_num) + + if !params[:category_id].blank? + @archive_files = ArchiveFile.can_display.where(:archive_file_category_id => params[:category_id]).desc( :is_top ).page( params[:page_main] ).per(@page_num) + @current_category = ArchiveFileCategory.from_id(params[:category_id]) rescue nil + elsif !params[:tag_id].blank? + @archive_files = ArchiveFile.can_display.where(:tagged_ids => params[:tag_id]).desc( :is_top ).page( params[:page_main] ).per(@page_num) + else + @archive_files = ArchiveFile.can_display.desc( :is_top ).page( params[:page_main] ).per(@page_num) + end + get_categorys + end + + def get_categorys + @archive_file_categorys = ArchiveFileCategory.excludes('disabled' => true) + end +end diff --git a/vendor/built_in_modules/dictionary/app/controllers/panel/archive/widget/archive_files_controller.rb b/vendor/built_in_modules/dictionary/app/controllers/panel/archive/widget/archive_files_controller.rb new file mode 100644 index 000000000..abfa7d933 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/controllers/panel/archive/widget/archive_files_controller.rb @@ -0,0 +1,52 @@ +class Panel::Archive::Widget::ArchiveFilesController < OrbitWidgetController + include AdminHelper + + def initialize + super + @app_title = 'archive_files' + end + + def index + + @part = PagePart.find(params[:part_id]) + + if @part.widget_data_count + @page_num = @part.widget_data_count + else + @page_num = 4 + end + + if @part.widget_field + @widget_fields = @part.widget_field + else + @widget_fields = [] + end + + @widget_style = @part.widget_style + + @category_id = @part.category + + date_now = Time.now + + if !params[:category_id].blank? + @archive_files = ArchiveFile.default_sort(params[:sort]).all.can_display.any_in(:archive_file_category_id => params[:category_id]).merge(ArchiveFileCategory.excludes('disable' => true)).desc( :is_top ).page( params[:page_main] ).per(@page_num) + @archive_file_categorys = ArchiveFileCategory.any_in(:_id => params[:category_id]).excludes('disable' => true) + elsif !params[:tag_id].blank? + @archive_files = ArchiveFile.default_sort(params[:sort]).all.can_display.any_in(:tagged_ids => params[:tag_id]).merge(ArchiveFileCategory.excludes('disable' => true)).desc( :is_top ).page( params[:page_main] ).per(@page_num) + get_categorys + else + @archive_files = ArchiveFile.default_sort(params[:sort]).all.can_display.merge(ArchiveFileCategory.excludes('disable' => true)).desc( :is_top).page( params[:page_main] ).per(@page_num) + get_categorys + end + + if params[:sort] + @archive_files = get_sorted_and_filtered('archive_file', nil, @archive_files) + end + + end + + def get_categorys + @archive_file_categorys = ArchiveFileCategory.excludes('disable' => true) + end + +end diff --git a/vendor/built_in_modules/dictionary/app/helpers/.gitkeep b/vendor/built_in_modules/dictionary/app/helpers/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/built_in_modules/dictionary/app/helpers/panel/archive/back_end/archive_file_categorys_helper.rb b/vendor/built_in_modules/dictionary/app/helpers/panel/archive/back_end/archive_file_categorys_helper.rb new file mode 100644 index 000000000..d5185ff97 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/helpers/panel/archive/back_end/archive_file_categorys_helper.rb @@ -0,0 +1,15 @@ +module Panel::Archive::BackEnd::ArchiveFileCategorysHelper +include ActionView::Helpers::UrlHelper + + + def show_anc_cate_permission_link(archive_file_category) + type = 'submit' + oa = archive_file_category.get_object_auth_by_title(type) + if oa.nil? + archive_file_category.object_auths.new(title: type ).save + oa = archive_file_category.get_object_auth_by_title(type) + end + link_to t(:category_auth),admin_object_auth_ob_auth_path(oa) + end + +end \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/app/mailers/.gitkeep b/vendor/built_in_modules/dictionary/app/mailers/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/built_in_modules/dictionary/app/models/.gitkeep b/vendor/built_in_modules/dictionary/app/models/.gitkeep 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 new file mode 100644 index 000000000..780944d65 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/models/archive_file.rb @@ -0,0 +1,88 @@ +# 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 new file mode 100644 index 000000000..9942c4da2 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/models/archive_file_category.rb @@ -0,0 +1,47 @@ +# 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 new file mode 100644 index 000000000..d45d34a82 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/models/archive_file_multiple.rb @@ -0,0 +1,27 @@ +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 new file mode 100644 index 000000000..48aedc30f --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/models/archive_tag.rb @@ -0,0 +1,10 @@ +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/app/views/.gitkeep b/vendor/built_in_modules/dictionary/app/views/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/_archive_file_category.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/_archive_file_category.html.erb new file mode 100644 index 000000000..6bb831a28 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/_archive_file_category.html.erb @@ -0,0 +1,20 @@ + + + + <%= archive_file_category.key %> +
+ +
+ + <% @site_valid_locales.each do |locale| %> + <%= archive_file_category.title_translations[locale] rescue nil %> + <% end %> + diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/_form.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/_form.html.erb new file mode 100644 index 000000000..036093360 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/_form.html.erb @@ -0,0 +1,30 @@ +<% # encoding: utf-8 %> + +<%= form_for(@archive_file_category, :remote => true, :url => @url) do |f| %> + +

<%= (@archive_file_category.new_record? ? 'Add' : 'Edit') %>

+ +
+ <%= f.label :key %> + <%= f.text_field :key %> +
+ +
+ <%= f.fields_for :title_translations do |f| %> + <% @site_valid_locales.each do |locale| %> +
+ <%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %> +
+ <%= f.text_field locale, :class =>' input-xxlarge', :value => (@archive_file_category.title_translations[locale] rescue nil) %> +
+
+ <% end %> + <% end %> +
+ +
+ <%= f.submit 'Submit/送出', :class=>'btn btn-primary' %> +
+ +<% end %> + \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/create.js.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/create.js.erb new file mode 100644 index 000000000..250d889b5 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/create.js.erb @@ -0,0 +1,2 @@ +$('<%= j render :partial => 'archive_file_category', :collection => [@archive_file_category] %>').appendTo('#archive_file_categorys').hide().fadeIn(); +$("#new_archive_file_category")[0].reset(); \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/destroy.js.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/destroy.js.erb new file mode 100644 index 000000000..795155982 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/destroy.js.erb @@ -0,0 +1 @@ +$("#<%= dom_id @archive_file_category %>").find(".archive_toggle").text("<%= show_toggle_archive_btn(@archive_file_category) %> "); \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/edit.js.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/edit.js.erb new file mode 100644 index 000000000..eaff01fa3 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/edit.js.erb @@ -0,0 +1 @@ +$("#form > form").replaceWith("<%= j render "form" %>"); \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/index.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/index.html.erb new file mode 100644 index 000000000..0d2c03397 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/index.html.erb @@ -0,0 +1,23 @@ + + +<%= flash_messages %> + + + + + + <% @site_valid_locales.each do |locale| %> + + <% end %> + + + + + <%= render :partial => 'archive_file_category', :collection => @archive_file_categorys %> + + +
<%= t('archive_file_category.key') %><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %>
+ +
<%= render :partial => "form" %>
+ + diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/new.js.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/new.js.erb new file mode 100644 index 000000000..40061b9fc --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/new.js.erb @@ -0,0 +1 @@ +$("#form > form").replaceWith("<%= j render "form" %>"); diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/update.js.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/update.js.erb new file mode 100644 index 000000000..2c5cf21e2 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_file_categorys/update.js.erb @@ -0,0 +1,4 @@ +$("#<%= dom_id @archive_file_category %>").replaceWith("<%= j render :partial => 'archive_file_category', :collection => [@archive_file_category] %>"); +<% @archive_file_category = ArchiveFileCategory.new(:display => 'List') # reset for new form %> +$(".edit_archive_file_category").replaceWith("<%= j render "form" %>") +$(".new_archive_file_category")[0].reset(); \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_archive_file.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_archive_file.html.erb new file mode 100644 index 000000000..2f49cf737 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_archive_file.html.erb @@ -0,0 +1,49 @@ + + + <% if (archive_file.create_user_id == current_or_guest_user.id) || is_manager? %> + <%= check_box_tag 'to_delete[]', archive_file.id, false, :class => "checkbox_in_list" %> + <% end -%> + + + <%= archive_file.sort_number %> + + +
+
+ <% if archive_file.is_top? %> + <%= t(:top) %> + <% end %> + <% if archive_file.is_hot? %> + <%= t(:hot) %> + <% end %> + <% if archive_file.is_hidden? %> + <%= t(:hidden) %> + <% end %> +
+
+ + <%= archive_file.archive_file_category.title %> + + <%= link_to archive_file.title, panel_archive_front_end_archive_file_path(archive_file) %> + +
+ +
+ + + +
+
+ <% archive_file.sorted_tags.each do |tag| %> + <%= tag.name %> + <% end %> +
+
+ + + diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_clear_filters.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_clear_filters.html.erb new file mode 100644 index 000000000..a15f7993d --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_clear_filters.html.erb @@ -0,0 +1,3 @@ +
+ <%= link_to content_tag(:i, nil, :class => 'icons-cycle') + t(:clear), panel_archive_back_end_archive_files_path(:filter => @filter, :sort => params[:sort], :direction => params[:direction], :clear => true, :type => type), :class => "btn btn-small js_history" %> +
\ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_filter.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_filter.html.erb new file mode 100644 index 000000000..906db0295 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_filter.html.erb @@ -0,0 +1,37 @@ + + +<% content_for :page_specific_javascript do %> + <%= javascript_include_tag "sort_header" %> +<% end %> diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_filter_categories.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_filter_categories.html.erb new file mode 100644 index 000000000..bc55aa689 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_filter_categories.html.erb @@ -0,0 +1,6 @@ +
+ <% @archive_file_categories.each do |category| -%> + <%= link_to category.title, panel_archive_back_end_archive_files_path(:filter => @filter, :new_filter => {:type => 'categories', :id => category.id}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('categories', category.id)}" %> + <% end -%> +
+<%= render :partial => 'clear_filters', :locals => {:type => 'categories'} %> \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_filter_status.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_filter_status.html.erb new file mode 100644 index 000000000..316d471e8 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_filter_status.html.erb @@ -0,0 +1,6 @@ +
+ <%= link_to t(:top), panel_archive_back_end_archive_files_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_top'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('status', 'is_top')}" %> + <%= link_to t(:hot), panel_archive_back_end_archive_files_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_hot'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('status', 'is_hot')}" %> + <%= link_to t(:hidden), panel_archive_back_end_archive_files_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_hidden'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('status', 'is_hidden')}" unless(is_guest?)%> +
+<%= render :partial => 'clear_filters', :locals => {:type => 'status'} %> \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_filter_tags.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_filter_tags.html.erb new file mode 100644 index 000000000..743521d95 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_filter_tags.html.erb @@ -0,0 +1,6 @@ +
+ <% @tags.each do |tag| -%> + <%= link_to tag.name, panel_archive_back_end_archive_files_path(:filter => @filter, :new_filter => {:type => 'tags', :id => tag.id}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('tags', tag.id)}" %> + <% end -%> +
+<%= render :partial => 'clear_filters', :locals => {:type => 'tags'} %> \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_form.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_form.html.erb new file mode 100644 index 000000000..318ba6b51 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_form.html.erb @@ -0,0 +1,157 @@ +<% # encoding: utf-8 %> + + <%= f.error_messages %> + + + +
+ +
+
+ +
+

Status

+
+
+ <%= f.check_box :is_top %><%= t('top') %> + <%= f.check_box :is_hot %><%= t('hot') %> + <%= f.check_box :is_hidden %><%= t('hide') %> +
+
+
+ +
+
+ +
+

Tags

+
+ <% @tags.each do |tag| %> + <%= check_box_tag 'archive_file[tag_ids][]', tag.id, @archive_file.tag_ids.include?(tag.id)%> + <%= tag.name %> + <% end %> +
+
+ +
+ + + + + +
+
+ + <%= f.label :category %> + <%= f.select :archive_file_category_id, @archive_file_categorys.collect {|t| [ t.title, t.id ]} %> + + <%= f.label :sort_number %> + <%= f.text_field :sort_number %> + + + +
+ + <% @site_valid_locales.each_with_index do |locale, i| %> + +
"> +
+ <%= f.label :title %> + <%= f.fields_for :title_translations do |f| %> + <%= I18nVariable.from_locale(locale) %> + <%= f.text_field locale, :class=>'post-title', :value => (@archive_file.title_translations[locale] rescue nil) %> + <% end %> +
+ +
+ + <% end %> + +
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + <% @archive_file.archive_file_multiples.asc(:_id).each_with_index do |archive_file_multiple, i| %> + <%= f.fields_for :archive_file_multiples, archive_file_multiple do |f| %> + <%= render :partial => 'form_file', :object => archive_file_multiple, :locals => {:f => f, :i => i} %> + <% end %> + <% end %> + +
排序數FileFile Name<%= t('呈現語系')%>
+
+ <%= hidden_field_tag 'archive_file_multiple_field_count', @archive_file.archive_file_multiples.count %> + ADD/新增 +
+
+ +
+ +
+ + +
+ + + + +
+ <%= hidden_field_tag 'page', params[:page] if !params[:page].blank? %> + <%= hidden_field_tag 'filter', params[:filter] %> + <%= f.submit t('submit'), :class=>'btn btn-primary' %> + <%= link_to t('cancel'), get_go_back, :class=>"btn" %> +
+ +
+ + + +<% content_for :page_specific_javascript do %> + <%= javascript_include_tag "archive_form" %> + +<% end %> + diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_form_file.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_form_file.html.erb new file mode 100644 index 000000000..52f776668 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_form_file.html.erb @@ -0,0 +1,64 @@ +<% # encoding: utf-8 %> + + " class='list_item'> + +
+
+ <%= f.text_field :sort_number %> +
+
+ + +
+
+ <%= f.file_field :file %> + <%= form_file.file.file ? ( link_to t(:view), form_file.file.url, {:class => 'btn', :target => '_blank', :title => t(:view)} ) : '' %> +
+
+ + + +
+ + <% @site_valid_locales.each_with_index do |locale, i| %> + +
"> + <%#= f.fields_for :i18n_variable, (form_file.new_record? ? form_file.build_i18n_variable : form_file.i18n_variable ) do |f| %> + <%= f.fields_for :file_title_translations do |f| %> +
+ +
+ <%= f.text_field locale, :class=>'post-file_title', :value => (form_file.file_title_translations[locale] rescue nil) %> +
+
+ <% end %> + +
+ + <% end %> + +
+ + + + <% @site_valid_locales.each do |locale| %> + <%= check_box_tag "archive_file[archive_file_multiples_attributes][#{( form_file.new_record? ? 'new_archive_file_multiples' : "#{i}" )}][choose_lang][]", locale, (form_file.choose_lang.nil? ? true : form_file.choose_lang.include?(locale)) %> + <%= I18nVariable.from_locale(locale) %> + <% end %> + <%= hidden_field_tag 'archive_file[archive_file_multiples_attributes][0][choose_lang][]', '' %> + + + + + <% if form_file.new_record? %> + + <% else %> + <%= f.hidden_field :id %> + + <%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %> + <% end %> + + + + + diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_sort_headers.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_sort_headers.html.erb new file mode 100644 index 000000000..34552e76d --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/_sort_headers.html.erb @@ -0,0 +1,6 @@ +<%= render_sort_bar(true, delete_panel_archive_back_end_archive_files_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]), + ['sort_number', 'sort_number', 'span1', :sort_number], + ['status', ['is_top', 'is_hot', 'is_hidden'], 'span1', :status], + ['category', 'archive_file_category', 'span2', :category], + ['title', 'title','span3', :title], + ['tags', 'tags', 'span2', :tags]).html_safe %> diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/destroy.js.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/destroy.js.erb new file mode 100644 index 000000000..7dc628710 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/destroy.js.erb @@ -0,0 +1 @@ +$("#<%= dom_id @archive_file %>").remove(); \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/edit.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/edit.html.erb new file mode 100644 index 000000000..f2e347cc2 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/edit.html.erb @@ -0,0 +1,5 @@ +

<%= t('archive.editing_archive') %>

+ +<%= form_for @archive_file, :url => panel_archive_back_end_archive_file_path(@archive_file), :html => {:class => 'clear'} do |f| %> + <%= render :partial => 'form', :locals => {:f => f} %> +<% end %> diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/index.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/index.html.erb new file mode 100644 index 000000000..684a7962d --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/index.html.erb @@ -0,0 +1,24 @@ +<%= render 'filter' %> + + + + + + + + + + + + + + <%= render :partial => 'archive_file', :collection => @archive_files %> + +
+ +
+ <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t(:add), new_panel_archive_back_end_archive_file_path, :class => 'btn btn-primary pull-right' if (is_manager? rescue nil) %> +
+ <%= paginate @archive_files, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> +
+
diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/index.js.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/index.js.erb new file mode 100644 index 000000000..f3d30c0b6 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/index.js.erb @@ -0,0 +1,7 @@ +$("#collapse-status").html("<%= j render 'filter_status' %>"); +$("#collapse-category").html("<%= j render 'filter_categories' %>"); +$("#collapse-tags").html("<%= j render 'filter_tags' %>"); +$("#delete_all").attr("action", "<%= delete_panel_archive_back_end_archive_files_path(:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil, :sort_options => params[:sort_options]) %>"); +$("#sort_headers").html("<%= j render 'sort_headers' %>"); +$("#tbody_archive").html("<%= j render :partial => 'archive_file', :collection => @archive_files %>"); +$("#archive_file_pagination").html("<%= j paginate @archive_files, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>"); \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/new.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/new.html.erb new file mode 100644 index 000000000..dcdaf8438 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/back_end/archive_files/new.html.erb @@ -0,0 +1,9 @@ + +<%= flash_messages %> +

<%= t('archive_file.new_archive') %>

+<%= form_for @archive_file, :url => panel_archive_back_end_archive_files_path, :html => {:class => 'clear'} do |f| %> + <%= render :partial => 'form', :locals => {:f => f} %> +<% end %> + +<%#= link_back %> + diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/front_end/archive_files/_index.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/front_end/archive_files/_index.html.erb new file mode 100644 index 000000000..b5aded496 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/front_end/archive_files/_index.html.erb @@ -0,0 +1,56 @@ +<% # encoding: utf-8 %> + + +
+ + + + + + + + + + + + <% @archive_files.each_with_index do |post,i| %> + class="even" <% end %>> + + + + + <% end %> + + +
<%= sortable(:title, t("archive.Title"))%><%= t("archive.Files")%><%= sortable(:archive_file_category, t("archive.Category"))%>
<%= post.title %>
+
+ <% if !post.archive_file_multiples.blank? %> +
    + <% post.archive_file_multiples.asc(:_id).each do | afile | %> + <% if afile.file.file and afile.choose_lang_display(I18n.locale.to_s) %> +
  1. + <%= link_to afile.file_title, afile.file.url, {:target => '_blank', :title => afile.file_title, :class => "o-archives-file"} %> + <%= post.get_file_icon(afile.file.url) %> +
  2. + <% end %> + <% end %> +
+ <% end %> +
+
+ <%= post.archive_file_category.title %> +
+
+ +<%= paginate @archive_files, :param_name => :page_main, :params => {:inner => 'false'} %> + +<%= stylesheet_link_tag "archive/archives" %> + + + + + + + + + diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/front_end/archive_files/index.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/front_end/archive_files/index.html.erb new file mode 100644 index 000000000..14377a7c7 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/front_end/archive_files/index.html.erb @@ -0,0 +1,18 @@ +<%= stylesheet_link_tag "default_widget" %> + + + +
+ <%= render 'index' %> +
+ +<%= stylesheet_link_tag "archive/archives" %> + + + + + + + + + diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/front_end/archive_files/index.js.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/front_end/archive_files/index.js.erb new file mode 100644 index 000000000..a0afb16fa --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/front_end/archive_files/index.js.erb @@ -0,0 +1 @@ +$('#archive_file_widget').html("<%= j render 'index' %>") diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/front_end/archive_files/show.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/front_end/archive_files/show.html.erb new file mode 100644 index 000000000..fe6994dac --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/front_end/archive_files/show.html.erb @@ -0,0 +1,30 @@ + +
+
+
+

<%= @archive_file.archive_file_category.title rescue nil %>

+
+
+
    +
  • +

    <%= @archive_file.title %>

    +
    +
      + <% @archive_file.archive_file_multiples.each do | afile | %> + <% if afile.file.file and afile.choose_lang_display(I18n.locale.to_s) %> +
    1. + <%= link_to afile.file_title, afile.file.url, {:target => '_blank', :title => afile.file_title, :class => "o-archives-file"} %> + <%= @archive_file.get_file_icon(afile.file.url) %> +
    2. + <% end %> + <% end %> +
    +
    +
  • +
+
+
+
+
+ +<%= stylesheet_link_tag "archive/archives" %> \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/_bulletins.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/_bulletins.html.erb new file mode 100644 index 000000000..eb70e2f86 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/_bulletins.html.erb @@ -0,0 +1,10 @@ +<% @bulletins.each do |bulletin| %> +
  • + <%= link_to bulletin.title, panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category_id , :tag_id => @selected_tag.id ) %> +
  • +<% end %> + + diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/_index.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/_index.html.erb new file mode 100644 index 000000000..9f752f1e3 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/_index.html.erb @@ -0,0 +1,98 @@ +<% # encoding: utf-8 %> + + +<% if @widget_style == '1' %> + +
    + + + + + + + + + + + <% @archive_files.each_with_index do |post,i| %> + class="even" <% end %>> + + + + + <% end %> + + +
    <%= sortable(:title, t("archive.Title"))%><%= t("archive.Files")%><%= sortable(:archive_file_category, t("archive.Category"))%>
    <%= post.title %>
    +
    + <% if !post.archive_file_multiples.blank? %> +
      + <% post.archive_file_multiples.asc(:_id).each do | afile | %> + <% if afile.file.file and afile.choose_lang_display(I18n.locale.to_s) %> +
    1. + <%= link_to afile.file_title, afile.file.url, {:target => '_blank', :title => afile.file_title, :class => "o-archives-file"} %> + <%= post.get_file_icon(afile.file.url) %> +
    2. + <% end %> + <% end %> +
    + <% end %> +
    +
    + <%= post.archive_file_category.title %> +
    +
    +
    + <% if !params[:category_id].blank? %> + <%= link_to t(:more_plus), panel_archive_front_end_archive_files_path(:category_id => @part.category) %> + <% else %> + <%= link_to t(:more_plus), panel_archive_front_end_archive_files_path %> + <% end %> +
    +<% elsif @widget_style == '2' %> + +
    +
    + + <% @archive_file_categorys.each do |afcpost| %> + +
    + <% if @category_id.blank? %> +

    <%= afcpost.title %>

    + <% end %> +
    +
    +
      + + <% afcpost.archive_files.can_display.desc( :is_top ).each do |post| %> +
    • +

      <%= post.title %>

      +
      + + <% if !post.archive_file_multiples.blank? %> +
        + <% post.archive_file_multiples.asc(:_id).each do | afile | %> + <% if afile.file.file and afile.choose_lang_display(I18n.locale.to_s) %> +
      1. + <%= link_to afile.file_title, afile.file.url, {:target => '_blank', :title => afile.file_title, :class => "o-archives-file"} %> + <%= post.get_file_icon(afile.file.url) %> +
      2. + <% end %> + <% end %> +
      + <% end %> + +
      +
    • + <% end %> + +
    +
    +
    + + <% end %> + +
    +
    + +<% end %> diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/_tag.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/_tag.html.erb new file mode 100644 index 000000000..6188bfe92 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/_tag.html.erb @@ -0,0 +1,3 @@ +
  • + <%= link_to tag.name, panel_announcement_widget_bulletins_and_web_links_path(:id => tag.id), :remote => true, :class => ('active' if tag.eql?(@selected_tag)) %> +
  • \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/_web_links.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/_web_links.html.erb new file mode 100644 index 000000000..a1b8f4dba --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/_web_links.html.erb @@ -0,0 +1,10 @@ +<% @web_links.each do |web_link| %> +
  • + <%= link_to web_link.title, web_link.url %> +
  • +<% end %> + + \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/archive_search_block.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/archive_search_block.html.erb new file mode 100644 index 000000000..4475e343e --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/archive_search_block.html.erb @@ -0,0 +1,8 @@ +<%= form_tag panel_archive_front_end_archive_files_path, method: :get do %> + <%= hidden_field_tag :category_id, params[:category_id] %> + <%= hidden_field_tag :tag_id, params[:tag_id] %> +

    + <%= text_field_tag :search_query, params[:search_query],{:value => (params[:search_query].blank?? '' : params[:search_query]),:placeholder => t("announcement.search") }%> + <%= submit_tag "Search", name: nil %> +

    +<% end %> \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/bulletins_list.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/bulletins_list.html.erb new file mode 100644 index 000000000..a07d11257 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/bulletins_list.html.erb @@ -0,0 +1,31 @@ +<% # encoding: utf-8 %> + +<% if @bulletins and !@bulletins.nil? %> + +
    +
      + <% @tags.each do |tag| %> +
    • <%= tag.name %>
    • + <% end %> +
    +
    + +<% @tags.each_with_index do |tag, index| %> +
    +

    <%= t("announcement.bulletins") %>

    +
    prev
    +
    next
    +
      + <% tag.bulletins.each do |post| %> +
    • <%= link_to post.title, panel_announcement_front_end_bulletin_path(post) %>
    • + <% end %> +
    +
    +<% end %> + +<% end %> + + + + + diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/bulletins_side_bar.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/bulletins_side_bar.html.erb new file mode 100644 index 000000000..f5f2077e4 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/bulletins_side_bar.html.erb @@ -0,0 +1,23 @@ + +
    +

    <%= t(:categories) %>

    +
      + <% @bulletin_categorys.each do |category| %> +
    • + <%= link_to category.title, panel_announcement_front_end_bulletins_path(:category_id => category.id) %> +
    • + <% end %> +
    +
    +
    +

    <%= t(:tag_cloud) %>

    +
    + <% @tags_and_class.each do |tag| %> + <%= link_to tag[0][I18n.locale], panel_announcement_front_end_bulletins_path(:tag_id => tag[0].id, :category_id => params[:category_id]), :class => "#{tag[1]} #{(tag[0].id.to_s.eql?(params[:tag_id]) || tag[0].key.eql?(params[:tag_id])) ? 'active' : nil} " %> + <% end %> +
    +
    + + \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/index.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/index.html.erb new file mode 100644 index 000000000..03e499e33 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/index.html.erb @@ -0,0 +1,9 @@ +<%= stylesheet_link_tag "default_widget" %> + + + +
    + <%= render 'index' %> +
    + +<%= stylesheet_link_tag "archive/archives" %> \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/index.js.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/index.js.erb new file mode 100644 index 000000000..a0afb16fa --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/index.js.erb @@ -0,0 +1 @@ +$('#archive_file_widget').html("<%= j render 'index' %>") diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/reload_bulletins.js.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/reload_bulletins.js.erb new file mode 100644 index 000000000..3ee82c103 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/reload_bulletins.js.erb @@ -0,0 +1 @@ +$('#bulletins_web_links_bulletins').html("<%= j render 'bulletins' if @bulletins %>") \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/reload_web_links.js.erb b/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/reload_web_links.js.erb new file mode 100644 index 000000000..d5abd76b6 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/views/panel/archive/widget/archive_files/reload_web_links.js.erb @@ -0,0 +1 @@ +$('#bulletins_web_links_web_links').html("<%= j render 'web_links' if @web_links %>") \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/archive.gemspec b/vendor/built_in_modules/dictionary/archive.gemspec new file mode 100644 index 000000000..e807e99c6 --- /dev/null +++ b/vendor/built_in_modules/dictionary/archive.gemspec @@ -0,0 +1,23 @@ +$:.push File.expand_path("../lib", __FILE__) + +# Maintain your gem's version: +require "archive/version" + +# Describe your gem and declare its dependencies: +Gem::Specification.new do |s| + s.name = "archive" + s.version = Archive::VERSION + s.authors = ["TODO: Your name"] + s.email = ["TODO: Your email"] + s.homepage = "TODO" + s.summary = "TODO: Summary of Archive." + s.description = "TODO: Description of Archive." + + s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"] + s.test_files = Dir["test/**/*"] + + s.add_dependency "rails", "~> 3.1.4" + # s.add_dependency "jquery-rails" + + s.add_development_dependency "sqlite3" +end diff --git a/vendor/built_in_modules/dictionary/archive.json b/vendor/built_in_modules/dictionary/archive.json new file mode 100644 index 000000000..2cc3b8e84 --- /dev/null +++ b/vendor/built_in_modules/dictionary/archive.json @@ -0,0 +1,12 @@ +{ + "title": "archive", + "version": "0.1", + "organization": "Rulingcom", + "author": "RD dep", + "intro": "Archive", + "update_info": "Some info", + "create_date": "11-11-2011", + "app_pages": ["archive_files"], + "widgets": {"archive_files":[]}, + "enable_frontend": true +} diff --git a/vendor/built_in_modules/dictionary/config/locales/en.yml b/vendor/built_in_modules/dictionary/config/locales/en.yml new file mode 100644 index 000000000..d108c4edd --- /dev/null +++ b/vendor/built_in_modules/dictionary/config/locales/en.yml @@ -0,0 +1,11 @@ +en: + + archive: + archive: Archive + Title: Title + Files: Files + Category: Category + frontend: + archive: Archive Front-end + widget: + index: Archive Widget \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/config/locales/zh_tw.yml b/vendor/built_in_modules/dictionary/config/locales/zh_tw.yml new file mode 100644 index 000000000..eeb190b55 --- /dev/null +++ b/vendor/built_in_modules/dictionary/config/locales/zh_tw.yml @@ -0,0 +1,15 @@ +zh_tw: + + archive: + archive: 檔案室 + Title: 標題 + Files: 檔案 + Category: 類別 + frontend: + archive: 檔案室前台 + widget: + index: 檔案室Widget + mongoid: + attributes: + archive_file: + sort_number: 排序數 diff --git a/vendor/built_in_modules/dictionary/config/routes.rb b/vendor/built_in_modules/dictionary/config/routes.rb new file mode 100644 index 000000000..b620dbee8 --- /dev/null +++ b/vendor/built_in_modules/dictionary/config/routes.rb @@ -0,0 +1,24 @@ +Rails.application.routes.draw do + namespace :panel do + namespace :archive do + namespace :back_end do + resources :archive_files do + collection do + get 'delete' + end + end + resources :archive_file_categorys + resources :tags + end + namespace :front_end do + match "archive_files" => "archive_files#index" + resources :archive_files + end + namespace :widget do + match "index" => "archive_files#index" + match "archive_search_block" => "archive_files#archive_search_block" + end + end + end + match "/appfront/*path" => redirect("/panel/*path") +end \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/init.rb b/vendor/built_in_modules/dictionary/init.rb new file mode 100644 index 000000000..90c562f1b --- /dev/null +++ b/vendor/built_in_modules/dictionary/init.rb @@ -0,0 +1,88 @@ +module Dictionary + OrbitApp.registration "Dictionary",:type=> 'ModuleApp' do + module_label 'archive.archive' + base_url File.expand_path File.dirname(__FILE__) + + # personal_plugin :enable => true,:path=>"panel/archive/plugin/profile",:i18n=>'archive.archive' + + version "0.1" + organization "Rulingcom" + author "RD dep" + intro "I am intro" + update_info 'some update_info' + + front_end do + app_page 'archive_files' do + frontend_i18n "archive.frontend.archive" + end + end + + category ["ArchiveFileCategory"] + + taggable + + widgets do + # default_widget do + # query 'ArchiveFile.all' + # field :category + # link_field :title,{:method => 'panel_archive_front_end_archive_file_path',:args=>:self} + # link_field :archive_file_category_with_title,{:method => 'panel_archive_front_end_archive_files_path',:args=>{:category_id => [:archive_file_category,:id]}} + # end + + categories_query 'ArchiveFileCategory.all' + tags_query 'ArchiveTag.all' + + customize_widget "index" do + widget_i18n "archive.widget.index" + style ["1"] + end + + customize_widget "archive_search_block" do + widget_i18n "announcement.widget.search" + end + + # item "index","announcement.widget.index",:default_template=>true,:fields=>["title","category","postdate"] + # item "bulletins_and_web_links","announcement.widget.bulletins_and_web_links" + end + + + side_bar do + head_label_i18n 'archive.archive',:icon_class=>"icons-archive" + available_for [:admin,:guest,:manager,:sub_manager] + active_for_controllers ({:private=>['archive_file_categorys','archive_files'],:public=>['panel/archive/back_end/tags']}) + active_for_object_auth ['ArchiveFileCategory'] + + head_link_path "panel_archive_back_end_archive_files_path" + + context_link 'all', + :link_path=>"panel_archive_back_end_archive_files_path" , + :priority=>1, + :active_for_action=>{:archive_files=>:index}, + :available_for => [:all] + + context_link 'add', + :link_path=>"new_panel_archive_back_end_archive_file_path" , + :priority=>2, + :active_for_action=>{:archive_files=>:new}, + :available_for => [:sub_manager] + + context_link 'categories', + :link_path=>"panel_archive_back_end_archive_file_categorys_path" , + :priority=>3, + :active_for_action=>{:archive_file_categorys=>:index}, + :available_for => [:manager] + + # context_link 'tags', + # :link_path=>"admin_tags_path(:module_app_id => ModuleApp.first(conditions: {title: 'Archive'}))" , + # :priority=>4, + # # :active_for_action=>{:bulletin_categorys=>:index}, + # :available_for => [:manager] + + context_link 'module_authorization', + :link_path=>"admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: 'Archive'}))", + :priority=>6, + :active_for_app_auth => 'Archive' + + end + end +end diff --git a/vendor/built_in_modules/dictionary/lib/archive.rb b/vendor/built_in_modules/dictionary/lib/archive.rb new file mode 100644 index 000000000..6401c81e1 --- /dev/null +++ b/vendor/built_in_modules/dictionary/lib/archive.rb @@ -0,0 +1,4 @@ +require "archive/engine" + +module Archive +end diff --git a/vendor/built_in_modules/dictionary/lib/archive/engine.rb b/vendor/built_in_modules/dictionary/lib/archive/engine.rb new file mode 100644 index 000000000..13c4a73a4 --- /dev/null +++ b/vendor/built_in_modules/dictionary/lib/archive/engine.rb @@ -0,0 +1,4 @@ +module Archive + 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/archive/version.rb new file mode 100644 index 000000000..052012f6e --- /dev/null +++ b/vendor/built_in_modules/dictionary/lib/archive/version.rb @@ -0,0 +1,3 @@ +module Archive + 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/archive_tasks.rake new file mode 100644 index 000000000..dbf17bdca --- /dev/null +++ b/vendor/built_in_modules/dictionary/lib/tasks/archive_tasks.rake @@ -0,0 +1,4 @@ +# desc "Explaining what the task does" +# task :archive do +# # Task goes here +# end diff --git a/vendor/built_in_modules/dictionary/script/rails b/vendor/built_in_modules/dictionary/script/rails new file mode 100644 index 000000000..23bd81fa1 --- /dev/null +++ b/vendor/built_in_modules/dictionary/script/rails @@ -0,0 +1,6 @@ +#!/usr/bin/env ruby.exe +#!/usr/bin/env ruby +# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. + +ENGINE_PATH = File.expand_path('../..', __FILE__) +load File.expand_path('../../test/dummy/script/rails', __FILE__) diff --git a/vendor/built_in_modules/dictionary/test/archive_test.rb b/vendor/built_in_modules/dictionary/test/archive_test.rb new file mode 100644 index 000000000..507b238de --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/archive_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ArchiveTest < ActiveSupport::TestCase + test "truth" do + assert_kind_of Module, Archive + end +end diff --git a/vendor/built_in_modules/dictionary/test/dummy/Rakefile b/vendor/built_in_modules/dictionary/test/dummy/Rakefile new file mode 100644 index 000000000..36458522c --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/Rakefile @@ -0,0 +1,7 @@ +#!/usr/bin/env rake +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require File.expand_path('../config/application', __FILE__) + +Dummy::Application.load_tasks diff --git a/vendor/built_in_modules/dictionary/test/dummy/app/assets/javascripts/application.js b/vendor/built_in_modules/dictionary/test/dummy/app/assets/javascripts/application.js new file mode 100644 index 000000000..37c7bfcdb --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/app/assets/javascripts/application.js @@ -0,0 +1,9 @@ +// This is a manifest file that'll be compiled into including all the files listed below. +// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically +// be included in the compiled file accessible from http://example.com/assets/application.js +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// the compiled file. +// +//= require jquery +//= require jquery_ujs +//= require_tree . diff --git a/vendor/built_in_modules/dictionary/test/dummy/app/assets/stylesheets/application.css b/vendor/built_in_modules/dictionary/test/dummy/app/assets/stylesheets/application.css new file mode 100644 index 000000000..fc25b5723 --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/app/assets/stylesheets/application.css @@ -0,0 +1,7 @@ +/* + * This is a manifest file that'll automatically include all the stylesheets available in this directory + * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at + * the top of the compiled file, but it's generally better to create a new file per style scope. + *= require_self + *= require_tree . +*/ \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/test/dummy/app/controllers/application_controller.rb b/vendor/built_in_modules/dictionary/test/dummy/app/controllers/application_controller.rb new file mode 100644 index 000000000..e8065d950 --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/app/controllers/application_controller.rb @@ -0,0 +1,3 @@ +class ApplicationController < ActionController::Base + protect_from_forgery +end diff --git a/vendor/built_in_modules/dictionary/test/dummy/app/helpers/application_helper.rb b/vendor/built_in_modules/dictionary/test/dummy/app/helpers/application_helper.rb new file mode 100644 index 000000000..de6be7945 --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/vendor/built_in_modules/dictionary/test/dummy/app/mailers/.gitkeep b/vendor/built_in_modules/dictionary/test/dummy/app/mailers/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/built_in_modules/dictionary/test/dummy/app/models/.gitkeep b/vendor/built_in_modules/dictionary/test/dummy/app/models/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/built_in_modules/dictionary/test/dummy/app/views/layouts/application.html.erb b/vendor/built_in_modules/dictionary/test/dummy/app/views/layouts/application.html.erb new file mode 100644 index 000000000..9a8a761bd --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/app/views/layouts/application.html.erb @@ -0,0 +1,14 @@ + + + + Dummy + <%= stylesheet_link_tag "application" %> + <%= javascript_include_tag "application" %> + <%= csrf_meta_tags %> + + + +<%= yield %> + + + diff --git a/vendor/built_in_modules/dictionary/test/dummy/config.ru b/vendor/built_in_modules/dictionary/test/dummy/config.ru new file mode 100644 index 000000000..1989ed8d0 --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/config.ru @@ -0,0 +1,4 @@ +# This file is used by Rack-based servers to start the application. + +require ::File.expand_path('../config/environment', __FILE__) +run Dummy::Application diff --git a/vendor/built_in_modules/dictionary/test/dummy/config/application.rb b/vendor/built_in_modules/dictionary/test/dummy/config/application.rb new file mode 100644 index 000000000..f73c4f9e5 --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/config/application.rb @@ -0,0 +1,45 @@ +require File.expand_path('../boot', __FILE__) + +require 'rails/all' + +Bundler.require +require "archive" + +module Dummy + class Application < Rails::Application + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + + # Custom directories with classes and modules you want to be autoloadable. + # config.autoload_paths += %W(#{config.root}/extras) + + # Only load the plugins named here, in the order given (default is alphabetical). + # :all can be used as a placeholder for all plugins not explicitly named. + # config.plugins = [ :exception_notification, :ssl_requirement, :all ] + + # Activate observers that should always be running. + # config.active_record.observers = :cacher, :garbage_collector, :forum_observer + + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' + + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] + # config.i18n.default_locale = :de + + # Configure the default encoding used in templates for Ruby 1.9. + config.encoding = "utf-8" + + # Configure sensitive parameters which will be filtered from the log file. + config.filter_parameters += [:password] + + # Enable the asset pipeline + config.assets.enabled = true + + # Version of your assets, change this if you want to expire all your assets + config.assets.version = '1.0' + end +end + diff --git a/vendor/built_in_modules/dictionary/test/dummy/config/boot.rb b/vendor/built_in_modules/dictionary/test/dummy/config/boot.rb new file mode 100644 index 000000000..eba068137 --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/config/boot.rb @@ -0,0 +1,10 @@ +require 'rubygems' +gemfile = File.expand_path('../../../../Gemfile', __FILE__) + +if File.exist?(gemfile) + ENV['BUNDLE_GEMFILE'] = gemfile + require 'bundler' + Bundler.setup +end + +$:.unshift File.expand_path('../../../../lib', __FILE__) \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/test/dummy/config/database.yml b/vendor/built_in_modules/dictionary/test/dummy/config/database.yml new file mode 100644 index 000000000..51a4dd459 --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/config/database.yml @@ -0,0 +1,25 @@ +# SQLite version 3.x +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem 'sqlite3' +development: + adapter: sqlite3 + database: db/development.sqlite3 + pool: 5 + timeout: 5000 + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + adapter: sqlite3 + database: db/test.sqlite3 + pool: 5 + timeout: 5000 + +production: + adapter: sqlite3 + database: db/production.sqlite3 + pool: 5 + timeout: 5000 diff --git a/vendor/built_in_modules/dictionary/test/dummy/config/environment.rb b/vendor/built_in_modules/dictionary/test/dummy/config/environment.rb new file mode 100644 index 000000000..3da5eb91d --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/config/environment.rb @@ -0,0 +1,5 @@ +# Load the rails application +require File.expand_path('../application', __FILE__) + +# Initialize the rails application +Dummy::Application.initialize! diff --git a/vendor/built_in_modules/dictionary/test/dummy/config/environments/development.rb b/vendor/built_in_modules/dictionary/test/dummy/config/environments/development.rb new file mode 100644 index 000000000..95a50b91e --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/config/environments/development.rb @@ -0,0 +1,30 @@ +Dummy::Application.configure do + # Settings specified here will take precedence over those in config/application.rb + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Log error messages when you accidentally call methods on nil. + config.whiny_nils = true + + # Show full error reports and disable caching + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Don't care if the mailer can't send + config.action_mailer.raise_delivery_errors = false + + # Print deprecation notices to the Rails logger + config.active_support.deprecation = :log + + # Only use best-standards-support built into browsers + config.action_dispatch.best_standards_support = :builtin + + # Do not compress assets + config.assets.compress = false + + # Expands the lines which load the assets + config.assets.debug = true +end diff --git a/vendor/built_in_modules/dictionary/test/dummy/config/environments/production.rb b/vendor/built_in_modules/dictionary/test/dummy/config/environments/production.rb new file mode 100644 index 000000000..ca2c58883 --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/config/environments/production.rb @@ -0,0 +1,60 @@ +Dummy::Application.configure do + # Settings specified here will take precedence over those in config/application.rb + + # Code is not reloaded between requests + config.cache_classes = true + + # Full error reports are disabled and caching is turned on + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Disable Rails's static asset server (Apache or nginx will already do this) + config.serve_static_assets = false + + # Compress JavaScripts and CSS + config.assets.compress = true + + # Don't fallback to assets pipeline if a precompiled asset is missed + config.assets.compile = false + + # Generate digests for assets URLs + config.assets.digest = true + + # Defaults to Rails.root.join("public/assets") + # config.assets.manifest = YOUR_PATH + + # Specifies the header that your server uses for sending files + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # See everything in the log (default is :info) + # config.log_level = :debug + + # Use a different logger for distributed setups + # config.logger = SyslogLogger.new + + # Use a different cache store in production + # config.cache_store = :mem_cache_store + + # Enable serving of images, stylesheets, and JavaScripts from an asset server + # config.action_controller.asset_host = "http://assets.example.com" + + # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) + # config.assets.precompile += %w( search.js ) + + # Disable delivery errors, bad email addresses will be ignored + # config.action_mailer.raise_delivery_errors = false + + # Enable threaded mode + # config.threadsafe! + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation can not be found) + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners + config.active_support.deprecation = :notify +end diff --git a/vendor/built_in_modules/dictionary/test/dummy/config/environments/test.rb b/vendor/built_in_modules/dictionary/test/dummy/config/environments/test.rb new file mode 100644 index 000000000..6810c9147 --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/config/environments/test.rb @@ -0,0 +1,39 @@ +Dummy::Application.configure do + # Settings specified here will take precedence over those in config/application.rb + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Configure static asset server for tests with Cache-Control for performance + config.serve_static_assets = true + config.static_cache_control = "public, max-age=3600" + + # Log error messages when you accidentally call methods on nil + config.whiny_nils = true + + # Show full error reports and disable caching + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment + config.action_controller.allow_forgery_protection = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Use SQL instead of Active Record's schema dumper when creating the test database. + # This is necessary if your schema can't be completely dumped by the schema dumper, + # like if you have constraints or database-specific column types + # config.active_record.schema_format = :sql + + # Print deprecation notices to the stderr + config.active_support.deprecation = :stderr +end diff --git a/vendor/built_in_modules/dictionary/test/dummy/config/initializers/backtrace_silencers.rb b/vendor/built_in_modules/dictionary/test/dummy/config/initializers/backtrace_silencers.rb new file mode 100644 index 000000000..59385cdf3 --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/vendor/built_in_modules/dictionary/test/dummy/config/initializers/inflections.rb b/vendor/built_in_modules/dictionary/test/dummy/config/initializers/inflections.rb new file mode 100644 index 000000000..9e8b0131f --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/config/initializers/inflections.rb @@ -0,0 +1,10 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format +# (all these examples are active by default): +# ActiveSupport::Inflector.inflections do |inflect| +# inflect.plural /^(ox)$/i, '\1en' +# inflect.singular /^(ox)en/i, '\1' +# inflect.irregular 'person', 'people' +# inflect.uncountable %w( fish sheep ) +# end diff --git a/vendor/built_in_modules/dictionary/test/dummy/config/initializers/mime_types.rb b/vendor/built_in_modules/dictionary/test/dummy/config/initializers/mime_types.rb new file mode 100644 index 000000000..72aca7e44 --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/config/initializers/mime_types.rb @@ -0,0 +1,5 @@ +# Be sure to restart your server when you modify this file. + +# Add new mime types for use in respond_to blocks: +# Mime::Type.register "text/richtext", :rtf +# Mime::Type.register_alias "text/html", :iphone diff --git a/vendor/built_in_modules/dictionary/test/dummy/config/initializers/secret_token.rb b/vendor/built_in_modules/dictionary/test/dummy/config/initializers/secret_token.rb new file mode 100644 index 000000000..32fa02f2c --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/config/initializers/secret_token.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +Dummy::Application.config.secret_token = 'aec42790c63fdc0784df1572e74631a6f9c9d16729b813ecbd5f086eaab251cdf0bcba044a78b706d1f45d43c4ec5af5df5cc5ffd2ff7ca64953a5806ce49618' diff --git a/vendor/built_in_modules/dictionary/test/dummy/config/initializers/session_store.rb b/vendor/built_in_modules/dictionary/test/dummy/config/initializers/session_store.rb new file mode 100644 index 000000000..952473ff9 --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/config/initializers/session_store.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +Dummy::Application.config.session_store :cookie_store, key: '_dummy_session' + +# Use the database for sessions instead of the cookie-based default, +# which shouldn't be used to store highly confidential information +# (create the session table with "rails generate session_migration") +# Dummy::Application.config.session_store :active_record_store diff --git a/vendor/built_in_modules/dictionary/test/dummy/config/initializers/wrap_parameters.rb b/vendor/built_in_modules/dictionary/test/dummy/config/initializers/wrap_parameters.rb new file mode 100644 index 000000000..999df2018 --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/config/initializers/wrap_parameters.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. +# +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters format: [:json] +end + +# Disable root element in JSON by default. +ActiveSupport.on_load(:active_record) do + self.include_root_in_json = false +end diff --git a/vendor/built_in_modules/dictionary/test/dummy/config/locales/en.yml b/vendor/built_in_modules/dictionary/test/dummy/config/locales/en.yml new file mode 100644 index 000000000..179c14ca5 --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/config/locales/en.yml @@ -0,0 +1,5 @@ +# Sample localization file for English. Add more files in this directory for other locales. +# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en: + hello: "Hello world" diff --git a/vendor/built_in_modules/dictionary/test/dummy/config/routes.rb b/vendor/built_in_modules/dictionary/test/dummy/config/routes.rb new file mode 100644 index 000000000..bb509f27a --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/config/routes.rb @@ -0,0 +1,58 @@ +Dummy::Application.routes.draw do + # The priority is based upon order of creation: + # first created -> highest priority. + + # Sample of regular route: + # match 'products/:id' => 'catalog#view' + # Keep in mind you can assign values other than :controller and :action + + # Sample of named route: + # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase + # This route can be invoked with purchase_url(:id => product.id) + + # Sample resource route (maps HTTP verbs to controller actions automatically): + # resources :products + + # Sample resource route with options: + # resources :products do + # member do + # get 'short' + # post 'toggle' + # end + # + # collection do + # get 'sold' + # end + # end + + # Sample resource route with sub-resources: + # resources :products do + # resources :comments, :sales + # resource :seller + # end + + # Sample resource route with more complex sub-resources + # resources :products do + # resources :comments + # resources :sales do + # get 'recent', :on => :collection + # end + # end + + # Sample resource route within a namespace: + # namespace :admin do + # # Directs /admin/products/* to Admin::ProductsController + # # (app/controllers/admin/products_controller.rb) + # resources :products + # end + + # You can have the root of your site routed with "root" + # just remember to delete public/index.html. + # root :to => 'welcome#index' + + # See how all your routes lay out with "rake routes" + + # This is a legacy wild controller route that's not recommended for RESTful applications. + # Note: This route will make all actions in every controller accessible via GET requests. + # match ':controller(/:action(/:id(.:format)))' +end diff --git a/vendor/built_in_modules/dictionary/test/dummy/lib/assets/.gitkeep b/vendor/built_in_modules/dictionary/test/dummy/lib/assets/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/built_in_modules/dictionary/test/dummy/log/.gitkeep b/vendor/built_in_modules/dictionary/test/dummy/log/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/built_in_modules/dictionary/test/dummy/public/404.html b/vendor/built_in_modules/dictionary/test/dummy/public/404.html new file mode 100644 index 000000000..9a48320a5 --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/public/404.html @@ -0,0 +1,26 @@ + + + + The page you were looking for doesn't exist (404) + + + + + +
    +

    The page you were looking for doesn't exist.

    +

    You may have mistyped the address or the page may have moved.

    +
    + + diff --git a/vendor/built_in_modules/dictionary/test/dummy/public/422.html b/vendor/built_in_modules/dictionary/test/dummy/public/422.html new file mode 100644 index 000000000..83660ab18 --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/public/422.html @@ -0,0 +1,26 @@ + + + + The change you wanted was rejected (422) + + + + + +
    +

    The change you wanted was rejected.

    +

    Maybe you tried to change something you didn't have access to.

    +
    + + diff --git a/vendor/built_in_modules/dictionary/test/dummy/public/500.html b/vendor/built_in_modules/dictionary/test/dummy/public/500.html new file mode 100644 index 000000000..b80307fc1 --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/public/500.html @@ -0,0 +1,26 @@ + + + + We're sorry, but something went wrong (500) + + + + + +
    +

    We're sorry, but something went wrong.

    +

    We've been notified about this issue and we'll take a look at it shortly.

    +
    + + diff --git a/vendor/built_in_modules/dictionary/test/dummy/public/favicon.ico b/vendor/built_in_modules/dictionary/test/dummy/public/favicon.ico new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/built_in_modules/dictionary/test/dummy/script/rails b/vendor/built_in_modules/dictionary/test/dummy/script/rails new file mode 100644 index 000000000..81eab02f5 --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/dummy/script/rails @@ -0,0 +1,6 @@ +#!/usr/bin/env ruby.exe +# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. + +APP_PATH = File.expand_path('../../config/application', __FILE__) +require File.expand_path('../../config/boot', __FILE__) +require 'rails/commands' diff --git a/vendor/built_in_modules/dictionary/test/integration/navigation_test.rb b/vendor/built_in_modules/dictionary/test/integration/navigation_test.rb new file mode 100644 index 000000000..97a94c9bb --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/integration/navigation_test.rb @@ -0,0 +1,10 @@ +require 'test_helper' + +class NavigationTest < ActionDispatch::IntegrationTest + fixtures :all + + # test "the truth" do + # assert true + # end +end + diff --git a/vendor/built_in_modules/dictionary/test/test_helper.rb b/vendor/built_in_modules/dictionary/test/test_helper.rb new file mode 100644 index 000000000..dcd3b276e --- /dev/null +++ b/vendor/built_in_modules/dictionary/test/test_helper.rb @@ -0,0 +1,10 @@ +# Configure Rails Environment +ENV["RAILS_ENV"] = "test" + +require File.expand_path("../dummy/config/environment.rb", __FILE__) +require "rails/test_help" + +Rails.backtrace_cleaner.remove_silencers! + +# Load support files +Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }