From edf236c1c746a7d667c0d71e8a385b6427307710 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Feb 2012 15:38:27 +0800 Subject: [PATCH] edit tags --- app/controllers/admin/tags_controller.rb | 2 +- .../app/models/bulletin - 複製.rb | 101 ++++++ .../widget/bulletins/index.html - 複製.erb | 42 +++ .../built_in_modules/web_resource/.gitignore | 6 + vendor/built_in_modules/web_resource/Gemfile | 17 + .../built_in_modules/web_resource/MIT-LICENSE | 20 ++ .../built_in_modules/web_resource/README.rdoc | 3 + vendor/built_in_modules/web_resource/Rakefile | 39 +++ .../app/assets/images/web_resource/.gitkeep | 0 .../assets/javascripts/web_resource/.gitkeep | 0 .../assets/stylesheets/web_resource/.gitkeep | 0 .../web_resource/app/controllers/.gitkeep | 0 .../app/controllers/application_controller.rb | 23 ++ .../web_resource/back_end/tags_controller.rb | 8 + .../back_end/web_link_categorys_controller.rb | 112 ++++++ .../back_end/web_links_controller.rb | 109 ++++++ .../front_end/web_links_controller.rb | 34 ++ .../widget/bulletins_controller.rb | 30 ++ .../web_resource/app/helpers/.gitkeep | 0 .../web_resource/app/mailers/.gitkeep | 0 .../web_resource/app/models/.gitkeep | 0 .../web_resource/app/models/web_link.rb | 93 +++++ .../app/models/web_link_category.rb | 14 + .../app/models/web_resource_tag.rb | 5 + .../web_resource/app/views/.gitkeep | 0 .../web_link_categorys/_form.html.erb | 26 ++ .../_web_link_category.html.erb | 12 + .../back_end/web_link_categorys/create.js.erb | 2 + .../web_link_categorys/destroy.js.erb | 1 + .../back_end/web_link_categorys/edit.js.erb | 1 + .../web_link_categorys/index.html.erb | 43 +++ .../back_end/web_link_categorys/new.js.erb | 1 + .../web_link_categorys/quick_edit.js.erb | 3 + .../back_end/web_link_categorys/update.js.erb | 4 + .../back_end/web_links/_form.html.erb | 54 +++ .../back_end/web_links/_web_links.html.erb | 16 + .../back_end/web_links/destroy.js.erb | 1 + .../back_end/web_links/edit.html.erb | 16 + .../back_end/web_links/index.html.erb | 58 +++ .../back_end/web_links/new.html.erb | 24 ++ .../back_end/web_links/show.html.erb | 57 +++ .../back_end/web_links/toggle_enable.js.erb | 3 + .../front_end/web_links/index.html.erb | 30 ++ .../front_end/web_links/show.html.erb | 57 +++ .../widget/bulletins/index.html.erb | 42 +++ .../web_resource/config/locales/en.yml | 129 +++++++ .../web_resource/config/locales/zh_tw.yml | 330 ++++++++++++++++++ .../web_resource/config/routes.rb | 23 ++ .../lib/tasks/web_resource_tasks.rake | 4 + .../web_resource/lib/web_resource.rb | 4 + .../web_resource/lib/web_resource/engine.rb | 4 + .../web_resource/lib/web_resource/version.rb | 3 + .../web_resource/script/rails | 6 + .../web_resource/test/dummy/Rakefile | 7 + .../app/assets/javascripts/application.js | 9 + .../app/assets/stylesheets/application.css | 7 + .../app/controllers/application_controller.rb | 3 + .../dummy/app/helpers/application_helper.rb | 2 + .../test/dummy/app/mailers/.gitkeep | 0 .../test/dummy/app/models/.gitkeep | 0 .../app/views/layouts/application.html.erb | 14 + .../web_resource/test/dummy/config.ru | 4 + .../test/dummy/config/application.rb | 45 +++ .../web_resource/test/dummy/config/boot.rb | 10 + .../test/dummy/config/database.yml | 25 ++ .../test/dummy/config/environment.rb | 5 + .../dummy/config/environments/development.rb | 30 ++ .../dummy/config/environments/production.rb | 60 ++++ .../test/dummy/config/environments/test.rb | 39 +++ .../initializers/backtrace_silencers.rb | 7 + .../dummy/config/initializers/inflections.rb | 10 + .../dummy/config/initializers/mime_types.rb | 5 + .../dummy/config/initializers/secret_token.rb | 7 + .../config/initializers/session_store.rb | 8 + .../config/initializers/wrap_parameters.rb | 14 + .../test/dummy/config/locales/en.yml | 5 + .../web_resource/test/dummy/config/routes.rb | 58 +++ .../test/dummy/lib/assets/.gitkeep | 0 .../web_resource/test/dummy/log/.gitkeep | 0 .../web_resource/test/dummy/public/404.html | 26 ++ .../web_resource/test/dummy/public/422.html | 26 ++ .../web_resource/test/dummy/public/500.html | 26 ++ .../test/dummy/public/favicon.ico | 0 .../web_resource/test/dummy/script/rails | 6 + .../test/integration/navigation_test.rb | 10 + .../web_resource/test/test_helper.rb | 10 + .../web_resource/test/web_resource_test.rb | 7 + .../web_resource/web_resource.gemspec | 23 ++ .../web_resource/web_resource.json | 11 + 89 files changed, 2130 insertions(+), 1 deletion(-) create mode 100644 vendor/built_in_modules/announcement/app/models/bulletin - 複製.rb create mode 100644 vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/index.html - 複製.erb create mode 100644 vendor/built_in_modules/web_resource/.gitignore create mode 100644 vendor/built_in_modules/web_resource/Gemfile create mode 100644 vendor/built_in_modules/web_resource/MIT-LICENSE create mode 100644 vendor/built_in_modules/web_resource/README.rdoc create mode 100644 vendor/built_in_modules/web_resource/Rakefile create mode 100644 vendor/built_in_modules/web_resource/app/assets/images/web_resource/.gitkeep create mode 100644 vendor/built_in_modules/web_resource/app/assets/javascripts/web_resource/.gitkeep create mode 100644 vendor/built_in_modules/web_resource/app/assets/stylesheets/web_resource/.gitkeep create mode 100644 vendor/built_in_modules/web_resource/app/controllers/.gitkeep create mode 100644 vendor/built_in_modules/web_resource/app/controllers/application_controller.rb create mode 100644 vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/tags_controller.rb create mode 100644 vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_link_categorys_controller.rb create mode 100644 vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_links_controller.rb create mode 100644 vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/front_end/web_links_controller.rb create mode 100644 vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/widget/bulletins_controller.rb create mode 100644 vendor/built_in_modules/web_resource/app/helpers/.gitkeep create mode 100644 vendor/built_in_modules/web_resource/app/mailers/.gitkeep create mode 100644 vendor/built_in_modules/web_resource/app/models/.gitkeep create mode 100644 vendor/built_in_modules/web_resource/app/models/web_link.rb create mode 100644 vendor/built_in_modules/web_resource/app/models/web_link_category.rb create mode 100644 vendor/built_in_modules/web_resource/app/models/web_resource_tag.rb create mode 100644 vendor/built_in_modules/web_resource/app/views/.gitkeep create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/_form.html.erb create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/_web_link_category.html.erb create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/create.js.erb create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/destroy.js.erb create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/edit.js.erb create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/index.html.erb create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/new.js.erb create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/quick_edit.js.erb create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/update.js.erb create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_form.html.erb create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_links.html.erb create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/destroy.js.erb create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/edit.html.erb create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/index.html.erb create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/new.html.erb create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/show.html.erb create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/toggle_enable.js.erb create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/front_end/web_links/index.html.erb create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/front_end/web_links/show.html.erb create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/bulletins/index.html.erb create mode 100644 vendor/built_in_modules/web_resource/config/locales/en.yml create mode 100644 vendor/built_in_modules/web_resource/config/locales/zh_tw.yml create mode 100644 vendor/built_in_modules/web_resource/config/routes.rb create mode 100644 vendor/built_in_modules/web_resource/lib/tasks/web_resource_tasks.rake create mode 100644 vendor/built_in_modules/web_resource/lib/web_resource.rb create mode 100644 vendor/built_in_modules/web_resource/lib/web_resource/engine.rb create mode 100644 vendor/built_in_modules/web_resource/lib/web_resource/version.rb create mode 100644 vendor/built_in_modules/web_resource/script/rails create mode 100644 vendor/built_in_modules/web_resource/test/dummy/Rakefile create mode 100644 vendor/built_in_modules/web_resource/test/dummy/app/assets/javascripts/application.js create mode 100644 vendor/built_in_modules/web_resource/test/dummy/app/assets/stylesheets/application.css create mode 100644 vendor/built_in_modules/web_resource/test/dummy/app/controllers/application_controller.rb create mode 100644 vendor/built_in_modules/web_resource/test/dummy/app/helpers/application_helper.rb create mode 100644 vendor/built_in_modules/web_resource/test/dummy/app/mailers/.gitkeep create mode 100644 vendor/built_in_modules/web_resource/test/dummy/app/models/.gitkeep create mode 100644 vendor/built_in_modules/web_resource/test/dummy/app/views/layouts/application.html.erb create mode 100644 vendor/built_in_modules/web_resource/test/dummy/config.ru create mode 100644 vendor/built_in_modules/web_resource/test/dummy/config/application.rb create mode 100644 vendor/built_in_modules/web_resource/test/dummy/config/boot.rb create mode 100644 vendor/built_in_modules/web_resource/test/dummy/config/database.yml create mode 100644 vendor/built_in_modules/web_resource/test/dummy/config/environment.rb create mode 100644 vendor/built_in_modules/web_resource/test/dummy/config/environments/development.rb create mode 100644 vendor/built_in_modules/web_resource/test/dummy/config/environments/production.rb create mode 100644 vendor/built_in_modules/web_resource/test/dummy/config/environments/test.rb create mode 100644 vendor/built_in_modules/web_resource/test/dummy/config/initializers/backtrace_silencers.rb create mode 100644 vendor/built_in_modules/web_resource/test/dummy/config/initializers/inflections.rb create mode 100644 vendor/built_in_modules/web_resource/test/dummy/config/initializers/mime_types.rb create mode 100644 vendor/built_in_modules/web_resource/test/dummy/config/initializers/secret_token.rb create mode 100644 vendor/built_in_modules/web_resource/test/dummy/config/initializers/session_store.rb create mode 100644 vendor/built_in_modules/web_resource/test/dummy/config/initializers/wrap_parameters.rb create mode 100644 vendor/built_in_modules/web_resource/test/dummy/config/locales/en.yml create mode 100644 vendor/built_in_modules/web_resource/test/dummy/config/routes.rb create mode 100644 vendor/built_in_modules/web_resource/test/dummy/lib/assets/.gitkeep create mode 100644 vendor/built_in_modules/web_resource/test/dummy/log/.gitkeep create mode 100644 vendor/built_in_modules/web_resource/test/dummy/public/404.html create mode 100644 vendor/built_in_modules/web_resource/test/dummy/public/422.html create mode 100644 vendor/built_in_modules/web_resource/test/dummy/public/500.html create mode 100644 vendor/built_in_modules/web_resource/test/dummy/public/favicon.ico create mode 100644 vendor/built_in_modules/web_resource/test/dummy/script/rails create mode 100644 vendor/built_in_modules/web_resource/test/integration/navigation_test.rb create mode 100644 vendor/built_in_modules/web_resource/test/test_helper.rb create mode 100644 vendor/built_in_modules/web_resource/test/web_resource_test.rb create mode 100644 vendor/built_in_modules/web_resource/web_resource.gemspec create mode 100644 vendor/built_in_modules/web_resource/web_resource.json diff --git a/app/controllers/admin/tags_controller.rb b/app/controllers/admin/tags_controller.rb index 29527b57..d8d59f52 100644 --- a/app/controllers/admin/tags_controller.rb +++ b/app/controllers/admin/tags_controller.rb @@ -23,7 +23,7 @@ class Admin::TagsController < ApplicationController @tag = Tag.create(params[:tag]) else module_app = ModuleApp.find(params[:tag][:module_app_id]) - @tag = eval("#{module_app.key.capitalize}Tag").create(params[:tag]) + @tag = eval("#{module_app.key.camelize}Tag").create(params[:tag]) end end diff --git a/vendor/built_in_modules/announcement/app/models/bulletin - 複製.rb b/vendor/built_in_modules/announcement/app/models/bulletin - 複製.rb new file mode 100644 index 00000000..c65e65f7 --- /dev/null +++ b/vendor/built_in_modules/announcement/app/models/bulletin - 複製.rb @@ -0,0 +1,101 @@ +# encoding: utf-8 + +class Bulletin + include Mongoid::Document + include Mongoid::Timestamps + include Mongoid::MultiParameterAttributes + + # field :category_id, :type => Integer + field :title + # has_one :title_variable, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy + # has_one :subtitle_variable, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy + # has_one :text_variable, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy + field :subtitle + field :text + field :postdate , :type => Date + field :deadline , :type => Date + # field :url + field :create_user_id + field :update_user_id + + field :is_top, :type => Boolean, :default => false + + mount_uploader :image, ImageUploader + + belongs_to :bulletin_category + + embeds_many :bulletin_links, :cascade_callbacks => true + embeds_many :bulletin_files, :cascade_callbacks => true + + # has_many :bulletin_files, :autosave => true, :dependent => :destroy + + accepts_nested_attributes_for :bulletin_files, :allow_destroy => true + accepts_nested_attributes_for :bulletin_links, :allow_destroy => true + + # validates_presence_of :title_variable + validates_presence_of :title + + after_save :save_bulletin_links + after_save :save_bulletin_files + + + def self.search( search = nil, category_id = nil ) + + if category_id.to_s.size > 0 and search.to_s.size > 0 + + key = /#{search}/ + + find(:all, :conditions => {title: key, bulletin_category_id: category_id}).desc( :is_top, :postdate ) + + elsif category_id.to_s.size > 0 and search.to_s.size < 1 + + find(:all, :conditions => {bulletin_category_id: category_id}).desc( :is_top, :postdate ) + + elsif search.to_s.size > 0 and category_id.to_s.size < 1 + + key = /#{search}/ + + find(:all, :conditions => {title: key}).desc( :is_top, :postdate ) + else + + find(:all).desc( :is_top, :postdate) + + end + + end + + + def self.widget_datas + + date_now = Time.now + + # find(:all, :conditions => {:postdate => {"$lte" => Date.today}, deadline: nil} ).desc( :is_top, :postdate) + # where( :postdate.lte => date_now ).where( :deadline => nil ).desc(:is_top, :postdate) + # any_of({ :title => "test" },{:deadline => nil, :title => "123"}) + any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).limit(5) + + + end + + + def is_top? + self.is_top + end + + def save_bulletin_links + self.bulletin_links.each do |t| + if t.should_destroy + t.destroy + end + end + end + + def save_bulletin_files + self.bulletin_files.each do |t| + if t.should_destroy + t.destroy + end + end + end + +end \ No newline at end of file diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/index.html - 複製.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/index.html - 複製.erb new file mode 100644 index 00000000..2c4cd153 --- /dev/null +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/index.html - 複製.erb @@ -0,0 +1,42 @@ + + +<% if @bulletin and !@bulletin.nil? %> + +
+

<%= @bulletin.title %>

+

<%= @bulletin.subtitle %>

+ <%= link_to "read more >",panel_announcement_front_end_bulletin_path(@bulletin.id) %> + read more > +
+ +<% end %> + +<% if @bulletins and !@bulletins.nil? %> + +
+

news

+ +<%= link_to "read more >",panel_announcement_front_end_bulletins_path(), :class => "btn" %> +read more > +
+ +
+

news

+ +<%= link_to "read more >",panel_announcement_front_end_bulletins_path(), :class => "btn" %> +read more > +
+ +<% end %> diff --git a/vendor/built_in_modules/web_resource/.gitignore b/vendor/built_in_modules/web_resource/.gitignore new file mode 100644 index 00000000..1463de6d --- /dev/null +++ b/vendor/built_in_modules/web_resource/.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/web_resource/Gemfile b/vendor/built_in_modules/web_resource/Gemfile new file mode 100644 index 00000000..3dd698e7 --- /dev/null +++ b/vendor/built_in_modules/web_resource/Gemfile @@ -0,0 +1,17 @@ +source "http://rubygems.org" + +# Declare your gem's dependencies in web_resource.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/web_resource/MIT-LICENSE b/vendor/built_in_modules/web_resource/MIT-LICENSE new file mode 100644 index 00000000..406f17b7 --- /dev/null +++ b/vendor/built_in_modules/web_resource/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/web_resource/README.rdoc b/vendor/built_in_modules/web_resource/README.rdoc new file mode 100644 index 00000000..2764e5c7 --- /dev/null +++ b/vendor/built_in_modules/web_resource/README.rdoc @@ -0,0 +1,3 @@ += WebResource + +This project rocks and uses MIT-LICENSE. \ No newline at end of file diff --git a/vendor/built_in_modules/web_resource/Rakefile b/vendor/built_in_modules/web_resource/Rakefile new file mode 100644 index 00000000..d5065a39 --- /dev/null +++ b/vendor/built_in_modules/web_resource/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 = 'WebResource' + 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/web_resource/app/assets/images/web_resource/.gitkeep b/vendor/built_in_modules/web_resource/app/assets/images/web_resource/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/vendor/built_in_modules/web_resource/app/assets/javascripts/web_resource/.gitkeep b/vendor/built_in_modules/web_resource/app/assets/javascripts/web_resource/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/vendor/built_in_modules/web_resource/app/assets/stylesheets/web_resource/.gitkeep b/vendor/built_in_modules/web_resource/app/assets/stylesheets/web_resource/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/vendor/built_in_modules/web_resource/app/controllers/.gitkeep b/vendor/built_in_modules/web_resource/app/controllers/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/vendor/built_in_modules/web_resource/app/controllers/application_controller.rb b/vendor/built_in_modules/web_resource/app/controllers/application_controller.rb new file mode 100644 index 00000000..307a4acd --- /dev/null +++ b/vendor/built_in_modules/web_resource/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/web_resource/app/controllers/panel/web_resource/back_end/tags_controller.rb b/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/tags_controller.rb new file mode 100644 index 00000000..5ea3562a --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/tags_controller.rb @@ -0,0 +1,8 @@ +class Panel::WebResource::BackEnd::TagsController < Admin::TagsController + + def initialize + super + @app_title = 'web_resource' + end + +end diff --git a/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_link_categorys_controller.rb b/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_link_categorys_controller.rb new file mode 100644 index 00000000..3db38add --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_link_categorys_controller.rb @@ -0,0 +1,112 @@ +class Panel::WebResource::BackEnd::WebLinkCategorysController < ApplicationController + + layout 'admin' + + def index + @web_link_categorys = WebLinkCategory.all + @web_link_category = WebLinkCategory.new(:display => 'List') + + @url = panel_web_resource_back_end_web_link_categorys_path + + respond_to do |format| + format.html # index.html.erb + format.js + end + end + + # GET /web_links/1 + # GET /web_links/1.xml + def show + @web_link_category = WebLinkCategory.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.js + end + end + + # GET /web_links/new + # GET /web_links/new.xml + def new + @web_link_category = WebLinkCategory.new(:display => 'List') + + respond_to do |format| + format.html # new.html.erb + format.js + end + end + + def quick_edit + # debugger + + @web_link_category = WebLinkCategory.find(params[:web_link_category_id]) + + @url = panel_web_resource_back_end_web_link_category_path(@web_link_category) + + respond_to do |format| + format.js + end + + end + + # GET /web_links/1/edit + def edit + @web_link_category = WebLinkCategory.find(params[:id]) + @i18n_variable = @web_link_category.i18n_variable + + @url = panel_web_resource_back_end_web_link_category_path(@web_link_category) + + respond_to do |format| + format.html + format.js + end + end + + # POST /web_links + # POST /web_links.xml + def create + @web_link_category = WebLinkCategory.new(params[:web_link_category]) + + respond_to do |format| + if @web_link_category.save + format.html { redirect_to(panel_web_resource_back_end_web_link_categorys_url, :notice => t('web_link_category.create_web_link_category_success')) } + format.js + else + format.html { render :action => "new" } + format.js { render action: "new" } + end + end + end + + # PUT /web_links/1 + # PUT /web_links/1.xml + def update + @web_link_category = WebLinkCategory.find(params[:id]) + + @url = panel_web_resource_back_end_web_link_category_path(@web_link_category) + + respond_to do |format| + if @web_link_category.update_attributes(params[:web_link_category]) + format.html { redirect_to(panel_web_resource_back_end_web_link_categorys_url, :notice => t('web_link_category.update_web_link_category_success')) } + # format.xml { head :ok } + format.js + else + format.html { render :action => "edit" } + format.js { render :action => "edit" } + end + end + end + + # DELETE /web_links/1 + # DELETE /web_links/1.xml + def destroy + @web_link_category = WebLinkCategory.find(params[:id]) + @web_link_category.destroy + + respond_to do |format| + format.html { redirect_to(panel_web_resource_back_end_web_link_categorys_url) } + # format.xml { head :ok } + format.js + end + end +end diff --git a/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_links_controller.rb b/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_links_controller.rb new file mode 100644 index 00000000..9cdcd0a2 --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_links_controller.rb @@ -0,0 +1,109 @@ +class Panel::WebResource::BackEnd::WebLinksController < ApplicationController + + + layout 'admin' + + before_filter :authenticate_user! + before_filter :is_admin? + + def index + + get_categorys(params[:web_link_category_id]) + + @web_links = WebLink.search(params[:search],params[:category_id]) + + respond_to do |format| + format.html # index.html.erb + format.xml { render :xml => @web_links } + end + end + + # GET /web_links/1 + # GET /web_links/1.xml + def show + @web_link = WebLink.find(params[:id]) + # get_categorys + + respond_to do |format| + format.html # show.html.erb + format.xml { render :xml => @web_link } + end + end + + # GET /web_links/new + # GET /web_links/new.xml + def new + @web_link = WebLink.new + + get_categorys + + respond_to do |format| + format.html # new.html.erb + format.xml { render :xml => @web_link } + end + end + + # GET /web_links/1/edit + def edit + @web_link = WebLink.find(params[:id]) + get_categorys + end + + # POST /web_links + # POST /web_links.xml + def create + @web_link = WebLink.new(params[:web_link]) + + @web_link.create_user_id = current_user.id + @web_link.update_user_id = current_user.id + + respond_to do |format| + if @web_link.save + format.html { redirect_to(panel_web_resource_back_end_web_links_url, :notice => t('web_resource.create_web_resource_success')) } + format.xml { render :xml => @web_link, :status => :created, :location => @web_link } + else + format.html { render :action => "new" } + format.xml { render :xml => @web_link.errors, :status => :unprocessable_entity } + end + end + end + + # PUT /web_links/1 + # PUT /web_links/1.xml + def update + @web_link = WebLink.find(params[:id]) + + @web_link.update_user_id = current_user.id + + respond_to do |format| + if @web_link.update_attributes(params[:web_link]) + format.html { redirect_to(panel_web_resource_back_end_web_links_url, :notice => t('web_resource.update_web_resource_success')) } + format.js { render 'toggle_enable' } + format.xml { head :ok } + else + format.html { render :action => "edit" } + format.xml { render :xml => @web_link.errors, :status => :unprocessable_entity } + end + end + end + + # DELETE /web_links/1 + # DELETE /web_links/1.xml + def destroy + @web_link = WebLink.find(params[:id]) + @web_link.destroy + + respond_to do |format| + format.html { redirect_to(panel_web_resource_back_end_web_links_url) } + # format.xml { head :ok } + format.js + end + end + + protected + + def get_categorys(id = nil) + @web_link_categorys = (id ? WebLinkCategory.find(id).to_a : WebLinkCategory.excludes('disabled' => true)) + end + +end diff --git a/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/front_end/web_links_controller.rb b/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/front_end/web_links_controller.rb new file mode 100644 index 00000000..e7400b27 --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/front_end/web_links_controller.rb @@ -0,0 +1,34 @@ +class Panel::WebResource::FrontEnd::WebLinksController < ObitWidgetController + + def initialize + super + @app_title = NewBlog::MOUDLEAPP_TITLE + end + + # GET /web_links + # GET /web_links.xml + + def index + + date_now = Time.now + + # @web_links = WebLink.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(1) + + @web_links = WebLink.desc("is_top").page( params[:page]) + + get_categorys + end + + def show + @web_link = WebLink.find(params[:id]) + get_categorys + end + + + protected + + def get_categorys + @web_link_categorys = WebLinkCategory.excludes('disabled' => true) + end + +end diff --git a/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/widget/bulletins_controller.rb b/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/widget/bulletins_controller.rb new file mode 100644 index 00000000..5ba9ffc0 --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/widget/bulletins_controller.rb @@ -0,0 +1,30 @@ +class Panel::Announcement::Widget::BulletinsController < ObitWidgetController + + def initialize + super + @app_title = NewBlog::MOUDLEAPP_TITLE + end + + # GET /bulletins + # GET /bulletins.xml + + def index + + # deadline + + @bulletin = Bulletin.where( :postdate.lte => Date.today ).desc(:is_top, :postdate).first + + @bulletins = Bulletin.widget_datas + + get_categorys + + end + + + protected + + def get_categorys + @bulletin_categorys = BulletinCategory.excludes('disabled' => true) + end + +end diff --git a/vendor/built_in_modules/web_resource/app/helpers/.gitkeep b/vendor/built_in_modules/web_resource/app/helpers/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/vendor/built_in_modules/web_resource/app/mailers/.gitkeep b/vendor/built_in_modules/web_resource/app/mailers/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/vendor/built_in_modules/web_resource/app/models/.gitkeep b/vendor/built_in_modules/web_resource/app/models/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/vendor/built_in_modules/web_resource/app/models/web_link.rb b/vendor/built_in_modules/web_resource/app/models/web_link.rb new file mode 100644 index 00000000..364713a6 --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/models/web_link.rb @@ -0,0 +1,93 @@ +# encoding: utf-8 + +class WebLink + include Mongoid::Document + include Mongoid::Timestamps + include Mongoid::MultiParameterAttributes + + + has_one :name, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy + has_one :context, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy + + has_and_belongs_to_many :tags, :class_name => "WebResourceTag" + + field :url + 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 :web_link_category + + validates_presence_of :name + + before_save :set_key + + def self.search( search = nil, category_id = nil ) + + if category_id.to_s.size > 0 and search.to_s.size > 0 + + key = /#{search}/ + + find(:all, :conditions => {name: key, web_resource_category_id: category_id}).desc( :is_top, :postdate ) + + elsif category_id.to_s.size > 0 and search.to_s.size < 1 + + find(:all, :conditions => {web_resource_category_id: category_id}).desc( :is_top, :postdate ) + + elsif search.to_s.size > 0 and category_id.to_s.size < 1 + + key = /#{search}/ + + find(:all, :conditions => {name: key}).desc( :is_top, :postdate ) + else + + find(:all).desc( :is_top, :postdate) + + end + + end + + + def self.widget_datas + + date_now = Time.now + + # find(:all, :conditions => {:postdate => {"$lte" => Date.today}, deadline: nil} ).desc( :is_top, :postdate) + # where( :postdate.lte => date_now ).where( :deadline => nil ).desc(:is_top, :postdate) + # any_of({ :name => "test" },{:deadline => nil, :name => "123"}) + any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate) + + + 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 + + def context + @context ||= I18nVariable.first(:conditions => {:key => 'context', :language_value_id => self.id, :language_value_type => self.class}) rescue nil + end + + def text + @text ||= I18nVariable.first(:conditions => {:key => 'text', :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 + if context.new_record? + context.key = 'context' + end + end + +end \ No newline at end of file diff --git a/vendor/built_in_modules/web_resource/app/models/web_link_category.rb b/vendor/built_in_modules/web_resource/app/models/web_link_category.rb new file mode 100644 index 00000000..c2a95f4b --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/models/web_link_category.rb @@ -0,0 +1,14 @@ +# encoding: utf-8 + +class WebLinkCategory + include Mongoid::Document + include Mongoid::Timestamps + # include Mongoid::MultiParameterAttributes + + field :key + + has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy + + has_many :web_links + +end \ No newline at end of file diff --git a/vendor/built_in_modules/web_resource/app/models/web_resource_tag.rb b/vendor/built_in_modules/web_resource/app/models/web_resource_tag.rb new file mode 100644 index 00000000..724075cd --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/models/web_resource_tag.rb @@ -0,0 +1,5 @@ +class WebResourceTag < Tag + + has_and_belongs_to_many :web_resources + +end \ No newline at end of file diff --git a/vendor/built_in_modules/web_resource/app/views/.gitkeep b/vendor/built_in_modules/web_resource/app/views/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/_form.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/_form.html.erb new file mode 100644 index 00000000..7eb698ea --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/_form.html.erb @@ -0,0 +1,26 @@ +<% # encoding: utf-8 %> + +<%= form_for(@web_link_category, :remote => true, :url => @url) do |f| %> +<%#= form_for(@web_link_category, :remote => true, :url => panel_web_resource_back_end_web_link_category_path(@web_link_category)) do |f| %> + +
+ <%= f.label :key %>
+ <%= f.text_field :key %> +
+ +
+ <%= f.label :name %>
+ <%= f.fields_for :i18n_variable, (@web_link_category.new_record? ? @web_link_category.build_i18n_variable : @web_link_category.i18n_variable) do |f| %> + <% @site_valid_locales.each do |locale| %> + <%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %> + <%= f.text_field locale, :style => "width:130px" %> + <% end %> + <% end %> +
+ +
+ <%= f.submit %> +
+ +<% end %> + \ No newline at end of file diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/_web_link_category.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/_web_link_category.html.erb new file mode 100644 index 00000000..d6e27e8d --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/_web_link_category.html.erb @@ -0,0 +1,12 @@ + + + <%= web_link_category.key %> + <% @site_valid_locales.each do |locale| %> + <%= web_link_category.i18n_variable[locale] rescue nil %> + <% end %> + + <%= link_to t('web_link_category.edit'), edit_panel_web_resource_back_end_web_link_category_path(web_link_category), :remote => true %> | + <%= link_to t('web_link_category.quick_edit'), panel_web_resource_back_end_web_link_category_quick_edit_path(web_link_category), :remote => true %> | + <%= link_to t('web_link_category.delete'), panel_web_resource_back_end_web_link_category_path(web_link_category), :confirm => t('sure?'), :method => :delete, :remote => true %> + + \ No newline at end of file diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/create.js.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/create.js.erb new file mode 100644 index 00000000..de1f5f8f --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/create.js.erb @@ -0,0 +1,2 @@ +$('<%= j render :partial => 'web_link_category', :collection => [@web_link_category] %>').appendTo('#web_link_categorys').hide().fadeIn(); +$("#new_web_link_category")[0].reset(); \ No newline at end of file diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/destroy.js.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/destroy.js.erb new file mode 100644 index 00000000..bea99633 --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/destroy.js.erb @@ -0,0 +1 @@ +$("#<%= dom_id @web_link_category %>").remove(); \ No newline at end of file diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/edit.js.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/edit.js.erb new file mode 100644 index 00000000..eaff01fa --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_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/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/index.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/index.html.erb new file mode 100644 index 00000000..45842451 --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/index.html.erb @@ -0,0 +1,43 @@ +<% content_for :secondary do %> +
+
+
+
+
+ +<% end -%> + +<%= flash_messages %> + +

<%= t('web_link_category.list_web_resource_class') %>

+
+
+
+
+
+ + + + <% @site_valid_locales.each do |locale| %> + + <% end %> + + + +<%# @web_link_categorys.each do |post| %> + <%= render :partial => 'web_link_category', :collection => @web_link_categorys %> +<%# end %> + + +
+
+
+
+ +

Add New

+
<%= render :partial => "form" %>
+ + + diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/new.js.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/new.js.erb new file mode 100644 index 00000000..40061b9f --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/new.js.erb @@ -0,0 +1 @@ +$("#form > form").replaceWith("<%= j render "form" %>"); diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/quick_edit.js.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/quick_edit.js.erb new file mode 100644 index 00000000..82c957e9 --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/quick_edit.js.erb @@ -0,0 +1,3 @@ +$.each($(".quick_edit"),function(obj){ $(this).remove(); }); +$("#<%= dom_id @web_link_category %>").append("
<%= j render "form" %>
"); +//$("#form > form").replaceWith("<%= j render "form" %>"); diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/update.js.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/update.js.erb new file mode 100644 index 00000000..b3a45bd4 --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/update.js.erb @@ -0,0 +1,4 @@ +$("#<%= dom_id @web_link_category %>").replaceWith("<%= j render :partial => 'link_category', :collection => [@web_link_category] %>"); +<% @web_link_category = WebLinkCategory.new(:display => 'List') # reset for new form %> +$(".edit_web_link_category").replaceWith("<%= j render "form" %>") +$(".new_web_link_category")[0].reset(); \ No newline at end of file diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_form.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_form.html.erb new file mode 100644 index 00000000..e57cba07 --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_form.html.erb @@ -0,0 +1,54 @@ +<% # encoding: utf-8 %> + + <%= f.error_messages %> + <%#= debugger %> + +
+ <%= f.label :category %>
+ <%= f.select :web_link_category_id, @web_link_categorys.collect {|t| [ t.i18n_variable[I18n.locale], t.id ]} %> +
+ +
+ <%= f.label :name %> + <%= f.fields_for :name, (@web_link.new_record? ? @web_link.build_name : @web_link.name ) do |f| %> + <% @site_valid_locales.each do |locale| %> + + <%= I18nVariable.from_locale(locale) %> + <%= f.text_field locale %> + + <% end %> + <% end %> +
+ +
+ <%= f.label :url %>
+ <%= f.text_field :url, :size => 60 %> +
+ +
+ <%= f.label :describe %> + <%= f.fields_for :context, (@web_link.new_record? ? @web_link.build_context : @web_link.context ) do |f| %> + <% @site_valid_locales.each do |locale| %> + + <%= I18nVariable.from_locale(locale) %> + <%= f.text_area locale, :rows => 10, :cols => 40 %> + + <% end %> + <% end %> +
+ +
+ <%= f.label :status %>
+ <%= f.check_box :is_top %><%= t('top') %> + <%= f.check_box :is_hot %><%= t('hot') %> + <%= f.check_box :is_hidden %><%= t('hidden') %> +
+ +
+
+ + +
+ <%= f.submit %> +
+ \ No newline at end of file diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_links.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_links.html.erb new file mode 100644 index 00000000..fae2b22a --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_links.html.erb @@ -0,0 +1,16 @@ + + + + <%= post.web_link_category.i18n_variable[I18n.locale] %> + + <%= link_to post.name[I18n.locale], panel_web_resource_back_end_web_link_path(post) %> + + + <%= link_to t('web_link.edit'), edit_panel_web_resource_back_end_web_link_path(post) %> | + + <%= link_to t(:set_top), eval("panel_web_resource_back_end_web_link_path(post, :authenticity_token => form_authenticity_token, :web_link => {:is_top => true})"), :remote => true, :method => :put, :id => "disable_#{post.id}", :style => "display:#{post.is_top? ? 'none' : ''}", :class => 'switch' %> + <%= link_to t(:cancel_top), eval("panel_web_resource_back_end_web_link_path(post, :authenticity_token => form_authenticity_token, :web_link => {:is_top => false})"), :remote => true, :method => :put, :id => "enable_#{post.id}", :style => "display:#{post.is_top? ? '' : 'none'}", :class => 'switch' %> + + | <%= link_to t('web_link.delete'), panel_web_resource_back_end_web_link_path(post), :confirm => t('sure?'), :method => :delete, :remote => true %> + + diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/destroy.js.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/destroy.js.erb new file mode 100644 index 00000000..05490b09 --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/destroy.js.erb @@ -0,0 +1 @@ +$("#<%= dom_id @bulletin %>").remove(); \ No newline at end of file diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/edit.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/edit.html.erb new file mode 100644 index 00000000..3bf35d16 --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/edit.html.erb @@ -0,0 +1,16 @@ +
+
+
+
+ +

<%= t('web_resource.editing_web_resource') %>

+ +<%= form_for @web_link, :url => panel_web_resource_back_end_web_link_path(@web_link) do |f| %> + <%= render :partial => 'form', :locals => {:f => f} %> +<% end %> + +<%= link_back %> +
+
+
+
\ No newline at end of file diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/index.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/index.html.erb new file mode 100644 index 00000000..5e1fceee --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/index.html.erb @@ -0,0 +1,58 @@ +<% content_for :secondary do %> +
+
+
+
+
+ +<% end -%> + +<%= flash_messages %> + +
+
+
+
+
+ +
<%= t('web_link.search') %> + + <%= form_for :web_link, :action => 'search', :method => 'get', :url => panel_web_resource_back_end_web_links_path do |f| %> + + <%#= f.select :web_link_category_id, @web_link_categorys.collect {|t| [ t.i18n_variable[I18n.locale], t.id ] },{ :include_blank => t('web_link.select') }%> + + Category <%= select_tag "category_id", options_for_select(@web_link_categorys.collect{|t| [t.i18n_variable[I18n.locale], t.id]}), :prompt => t('web_link.select') %> + + KeyWord <%= text_field_tag :search, params[:search], :id => 'search_field' %> + + <%= submit_tag "Search", :name => nil %> + + <% end %> + + +
+ +
+
+ +

<%= t('web_link.list_link') %>

+ + + + + + + + + + <% @web_links.each do |post| %> + <%= render :partial => 'web_links', :locals => {:post => post} %> + <% end %> +
<%= t('web_link.status') %><%= t('web_link.category') %><%= t('web_link.name') %><%= t('web_link.action') %>
+ +
+ diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/new.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/new.html.erb new file mode 100644 index 00000000..5bc81f44 --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/new.html.erb @@ -0,0 +1,24 @@ +
+
+
+
+ +<% content_for :secondary do %> + +<% end -%> + +<%= flash_messages %> +

<%= t('web_link.new_web_resource') %>

+<%= form_for @web_link, :url => panel_web_resource_back_end_web_links_path do |f| %> + <%= render :partial => 'form', :locals => {:f => f} %> +<% end %> + +<%= link_back %> + + + +
+
+
\ No newline at end of file diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/show.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/show.html.erb new file mode 100644 index 00000000..c3ba2c09 --- /dev/null +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/show.html.erb @@ -0,0 +1,57 @@ +<% # encoding: utf-8 %> + +
+
+
+ +

<%= flash_messages %>

+ +