diff --git a/app/views/layouts/_side_bar.html.erb b/app/views/layouts/_side_bar.html.erb index 3a36a48a7..ff61e2dab 100644 --- a/app/views/layouts/_side_bar.html.erb +++ b/app/views/layouts/_side_bar.html.erb @@ -48,6 +48,16 @@ <% end -%> <% end -%> +<%= content_tag :li, :class => active_for_controllers('archive_files', 'tags', 'archive_file_categorys') do -%> + <%= link_to content_tag(:i, nil, :class => 'icons-archive') + t('admin.archive'), panel_archive_back_end_archive_files_path %> + <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('archive_files', 'tags', 'archive_file_categorys')) do -%> + <%= content_tag :li, link_to(t('admin.all_articles'), panel_archive_back_end_archive_files_path), :class => active_for_action('archive_file', 'index') %> + <%= content_tag :li, link_to(t('admin.add_new'), new_panel_archive_back_end_archive_file_path), :class => active_for_action('archive_file', 'new') %> + <%= content_tag :li, link_to(t('admin.categories'), panel_archive_back_end_archive_file_categorys_path), :class => active_for_action('archive_file_categorys', 'index') %> + <%= content_tag :li, link_to(t('admin.tags'), panel_archive_back_end_tags_path), :class => active_for_action('tags', 'index') %> + <% end -%> +<% end -%> + <%= content_tag :li, :class => active_for_controllers(nil) do -%> <%= link_to content_tag(:i, nil, :class => 'icons-cog') + t('admin.site_settings'), nil %> <% end -%> diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_bulletin_category.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_bulletin_category.html.erb index 7f1b56268..e9396cba1 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_bulletin_category.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_bulletin_category.html.erb @@ -12,5 +12,4 @@ <% @site_valid_locales.each do |locale| %> <%= bulletin_category.i18n_variable[locale] rescue nil %> <% end %> - <%= bulletin_category.display %> diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/index.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/index.html.erb index 0a6e7f83b..28d2fde0c 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/index.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/index.html.erb @@ -8,7 +8,6 @@ <% @site_valid_locales.each do |locale| %> <%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %> <% end %> - <%= t('bulletin_category.display') %> diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb index ef437e4da..9c997914a 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb @@ -40,7 +40,7 @@
- <%= f.date_select :postdate, {:use_month_numbers => true, :prompt => { :month => 'Month', :day => 'Day', :year => 'Year'}, :order => [:day, :month, :year] }, {:class => 'input-small'} %> + <%= f.date_select :postdate, {:use_month_numbers => true, :order => [:day, :month, :year] }, {:class => 'input-small'} %>
diff --git a/vendor/built_in_modules/archive/.gitignore b/vendor/built_in_modules/archive/.gitignore new file mode 100644 index 000000000..1463de6df --- /dev/null +++ b/vendor/built_in_modules/archive/.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/archive/Gemfile b/vendor/built_in_modules/archive/Gemfile new file mode 100644 index 000000000..f92bd9029 --- /dev/null +++ b/vendor/built_in_modules/archive/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/archive/MIT-LICENSE b/vendor/built_in_modules/archive/MIT-LICENSE new file mode 100644 index 000000000..406f17b70 --- /dev/null +++ b/vendor/built_in_modules/archive/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/archive/README.rdoc b/vendor/built_in_modules/archive/README.rdoc new file mode 100644 index 000000000..2a19864e6 --- /dev/null +++ b/vendor/built_in_modules/archive/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/archive/Rakefile b/vendor/built_in_modules/archive/Rakefile new file mode 100644 index 000000000..b57290d4e --- /dev/null +++ b/vendor/built_in_modules/archive/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/archive/app/assets/images/archive/.gitkeep b/vendor/built_in_modules/archive/app/assets/images/archive/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/built_in_modules/archive/app/assets/javascripts/archive/.gitkeep b/vendor/built_in_modules/archive/app/assets/javascripts/archive/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/built_in_modules/archive/app/assets/stylesheets/archive/.gitkeep b/vendor/built_in_modules/archive/app/assets/stylesheets/archive/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/built_in_modules/archive/app/controllers/.gitkeep b/vendor/built_in_modules/archive/app/controllers/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/built_in_modules/archive/app/controllers/application_controller.rb b/vendor/built_in_modules/archive/app/controllers/application_controller.rb new file mode 100644 index 000000000..307a4acd8 --- /dev/null +++ b/vendor/built_in_modules/archive/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/archive/app/controllers/panel/archive/back_end/archive_file_categorys_controller.rb b/vendor/built_in_modules/archive/app/controllers/panel/archive/back_end/archive_file_categorys_controller.rb new file mode 100644 index 000000000..f9aba371d --- /dev/null +++ b/vendor/built_in_modules/archive/app/controllers/panel/archive/back_end/archive_file_categorys_controller.rb @@ -0,0 +1,97 @@ +class Panel::Archive::BackEnd::ArchiveFileCategorysController < OrbitBackendController + + def index + @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 + + # 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]) + @i18n_variable = @archive_file_category.i18n_variable + + @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.destroy + + respond_to do |format| + format.html { redirect_to(panel_archive_back_end_archive_file_categorys_url) } + # format.xml { head :ok } + format.js + end + end +end diff --git a/vendor/built_in_modules/archive/app/controllers/panel/archive/back_end/archive_files_controller.rb b/vendor/built_in_modules/archive/app/controllers/panel/archive/back_end/archive_files_controller.rb new file mode 100644 index 000000000..a4804bb56 --- /dev/null +++ b/vendor/built_in_modules/archive/app/controllers/panel/archive/back_end/archive_files_controller.rb @@ -0,0 +1,117 @@ +class Panel::Archive::BackEnd::ArchiveFilesController < OrbitBackendController + + before_filter :authenticate_user! + before_filter :is_admin? + + def index + + get_categorys(params[:archive_file_category_id]) + + @archive_files = ArchiveFile.all.page(params[:page]).per(10) + + get_tags + + respond_to do |format| + format.html # index.html.erb + format.xml { render :xml => @archive_files } + end + end + + # GET /archive_files/1 + # GET /archive_files/1.xml + def show + @archive_file = ArchiveFile.find(params[:id]) + # get_categorys + + 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 + + get_categorys + + 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]) + get_categorys + 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 + 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) } + 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 + + protected + + def get_categorys(id = nil) + @archive_file_categorys = (id ? ArchiveFileCategory.find(id).to_a : ArchiveFileCategory.excludes('disabled' => true)) + end + + def get_tags + module_app = ModuleApp.first(:conditions => {:key => 'archive'}) + @tags = Tag.all(:conditions => {:module_app_id => module_app.id}) + end + +end diff --git a/vendor/built_in_modules/archive/app/controllers/panel/archive/back_end/tags_controller.rb b/vendor/built_in_modules/archive/app/controllers/panel/archive/back_end/tags_controller.rb new file mode 100644 index 000000000..8dc1d4f3d --- /dev/null +++ b/vendor/built_in_modules/archive/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/archive/app/helpers/.gitkeep b/vendor/built_in_modules/archive/app/helpers/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/built_in_modules/archive/app/mailers/.gitkeep b/vendor/built_in_modules/archive/app/mailers/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/built_in_modules/archive/app/models/.gitkeep b/vendor/built_in_modules/archive/app/models/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/built_in_modules/archive/app/models/archive_file.rb b/vendor/built_in_modules/archive/app/models/archive_file.rb new file mode 100644 index 000000000..61546825a --- /dev/null +++ b/vendor/built_in_modules/archive/app/models/archive_file.rb @@ -0,0 +1,63 @@ +# encoding: utf-8 + +class ArchiveFile + include Mongoid::Document + include Mongoid::Timestamps + include Mongoid::MultiParameterAttributes + + + has_one :name, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy + + 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 + + belongs_to :archive_file_category + + validates_presence_of :name + + before_save :set_key + + 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, :name ) + + else + + find(:all).desc( :is_top, :name) + + end + + end + + + def self.widget_datas + + where( :is_hidden => false ).desc(:is_top, :name) + + end + + def is_top? + self.is_top + end + + def name + @name ||= I18nVariable.first(:conditions => {:key => 'name', :language_value_id => self.id, :language_value_type => self.class}) rescue nil + end + + protected + + def set_key + if name.new_record? + name.key = 'name' + end + end + +end \ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/models/archive_file_category.rb b/vendor/built_in_modules/archive/app/models/archive_file_category.rb new file mode 100644 index 000000000..abb08bd36 --- /dev/null +++ b/vendor/built_in_modules/archive/app/models/archive_file_category.rb @@ -0,0 +1,14 @@ +# encoding: utf-8 + +class ArchiveFileCategory + include Mongoid::Document + include Mongoid::Timestamps + # include Mongoid::MultiParameterAttributes + + field :key + + has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy + + has_many :archive_files + +end \ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/models/archive_tag.rb b/vendor/built_in_modules/archive/app/models/archive_tag.rb new file mode 100644 index 000000000..48aedc30f --- /dev/null +++ b/vendor/built_in_modules/archive/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/archive/app/views/.gitkeep b/vendor/built_in_modules/archive/app/views/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/_archive_file_category.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/_archive_file_category.html.erb new file mode 100644 index 000000000..c6bf4616c --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/_archive_file_category.html.erb @@ -0,0 +1,16 @@ + + + + + <%= archive_file_category.key %> +
+ +
+ + <% @site_valid_locales.each do |locale| %> + <%= archive_file_category.i18n_variable[locale] rescue nil %> + <% end %> + \ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/_form.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/_form.html.erb new file mode 100644 index 000000000..f79bbab06 --- /dev/null +++ b/vendor/built_in_modules/archive/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 :i18n_variable, (@archive_file_category.new_record? ? @archive_file_category.build_i18n_variable : @archive_file_category.i18n_variable) 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' %> +
+
+ <% end %> + <% end %> +
+ +
+ <%= f.submit 'Submit/送出', :class=>'btn btn-primary' %> +
+ +<% end %> + \ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/create.js.erb b/vendor/built_in_modules/archive/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/archive/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/archive/app/views/panel/archive/back_end/archive_file_categorys/destroy.js.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/destroy.js.erb new file mode 100644 index 000000000..a8b303ed1 --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/destroy.js.erb @@ -0,0 +1 @@ +$("#<%= dom_id @archive_file_category %>").remove(); \ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/edit.js.erb b/vendor/built_in_modules/archive/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/archive/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/archive/app/views/panel/archive/back_end/archive_file_categorys/index.html.erb b/vendor/built_in_modules/archive/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/archive/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/archive/app/views/panel/archive/back_end/archive_file_categorys/new.js.erb b/vendor/built_in_modules/archive/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/archive/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/archive/app/views/panel/archive/back_end/archive_file_categorys/update.js.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/update.js.erb new file mode 100644 index 000000000..9a6f431ef --- /dev/null +++ b/vendor/built_in_modules/archive/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 => 'link_category', :collection => [@archive_file_category] %>"); +<% @archive_file_category = WebLinkCategory.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/archive/app/views/panel/archive/back_end/archive_files/_archive_files.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_archive_files.html.erb new file mode 100644 index 000000000..701ba9890 --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_archive_files.html.erb @@ -0,0 +1,30 @@ + + + + <% if post.is_top? %> + <%= t(:top) %> + <% end %> + <% if post.is_hot? %> + <%= t(:hot) %> + <% end %> + <% if post.is_hidden? %> + <%= t(:hidden) %> + <% end %> +
+ +
+ + <%= post.archive_file_category.i18n_variable[I18n.locale] %> + + <%= link_to post.name[I18n.locale], panel_archive_back_end_archive_file_path(post) %> + + + <% post.tags.each do |tag| %> + <%= tag[I18n.locale] %> + <% end %> + + + diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_form.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_form.html.erb new file mode 100644 index 000000000..ef3e223b7 --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_form.html.erb @@ -0,0 +1,84 @@ +<% # 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[I18n.locale] %> + <% end %> +
+
+ +
+ + + + + +
+
+ + <%= f.label :category %> + <%= f.select :archive_file_category_id, @archive_file_categorys.collect {|t| [ t.i18n_variable[I18n.locale], t.id ]} %> + + + +
+ + <% @site_valid_locales.each_with_index do |locale, i| %> + +
"> +
+ <%= f.label :name %> + <%= f.fields_for :name, (@archive_file.new_record? ? @archive_file.build_name : @archive_file.name ) do |f| %> + <%= I18nVariable.from_locale(locale) %> + <%= f.text_field locale, :class=>'post-title' %> + <% end %> +
+ +
+ + <% end %> + +
+ +
+ + + + +
+ <%= f.submit t('submit'), :class=>'btn btn-primary' %> + <%= link_to t('cancel'), get_go_back, :class=>"btn" %> +
+ +
+ \ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/destroy.js.erb b/vendor/built_in_modules/archive/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/archive/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/archive/app/views/panel/archive/back_end/archive_files/edit.html.erb b/vendor/built_in_modules/archive/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/archive/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/archive/app/views/panel/archive/back_end/archive_files/index.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/index.html.erb new file mode 100644 index 000000000..b00a3c4c5 --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/index.html.erb @@ -0,0 +1,23 @@ + +<%= flash_messages %> + + + + + + + + + + + + + <% @archive_files.each do |post| %> + <%= render :partial => 'archive_files', :locals => {:post => post} %> + <% end %> + + +
<%= t('archive_file.status') %><%= t('archive_file.category') %><%= t('archive_file.name') %><%= t('archive_file.tags') %>
+ +<%= paginate @archive_files %> + diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/new.html.erb b/vendor/built_in_modules/archive/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/archive/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/archive/app/views/panel/archive/back_end/archive_files/show.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/show.html.erb new file mode 100644 index 000000000..f02d91569 --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/show.html.erb @@ -0,0 +1,57 @@ +<% # encoding: utf-8 %> + +
+
+
+ +

<%= flash_messages %>

+ +