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"]},
|
||||
:year => project["year"],
|
||||
:language => project["language"].sub("-","_"),
|
||||
:period_start_date => Date.strptime(project["start_date"].gsub('00','01'), '%Y-%m'),
|
||||
:period_end_date => Date.strptime(project["end_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"].sub('-00','-01'), '%Y-%m') rescue nil),
|
||||
:url => project["reference_url"],
|
||||
:note_translations => {
|
||||
"en" => project["note"]["en"],
|
||||
|
@ -982,8 +982,8 @@ class Admin::ImportController < OrbitAdminController
|
|||
"en" => experience["job_title"]["en"],
|
||||
"zh_tw" => experience["job_title"]["zh-tw"]},
|
||||
:language => experience["language"].gsub('-','_'),
|
||||
:start_date => Date.strptime(experience["start_date"].gsub('00','01'), '%Y-%m'),
|
||||
:end_date => Date.strptime(experience["end_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"].sub('-00','-01'), '%Y-%m') rescue nil),
|
||||
:rss2_id => experience["rss2_id"])
|
||||
|
||||
new_experience.member_profile = member
|
||||
|
@ -1009,7 +1009,7 @@ class Admin::ImportController < OrbitAdminController
|
|||
old_honor = Honor.where(:rss2_id => honor["rss2_id"]).first
|
||||
if old_honor.nil?
|
||||
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 => {
|
||||
"en" => honor["award_name"]["en"],
|
||||
"zh_tw" => honor["award_name"]["zh-tw"]},
|
||||
|
@ -1054,7 +1054,7 @@ class Admin::ImportController < OrbitAdminController
|
|||
:form_to_end => rss2_journal["from_to"][1],
|
||||
:total_pages => rss2_journal["total_pages"],
|
||||
: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"],
|
||||
:note => rss2_journal["note"],
|
||||
|
||||
|
@ -1126,8 +1126,8 @@ class Admin::ImportController < OrbitAdminController
|
|||
:year => rss2_conference["year"],
|
||||
:language => rss2_conference["language"].gsub('-','_'),
|
||||
:isi_number => rss2_conference["isi_number"],
|
||||
:period_start_date => Date.parse(rss2_conference["start_date"].gsub('00','01')),
|
||||
:period_end_date => Date.parse(rss2_conference["end_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"].sub('-00','-01')) rescue nil),
|
||||
:url => rss2_conference["reference_url"],
|
||||
:isbn => rss2_conference["issn"],
|
||||
:note => rss2_conference["note"],
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
<div class="index-journal-paper">
|
||||
<h3 class="index-title">
|
||||
<span>{{widget-title}}</span>
|
||||
</h3>
|
||||
<div class="row" data-level="0" data-list="books">
|
||||
<div class="index-content col-sm-6">
|
||||
<div class="index-content-inner">
|
||||
<section class="index-part">
|
||||
<h4 class="index-content-title">
|
||||
<a href="{{link_to_show}}">{{book_title}}</a>
|
||||
</h4>
|
||||
<p class="index-subtitle">{{authors}}</p>
|
||||
<a class="more" href="{{link_to_show}}">Read More »</a>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-hover table-striped journal-papers-index">
|
||||
<caption><h3>{{widget-title}}</h3></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-1">{{th_year}}</th>
|
||||
<th class="col-md-9">{{th_title}}</th>
|
||||
<th class="col-md-2">{{th_author}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody data-level="0" data-list="books">
|
||||
<tr>
|
||||
<td>{{year}}</td>
|
||||
<td><a href="{{link_to_show}}">{{book_title}}</a></td>
|
||||
<td>{{author}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{{pagination_goes_here}}
|
|
@ -1,19 +1,18 @@
|
|||
<div class="index-journal-paper">
|
||||
<h3 class="index-title">
|
||||
<span>{{widget-title}}</span>
|
||||
</h3>
|
||||
<div class="row" data-level="0" data-list="journal_papers">
|
||||
<div class="index-content col-sm-6">
|
||||
<div class="index-content-inner">
|
||||
<section class="index-part">
|
||||
<h4 class="index-content-title">
|
||||
<a href="{{link_to_show}}">{{paper_title}}</a>
|
||||
</h4>
|
||||
<p class="index-subtitle">{{authors}}</p>
|
||||
<a class="more" href="{{link_to_show}}">Read More »</a>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-hover table-striped journal-papers-index">
|
||||
<caption><h3>{{widget-title}}</h3></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-1">{{th_year}}</th>
|
||||
<th class="col-md-9">{{th_title}}</th>
|
||||
<th class="col-md-2">{{th_author}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody data-level="0" data-list="journal_papers">
|
||||
<tr>
|
||||
<td>{{year}}</td>
|
||||
<td><a href="{{link_to_show}}">{{paper_title}}</a></td>
|
||||
<td>{{author}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{{pagination_goes_here}}
|
|
@ -1,6 +1,6 @@
|
|||
class KeywordConstraint
|
||||
def matches?(request)
|
||||
keywords = %w{admin desktop user signup login}
|
||||
keywords = ["/admin", "//desktop", "/user", "/signup", "/login"]
|
||||
keywords.all? { |k| !request.url.include?(k) }
|
||||
end
|
||||
end
|
|
@ -234,49 +234,6 @@ Orbit::Application.routes.draw do
|
|||
get '(/:page)(/:page)(/:page)/member(/:name-:uid)', to: 'pages#show'
|
||||
resources :pages
|
||||
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
|
||||
# Directs /admin/products/* to Admin::ProductsController
|
||||
# (app/controllers/admin/products_controller.rb)
|
||||
|
|
Loading…
Reference in New Issue