Removed the modules for basic site

This commit is contained in:
saurabhbhatia 2013-12-16 16:21:42 +08:00
parent fd24fbe082
commit 3c4247f538
555 changed files with 0 additions and 19140 deletions

View File

@ -1,6 +0,0 @@
.bundle/
log/*.log
pkg/
test/dummy/db/*.sqlite3
test/dummy/log/*.log
test/dummy/tmp/

View File

@ -1,17 +0,0 @@
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'

View File

@ -1,20 +0,0 @@
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.

View File

@ -1,3 +0,0 @@
= Archive
This project rocks and uses MIT-LICENSE.

View File

@ -1,39 +0,0 @@
#!/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

View File

@ -1,157 +0,0 @@
/* General style with default layout */
.o-archives {}
.o-archives .o-archives-content {}
.o-archives .o-archives-group {
margin: 20px 0 0 0;
padding: 20px 0 0 0;
border-top: dashed 1px #eee;
}
.o-archives .o-archives-group:first-child {
margin: 0;
padding: 0;
border: 0;
}
.o-archives .o-archives-category {
padding-bottom: 16px;
margin-bottom: 16px;
border-bottom: solid 2px #ccc;
font-weight: bold;
}
.o-archives .o-archives-list {}
.o-archives .o-archives-list ul {
margin: 0;
padding: 0;
list-style: none;
}
.o-archives .o-archives-list li {}
.o-archives .o-archives-title {
border-left: solid 8px #eee;
border-bottom: solid 1px #eee;
padding: 0 0 0 16px;
line-height: 2em;
}
.o-archives .o-archives-list-item {
padding: 12px 0;
}
.o-archives .o-archives-list-item ol {
list-style-type: disc;
margin: 0;
}
.o-archives .o-archives-list-item li {
margin: 0 0 8px 0;
}
.o-archives .o-archives-file {
font-size: 0.85em;
}
.o-archives .o-archives-file:hover {}
.o-archives .o-archives-file-type {
display: inline-block;
vertical-align: top;
margin-left: 8px;
padding: 0 6px;
height: 16px;
font-size: 10px;
text-transform: uppercase;
line-height: 16px;
background-color: #666;
color: #fff;
border-radius: 3px;
}
.o-archives .o-archives-hot {
font-size: 11px;
font-weight: normal;
padding: 0 4px;
display: inline-block;
vertical-align: top;
margin: 0 0 0 8px;
background-color: #D83131;
color: #FFF;
}
/* Tag list */
.o-archives .o-archives-tag-list {}
.o-archives .o-archives-tag-list ul {
margin: 0 -4px;
padding: 0;
list-style: none;
}
.o-archives .o-archives-tag-list ul:after {
content: ".";
clear: both;
display: block;
height: 0;
visibility: hidden;
}
.o-archives .o-archives-tag-list li {
float: left;
margin: 0 4px 8px 4px;
}
.o-archives .o-archives-tag {
display: block;
border: solid 1px #ccc;
padding: 4px;
font-size: 0.85em;
}
.o-archives .o-archives-tag:hover {}
/* Table layout */
.o-archives.layout-table {}
.o-archives .o-archives-search {
overflow: hidden;
margin: 0 0 10px 0;
}
.o-archives .o-archives-search label {
display: inline-block;
margin: 0 8px 0 0;
}
.o-archives .o-archives-search-option {
float: right;
}
.o-archives .o-archives-search-option select {
width: 80px;
}
.o-archives .o-archives-search-keyword {}
.o-archives .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;
padding: 8px 4px;
font-size: 0.85em;
}
.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;
line-height: 1.2em;
}
.o-archives.layout-table .o-archives-category {
padding: 0;
margin: 0;
border: 0;
font-weight: normal;
}
.o-archives.layout-table .o-archives-tag {
display: inline-block;
margin-bottom: 3px;
}
.o-archives.layout-table .o-archives-list-item {
padding: 0;
}

View File

@ -1,23 +0,0 @@
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

View File

@ -1,144 +0,0 @@
class Panel::Archive::BackEnd::ArchiveFileCategorysController < OrbitBackendController
include OrbitControllerLib::DivisionForDisable
open_for_manager :except => [:index,:get_categorys_json,:get_archive_files_json]
open_for_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

View File

@ -1,162 +0,0 @@
class Panel::Archive::BackEnd::ArchiveFilesController < OrbitBackendController
# before_filter :for_app_manager,:except => [:index,:show]
# include OrbitControllerLib::DivisionForDisable
open_for_sub_manager :except => [:index]
before_filter :only => [ :new, :create, :edit, :update ] do |controller|
@categories = get_categories_for_form
end
def index
@tags = get_tags
@categories = get_categories_for_index
@statuses = get_statuses
category_ids = @categories.collect{|t| t.id}
@archive_files = get_sorted_and_filtered("archive_file", :category_id.in => category_ids)
respond_to do |format|
format.html # index.html.erb
format.js { }
format.xml { render :xml => @archive_files }
end
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
if(session[:in_validate_object].blank?)
@archive_file = ArchiveFile.new
else
@archive_file = session[:in_validate_object]
session[:in_validate_object] = {}
end
@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])
if !current_user.admin?
redirect_to :action => :index
else
@tags = get_tags
end
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

View File

@ -1,136 +0,0 @@
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
@frontend_style = !@item.frontend_style.blank? ? @item.frontend_style : "1"
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?
@archive_file_categorys = @module_app.categories.enabled.any_in(:_id => params[:category_id])
@archive_file_category_ids = @module_app.categories.enabled.any_in(:_id => params[:category_id]).collect{|a|a.id}
else
@archive_file_categorys = @module_app.categories.enabled
@archive_file_category_ids = @module_app.categories.enabled.collect{|a|a.id}
end
if @frontend_style == "1"
if !params[:category_id].blank? && !params[:tag_id].blank?
@archive_files = ArchiveFile.can_display.where(:category_id.in => @archive_file_category_ids, :tagged_ids.in => params[:tag_id], :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).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.can_display.where(:category_id.in => @archive_file_category_ids, :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).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(:category_id.in => @archive_file_category_ids,:tagged_ids.in => params[:tag_id], :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).page( params[:page_main] ).per(@page_num)
else
@archive_files = ArchiveFile.can_display.where(:category_id.in => @archive_file_category_ids, :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).page( params[:page_main] ).per(@page_num)
end
elsif @frontend_style == "2"
@archive_file_datas = Array.new
@archive_file_categorys.each do |afcg|
if !params[:category_id].blank? && !params[:tag_id].blank?
@archive_files = ArchiveFile.can_display.where(:category_id.in => [afcg.id], :tagged_ids.in => params[:tag_id], :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort])
elsif !params[:category_id].blank?
@archive_files = ArchiveFile.can_display.where(:category_id.in => [afcg.id], :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort])
elsif !params[:tag_id].blank?
@archive_files = ArchiveFile.can_display.where(:category_id => afcg.id, :tagged_ids.in => params[:tag_id], :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort])
else
@archive_files = ArchiveFile.can_display.where(:category_id => afcg.id, :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort])
end
archive_file_datas = Array.new
@archive_files.each do |af|
archive_file_multiple_datas = Array.new
af.archive_file_multiples.asc(:sort_number).each do | afile |
archive_file_multiple_datas << {
"file_title" => (!afile.file_title.blank? ? afile.file_title : t('archive.download') ) ,
"url" => afile.file.url,
"icon" => af.get_file_icon(afile.file.url)
} if afile.file.file and afile.choose_lang_display(I18n.locale.to_s)
end
archive_file_datas << { "title" => af.title, "is_hot" => (!af.is_hot.blank? ? '1' : ''), "archive_file_multiples" => archive_file_multiple_datas } if !af.archive_file_multiples.blank? and !archive_file_multiple_datas.blank?
end
@archive_file_datas << { "title" => afcg.title, "archive_files" => archive_file_datas } if !@archive_files.blank?
end
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

View File

@ -1,128 +0,0 @@
class Panel::Archive::Widget::ArchiveFilesController < OrbitWidgetController
include AdminHelper
def initialize
super
@app_title = 'archive_files'
end
def index
@part = PagePart.find(params[:part_id])
@title = @part.title_translations[I18n.locale.to_s]
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
@widget_style = !@part.widget_style.blank? ? @part.widget_style : "1"
@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(: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[:category_id].blank? && !params[:tag_id].blank?
# @archive_files = ArchiveFile.default_sort(params[:sort]).can_display.where(: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(: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
if !params[:category_id].blank?
@archive_file_categorys = @module_app.categories.enabled.any_in(:_id => params[:category_id])
@archive_file_category_ids = @module_app.categories.enabled.any_in(:_id => params[:category_id]).collect{|a|a.id}
else
@archive_file_categorys = @module_app.categories.enabled
@archive_file_category_ids = @module_app.categories.enabled.collect{|a|a.id}
end
if @widget_style == "1"
if !params[:category_id].blank? && !params[:tag_id].blank?
@archive_files = ArchiveFile.can_display.where(:category_id.in => @archive_file_category_ids, :tagged_ids.in => params[:tag_id], :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).page( params[:page_main] ).per(@page_num)
elsif !params[:category_id].blank?
@archive_files = ArchiveFile.can_display.where(:category_id.in => @archive_file_category_ids, :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).page( params[:page_main] ).per(@page_num)
elsif !params[:tag_id].blank?
@archive_files = ArchiveFile.can_display.where(:category_id.in => @archive_file_category_ids,:tagged_ids.in => params[:tag_id], :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).page( params[:page_main] ).per(@page_num)
else
@archive_files = ArchiveFile.can_display.where(:category_id.in => @archive_file_category_ids, :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).page( params[:page_main] ).per(@page_num)
end
elsif @widget_style == "2"
@archive_file_datas = Array.new
@archive_file_categorys.each do |afcg|
if !params[:category_id].blank? && !params[:tag_id].blank?
@archive_files = ArchiveFile.can_display.where(:category_id.in => [afcg.id], :tagged_ids.in => params[:tag_id], :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).limit(@page_num)
elsif !params[:category_id].blank?
@archive_files = ArchiveFile.can_display.where(:category_id.in => [afcg.id], :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).limit(@page_num)
elsif !params[:tag_id].blank?
@archive_files = ArchiveFile.can_display.where(:category_id => afcg.id, :tagged_ids.in => params[:tag_id], :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).limit(@page_num)
else
@archive_files = ArchiveFile.can_display.where(:category_id => afcg.id, :title.nin=>[""]).desc( :is_top ).default_sort(params[:sort]).limit(@page_num)
end
archive_file_datas = Array.new
@archive_files.each do |af|
archive_file_multiple_datas = Array.new
af.archive_file_multiples.asc(:sort_number).each do | afile |
archive_file_multiple_datas << {
"file_title" => (!afile.file_title.blank? ? afile.file_title : t('archive.download') ) ,
"url" => afile.file.url,
"icon" => af.get_file_icon(afile.file.url)
} if afile.file.file and afile.choose_lang_display(I18n.locale.to_s)
end
archive_file_datas << { "title" => af.title, "is_hot" => (!af.is_hot.blank? ? '1' : ''), "archive_file_multiples" => archive_file_multiple_datas } if !af.archive_file_multiples.blank? and !archive_file_multiple_datas.blank?
end
@archive_file_datas << { "title" => afcg.title, "archive_files" => archive_file_datas } if !@archive_files.blank?
end
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

View File

@ -1,15 +0,0 @@
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

View File

@ -1,81 +0,0 @@
# encoding: utf-8
class ArchiveFile
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::MultiParameterAttributes
include Mongoid::Sortable
include Sunspot::Mongoid2
include OrbitCategory::Categorizable
include OrbitModel::LanguageRestrict
include OrbitModel::Status
include OrbitModel::TimeFrame
include OrbitTag::Taggable
# BelongsToCategory = :archive_file_category
# PAYMENT_TYPES = @site_valid_locales
field :title, localize: true
field :create_user_id
field :update_user_id, :class_name => "User"
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 get_file_icon( file_data )
file_icon = "<span class=\"o-archives-file-type\">#{file_data.split('.')[-1]}</span>".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

View File

@ -1,31 +0,0 @@
# encoding: utf-8
class ArchiveFileCategory
include Mongoid::Document
include Mongoid::Timestamps
include OrbitCoreLib::ObjectAuthable
include OrbitCoreLib::ObjectDisable
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
def pp_object
title
end
def self.from_id(id)
ArchiveFileCategory.find(id) rescue nil
end
end

View File

@ -1,27 +0,0 @@
class ArchiveFileMultiple
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Sortable
mount_uploader :file, AssetUploader
field :file_title, localize: true
# field :description
field :choose_lang, :type => Array, :default => nil
field :should_destroy, :type => Boolean
default_scope asc(:sort_number)
def choose_lang_display(lang)
self.choose_lang.include?(lang)
end
belongs_to :archive_file
# has_many :archive_file_multiple_langs, :autosave => true, :dependent => :destroy
# accepts_nested_attributes_for :archive_file_multiple_langs, :allow_destroy => true
end

View File

@ -1,20 +0,0 @@
<tr id="<%= dom_id archive_file_category %>" class="with_action">
<td>
<%= archive_file_category.key %>
<div class="quick-edit">
<ul class="nav nav-pills hide">
<% if is_admin?%>
<li><%= link_to t(:edit), edit_panel_archive_back_end_archive_file_category_path(archive_file_category), :remote => true %></li>
<li><%= link_to show_toggle_archive_btn(archive_file_category) , panel_archive_back_end_archive_file_category_path(archive_file_category), :confirm => t(:sure?), :method => :delete, :remote => true,:class=> "archive_toggle" %></li>
<% end %>
<%if is_manager? || is_admin? %>
<li><%= show_anc_cate_permission_link(archive_file_category) %></li>
<% end %>
</ul>
</div>
</td>
<% @site_in_use_locales.each do |locale| %>
<td><%= archive_file_category.title_translations[locale] rescue nil %></td>
<% end %>
</tr>

View File

@ -1,30 +0,0 @@
<% # encoding: utf-8 %>
<%= form_for(@archive_file_category, :remote => true, :url => @url) do |f| %>
<h2><%= (@archive_file_category.new_record? ? 'Add' : 'Edit') %></h2>
<div id="widget-title">
<%= f.label :key %>
<%= f.text_field :key %>
</div>
<div id="widget-title">
<%= f.fields_for :title_translations do |f| %>
<% @site_in_use_locales.each do |locale| %>
<div class="control-group">
<%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
<div class="controls">
<%= f.text_field locale, :class =>' input-xxlarge', :value => (@archive_file_category.title_translations[locale] rescue nil) %>
</div>
</div>
<% end %>
<% end %>
</div>
<div class="form-actions">
<%= f.submit 'Submit/送出', :class=>'btn btn-primary' %>
</div>
<% end %>

View File

@ -1,2 +0,0 @@
$('<%= j render :partial => 'archive_file_category', :collection => [@archive_file_category] %>').appendTo('#archive_file_categorys').hide().fadeIn();
$("#new_archive_file_category")[0].reset();

View File

@ -1 +0,0 @@
$("#<%= dom_id @archive_file_category %>").find(".archive_toggle").text("<%= show_toggle_archive_btn(@archive_file_category) %> ");

View File

@ -1 +0,0 @@
$("#form > form").replaceWith("<%= j render "form" %>");

View File

@ -1,23 +0,0 @@
<%= flash_messages %>
<table id="archive_file_categorys" class="table main-list">
<thead>
<tr>
<th class="span1-2"><%= t('archive_file_category.key') %></th>
<% @site_in_use_locales.each do |locale| %>
<th class="span1-2"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th>
<% end %>
</tr>
</thead>
<tbody>
<%= render :partial => 'archive_file_category', :collection => @archive_file_categorys %>
</tbody>
</table>
<div id="form"><%= render :partial => "form" %></div>

View File

@ -1 +0,0 @@
$("#form > form").replaceWith("<%= j render "form" %>");

View File

@ -1,4 +0,0 @@
$("#<%= 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();

View File

@ -1,49 +0,0 @@
<tr id="<%= dom_id archive_file %>" class="with_action">
<td>
<% 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 -%>
</td>
<td>
<%= archive_file.sort_number %>
</td>
<td>
<div class="label-group">
<div class="label-td">
<% if archive_file.is_top? %>
<span class="label label-success"><%= t(:top) %></span>
<% end %>
<% if archive_file.is_hot? %>
<span class="label label-important"><%= t(:hot) %></span>
<% end %>
<% if archive_file.is_hidden? %>
<span class="label"><%= t(:hidden) %></span>
<% end %>
</div>
</div>
</td>
<td><%= archive_file.archive_file_category.title %></td>
<td>
<%= link_to archive_file.title, panel_archive_front_end_archive_file_path(archive_file) %>
<div class="quick-edit">
<ul class="nav nav-pills hide">
<% if (archive_file.create_user_id == current_or_guest_user.id) || is_manager? %>
<li><%= link_to t(:edit), edit_panel_archive_back_end_archive_file_path(archive_file) %></li>
<li class="dropdown"><%= link_to t(:delete_), panel_archive_back_end_archive_file_path(archive_file), :confirm => t(:sure?), :method => :delete, :remote => true %></li>
<% end -%>
</ul>
</div>
</td>
<td>
<div class="label-group">
<div class="label-td">
<% archive_file.sorted_tags.each do |tag| %>
<span class="label label-tags"><%= tag.name %></span>
<% end %>
</div>
</div>
</td>
</tr>

View File

@ -1,3 +0,0 @@
<div class="filter-clear">
<%= 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" %>
</div>

View File

@ -1,37 +0,0 @@
<div id='filter' class="subnav">
<ul class="nav nav-pills filter">
<li class="accordion-group">
<div class="accordion-heading">
<a href="#collapse-status" data-toggle="collapse" data-parent="#filter" class="accordion-toggle"><%= t(:status) %> <b class="web-symbol"></b></a>
</div>
</li>
<li class="accordion-group">
<div class="accordion-heading">
<a href="#collapse-category" data-toggle="collapse" data-parent="#filter" class="accordion-toggle"><%= t(:categories) %> <b class="web-symbol"></b></a>
</div>
</li>
<li class="accordion-group">
<div class="accordion-heading">
<a href="#collapse-tags" data-toggle="collapse" data-parent="#filter" class="accordion-toggle"><%= t(:tags) %> <b class="web-symbol"></b></a>
</div>
</li>
</ul>
<div class="filters accordion-group">
<div class="accordion-body collapse" id="collapse-status">
<%= render 'filter_status' %>
</div>
<div class="accordion-body collapse" id="collapse-category">
<%= render 'filter_categories' %>
</div>
<div class="accordion-body collapse" id="collapse-tags">
<%= render 'filter_tags' %>
</div>
<div id="sort_headers" class="table-label">
<%= render 'sort_headers' %>
</div>
</div>
</div>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "sort_header" %>
<% end %>

View File

@ -1,6 +0,0 @@
<div class="accordion-inner" data-toggle="buttons-checkbox">
<% @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 -%>
</div>
<%= render :partial => 'clear_filters', :locals => {:type => 'categories'} %>

View File

@ -1,6 +0,0 @@
<div class="accordion-inner" data-toggle="buttons-checkbox">
<%= 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?)%>
</div>
<%= render :partial => 'clear_filters', :locals => {:type => 'status'} %>

View File

@ -1,6 +0,0 @@
<div class="accordion-inner" data-toggle="buttons-checkbox">
<% @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 -%>
</div>
<%= render :partial => 'clear_filters', :locals => {:type => 'tags'} %>

View File

@ -1,198 +0,0 @@
<% # encoding: utf-8 %>
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %>
<%= stylesheet_link_tag "lib/main-list" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/file-type" %>
<%= javascript_include_tag "lib/module-area" %>
<% end %>
<%= f.error_messages %>
<!-- Input Area -->
<div class="input-area">
<!-- Module Tabs -->
<div class="nav-name"><strong><%= t(:module) %></strong></div>
<ul class="nav nav-pills module-nav">
<li></li>
<li class="active">
<a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
</li>
<% if show_form_status_field(@archive_file) %>
<li>
<a href="#status" data-toggle="tab"><%= t(:status) %></a>
</li>
<% end %>
<li>
<a href="#tag" data-toggle="tab"><%= t(:tags) %></a>
</li>
</ul>
<!-- Module -->
<div class="tab-content module-area">
<!-- Basic Module -->
<div class="tab-pane fade in active" id="basic">
<!-- Category -->
<div class="control-group">
<label class="control-label muted"><%= t(:category) %></label>
<div class="controls">
<%= f.select :category_id, @categories.collect{|t| [ t.title, t.id ]} %>
</div>
</div>
<!-- Sort -->
<div class="control-group">
<label class="control-label muted"><%= t(:sort_number) %></label>
<div class="controls">
<%= f.text_field :sort_number %>
</div>
</div>
</div>
<!-- Status Module -->
<% if show_form_status_field(@archive_file) %>
<div class="tab-pane fade" id="status">
<!-- Status -->
<div class="control-group">
<label class="control-label muted"><%= t(:status) %></label>
<div class="controls" data-toggle="buttons-checkbox">
<label class="checkbox inline btn <%= 'active' if @archive_file.is_top? %>">
<%= f.check_box :is_top %> <%= t(:top) %>
</label>
<label class="checkbox inline btn <%= 'active' if @archive_file.is_hot? %>">
<%= f.check_box :is_hot %> <%= t(:hot) %>
</label>
<label class="checkbox inline btn <%= 'active' if @archive_file.is_hidden? %>">
<%= f.check_box :is_hidden %> <%= t(:hide) %>
</label>
</div>
</div>
</div>
<% end %>
<!-- Tag Module -->
<div class="tab-pane fade" id="tag">
<!-- Tag -->
<div class="control-group">
<label class="control-label muted"><%= t(:tags) %></label>
<div class="controls" data-toggle="buttons-checkbox">
<% @tags.each do |tag| %>
<label class="checkbox inline btn <%= 'active' if @archive_file.tag_ids.include?(tag.id) %>">
<%= check_box_tag 'archive_file[tag_ids][]', tag.id, @archive_file.tag_ids.include?(tag.id) %> <%= tag.name %>
<%= hidden_field_tag 'archive_file[tag_ids][]', '' %>
</label>
<% end %>
</div>
</div>
</div>
</div>
<!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a>
</li>
<% end %>
</ul>
<!-- Language -->
<div class="tab-content language-area">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
<!-- Title-->
<div class="control-group input-title">
<label class="control-label muted"><%= t(:title) %></label>
<div class="controls">
<%= f.fields_for :title_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t(:title), value: (@archive_file.title_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
</div>
<% end %>
<!-- File -->
<div class="control-group">
<label class="control-label muted"><%= t(:file_) %></label>
<div class="controls">
<!-- Exist -->
<% if @archive_file && !@archive_file.archive_file_multiples.blank? %>
<div class="exist">
<% @archive_file.archive_file_multiples.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 %>
<hr>
</div>
<% end %>
<!-- Add -->
<div class="add-target">
</div>
<p class="add-btn">
<%= hidden_field_tag 'archive_file_multiple_field_count', @archive_file.archive_file_multiples.count %>
<a id="add_file" class="trigger btn btn-small btn-primary"><i class="icons-plus"></i> <%= t(:add) %></a>
</p>
</div>
</div>
</div>
</div>
<!-- Form Actions -->
<div class="form-actions">
<%= hidden_field_tag 'page', params[:page] if !params[:page].blank? %>
<%= f.submit t('submit'), class: 'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div>
<% content_for :page_specific_javascript do %>
<script>
$(document).ready(function() {
$('.main-forms .add-on').tooltip();
$(document).on('click', '#add_file', function(){
var new_id = $(this).prev().attr('value');
var old_id = new RegExp("new_archive_file_multiples", "g");
var on = $('.language-nav li.active').index();
var le = $(this).parent('.add-btn').prev('.add-target').children('.start-line').length;
$(this).prev().attr('value', parseInt(new_id) + 1);
$(this).parent().siblings('.add-target').append(("<%= escape_javascript(add_attribute 'form_file', f, :archive_file_multiples) %>").replace(old_id, new_id));
$(this).parent('.add-btn').prev('.add-target').children('.start-line').eq(le).children('.input-append').find('.tab-content').each(function() {
$(this).children('.tab-pane').eq(on).addClass('in active').siblings().removeClass('in active');
});
formTip();
});
$(document).on('click', '.delete_file', function(){
$(this).parents('.input-prepend').remove();
});
$(document).on('click', '.remove_existing_record', function(){
if(confirm("<%= I18n.t(:sure?)%>")){
$(this).children('.should_destroy').attr('value', 1);
$(this).parents('.start-line').hide();
}
});
});
</script>
<% end %>

View File

@ -1,66 +0,0 @@
<% if form_file.new_record? %>
<div class="fileupload fileupload-new start-line" data-provides="fileupload">
<% else %>
<div class="fileupload fileupload-exist start-line" data-provides="fileupload">
<% if form_file.file.blank? %>
<%= t(:no_file) %>
<% else %>
<%= link_to content_tag(:i) + form_file.file_identifier, form_file.file.url, {:class => 'file-link file-type', :target => '_blank', :title => form_file.file_identifier} %>
<% end %>
<% end %>
<div class="input-prepend input-append">
<label>
<span class="add-on btn btn-file" title="<%= t(:file_) %>">
<i class="icons-paperclip"></i>
<%= f.file_field :file %>
</span>
<div class="uneditable-input input-medium">
<i class="icon-file fileupload-exists"></i>
<span class="fileupload-preview"><%= (form_file.new_record? || form_file.file.blank?) ? t(:select_file) : t(:change_file) %></span>
</div>
</label>
<span class="add-on icons-pencil" title="<%= t('file.name') %>"></span>
<span class="tab-content">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
<%= f.fields_for :file_title_translations do |f| %>
<%= f.text_field locale, :class => "input-medium", placeholder: t('file.name'), :value => (form_file.file_title_translations[locale] rescue nil) %>
<% end %>
</span>
<% end %>
</span>
<span class="add-on icon-list-ol" title="<%= t(:sort_number) %>"></span>
<span class="tab-content">
<%= f.text_field :sort_number , :class => "input-mini" %>
</span>
<span class="add-on btn-group btn" title="<%= t('archive.show_lang') %>">
<i class="icons-earth"></i> <span class="caret"></span>
<ul class="dropdown-menu">
<% @site_in_use_locales.each do |locale| %>
<li>
<label class="checkbox">
<%= 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) %>
</label>
</li>
<% end %>
</ul>
<%= hidden_field_tag 'archive_file[archive_file_multiples_attributes][0][choose_lang][]', '' %>
</span>
<% if form_file.new_record? %>
<span class="delete_file add-on btn" title="<%= t(:delete_) %>">
<a class="icon-trash"></a>
</span>
<% else %>
<span class="remove_existing_record add-on btn" title="<%= t(:remove) %>">
<%= f.hidden_field :id %>
<a class=" icon-remove"></a>
<%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %>
</span>
<% end %>
</div>
</div>

View File

@ -1 +0,0 @@
$("#<%= dom_id @archive_file %>").remove();

View File

@ -1,5 +0,0 @@
<%= form_for @archive_file, url: panel_archive_back_end_archive_file_path(@archive_file), html: {class: "form-horizontal main-forms previewable"} do |f| %>
<fieldset>
<%= render partial: 'form', locals: {f: f} %>
</fieldset>
<% end %>

View File

@ -1,54 +0,0 @@
<% set_default_index do
objects @archive_files
quick_edit_link type: 'edit',
link: 'edit_panel_archive_back_end_archive_file_path'
quick_edit_link type: 'detail'
quick_edit_link type: 'delete',
link: 'panel_archive_back_end_archive_file_path'
field type: 'status',
db_field: @statuses,
translation: 'status',
hide: 'phone',
sort: 'status',
header_class: 'span2'
field type: 'associated',
db_field: 'category',
model_field: 'title',
translation: 'category',
hide: 'phone',
sort: 'category',
header_class: 'span2'
field db_field: 'title',
translation: 'title',
sort: 'title',
display_option: 'link_to value, panel_archive_front_end_archive_file_path(object)',
quick_edit: true,
header_class: 'span5'
field type: 'tags',
hide: 'all',
sort: 'tags'
field type: 'associated',
db_field: 'archive_file_multiples',
translation: 'file_',
display_option: "content_tag(:span, link_to(content_tag(:i) + object.file_identifier, object.file.url, target: '_blank'), class: 'file-type') unless object.file.blank?",
hide: 'all',
header_class: 'span2'
filter_field type: 'array',
values: @statuses,
translation: 'status'
filter_field type: 'objects',
values: @categories,
translation: 'category',
object_field: 'title'
filter_field type: 'objects',
values: @tags,
translation: 'tags',
object_field: 'name'
footer link: 'new_panel_archive_back_end_archive_file_path'
end %>
<%= render 'admin/default_index/index' %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/file-type" %>
<% end %>

View File

@ -1,7 +0,0 @@
$("#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} %>");

View File

@ -1,5 +0,0 @@
<%= form_for @archive_file, url: panel_archive_back_end_archive_files_path, html: {class: "form-horizontal main-forms previewable"} do |f| %>
<fieldset>
<%= render partial: 'form', locals: {f: f} %>
</fieldset>
<% end %>

View File

@ -1,98 +0,0 @@
<% # encoding: utf-8 %>
<% if @frontend_style == '1' %>
<div class="o-archives layout-table">
<table>
<thead>
<tr>
<th class="column-ctrl col-title"><%= sortable(:title, t("archive.Title"))%></th>
<th class="column-ctrl col-file"><%= t("archive.Files")%></th>
<th class="column-ctrl col-category"><%= sortable(:archive_file_category, t("archive.Category"))%></th>
</tr>
</thead>
<tbody>
<% @archive_files.each_with_index do |post,i| %>
<tr <% if ( (i + 1) % 2 ) == 0 %> class="even" <% end %>>
<td>
<div class="o-archives-title"><%= post.title %>
<% if !post.is_hot.blank? %><span class="o-archives-hot"><%= t('hot')%></span><% end %>
</div>
</td>
<td>
<div class="o-archives-list-item">
<% if !post.archive_file_multiples.blank? %>
<ol>
<% post.archive_file_multiples.asc(:sort_number).each do | afile | %>
<% if afile.file.file and afile.choose_lang_display(I18n.locale.to_s) %>
<li>
<%= link_to (!afile.file_title.blank? ? afile.file_title : t('archive.download') ), afile.file.url, {:target => '_blank', :title => afile.file_title, :class => "o-archives-file"} if afile.file.file %>
<%= post.get_file_icon(afile.file.url) %>
</li>
<% end %>
<% end %>
</ol>
<% end %>
</div>
</td>
<td><div class="o-archives-category">
<%= post.category.title if !post.category.blank? %>
</div></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<%= paginate @archive_files, :param_name => :page_main, :params => {:inner => 'false'} %>
<% elsif @frontend_style == '2' %>
<div class="o-archives">
<div class="o-archives-content">
<% @archive_file_datas.each do |afcpost| %>
<div class="o-archives-group">
<h2 class="o-archives-category h2"><%= afcpost["title"] %></h2>
<div class="o-archives-content">
<div class="o-archives-list">
<ul>
<% afcpost["archive_files"].each do |post| %>
<li>
<h3 class="o-archives-title h3">
<%= post["title"] %>
<% if !post["is_hot"].blank? %><span class="o-archives-hot"><%= t('hot')%></span><% end %>
</h3>
<div class="o-archives-list-item">
<ol>
<% post["archive_file_multiples"].each do | afile | %>
<li>
<%= link_to afile["file_title"], afile["url"], {:target => '_blank', :title => afile["file_title"], :class => "o-archives-file"} %>
<%= afile["icon"] %>
</li>
<% end %>
</ol>
</div>
</li>
<% end %>
</ul>
</div>
</div>
<% end %>
</div>
</div>
<% end %>
<%#= stylesheet_link_tag "archive/archives" %>

View File

@ -1,17 +0,0 @@
<%#= stylesheet_link_tag "default_widget" %>
<%= javascript_include_tag "mobile/jquery.mu.image.resize.js" %>
<div id="archive_file_widget">
<%= render 'index' %>
</div>
<%#= stylesheet_link_tag "archive/archives" %>

View File

@ -1 +0,0 @@
$('#archive_file_widget').html("<%= j render 'index' %>")

View File

@ -1,30 +0,0 @@
<div class="o-archives">
<div class="o-archives-content">
<div class="o-archives-group">
<h2 class="o-archives-category h2"><%= @archive_file.archive_file_category.title rescue nil %></h2>
<div class="o-archives-content">
<div class="o-archives-list">
<ul>
<li>
<h3 class="o-archives-title h3"><%= @archive_file.title %></h3>
<div class="o-archives-list-item">
<ol>
<% @archive_file.archive_file_multiples.each do | afile | %>
<% if afile.file.file and afile.choose_lang_display(I18n.locale.to_s) %>
<li>
<%= link_to (!afile.file_title.blank? ? afile.file_title : t('download_') ), afile.file.url, {:target => '_blank', :title => afile.file_title, :class => "o-archives-file"} if afile.file.file %>
<%= @archive_file.get_file_icon(afile.file.url) %>
</li>
<% end %>
<% end %>
</ol>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
<%= stylesheet_link_tag "archive/archives" %>

View File

@ -1,10 +0,0 @@
<% @bulletins.each do |bulletin| %>
<li>
<%= link_to bulletin.title, panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category_id , :tag_id => @selected_tag.id ) %>
</li>
<% end %>
<div class='pagination'>
<%= link_to_previous_page @bulletins, 'Previous Page', :params => {:controller => 'widget/bulletins', :action => 'reload_bulletins', :tag_id => @selected_tag.id}, :remote => true, :class => 'previous' %>
<%= link_to_next_page @bulletins, 'Next Page', :params => {:controller => 'widget/bulletins', :action => 'reload_bulletins', :tag_id => @selected_tag.id}, :remote => true, :class => 'next' %>
</div>

View File

@ -1,99 +0,0 @@
<% # encoding: utf-8 %>
<% if @title %>
<h2 class="h2"><%= @title %></h2>
<% end %>
<% if @widget_style == '1' %>
<div class="o-archives layout-table">
<table>
<thead>
<tr>
<th class="column-ctrl col-title"><%= sortable(:title, t("archive.Title"))%></th>
<th class="column-ctrl col-file"><%= t("archive.Files")%></th>
<th class="column-ctrl col-category"><%= sortable(:archive_file_category, t("archive.Category"))%></th>
</tr>
</thead>
<tbody>
<% @archive_files.each_with_index do |post,i| %>
<tr <% if ( (i + 1) % 2 ) == 0 %> class="even" <% end %>>
<td>
<div class="o-archives-title"><%= post.title %>
<% if !post.is_hot.blank? %><span class="o-archives-hot"><%= t('hot')%></span><% end %>
</div>
</td>
<td>
<div class="o-archives-list-item">
<% if !post.archive_file_multiples.blank? %>
<ol>
<% post.archive_file_multiples.asc(:_id).each do | afile | %>
<% if afile.file.file and afile.choose_lang_display(I18n.locale.to_s) %>
<li>
<%= link_to (!afile.file_title.blank? ? afile.file_title : t('archive.download') ), afile.file.url, {:target => '_blank', :title => afile.file_title, :class => "o-archives-file"} if afile.file.file %>
<%= post.get_file_icon(afile.file.url) %>
</li>
<% end %>
<% end %>
</ol>
<% end %>
</div>
</td>
<td><div class="o-archives-category">
<%= post.category.title if !post.category.blank? %>
</div></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% elsif @widget_style == '2' %>
<div class="o-archives">
<div class="o-archives-content">
<% @archive_file_datas.each do |afcpost| %>
<div class="o-archives-group">
<h2 class="o-archives-category h2"><%= afcpost["title"] %></h2>
<div class="o-archives-content">
<div class="o-archives-list">
<ul>
<% afcpost["archive_files"].each do |post| %>
<li>
<h3 class="o-archives-title h3">
<%= post["title"] %>
<% if !post["is_hot"].blank? %><span class="o-archives-hot"><%= t('hot')%></span><% end %>
</h3>
<div class="o-archives-list-item">
<ol>
<% post["archive_file_multiples"].each do | afile | %>
<li>
<%= link_to afile["file_title"], afile["url"], {:target => '_blank', :title => afile["file_title"], :class => "o-archives-file"} %>
<%= afile["icon"] %>
</li>
<% end %>
</ol>
</div>
</li>
<% end %>
</ul>
</div>
</div>
<% end %>
</div>
</div>
<% end %>
<div class="pull_right">
<% if !@archive_files.blank? or !@archive_file_datas.blank? %>
<% 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 %>
<% end %>
</div>

View File

@ -1,3 +0,0 @@
<li>
<%= link_to tag.name, panel_announcement_widget_bulletins_and_web_links_path(:id => tag.id), :remote => true, :class => ('active' if tag.eql?(@selected_tag)) %>
</li>

View File

@ -1,10 +0,0 @@
<% @web_links.each do |web_link| %>
<li>
<%= link_to web_link.title, web_link.url %>
</li>
<% end %>
<div class='pagination'>
<%= link_to_previous_page @web_links, 'Previous Page', :params => {:controller => 'widget/bulletins', :action => 'reload_web_links', :tag_id => @selected_tag.id}, :remote => true, :class => 'previous' %>
<%= link_to_next_page @web_links, 'Next Page', :params => {:controller => 'widget/bulletins', :action => 'reload_web_links', :tag_id => @selected_tag.id}, :remote => true, :class => 'next' %>
</div>

View File

@ -1,8 +0,0 @@
<%= 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] %>
<p>
<%= 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 %>
</p>
<% end %>

View File

@ -1,31 +0,0 @@
<% # encoding: utf-8 %>
<% if @bulletins and !@bulletins.nil? %>
<div class="tag_block">
<ul class="tag_list">
<% @tags.each do |tag| %>
<li><%= tag.name %></li>
<% end %>
</ul>
</div>
<% @tags.each_with_index do |tag, index| %>
<div id="news_<%= index %>" class="news_block">
<h3 class="news_title2"><%= t("announcement.bulletins") %></h3>
<div class="news_prev">prev</div>
<div class="news_next">next</div>
<ul class="news_list">
<% tag.bulletins.each do |post| %>
<li><%= link_to post.title, panel_announcement_front_end_bulletin_path(post) %></li>
<% end %>
</ul>
</div>
<% end %>
<% end %>

View File

@ -1,23 +0,0 @@
<!-- <div class="search"> <input type="text" onfocus="this.value='';this.searchClickFlag=true;" onblur="if(this.value==''){this.value='公告搜尋';this.searchClickFlag=false;}" value="公告搜尋" id="q" class="search_key" name="q"/> <input type="submit" name="sa" id="sa" class="sa" value="." /> </div> -->
<div class="category_list">
<h3 class="h3"><%= t(:categories) %></h3>
<ul class="list">
<% @bulletin_categorys.each do |category| %>
<li class="<%= category.id.to_s.eql?(params[:category_id]) ? 'active' : nil %>">
<%= link_to category.title, panel_announcement_front_end_bulletins_path(:category_id => category.id) %>
</li>
<% end %>
</ul>
</div>
<div class="tag_cloud">
<h3 class="h3"><%= t(:tag_cloud) %></h3>
<div class="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 %>
</div>
</div>
<!-- <div class="clear"></div> -->
<!-- <div class="rss_feed">
<a href="" class="rssimg"> Rss feed </a>
</div> -->

View File

@ -1,8 +0,0 @@
<%#= stylesheet_link_tag "default_widget" %>
<%= javascript_include_tag "mobile/jquery.mu.image.resize.js" %>
<div id="archive_file_widget">
<%= render 'index' %>
</div>
<%#= stylesheet_link_tag "archive/archives" %>

View File

@ -1 +0,0 @@
$('#archive_file_widget').html("<%= j render 'index' %>")

View File

@ -1 +0,0 @@
$('#bulletins_web_links_bulletins').html("<%= j render 'bulletins' if @bulletins %>")

View File

@ -1 +0,0 @@
$('#bulletins_web_links_web_links').html("<%= j render 'web_links' if @web_links %>")

View File

@ -1,23 +0,0 @@
$:.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

View File

@ -1,12 +0,0 @@
{
"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
}

View File

@ -1,13 +0,0 @@
en:
archive:
show_lang: Language
download: Download
archive: Archive
Title: Title
Files: Files
Category: Category
frontend:
archive: Archive Frontend
widget:
index: Archive Widget

View File

@ -1,17 +0,0 @@
zh_tw:
archive:
show_lang: 呈現語系
download: 檔案下載
archive: 檔案室
Title: 標題
Files: 檔案
Category: 類別
frontend:
archive: 檔案室前台
widget:
index: 檔案室Widget
mongoid:
attributes:
archive_file:
sort_number: 排序數

View File

@ -1,24 +0,0 @@
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

View File

@ -1,84 +0,0 @@
module Archive
OrbitApp.registration "Archive",: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"
style ["1","2"]
end
end
# category ["ArchiveFileCategory"]
authorizable
categorizable
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","2"]
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_controllers ({:private=>['archive_file_categorys','archive_files','module_tags', 'categories']})
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=>"admin_module_app_categories_path(get_module_app)" ,
:priority=>3,
:active_for_category => 'Archive',
:available_for => [:manager]
context_link 'tags',
:link_path=>"admin_module_tags_path(module_app_id: get_module_app)" ,
:priority=>4,
:active_for_tag => 'Archive',
:available_for => [:manager]
end
end
end

View File

@ -1,4 +0,0 @@
require "archive/engine"
module Archive
end

View File

@ -1,4 +0,0 @@
module Archive
class Engine < Rails::Engine
end
end

View File

@ -1,3 +0,0 @@
module Archive
VERSION = "0.0.1"
end

View File

@ -1,4 +0,0 @@
# desc "Explaining what the task does"
# task :archive do
# # Task goes here
# end

View File

@ -1,6 +0,0 @@
#!/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__)

View File

@ -1,7 +0,0 @@
require 'test_helper'
class ArchiveTest < ActiveSupport::TestCase
test "truth" do
assert_kind_of Module, Archive
end
end

View File

@ -1,7 +0,0 @@
#!/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

View File

@ -1,9 +0,0 @@
// 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 .

View File

@ -1,7 +0,0 @@
/*
* 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 .
*/

View File

@ -1,3 +0,0 @@
class ApplicationController < ActionController::Base
protect_from_forgery
end

View File

@ -1,2 +0,0 @@
module ApplicationHelper
end

View File

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Dummy</title>
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body>
<%= yield %>
</body>
</html>

View File

@ -1,4 +0,0 @@
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
run Dummy::Application

View File

@ -1,45 +0,0 @@
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

View File

@ -1,10 +0,0 @@
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__)

View File

@ -1,25 +0,0 @@
# 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

View File

@ -1,5 +0,0 @@
# Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
Dummy::Application.initialize!

View File

@ -1,30 +0,0 @@
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

View File

@ -1,60 +0,0 @@
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

View File

@ -1,39 +0,0 @@
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

View File

@ -1,7 +0,0 @@
# 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!

View File

@ -1,10 +0,0 @@
# 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

View File

@ -1,5 +0,0 @@
# 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

View File

@ -1,7 +0,0 @@
# 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'

View File

@ -1,8 +0,0 @@
# 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

View File

@ -1,14 +0,0 @@
# 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

View File

@ -1,5 +0,0 @@
# 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"

View File

@ -1,58 +0,0 @@
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

View File

@ -1,26 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>The page you were looking for doesn't exist (404)</title>
<style type="text/css">
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
div.dialog {
width: 25em;
padding: 0 4em;
margin: 4em auto 0 auto;
border: 1px solid #ccc;
border-right-color: #999;
border-bottom-color: #999;
}
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
</style>
</head>
<body>
<!-- This file lives in public/404.html -->
<div class="dialog">
<h1>The page you were looking for doesn't exist.</h1>
<p>You may have mistyped the address or the page may have moved.</p>
</div>
</body>
</html>

View File

@ -1,26 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>The change you wanted was rejected (422)</title>
<style type="text/css">
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
div.dialog {
width: 25em;
padding: 0 4em;
margin: 4em auto 0 auto;
border: 1px solid #ccc;
border-right-color: #999;
border-bottom-color: #999;
}
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
</style>
</head>
<body>
<!-- This file lives in public/422.html -->
<div class="dialog">
<h1>The change you wanted was rejected.</h1>
<p>Maybe you tried to change something you didn't have access to.</p>
</div>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More