forked from saurabh/orbit4-5
Fix import bugs, routing keyword_constraint issue and template update for book and journal plugins
This commit is contained in:
parent
b1ed03b01c
commit
118d70b7f6
|
@ -805,8 +805,8 @@ class Admin::ImportController < OrbitAdminController
|
||||||
"zh_tw" => project["unit"]["zh-tw"]},
|
"zh_tw" => project["unit"]["zh-tw"]},
|
||||||
:year => project["year"],
|
:year => project["year"],
|
||||||
:language => project["language"].sub("-","_"),
|
:language => project["language"].sub("-","_"),
|
||||||
:period_start_date => Date.strptime(project["start_date"].gsub('00','01'), '%Y-%m'),
|
:period_start_date => (Date.strptime(project["start_date"].sub('-00','-01'), '%Y-%m') rescue nil),
|
||||||
:period_end_date => Date.strptime(project["end_date"].gsub('00','01'), '%Y-%m'),
|
:period_end_date => (Date.strptime(project["end_date"].sub('-00','-01'), '%Y-%m') rescue nil),
|
||||||
:url => project["reference_url"],
|
:url => project["reference_url"],
|
||||||
:note_translations => {
|
:note_translations => {
|
||||||
"en" => project["note"]["en"],
|
"en" => project["note"]["en"],
|
||||||
|
@ -982,8 +982,8 @@ class Admin::ImportController < OrbitAdminController
|
||||||
"en" => experience["job_title"]["en"],
|
"en" => experience["job_title"]["en"],
|
||||||
"zh_tw" => experience["job_title"]["zh-tw"]},
|
"zh_tw" => experience["job_title"]["zh-tw"]},
|
||||||
:language => experience["language"].gsub('-','_'),
|
:language => experience["language"].gsub('-','_'),
|
||||||
:start_date => Date.strptime(experience["start_date"].gsub('00','01'), '%Y-%m'),
|
:start_date => (Date.strptime(experience["start_date"].sub('-00','-01'), '%Y-%m') rescue nil),
|
||||||
:end_date => Date.strptime(experience["end_date"].gsub('00','01'), '%Y-%m'),
|
:end_date => (Date.strptime(experience["end_date"].sub('-00','-01'), '%Y-%m') rescue nil),
|
||||||
:rss2_id => experience["rss2_id"])
|
:rss2_id => experience["rss2_id"])
|
||||||
|
|
||||||
new_experience.member_profile = member
|
new_experience.member_profile = member
|
||||||
|
@ -1009,7 +1009,7 @@ class Admin::ImportController < OrbitAdminController
|
||||||
old_honor = Honor.where(:rss2_id => honor["rss2_id"]).first
|
old_honor = Honor.where(:rss2_id => honor["rss2_id"]).first
|
||||||
if old_honor.nil?
|
if old_honor.nil?
|
||||||
new_honor = Honor.new(
|
new_honor = Honor.new(
|
||||||
:year => honor["year"],
|
:year => (honor["year"].to_i<1900 ? (honor["year"].to_i+1911).to_s : honor["year"]),
|
||||||
:award_name_translations => {
|
:award_name_translations => {
|
||||||
"en" => honor["award_name"]["en"],
|
"en" => honor["award_name"]["en"],
|
||||||
"zh_tw" => honor["award_name"]["zh-tw"]},
|
"zh_tw" => honor["award_name"]["zh-tw"]},
|
||||||
|
@ -1054,7 +1054,7 @@ class Admin::ImportController < OrbitAdminController
|
||||||
:form_to_end => rss2_journal["from_to"][1],
|
:form_to_end => rss2_journal["from_to"][1],
|
||||||
:total_pages => rss2_journal["total_pages"],
|
:total_pages => rss2_journal["total_pages"],
|
||||||
:isbn => rss2_journal["issn"],
|
:isbn => rss2_journal["issn"],
|
||||||
:publication_date => Date.parse(rss2_journal["date_of_publication"].gsub('00','01')),
|
:publication_date => (Date.parse(rss2_journal["date_of_publication"].sub('-00','-01')) rescue nil),
|
||||||
:url => rss2_journal["reference_url"],
|
:url => rss2_journal["reference_url"],
|
||||||
:note => rss2_journal["note"],
|
:note => rss2_journal["note"],
|
||||||
|
|
||||||
|
@ -1126,8 +1126,8 @@ class Admin::ImportController < OrbitAdminController
|
||||||
:year => rss2_conference["year"],
|
:year => rss2_conference["year"],
|
||||||
:language => rss2_conference["language"].gsub('-','_'),
|
:language => rss2_conference["language"].gsub('-','_'),
|
||||||
:isi_number => rss2_conference["isi_number"],
|
:isi_number => rss2_conference["isi_number"],
|
||||||
:period_start_date => Date.parse(rss2_conference["start_date"].gsub('00','01')),
|
:period_start_date => (Date.parse(rss2_conference["start_date"].sub('-00','-01')) rescue nil),
|
||||||
:period_end_date => Date.parse(rss2_conference["end_date"].gsub('00','01')),
|
:period_end_date => (Date.parse(rss2_conference["end_date"].sub('-00','-01')) rescue nil),
|
||||||
:url => rss2_conference["reference_url"],
|
:url => rss2_conference["reference_url"],
|
||||||
:isbn => rss2_conference["issn"],
|
:isbn => rss2_conference["issn"],
|
||||||
:note => rss2_conference["note"],
|
:note => rss2_conference["note"],
|
||||||
|
|
|
@ -1,19 +1,18 @@
|
||||||
<div class="index-journal-paper">
|
<table class="table table-hover table-striped journal-papers-index">
|
||||||
<h3 class="index-title">
|
<caption><h3>{{widget-title}}</h3></caption>
|
||||||
<span>{{widget-title}}</span>
|
<thead>
|
||||||
</h3>
|
<tr>
|
||||||
<div class="row" data-level="0" data-list="books">
|
<th class="col-md-1">{{th_year}}</th>
|
||||||
<div class="index-content col-sm-6">
|
<th class="col-md-9">{{th_title}}</th>
|
||||||
<div class="index-content-inner">
|
<th class="col-md-2">{{th_author}}</th>
|
||||||
<section class="index-part">
|
</tr>
|
||||||
<h4 class="index-content-title">
|
</thead>
|
||||||
<a href="{{link_to_show}}">{{book_title}}</a>
|
<tbody data-level="0" data-list="books">
|
||||||
</h4>
|
<tr>
|
||||||
<p class="index-subtitle">{{authors}}</p>
|
<td>{{year}}</td>
|
||||||
<a class="more" href="{{link_to_show}}">Read More »</a>
|
<td><a href="{{link_to_show}}">{{book_title}}</a></td>
|
||||||
</section>
|
<td>{{author}}</td>
|
||||||
</div>
|
</tr>
|
||||||
</div>
|
</tbody>
|
||||||
</div>
|
</table>
|
||||||
</div>
|
|
||||||
{{pagination_goes_here}}
|
{{pagination_goes_here}}
|
|
@ -1,19 +1,18 @@
|
||||||
<div class="index-journal-paper">
|
<table class="table table-hover table-striped journal-papers-index">
|
||||||
<h3 class="index-title">
|
<caption><h3>{{widget-title}}</h3></caption>
|
||||||
<span>{{widget-title}}</span>
|
<thead>
|
||||||
</h3>
|
<tr>
|
||||||
<div class="row" data-level="0" data-list="journal_papers">
|
<th class="col-md-1">{{th_year}}</th>
|
||||||
<div class="index-content col-sm-6">
|
<th class="col-md-9">{{th_title}}</th>
|
||||||
<div class="index-content-inner">
|
<th class="col-md-2">{{th_author}}</th>
|
||||||
<section class="index-part">
|
</tr>
|
||||||
<h4 class="index-content-title">
|
</thead>
|
||||||
<a href="{{link_to_show}}">{{paper_title}}</a>
|
<tbody data-level="0" data-list="journal_papers">
|
||||||
</h4>
|
<tr>
|
||||||
<p class="index-subtitle">{{authors}}</p>
|
<td>{{year}}</td>
|
||||||
<a class="more" href="{{link_to_show}}">Read More »</a>
|
<td><a href="{{link_to_show}}">{{paper_title}}</a></td>
|
||||||
</section>
|
<td>{{author}}</td>
|
||||||
</div>
|
</tr>
|
||||||
</div>
|
</tbody>
|
||||||
</div>
|
</table>
|
||||||
</div>
|
|
||||||
{{pagination_goes_here}}
|
{{pagination_goes_here}}
|
|
@ -1,6 +1,6 @@
|
||||||
class KeywordConstraint
|
class KeywordConstraint
|
||||||
def matches?(request)
|
def matches?(request)
|
||||||
keywords = %w{admin desktop user signup login}
|
keywords = ["/admin", "//desktop", "/user", "/signup", "/login"]
|
||||||
keywords.all? { |k| !request.url.include?(k) }
|
keywords.all? { |k| !request.url.include?(k) }
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -234,49 +234,6 @@ Orbit::Application.routes.draw do
|
||||||
get '(/:page)(/:page)(/:page)/member(/:name-:uid)', to: 'pages#show'
|
get '(/:page)(/:page)(/:page)/member(/:name-:uid)', to: 'pages#show'
|
||||||
resources :pages
|
resources :pages
|
||||||
end
|
end
|
||||||
# Example of regular route:
|
|
||||||
# get 'products/:id' => 'catalog#view'
|
|
||||||
|
|
||||||
# Example of named route that can be invoked with purchase_url(id: product.id)
|
|
||||||
# get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
|
|
||||||
|
|
||||||
# Example resource route (maps HTTP verbs to controller actions automatically):
|
|
||||||
# resources :products
|
|
||||||
|
|
||||||
# Example resource route with options:
|
|
||||||
# resources :products do
|
|
||||||
# member do
|
|
||||||
# get 'short'
|
|
||||||
# post 'toggle'
|
|
||||||
# end
|
|
||||||
#
|
|
||||||
# collection do
|
|
||||||
# get 'sold'
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
|
|
||||||
# Example resource route with sub-resources:
|
|
||||||
# resources :products do
|
|
||||||
# resources :comments, :sales
|
|
||||||
# resource :seller
|
|
||||||
# end
|
|
||||||
|
|
||||||
# Example resource route with more complex sub-resources:
|
|
||||||
# resources :products do
|
|
||||||
# resources :comments
|
|
||||||
# resources :sales do
|
|
||||||
# get 'recent', on: :collection
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
|
|
||||||
# Example resource route with concerns:
|
|
||||||
# concern :toggleable do
|
|
||||||
# post 'toggle'
|
|
||||||
# end
|
|
||||||
# resources :posts, concerns: :toggleable
|
|
||||||
# resources :photos, concerns: :toggleable
|
|
||||||
|
|
||||||
# Example resource route within a namespace:
|
|
||||||
namespace :admin do
|
namespace :admin do
|
||||||
# Directs /admin/products/* to Admin::ProductsController
|
# Directs /admin/products/* to Admin::ProductsController
|
||||||
# (app/controllers/admin/products_controller.rb)
|
# (app/controllers/admin/products_controller.rb)
|
||||||
|
|
Loading…
Reference in New Issue