From f1b6771b345cdd2578ecf9615835614e46fcd358 Mon Sep 17 00:00:00 2001 From: Rueshyna Date: Tue, 15 Jan 2013 17:47:00 +0800 Subject: [PATCH] gprs byebye, location have two language, must have picture, long, lang have limit --- app/views/layouts/_side_bar_content.html.erb | 6 +- vendor/built_in_modules/gprs/README.rdoc | 3 - .../panel/gprs/back_end/locations_helper.rb | 2 - .../gprs/app/models/location.rb | 11 --- .../gprs/back_end/locations/_form.html.erb | 30 ------- .../gprs/back_end/locations/edit.html.erb | 4 - .../gprs/back_end/locations/new.html.erb | 3 - .../gprs/back_end/locations/show.html.erb | 0 vendor/built_in_modules/gprs/lib/gprs.rb | 4 - .../built_in_modules/gprs/test/gprs_test.rb | 7 -- .../gprs/back_end/locations_helper_test.rb | 4 - .../{gprs => location}/.gitignore | 0 .../{gprs => location}/Gemfile | 2 +- .../{gprs => location}/MIT-LICENSE | 0 vendor/built_in_modules/location/README.rdoc | 3 + .../{gprs => location}/Rakefile | 2 +- .../app/assets/images/location}/.gitkeep | 0 .../app/assets/javascripts/gprs/.gitkeep | 0 .../panel/location}/back_end/locations.js | 0 .../app/assets/stylesheets/location}/.gitkeep | 0 .../panel/location}/back_end/locations.css | 0 .../app/controllers/.gitkeep | 0 .../back_end/locations_controller.rb | 46 +++++----- .../{gprs => location}/app/helpers/.gitkeep | 0 .../location/back_end/locations_helper.rb | 2 + .../{gprs => location}/app/mailers/.gitkeep | 0 .../{gprs => location}/app/models/.gitkeep | 0 .../location/app/models/location_info.rb | 19 ++++ .../app/uploaders/locations_uploader.rb | 4 +- .../{gprs => location}/app/views/.gitkeep | 0 .../back_end/locations/_form.html.erb | 38 ++++++++ .../location/back_end/locations/edit.html.erb | 4 + .../back_end/locations/index.html.erb | 15 ++-- .../location/back_end/locations/new.html.erb | 3 + .../{gprs => location}/config/routes.rb | 2 +- .../built_in_modules/location/lib/location.rb | 4 + .../gprs => location/lib/location}/engine.rb | 2 +- .../gprs => location/lib/location}/version.rb | 2 +- .../lib/tasks/location_tasks.rake} | 2 +- .../location.gemspec} | 10 +-- .../built_in_modules/location/location.json | 12 +++ .../{gprs => location}/script/rails | 0 .../{gprs => location}/test/dummy/Rakefile | 0 .../app/assets/javascripts/application.js | 0 .../app/assets/stylesheets/application.css | 0 .../app/controllers/application_controller.rb | 0 .../dummy/app/helpers/application_helper.rb | 0 .../test/dummy/app/mailers/.gitkeep | 0 .../test/dummy/app/models/.gitkeep | 0 .../app/views/layouts/application.html.erb | 0 .../{gprs => location}/test/dummy/config.ru | 0 .../test/dummy/config/application.rb | 2 +- .../test/dummy/config/boot.rb | 0 .../test/dummy/config/database.yml | 0 .../test/dummy/config/environment.rb | 0 .../dummy/config/environments/development.rb | 0 .../dummy/config/environments/production.rb | 0 .../test/dummy/config/environments/test.rb | 0 .../initializers/backtrace_silencers.rb | 0 .../dummy/config/initializers/inflections.rb | 0 .../dummy/config/initializers/mime_types.rb | 0 .../dummy/config/initializers/secret_token.rb | 0 .../config/initializers/session_store.rb | 0 .../config/initializers/wrap_parameters.rb | 0 .../test/dummy/config/locales/en.yml | 0 .../test/dummy/config/routes.rb | 0 .../test/dummy/lib/assets/.gitkeep | 0 .../test/dummy/log/.gitkeep | 0 .../test/dummy/public/404.html | 0 .../test/dummy/public/422.html | 0 .../test/dummy/public/500.html | 0 .../test/dummy/public/favicon.ico | 0 .../test/dummy/script/rails | 0 .../back_end/locations_controller_test.rb | 2 +- .../test/integration/navigation_test.rb | 0 .../location/test/location_test.rb | 7 ++ .../{gprs => location}/test/test_helper.rb | 0 .../back_end/locations_helper_test.rb | 4 + .../desktop/journal_lists_controller.rb | 2 - .../desktop/journal_pages/_form.html.erb | 88 +++++++++---------- .../desktop/journal_pages/_form_file.html.erb | 12 ++- 81 files changed, 196 insertions(+), 167 deletions(-) delete mode 100644 vendor/built_in_modules/gprs/README.rdoc delete mode 100644 vendor/built_in_modules/gprs/app/helpers/panel/gprs/back_end/locations_helper.rb delete mode 100644 vendor/built_in_modules/gprs/app/models/location.rb delete mode 100644 vendor/built_in_modules/gprs/app/views/panel/gprs/back_end/locations/_form.html.erb delete mode 100644 vendor/built_in_modules/gprs/app/views/panel/gprs/back_end/locations/edit.html.erb delete mode 100644 vendor/built_in_modules/gprs/app/views/panel/gprs/back_end/locations/new.html.erb delete mode 100644 vendor/built_in_modules/gprs/app/views/panel/gprs/back_end/locations/show.html.erb delete mode 100644 vendor/built_in_modules/gprs/lib/gprs.rb delete mode 100644 vendor/built_in_modules/gprs/test/gprs_test.rb delete mode 100644 vendor/built_in_modules/gprs/test/unit/helpers/panel/gprs/back_end/locations_helper_test.rb rename vendor/built_in_modules/{gprs => location}/.gitignore (100%) rename vendor/built_in_modules/{gprs => location}/Gemfile (91%) rename vendor/built_in_modules/{gprs => location}/MIT-LICENSE (100%) create mode 100644 vendor/built_in_modules/location/README.rdoc rename vendor/built_in_modules/{gprs => location}/Rakefile (96%) rename vendor/built_in_modules/{gprs/app/assets/images/gprs => location/app/assets/images/location}/.gitkeep (100%) rename vendor/built_in_modules/{gprs => location}/app/assets/javascripts/gprs/.gitkeep (100%) rename vendor/built_in_modules/{gprs/app/assets/javascripts/panel/gprs => location/app/assets/javascripts/panel/location}/back_end/locations.js (100%) rename vendor/built_in_modules/{gprs/app/assets/stylesheets/gprs => location/app/assets/stylesheets/location}/.gitkeep (100%) rename vendor/built_in_modules/{gprs/app/assets/stylesheets/panel/gprs => location/app/assets/stylesheets/panel/location}/back_end/locations.css (100%) rename vendor/built_in_modules/{gprs => location}/app/controllers/.gitkeep (100%) rename vendor/built_in_modules/{gprs/app/controllers/panel/gprs => location/app/controllers/panel/location}/back_end/locations_controller.rb (55%) rename vendor/built_in_modules/{gprs => location}/app/helpers/.gitkeep (100%) create mode 100644 vendor/built_in_modules/location/app/helpers/panel/location/back_end/locations_helper.rb rename vendor/built_in_modules/{gprs => location}/app/mailers/.gitkeep (100%) rename vendor/built_in_modules/{gprs => location}/app/models/.gitkeep (100%) create mode 100644 vendor/built_in_modules/location/app/models/location_info.rb rename app/uploaders/gprs_uploader.rb => vendor/built_in_modules/location/app/uploaders/locations_uploader.rb (92%) rename vendor/built_in_modules/{gprs => location}/app/views/.gitkeep (100%) create mode 100644 vendor/built_in_modules/location/app/views/panel/location/back_end/locations/_form.html.erb create mode 100644 vendor/built_in_modules/location/app/views/panel/location/back_end/locations/edit.html.erb rename vendor/built_in_modules/{gprs/app/views/panel/gprs => location/app/views/panel/location}/back_end/locations/index.html.erb (67%) create mode 100644 vendor/built_in_modules/location/app/views/panel/location/back_end/locations/new.html.erb rename vendor/built_in_modules/{gprs => location}/config/routes.rb (88%) create mode 100644 vendor/built_in_modules/location/lib/location.rb rename vendor/built_in_modules/{gprs/lib/gprs => location/lib/location}/engine.rb (71%) rename vendor/built_in_modules/{gprs/lib/gprs => location/lib/location}/version.rb (60%) rename vendor/built_in_modules/{gprs/lib/tasks/gprs_tasks.rake => location/lib/tasks/location_tasks.rake} (76%) rename vendor/built_in_modules/{gprs/gprs.gemspec => location/location.gemspec} (72%) create mode 100644 vendor/built_in_modules/location/location.json rename vendor/built_in_modules/{gprs => location}/script/rails (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/Rakefile (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/app/assets/javascripts/application.js (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/app/assets/stylesheets/application.css (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/app/controllers/application_controller.rb (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/app/helpers/application_helper.rb (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/app/mailers/.gitkeep (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/app/models/.gitkeep (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/app/views/layouts/application.html.erb (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/config.ru (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/config/application.rb (98%) rename vendor/built_in_modules/{gprs => location}/test/dummy/config/boot.rb (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/config/database.yml (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/config/environment.rb (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/config/environments/development.rb (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/config/environments/production.rb (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/config/environments/test.rb (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/config/initializers/backtrace_silencers.rb (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/config/initializers/inflections.rb (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/config/initializers/mime_types.rb (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/config/initializers/secret_token.rb (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/config/initializers/session_store.rb (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/config/initializers/wrap_parameters.rb (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/config/locales/en.yml (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/config/routes.rb (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/lib/assets/.gitkeep (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/log/.gitkeep (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/public/404.html (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/public/422.html (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/public/500.html (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/public/favicon.ico (100%) rename vendor/built_in_modules/{gprs => location}/test/dummy/script/rails (100%) rename vendor/built_in_modules/{gprs/test/functional/panel/gprs => location/test/functional/panel/location}/back_end/locations_controller_test.rb (68%) rename vendor/built_in_modules/{gprs => location}/test/integration/navigation_test.rb (100%) create mode 100644 vendor/built_in_modules/location/test/location_test.rb rename vendor/built_in_modules/{gprs => location}/test/test_helper.rb (100%) create mode 100644 vendor/built_in_modules/location/test/unit/helpers/panel/location/back_end/locations_helper_test.rb delete mode 100644 vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_lists_controller.rb diff --git a/app/views/layouts/_side_bar_content.html.erb b/app/views/layouts/_side_bar_content.html.erb index f5d54d9b..037b8a56 100644 --- a/app/views/layouts/_side_bar_content.html.erb +++ b/app/views/layouts/_side_bar_content.html.erb @@ -69,8 +69,8 @@ <%= content_tag :li, link_to(t(:tags), panel_calendar_back_end_tags_path), :class => active_for_action('/panel/calendar/back_end/tags', 'index')if (is_manager? rescue nil) %> <% end -%> <% end %> -<%= content_tag :li, :class => active_for_controllers('locations') || active_for_app_auth("gprs") do -%> - <%= link_to content_tag(:i, nil, :class => 'icons-location') + content_tag(:span, t(:location)), panel_gprs_back_end_locations_path %> +<%= content_tag :li, :class => active_for_controllers('locations') do -%> + <%= link_to content_tag(:i, nil, :class => 'icons-location') + content_tag(:span, t(:location)), panel_location_back_end_locations_path %> <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('locations') ) do -%> <% end -%> <% end %> @@ -79,4 +79,4 @@ <% flash.each do |key, msg| %> <%= content_tag :span, msg, :class => [key, "notice label label-warning"] %> <% end %> - \ No newline at end of file + diff --git a/vendor/built_in_modules/gprs/README.rdoc b/vendor/built_in_modules/gprs/README.rdoc deleted file mode 100644 index 6cc30110..00000000 --- a/vendor/built_in_modules/gprs/README.rdoc +++ /dev/null @@ -1,3 +0,0 @@ -= Gprs - -This project rocks and uses MIT-LICENSE. \ No newline at end of file diff --git a/vendor/built_in_modules/gprs/app/helpers/panel/gprs/back_end/locations_helper.rb b/vendor/built_in_modules/gprs/app/helpers/panel/gprs/back_end/locations_helper.rb deleted file mode 100644 index 50985d54..00000000 --- a/vendor/built_in_modules/gprs/app/helpers/panel/gprs/back_end/locations_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module Panel::Gprs::BackEnd::LocationsHelper -end diff --git a/vendor/built_in_modules/gprs/app/models/location.rb b/vendor/built_in_modules/gprs/app/models/location.rb deleted file mode 100644 index f6455920..00000000 --- a/vendor/built_in_modules/gprs/app/models/location.rb +++ /dev/null @@ -1,11 +0,0 @@ -class Location - include Mongoid::Document - include Mongoid::Timestamps - - mount_uploader :file, GprsUploader - - field :name - field :description - field :longitude, type: Float - field :latitude, type: Float -end diff --git a/vendor/built_in_modules/gprs/app/views/panel/gprs/back_end/locations/_form.html.erb b/vendor/built_in_modules/gprs/app/views/panel/gprs/back_end/locations/_form.html.erb deleted file mode 100644 index 62e8b21b..00000000 --- a/vendor/built_in_modules/gprs/app/views/panel/gprs/back_end/locations/_form.html.erb +++ /dev/null @@ -1,30 +0,0 @@ -
- -
- <%= f.text_field :name, :class=>"span4", :placeholder => "Area" %> -
-
-
- -
- <%= f.file_field :file %> -
-
-
- -
- <%= f.text_field :longitude, :class=>"span2", :placeholder => "Longitude" %> - <%= f.text_field :latitude, :class=>"span2", :placeholder => "Langitude" %> -
-
-
- -
- <%= f.text_area :description, :class=>"span4", :cols=>"30", :row=>"5" %> -
-
-
-
- <%= f.submit "Save", :class=>"btn" %> -
-
diff --git a/vendor/built_in_modules/gprs/app/views/panel/gprs/back_end/locations/edit.html.erb b/vendor/built_in_modules/gprs/app/views/panel/gprs/back_end/locations/edit.html.erb deleted file mode 100644 index 82a59afa..00000000 --- a/vendor/built_in_modules/gprs/app/views/panel/gprs/back_end/locations/edit.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<%= form_for @location, :url=> panel_gprs_back_end_location_path(@location), :html => { :class=>"form-horizontal"} do |f| %> - <%= render :partial => 'form', :locals => {:f => f} %> -<% end %> - diff --git a/vendor/built_in_modules/gprs/app/views/panel/gprs/back_end/locations/new.html.erb b/vendor/built_in_modules/gprs/app/views/panel/gprs/back_end/locations/new.html.erb deleted file mode 100644 index 4f911d83..00000000 --- a/vendor/built_in_modules/gprs/app/views/panel/gprs/back_end/locations/new.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= form_for @location, :url=> panel_gprs_back_end_locations_path, :html => { :class=>"form-horizontal"} do |f| %> - <%= render :partial => 'form', :locals => {:f => f} %> -<% end %> diff --git a/vendor/built_in_modules/gprs/app/views/panel/gprs/back_end/locations/show.html.erb b/vendor/built_in_modules/gprs/app/views/panel/gprs/back_end/locations/show.html.erb deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/built_in_modules/gprs/lib/gprs.rb b/vendor/built_in_modules/gprs/lib/gprs.rb deleted file mode 100644 index 7a4d99e7..00000000 --- a/vendor/built_in_modules/gprs/lib/gprs.rb +++ /dev/null @@ -1,4 +0,0 @@ -require "gprs/engine" - -module Gprs -end diff --git a/vendor/built_in_modules/gprs/test/gprs_test.rb b/vendor/built_in_modules/gprs/test/gprs_test.rb deleted file mode 100644 index 1ab42707..00000000 --- a/vendor/built_in_modules/gprs/test/gprs_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class GprsTest < ActiveSupport::TestCase - test "truth" do - assert_kind_of Module, Gprs - end -end diff --git a/vendor/built_in_modules/gprs/test/unit/helpers/panel/gprs/back_end/locations_helper_test.rb b/vendor/built_in_modules/gprs/test/unit/helpers/panel/gprs/back_end/locations_helper_test.rb deleted file mode 100644 index e1302ea2..00000000 --- a/vendor/built_in_modules/gprs/test/unit/helpers/panel/gprs/back_end/locations_helper_test.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test_helper' - -class Panel::Gprs::BackEnd::LocationsHelperTest < ActionView::TestCase -end diff --git a/vendor/built_in_modules/gprs/.gitignore b/vendor/built_in_modules/location/.gitignore similarity index 100% rename from vendor/built_in_modules/gprs/.gitignore rename to vendor/built_in_modules/location/.gitignore diff --git a/vendor/built_in_modules/gprs/Gemfile b/vendor/built_in_modules/location/Gemfile similarity index 91% rename from vendor/built_in_modules/gprs/Gemfile rename to vendor/built_in_modules/location/Gemfile index cdc455ae..a6e487f4 100644 --- a/vendor/built_in_modules/gprs/Gemfile +++ b/vendor/built_in_modules/location/Gemfile @@ -1,6 +1,6 @@ source "http://rubygems.org" -# Declare your gem's dependencies in gprs.gemspec. +# Declare your gem's dependencies in location.gemspec. # Bundler will treat runtime dependencies like base dependencies, and # development dependencies will be added by default to the :development group. gemspec diff --git a/vendor/built_in_modules/gprs/MIT-LICENSE b/vendor/built_in_modules/location/MIT-LICENSE similarity index 100% rename from vendor/built_in_modules/gprs/MIT-LICENSE rename to vendor/built_in_modules/location/MIT-LICENSE diff --git a/vendor/built_in_modules/location/README.rdoc b/vendor/built_in_modules/location/README.rdoc new file mode 100644 index 00000000..937b4141 --- /dev/null +++ b/vendor/built_in_modules/location/README.rdoc @@ -0,0 +1,3 @@ += Location + +This project rocks and uses MIT-LICENSE. diff --git a/vendor/built_in_modules/gprs/Rakefile b/vendor/built_in_modules/location/Rakefile similarity index 96% rename from vendor/built_in_modules/gprs/Rakefile rename to vendor/built_in_modules/location/Rakefile index e9f3324c..66353374 100644 --- a/vendor/built_in_modules/gprs/Rakefile +++ b/vendor/built_in_modules/location/Rakefile @@ -14,7 +14,7 @@ end RDoc::Task.new(:rdoc) do |rdoc| rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'Gprs' + rdoc.title = 'Location' rdoc.options << '--line-numbers' rdoc.rdoc_files.include('README.rdoc') rdoc.rdoc_files.include('lib/**/*.rb') diff --git a/vendor/built_in_modules/gprs/app/assets/images/gprs/.gitkeep b/vendor/built_in_modules/location/app/assets/images/location/.gitkeep similarity index 100% rename from vendor/built_in_modules/gprs/app/assets/images/gprs/.gitkeep rename to vendor/built_in_modules/location/app/assets/images/location/.gitkeep diff --git a/vendor/built_in_modules/gprs/app/assets/javascripts/gprs/.gitkeep b/vendor/built_in_modules/location/app/assets/javascripts/gprs/.gitkeep similarity index 100% rename from vendor/built_in_modules/gprs/app/assets/javascripts/gprs/.gitkeep rename to vendor/built_in_modules/location/app/assets/javascripts/gprs/.gitkeep diff --git a/vendor/built_in_modules/gprs/app/assets/javascripts/panel/gprs/back_end/locations.js b/vendor/built_in_modules/location/app/assets/javascripts/panel/location/back_end/locations.js similarity index 100% rename from vendor/built_in_modules/gprs/app/assets/javascripts/panel/gprs/back_end/locations.js rename to vendor/built_in_modules/location/app/assets/javascripts/panel/location/back_end/locations.js diff --git a/vendor/built_in_modules/gprs/app/assets/stylesheets/gprs/.gitkeep b/vendor/built_in_modules/location/app/assets/stylesheets/location/.gitkeep similarity index 100% rename from vendor/built_in_modules/gprs/app/assets/stylesheets/gprs/.gitkeep rename to vendor/built_in_modules/location/app/assets/stylesheets/location/.gitkeep diff --git a/vendor/built_in_modules/gprs/app/assets/stylesheets/panel/gprs/back_end/locations.css b/vendor/built_in_modules/location/app/assets/stylesheets/panel/location/back_end/locations.css similarity index 100% rename from vendor/built_in_modules/gprs/app/assets/stylesheets/panel/gprs/back_end/locations.css rename to vendor/built_in_modules/location/app/assets/stylesheets/panel/location/back_end/locations.css diff --git a/vendor/built_in_modules/gprs/app/controllers/.gitkeep b/vendor/built_in_modules/location/app/controllers/.gitkeep similarity index 100% rename from vendor/built_in_modules/gprs/app/controllers/.gitkeep rename to vendor/built_in_modules/location/app/controllers/.gitkeep diff --git a/vendor/built_in_modules/gprs/app/controllers/panel/gprs/back_end/locations_controller.rb b/vendor/built_in_modules/location/app/controllers/panel/location/back_end/locations_controller.rb similarity index 55% rename from vendor/built_in_modules/gprs/app/controllers/panel/gprs/back_end/locations_controller.rb rename to vendor/built_in_modules/location/app/controllers/panel/location/back_end/locations_controller.rb index 1ba13703..5594bb7f 100644 --- a/vendor/built_in_modules/gprs/app/controllers/panel/gprs/back_end/locations_controller.rb +++ b/vendor/built_in_modules/location/app/controllers/panel/location/back_end/locations_controller.rb @@ -1,13 +1,11 @@ -class Panel::Gprs::BackEnd::LocationsController < OrbitBackendController +class Panel::Location::BackEnd::LocationsController < OrbitBackendController + include AdminHelper - #before_filter :clean_values, :only => [:create, :update] - - before_filter :force_order_for_visitor,:only => [:index, :new, :edit, :delete] + before_filter :force_order_for_visitor,:only => [:index, :new, :edit, :create, :update, :delete] before_filter :force_order_for_user,:except => [:get_locations,:index] - #before_filter :for_app_sub_manager,:except => [:index, :new, :edit, :delete, :get_locations] def index - @locations = Location.all + @location_infos = LocationInfo.all respond_to do |format| format.html # new.html.erb format.json { render json: @locations } @@ -15,7 +13,7 @@ class Panel::Gprs::BackEnd::LocationsController < OrbitBackendController end def new - @location = Location.new + @location_info = LocationInfo.new respond_to do |format| format.html # new.html.erb @@ -24,11 +22,11 @@ class Panel::Gprs::BackEnd::LocationsController < OrbitBackendController end def edit - @location = Location.find(params[:id]) + @location_info = LocationInfo.find(params[:id]) end def show - @location = Location.find(params[:id]) + @location_info = LocationInfo.find(params[:id]) respond_to do |format| format.html format.json { render json: @location } @@ -36,29 +34,34 @@ class Panel::Gprs::BackEnd::LocationsController < OrbitBackendController end def create - @location = Location.new(params[:location]) - @location.save! - redirect_to panel_gprs_back_end_locations_url + @location_info = LocationInfo.new(params[:location_info]) + if @location_info.save + flash[:success] = "Success!!" + redirect_to panel_location_back_end_locations_url + else + error_msg = @location_info.errors.full_messages + render 'new' + end end def update - @location = Location.find(params[:id]) - @location.update_attributes(params[:location]) - redirect_to panel_gprs_back_end_locations_url + @location_info = LocationInfo.find(params[:id]) + @location_info.update_attributes(params[:location_info]) + redirect_to panel_location_back_end_locations_url end def destroy - @location = Location.find(params[:id]) - @location.destroy - redirect_to panel_gprs_back_end_locations_url + @location_info = LocationInfo.find(params[:id]) + @location_info.destroy + redirect_to panel_location_back_end_locations_url end def get_locations - locations = Location.all + location_infos = LocationInfo.all @data = Array.new - locations.each do |location| + location_infos.each do |location| picurl = location.file.blank? ? '' : "http://#{request.host_with_port + location.file.url}" thumburl = location.file.blank? ? '' : "http://#{request.host_with_port + location.file.thumb.url}" @data << { name: location.name, @@ -69,9 +72,6 @@ class Panel::Gprs::BackEnd::LocationsController < OrbitBackendController description: location.description } end - #print readable json render :json => JSON.pretty_generate({location: @data}) - - #render :json => {location: @data}.to_json end end diff --git a/vendor/built_in_modules/gprs/app/helpers/.gitkeep b/vendor/built_in_modules/location/app/helpers/.gitkeep similarity index 100% rename from vendor/built_in_modules/gprs/app/helpers/.gitkeep rename to vendor/built_in_modules/location/app/helpers/.gitkeep diff --git a/vendor/built_in_modules/location/app/helpers/panel/location/back_end/locations_helper.rb b/vendor/built_in_modules/location/app/helpers/panel/location/back_end/locations_helper.rb new file mode 100644 index 00000000..a354c2c9 --- /dev/null +++ b/vendor/built_in_modules/location/app/helpers/panel/location/back_end/locations_helper.rb @@ -0,0 +1,2 @@ +module Panel::Location::BackEnd::LocationsHelper +end diff --git a/vendor/built_in_modules/gprs/app/mailers/.gitkeep b/vendor/built_in_modules/location/app/mailers/.gitkeep similarity index 100% rename from vendor/built_in_modules/gprs/app/mailers/.gitkeep rename to vendor/built_in_modules/location/app/mailers/.gitkeep diff --git a/vendor/built_in_modules/gprs/app/models/.gitkeep b/vendor/built_in_modules/location/app/models/.gitkeep similarity index 100% rename from vendor/built_in_modules/gprs/app/models/.gitkeep rename to vendor/built_in_modules/location/app/models/.gitkeep diff --git a/vendor/built_in_modules/location/app/models/location_info.rb b/vendor/built_in_modules/location/app/models/location_info.rb new file mode 100644 index 00000000..23e87841 --- /dev/null +++ b/vendor/built_in_modules/location/app/models/location_info.rb @@ -0,0 +1,19 @@ +class LocationInfo + include Mongoid::Document + include Mongoid::Timestamps + + mount_uploader :file, LocationsUploader + + field :name, localize: true + field :description, localize: true + field :longitude, type: Float + field :latitude, type: Float + + validates :file, presence: true + validates :longitude, + numericality: { less_than_or_equal_to: 180.0, greater_than_or_equal_to: -180.0 }, + unless: Proc.new{self.longitude.blank?} + validates :latitude, + numericality: { less_than_or_equal_to: 90.0, greater_than_or_equal_to: -90.0 }, + unless: Proc.new{self.latitude.blank?} +end diff --git a/app/uploaders/gprs_uploader.rb b/vendor/built_in_modules/location/app/uploaders/locations_uploader.rb similarity index 92% rename from app/uploaders/gprs_uploader.rb rename to vendor/built_in_modules/location/app/uploaders/locations_uploader.rb index 4ce41321..55056a5b 100644 --- a/app/uploaders/gprs_uploader.rb +++ b/vendor/built_in_modules/location/app/uploaders/locations_uploader.rb @@ -1,4 +1,4 @@ -class GprsUploader < CarrierWave::Uploader::Base +class LocationsUploader < CarrierWave::Uploader::Base # Include RMagick or ImageScience support: # include CarrierWave::RMagick @@ -12,7 +12,7 @@ class GprsUploader < CarrierWave::Uploader::Base # Override the directory where uploaded files will be stored. # This is a sensible default for uploaders that are meant to be mounted: def store_dir - "gprs/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" + "location/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end # Provide a default URL as a default if there hasn't been a file uploaded: diff --git a/vendor/built_in_modules/gprs/app/views/.gitkeep b/vendor/built_in_modules/location/app/views/.gitkeep similarity index 100% rename from vendor/built_in_modules/gprs/app/views/.gitkeep rename to vendor/built_in_modules/location/app/views/.gitkeep diff --git a/vendor/built_in_modules/location/app/views/panel/location/back_end/locations/_form.html.erb b/vendor/built_in_modules/location/app/views/panel/location/back_end/locations/_form.html.erb new file mode 100644 index 00000000..d38b744c --- /dev/null +++ b/vendor/built_in_modules/location/app/views/panel/location/back_end/locations/_form.html.erb @@ -0,0 +1,38 @@ + <% @location_info.errors.full_messages.each do |msg| %> +
  • * <%= msg %>
  • + <% end %> +
    + +
    + <%= f.fields_for :name_translations do |f| %> + <%= f.text_field locale, :class=>'span4', :value => (@location_info.name_translations[locale.to_s] rescue nil) %> + <% end %> +
    +
    +
    + +
    + <%= @location_info.file? ? ( link_to t(:view), @location_info.file.url, {:class => 'for_preview btn', :target => '_blank', :title => t(:view)}) : '' %> + <%= f.file_field :file %> +
    +
    +
    + +
    + <%= f.text_field :longitude, :class=>"span2", :placeholder => "Longitude" %> + <%= f.text_field :latitude, :class=>"span2", :placeholder => "Langitude" %> +
    +
    +
    + +
    + <%= f.fields_for :description_translations do |f| %> + <%= f.text_area locale, :class=>'span4', :cols=>"30", :row=>"5", :value => (@location_info.description_translations[locale.to_s] rescue nil) %> + <% end %> +
    +
    +
    +
    + <%= f.submit t("submit"), :class=>"btn" %> +
    +
    diff --git a/vendor/built_in_modules/location/app/views/panel/location/back_end/locations/edit.html.erb b/vendor/built_in_modules/location/app/views/panel/location/back_end/locations/edit.html.erb new file mode 100644 index 00000000..357907d8 --- /dev/null +++ b/vendor/built_in_modules/location/app/views/panel/location/back_end/locations/edit.html.erb @@ -0,0 +1,4 @@ +<%= form_for @location_info, :url=> panel_location_back_end_location_path(@location_info), :html => { :class=>"form-horizontal"} do |f| %> + <%= render :partial => 'form', :locals => {:f => f} %> +<% end %> + diff --git a/vendor/built_in_modules/gprs/app/views/panel/gprs/back_end/locations/index.html.erb b/vendor/built_in_modules/location/app/views/panel/location/back_end/locations/index.html.erb similarity index 67% rename from vendor/built_in_modules/gprs/app/views/panel/gprs/back_end/locations/index.html.erb rename to vendor/built_in_modules/location/app/views/panel/location/back_end/locations/index.html.erb index 95b72b73..12d23773 100644 --- a/vendor/built_in_modules/gprs/app/views/panel/gprs/back_end/locations/index.html.erb +++ b/vendor/built_in_modules/location/app/views/panel/location/back_end/locations/index.html.erb @@ -13,22 +13,21 @@ - <% @locations.each do |location| %> + <% @location_infos.each do |location| %> <%= image_tag(location.file, alt: location.file, size: "50x50" ) if !location.file.blank? %> - <%= location.name%> + <%= location.name %> <%= location.longitude%> <%= location.latitude%> - <%= location.description%> + <%= location.description %> <%if is_manager? %> - <%= link_to 'Edit', edit_panel_gprs_back_end_location_path(location) %> - <%= link_to 'Destroy', panel_gprs_back_end_location_path(location), method: :delete , :confirm => t(:sure?) %> + <%= link_to 'Edit', edit_panel_location_back_end_location_path(location) %> + <%= link_to 'Destroy', panel_location_back_end_location_path(location), method: :delete , :confirm => t(:sure?) %> <%end%> - <% end %> <%if is_manager? %> -<%= link_to 'New', new_panel_gprs_back_end_location_path %> -<% end %> \ No newline at end of file +<%= link_to 'New', new_panel_location_back_end_location_path %> +<% end %> diff --git a/vendor/built_in_modules/location/app/views/panel/location/back_end/locations/new.html.erb b/vendor/built_in_modules/location/app/views/panel/location/back_end/locations/new.html.erb new file mode 100644 index 00000000..36545064 --- /dev/null +++ b/vendor/built_in_modules/location/app/views/panel/location/back_end/locations/new.html.erb @@ -0,0 +1,3 @@ +<%= form_for @location_info, :url=> panel_location_back_end_locations_path, :html => { :class=>"form-horizontal"} do |f| %> + <%= render :partial => 'form', :locals => {:f => f} %> +<% end %> diff --git a/vendor/built_in_modules/gprs/config/routes.rb b/vendor/built_in_modules/location/config/routes.rb similarity index 88% rename from vendor/built_in_modules/gprs/config/routes.rb rename to vendor/built_in_modules/location/config/routes.rb index 0ba8a27c..f7332d21 100644 --- a/vendor/built_in_modules/gprs/config/routes.rb +++ b/vendor/built_in_modules/location/config/routes.rb @@ -1,6 +1,6 @@ Rails.application.routes.draw do namespace :panel do - namespace :gprs do + namespace :location do namespace :back_end do match "locations/get_locations" => "locations#get_locations" diff --git a/vendor/built_in_modules/location/lib/location.rb b/vendor/built_in_modules/location/lib/location.rb new file mode 100644 index 00000000..cd134803 --- /dev/null +++ b/vendor/built_in_modules/location/lib/location.rb @@ -0,0 +1,4 @@ +require "location/engine" + +module Location +end diff --git a/vendor/built_in_modules/gprs/lib/gprs/engine.rb b/vendor/built_in_modules/location/lib/location/engine.rb similarity index 71% rename from vendor/built_in_modules/gprs/lib/gprs/engine.rb rename to vendor/built_in_modules/location/lib/location/engine.rb index 42da611a..161a9bbd 100644 --- a/vendor/built_in_modules/gprs/lib/gprs/engine.rb +++ b/vendor/built_in_modules/location/lib/location/engine.rb @@ -1,4 +1,4 @@ -module Gprs +module Location class Engine < Rails::Engine end end diff --git a/vendor/built_in_modules/gprs/lib/gprs/version.rb b/vendor/built_in_modules/location/lib/location/version.rb similarity index 60% rename from vendor/built_in_modules/gprs/lib/gprs/version.rb rename to vendor/built_in_modules/location/lib/location/version.rb index bf13294d..95df884b 100644 --- a/vendor/built_in_modules/gprs/lib/gprs/version.rb +++ b/vendor/built_in_modules/location/lib/location/version.rb @@ -1,3 +1,3 @@ -module Gprs +module Location VERSION = "0.0.1" end diff --git a/vendor/built_in_modules/gprs/lib/tasks/gprs_tasks.rake b/vendor/built_in_modules/location/lib/tasks/location_tasks.rake similarity index 76% rename from vendor/built_in_modules/gprs/lib/tasks/gprs_tasks.rake rename to vendor/built_in_modules/location/lib/tasks/location_tasks.rake index ba45136c..152c5d6b 100644 --- a/vendor/built_in_modules/gprs/lib/tasks/gprs_tasks.rake +++ b/vendor/built_in_modules/location/lib/tasks/location_tasks.rake @@ -1,4 +1,4 @@ # desc "Explaining what the task does" -# task :gprs do +# task :location do # # Task goes here # end diff --git a/vendor/built_in_modules/gprs/gprs.gemspec b/vendor/built_in_modules/location/location.gemspec similarity index 72% rename from vendor/built_in_modules/gprs/gprs.gemspec rename to vendor/built_in_modules/location/location.gemspec index a701f924..439256b7 100644 --- a/vendor/built_in_modules/gprs/gprs.gemspec +++ b/vendor/built_in_modules/location/location.gemspec @@ -1,17 +1,17 @@ $:.push File.expand_path("../lib", __FILE__) # Maintain your gem's version: -require "gprs/version" +require "location/version" # Describe your gem and declare its dependencies: Gem::Specification.new do |s| - s.name = "gprs" - s.version = Gprs::VERSION + s.name = "location" + s.version = Location::VERSION s.authors = ["TODO: Your name"] s.email = ["TODO: Your email"] s.homepage = "TODO" - s.summary = "TODO: Summary of Gprs." - s.description = "TODO: Description of Gprs." + s.summary = "TODO: Summary of Location." + s.description = "TODO: Description of Location." s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"] s.test_files = Dir["test/**/*"] diff --git a/vendor/built_in_modules/location/location.json b/vendor/built_in_modules/location/location.json new file mode 100644 index 00000000..01e89b5d --- /dev/null +++ b/vendor/built_in_modules/location/location.json @@ -0,0 +1,12 @@ +{ + "title": "location", + "version": "0.1", + "organization": "Rulingcom", + "author": "RD dep", + "intro": "A simple blog……", + "update_info": "Some info", + "create_date": "11-11-2011", + "widgets": [], + "category": [], + "enable_frontend": false +} diff --git a/vendor/built_in_modules/gprs/script/rails b/vendor/built_in_modules/location/script/rails similarity index 100% rename from vendor/built_in_modules/gprs/script/rails rename to vendor/built_in_modules/location/script/rails diff --git a/vendor/built_in_modules/gprs/test/dummy/Rakefile b/vendor/built_in_modules/location/test/dummy/Rakefile similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/Rakefile rename to vendor/built_in_modules/location/test/dummy/Rakefile diff --git a/vendor/built_in_modules/gprs/test/dummy/app/assets/javascripts/application.js b/vendor/built_in_modules/location/test/dummy/app/assets/javascripts/application.js similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/app/assets/javascripts/application.js rename to vendor/built_in_modules/location/test/dummy/app/assets/javascripts/application.js diff --git a/vendor/built_in_modules/gprs/test/dummy/app/assets/stylesheets/application.css b/vendor/built_in_modules/location/test/dummy/app/assets/stylesheets/application.css similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/app/assets/stylesheets/application.css rename to vendor/built_in_modules/location/test/dummy/app/assets/stylesheets/application.css diff --git a/vendor/built_in_modules/gprs/test/dummy/app/controllers/application_controller.rb b/vendor/built_in_modules/location/test/dummy/app/controllers/application_controller.rb similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/app/controllers/application_controller.rb rename to vendor/built_in_modules/location/test/dummy/app/controllers/application_controller.rb diff --git a/vendor/built_in_modules/gprs/test/dummy/app/helpers/application_helper.rb b/vendor/built_in_modules/location/test/dummy/app/helpers/application_helper.rb similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/app/helpers/application_helper.rb rename to vendor/built_in_modules/location/test/dummy/app/helpers/application_helper.rb diff --git a/vendor/built_in_modules/gprs/test/dummy/app/mailers/.gitkeep b/vendor/built_in_modules/location/test/dummy/app/mailers/.gitkeep similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/app/mailers/.gitkeep rename to vendor/built_in_modules/location/test/dummy/app/mailers/.gitkeep diff --git a/vendor/built_in_modules/gprs/test/dummy/app/models/.gitkeep b/vendor/built_in_modules/location/test/dummy/app/models/.gitkeep similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/app/models/.gitkeep rename to vendor/built_in_modules/location/test/dummy/app/models/.gitkeep diff --git a/vendor/built_in_modules/gprs/test/dummy/app/views/layouts/application.html.erb b/vendor/built_in_modules/location/test/dummy/app/views/layouts/application.html.erb similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/app/views/layouts/application.html.erb rename to vendor/built_in_modules/location/test/dummy/app/views/layouts/application.html.erb diff --git a/vendor/built_in_modules/gprs/test/dummy/config.ru b/vendor/built_in_modules/location/test/dummy/config.ru similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/config.ru rename to vendor/built_in_modules/location/test/dummy/config.ru diff --git a/vendor/built_in_modules/gprs/test/dummy/config/application.rb b/vendor/built_in_modules/location/test/dummy/config/application.rb similarity index 98% rename from vendor/built_in_modules/gprs/test/dummy/config/application.rb rename to vendor/built_in_modules/location/test/dummy/config/application.rb index f03b73e0..e98216b3 100644 --- a/vendor/built_in_modules/gprs/test/dummy/config/application.rb +++ b/vendor/built_in_modules/location/test/dummy/config/application.rb @@ -3,7 +3,7 @@ require File.expand_path('../boot', __FILE__) require 'rails/all' Bundler.require -require "gprs" +require "location" module Dummy class Application < Rails::Application diff --git a/vendor/built_in_modules/gprs/test/dummy/config/boot.rb b/vendor/built_in_modules/location/test/dummy/config/boot.rb similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/config/boot.rb rename to vendor/built_in_modules/location/test/dummy/config/boot.rb diff --git a/vendor/built_in_modules/gprs/test/dummy/config/database.yml b/vendor/built_in_modules/location/test/dummy/config/database.yml similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/config/database.yml rename to vendor/built_in_modules/location/test/dummy/config/database.yml diff --git a/vendor/built_in_modules/gprs/test/dummy/config/environment.rb b/vendor/built_in_modules/location/test/dummy/config/environment.rb similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/config/environment.rb rename to vendor/built_in_modules/location/test/dummy/config/environment.rb diff --git a/vendor/built_in_modules/gprs/test/dummy/config/environments/development.rb b/vendor/built_in_modules/location/test/dummy/config/environments/development.rb similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/config/environments/development.rb rename to vendor/built_in_modules/location/test/dummy/config/environments/development.rb diff --git a/vendor/built_in_modules/gprs/test/dummy/config/environments/production.rb b/vendor/built_in_modules/location/test/dummy/config/environments/production.rb similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/config/environments/production.rb rename to vendor/built_in_modules/location/test/dummy/config/environments/production.rb diff --git a/vendor/built_in_modules/gprs/test/dummy/config/environments/test.rb b/vendor/built_in_modules/location/test/dummy/config/environments/test.rb similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/config/environments/test.rb rename to vendor/built_in_modules/location/test/dummy/config/environments/test.rb diff --git a/vendor/built_in_modules/gprs/test/dummy/config/initializers/backtrace_silencers.rb b/vendor/built_in_modules/location/test/dummy/config/initializers/backtrace_silencers.rb similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/config/initializers/backtrace_silencers.rb rename to vendor/built_in_modules/location/test/dummy/config/initializers/backtrace_silencers.rb diff --git a/vendor/built_in_modules/gprs/test/dummy/config/initializers/inflections.rb b/vendor/built_in_modules/location/test/dummy/config/initializers/inflections.rb similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/config/initializers/inflections.rb rename to vendor/built_in_modules/location/test/dummy/config/initializers/inflections.rb diff --git a/vendor/built_in_modules/gprs/test/dummy/config/initializers/mime_types.rb b/vendor/built_in_modules/location/test/dummy/config/initializers/mime_types.rb similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/config/initializers/mime_types.rb rename to vendor/built_in_modules/location/test/dummy/config/initializers/mime_types.rb diff --git a/vendor/built_in_modules/gprs/test/dummy/config/initializers/secret_token.rb b/vendor/built_in_modules/location/test/dummy/config/initializers/secret_token.rb similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/config/initializers/secret_token.rb rename to vendor/built_in_modules/location/test/dummy/config/initializers/secret_token.rb diff --git a/vendor/built_in_modules/gprs/test/dummy/config/initializers/session_store.rb b/vendor/built_in_modules/location/test/dummy/config/initializers/session_store.rb similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/config/initializers/session_store.rb rename to vendor/built_in_modules/location/test/dummy/config/initializers/session_store.rb diff --git a/vendor/built_in_modules/gprs/test/dummy/config/initializers/wrap_parameters.rb b/vendor/built_in_modules/location/test/dummy/config/initializers/wrap_parameters.rb similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/config/initializers/wrap_parameters.rb rename to vendor/built_in_modules/location/test/dummy/config/initializers/wrap_parameters.rb diff --git a/vendor/built_in_modules/gprs/test/dummy/config/locales/en.yml b/vendor/built_in_modules/location/test/dummy/config/locales/en.yml similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/config/locales/en.yml rename to vendor/built_in_modules/location/test/dummy/config/locales/en.yml diff --git a/vendor/built_in_modules/gprs/test/dummy/config/routes.rb b/vendor/built_in_modules/location/test/dummy/config/routes.rb similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/config/routes.rb rename to vendor/built_in_modules/location/test/dummy/config/routes.rb diff --git a/vendor/built_in_modules/gprs/test/dummy/lib/assets/.gitkeep b/vendor/built_in_modules/location/test/dummy/lib/assets/.gitkeep similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/lib/assets/.gitkeep rename to vendor/built_in_modules/location/test/dummy/lib/assets/.gitkeep diff --git a/vendor/built_in_modules/gprs/test/dummy/log/.gitkeep b/vendor/built_in_modules/location/test/dummy/log/.gitkeep similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/log/.gitkeep rename to vendor/built_in_modules/location/test/dummy/log/.gitkeep diff --git a/vendor/built_in_modules/gprs/test/dummy/public/404.html b/vendor/built_in_modules/location/test/dummy/public/404.html similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/public/404.html rename to vendor/built_in_modules/location/test/dummy/public/404.html diff --git a/vendor/built_in_modules/gprs/test/dummy/public/422.html b/vendor/built_in_modules/location/test/dummy/public/422.html similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/public/422.html rename to vendor/built_in_modules/location/test/dummy/public/422.html diff --git a/vendor/built_in_modules/gprs/test/dummy/public/500.html b/vendor/built_in_modules/location/test/dummy/public/500.html similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/public/500.html rename to vendor/built_in_modules/location/test/dummy/public/500.html diff --git a/vendor/built_in_modules/gprs/test/dummy/public/favicon.ico b/vendor/built_in_modules/location/test/dummy/public/favicon.ico similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/public/favicon.ico rename to vendor/built_in_modules/location/test/dummy/public/favicon.ico diff --git a/vendor/built_in_modules/gprs/test/dummy/script/rails b/vendor/built_in_modules/location/test/dummy/script/rails similarity index 100% rename from vendor/built_in_modules/gprs/test/dummy/script/rails rename to vendor/built_in_modules/location/test/dummy/script/rails diff --git a/vendor/built_in_modules/gprs/test/functional/panel/gprs/back_end/locations_controller_test.rb b/vendor/built_in_modules/location/test/functional/panel/location/back_end/locations_controller_test.rb similarity index 68% rename from vendor/built_in_modules/gprs/test/functional/panel/gprs/back_end/locations_controller_test.rb rename to vendor/built_in_modules/location/test/functional/panel/location/back_end/locations_controller_test.rb index bb6d0908..0edd65ab 100644 --- a/vendor/built_in_modules/gprs/test/functional/panel/gprs/back_end/locations_controller_test.rb +++ b/vendor/built_in_modules/location/test/functional/panel/location/back_end/locations_controller_test.rb @@ -1,6 +1,6 @@ require 'test_helper' -class Panel::Gprs::BackEnd::LocationsControllerTest < ActionController::TestCase +class Panel::Location::BackEnd::LocationsControllerTest < ActionController::TestCase test "should get index" do get :index assert_response :success diff --git a/vendor/built_in_modules/gprs/test/integration/navigation_test.rb b/vendor/built_in_modules/location/test/integration/navigation_test.rb similarity index 100% rename from vendor/built_in_modules/gprs/test/integration/navigation_test.rb rename to vendor/built_in_modules/location/test/integration/navigation_test.rb diff --git a/vendor/built_in_modules/location/test/location_test.rb b/vendor/built_in_modules/location/test/location_test.rb new file mode 100644 index 00000000..b85756bc --- /dev/null +++ b/vendor/built_in_modules/location/test/location_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class LocationTest < ActiveSupport::TestCase + test "truth" do + assert_kind_of Module, Location + end +end diff --git a/vendor/built_in_modules/gprs/test/test_helper.rb b/vendor/built_in_modules/location/test/test_helper.rb similarity index 100% rename from vendor/built_in_modules/gprs/test/test_helper.rb rename to vendor/built_in_modules/location/test/test_helper.rb diff --git a/vendor/built_in_modules/location/test/unit/helpers/panel/location/back_end/locations_helper_test.rb b/vendor/built_in_modules/location/test/unit/helpers/panel/location/back_end/locations_helper_test.rb new file mode 100644 index 00000000..9e39a511 --- /dev/null +++ b/vendor/built_in_modules/location/test/unit/helpers/panel/location/back_end/locations_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class Panel::Location::BackEnd::LocationsHelperTest < ActionView::TestCase +end diff --git a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_lists_controller.rb b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_lists_controller.rb deleted file mode 100644 index b7d05a24..00000000 --- a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_lists_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class Panel::PersonalJournal::Desktop::JournalListsController < ApplicationController -end diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_pages/_form.html.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_pages/_form.html.erb index de144196..431fe8ce 100644 --- a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_pages/_form.html.erb +++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_pages/_form.html.erb @@ -6,23 +6,6 @@ <%= submit_tag "Cancel", :type => "button", class: "bt-cancel ini_input hp hh2 thmadm thmtxt" %> <% end %> -
    Share
    @@ -46,15 +29,28 @@
    • - <%= f.text_area :paper_title, size: "20x2", placeholder: "Paper Title", class: "s_grid_6 s_grid"%> + <%= f.fields_for :paper_title_translations do |f| %> + <%= f.text_area locale, + class: "s_grid_6 s_grid", + size: "20x2", + placeholder: t("personal_journal.paper_title"), + value: (@writing_journal.paper_title_translations[locale] rescue nil) %> + <% end %>
    • - <%= f.text_field :journal_title, size: "20", placeholder: "Journal Title", class: "s_grid_6 s_grid", "autocomplete-list" => "journal_title_autocomplete_list" %> + <%= f.fields_for :journal_title_translations do |f| %> + <%= f.text_field locale, + size: "20", + placeholder: t("personal_journal.journal_title"), + class: "s_grid_6 s_grid", + "autocomplete-list" => "journal_title_autocomplete_list", + value: (@writing_journal.journal_title_translations[locale] rescue nil) %> + <% end %>
    • - <%= label_tag("", "Journal Level") %> + <%= label_tag("", t("personal_journal.level_type")) %>
        <% @level_types.each_with_index do |level_type, i| %>
      • @@ -66,23 +62,19 @@
      • <% end %>
      -
    • - <%= label_tag("", "ISSN(ISBN)", class: "s_grid_2 s_grid") %><%= f.text_field :isbn, size: "20", placeholder: "829872987", class: "s_grid_4 s_grid"%> + <%= label_tag("", t("personal_journal.isbn"), class: "s_grid_2 s_grid") %><%= f.text_field :isbn, size: "20", placeholder: "829872987", class: "s_grid_4 s_grid"%>
    • - <%= label_tag("", "Volume No.", class: "s_grid_2 s_grid") %><%= f.text_field :vol_no, size: "20", placeholder: "829872987", class: "s_grid_4 s_grid"%> + <%= label_tag("", t("personal_journal.vol_no"), class: "s_grid_2 s_grid") %><%= f.text_field :vol_no, size: "20", placeholder: "829872987", class: "s_grid_4 s_grid"%>
    • - <%= label_tag("", "Issue No.", class: "s_grid_2 s_grid") %><%= f.text_field :issue_no, size: "20", placeholder:"829872987", class: "s_grid_4 s_grid"%> + <%= label_tag("", t("personal_journal.issue_no"), class: "s_grid_2 s_grid") %><%= f.text_field :issue_no, size: "20", placeholder:"829872987", class: "s_grid_4 s_grid"%>
    • @@ -90,20 +82,28 @@
    • - <%= label_tag("", "Pages", class: "s_grid_2 s_grid") %><%= label_tag("", "from", class: "s_grid_1 s_grid") %><%= f.text_field :form_to_start, size: "10", placeholder: "1", class: "s_grid_1 s_grid"%><%= label_tag("", "to", class: "s_grid_1 s_grid") %><%= f.text_field :form_to_end, size: "10", placeholder: "20", class: "s_grid_1 s_grid"%> + <%= label_tag("", t("personal_journal.total_pages"), class: "s_grid_2 s_grid") %><%= label_tag("", "from", class: "s_grid_1 s_grid") %><%= f.text_field :form_to_start, size: "10", placeholder: "1", class: "s_grid_1 s_grid"%><%= label_tag("", "to", class: "s_grid_1 s_grid") %><%= f.text_field :form_to_end, size: "10", placeholder: "20", class: "s_grid_1 s_grid"%>
    • - <%= f.text_area :authors, size: "20x2", placeholder: "Authors", class: "s_grid_6 s_grid", "autocomplete-list" => "coauthor_autocomplete_list"%> + <%= f.fields_for :authors_translations do |f| %> + <%= f.text_area locale, + class: "s_grid_6 s_grid", + size: "20x2", + placeholder: t("web_resource.authors"), + "autocomplete-list" => "coauthor_autocomplete_list", + value: (@writing_journal.authors_translations[locale] rescue nil) %> + <% end %>
    • <%= options_for_select( - @paper_types.map do |paper_type| - [paper_type.title, paper_type.id] - end - ) - %> + [t("personal_journal.level_type")] + + @paper_types.map do |paper_type| + [paper_type.title, paper_type.id] + end + ) + %>
    • - <%= label_tag("", "Date of Publication", class: "s_grid_3 s_grid") %> + <%= label_tag("", t("personal_journal.publication_date"), class: "s_grid_3 s_grid") %> <%= f.date_select :publication_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 's_grid_1 s_grid'} %>
    • - <%= f.text_field :keywords, size: "20", value: @writing_journal.keywords ||= "Keywords", class: "s_grid_6 s_grid"%> + <%= f.text_field :keywords, size: "20", placeholder: t("personal_journal.keywords"), class: "s_grid_6 s_grid"%>
    • - <%= f.label :year ,:class => "s_grid_2 s_grid" %> + <%= f.label :year, t("personal_journal.year"), :class => "s_grid_2 s_grid" %> <%= select_year((@writing_journal.year ? @writing_journal.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_journal[year]', :class => "s_grid_4 s_grid"} ) %>
    • - <%= f.label :language ,:class => "s_grid_2 s_grid" %> -
    • @@ -214,8 +212,6 @@ orbitDesktop.prototype.initializeJournalPapers.coauthor_autocomplete_list = <%= @co_author_candidate.to_json.html_safe %>; - -<%= javascript_include_tag "archive_plugin_form" %>