ntu_ga
This commit is contained in:
parent
d23a956085
commit
b020b8e13f
|
@ -0,0 +1,10 @@
|
||||||
|
$(document).ajaxStop(function() {
|
||||||
|
$('.nav').find('.dropdown').on({
|
||||||
|
mouseleave: function() {
|
||||||
|
$(this).removeClass("open");
|
||||||
|
},
|
||||||
|
mouseenter: function() {
|
||||||
|
$(this).addClass("open")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
|
@ -85,7 +85,6 @@
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Check Box Card */
|
/* Check Box Card */
|
||||||
.checkbox-card {
|
.checkbox-card {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
# encoding: utf-8
|
||||||
|
|
||||||
|
class SessionsController < Devise::SessionsController
|
||||||
|
prepend_before_filter :require_no_authentication, :only => [ :new, :create ]
|
||||||
|
|
||||||
|
|
||||||
|
def create
|
||||||
|
@site = Site.first
|
||||||
|
|
||||||
|
private_key = OpenSSL::PKey::RSA.new(@site.private_key)
|
||||||
|
wresult = private_key.private_decrypt(request.params['wresult'])
|
||||||
|
|
||||||
|
@ids = wresult.split("@")
|
||||||
|
|
||||||
|
login_uid = @ids[0]
|
||||||
|
|
||||||
|
resource = User.first(conditions:{user_id: login_uid})
|
||||||
|
|
||||||
|
if !resource.blank?
|
||||||
|
resource_name = resource.class.to_s.downcase
|
||||||
|
sign_in(resource_name, resource)
|
||||||
|
session[:user_id_type] = "myntu"
|
||||||
|
redirect_to after_sign_in_path_for(resource)
|
||||||
|
else
|
||||||
|
flash[:error] = "很抱歉,您無此權限或帳號登入本站,請洽本站管理員<br />Sorry, you don't have the account or authority to login. Please contact the website administrator."
|
||||||
|
redirect_to :root
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
@user_id_type = session[:user_id_type]
|
||||||
|
sign_out
|
||||||
|
if @user_id_type == "myntu"
|
||||||
|
redirect_to "https://adfs.ntu.edu.tw/adfs/ls/?wa=wsignout1.0&wreply=https://galogin.ntu.edu.tw"
|
||||||
|
else
|
||||||
|
redirect_to root_path
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
|
@ -204,6 +204,9 @@ module ApplicationHelper
|
||||||
|
|
||||||
def page_javascripts(page, edit=nil)
|
def page_javascripts(page, edit=nil)
|
||||||
javascripts = ''
|
javascripts = ''
|
||||||
|
unless edit
|
||||||
|
javascripts << "<script type='text/javascript' src='/assets/orbit-bar-search.js'></script>\n"
|
||||||
|
end
|
||||||
# javascripts << "<script type='text/javascript' src='/assets/lib/jquery.preload-min.js'></script>\n"
|
# javascripts << "<script type='text/javascript' src='/assets/lib/jquery.preload-min.js'></script>\n"
|
||||||
# javascripts << "<script type='text/javascript' src='/assets/jquery.cycle.all.latest.js'></script>\n"
|
# javascripts << "<script type='text/javascript' src='/assets/jquery.cycle.all.latest.js'></script>\n"
|
||||||
javascripts << "<script type='text/javascript' src='/assets/lib/social-share-button.js'></script>\n"
|
javascripts << "<script type='text/javascript' src='/assets/lib/social-share-button.js'></script>\n"
|
||||||
|
@ -303,7 +306,7 @@ module ApplicationHelper
|
||||||
|
|
||||||
# NTU link
|
# NTU link
|
||||||
def get_link(site_number)
|
def get_link(site_number)
|
||||||
"http://#{request.host}:2#{site_number}00"
|
"http://#{site_number}.#{request.domain(3)}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def sortable(column, title = nil, options = {})
|
def sortable(column, title = nil, options = {})
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
<% unless users.blank? %>
|
||||||
|
<div class="promoter-block">
|
||||||
|
<p class="promoter-title"><%= t(:promoter) %>:</p>
|
||||||
|
<ul>
|
||||||
|
<% users.each do |user| %>
|
||||||
|
<li class="promoter">
|
||||||
|
<p>
|
||||||
|
<%= link_to user.name, "mailto:#{user.email}", class: "promoter-name" %> / <span class="promoter-phone"><%= user.office_tel %></span>
|
||||||
|
</p>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
|
@ -1,4 +1,5 @@
|
||||||
<% content_for :page_specific_javascript do -%>
|
<% content_for :page_specific_javascript do -%>
|
||||||
|
<%= javascript_include_tag "member-selection" %>
|
||||||
<%= javascript_include_tag "lib/jquery.nanoscroller" %>
|
<%= javascript_include_tag "lib/jquery.nanoscroller" %>
|
||||||
<%= javascript_include_tag "lib/checkbox.card" %>
|
<%= javascript_include_tag "lib/checkbox.card" %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
|
@ -12,10 +12,11 @@
|
||||||
<input name="utf8" type="hidden" value="" />
|
<input name="utf8" type="hidden" value="" />
|
||||||
<input name="authenticity_token" type="hidden" value="" />
|
<input name="authenticity_token" type="hidden" value="" />
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="other-sign-in">
|
<div class="other-sign-in">
|
||||||
<a class="btn btn-primary" type="submit">Other Sign In</a>
|
<% @request_hosts = request.host_with_port.split(".") %>
|
||||||
|
<a class="btn btn-primary" type="submit" href="https://adfs.ntu.edu.tw/adfs/ls/?wa=wsignin1.0&wtrealm=https://galogin.ntu.edu.tw/saml_login&wctx=<%= @request_hosts[0] %>">使用計中帳號登入</a>
|
||||||
<p>or</p>
|
<p>or</p>
|
||||||
</div> -->
|
</div>
|
||||||
<div class="form-block">
|
<div class="form-block">
|
||||||
<div class="form-list clearfix">
|
<div class="form-list clearfix">
|
||||||
<form class="content" accept-charset="UTF-8" action="/users/sign_in" method="post">
|
<form class="content" accept-charset="UTF-8" action="/users/sign_in" method="post">
|
||||||
|
|
|
@ -7,6 +7,16 @@
|
||||||
</form>
|
</form>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<!-- ntu sites -->
|
||||||
|
<li id="orbit-tag" class="dropdown">
|
||||||
|
<a class="dropdown-toggle orbit-bar-language" data-icons="" href="#" data-toggle="dropdown"></a>
|
||||||
|
<ul class="dropdown-menu language-menu">
|
||||||
|
<% t('ntu.site_names').each do |site| %>
|
||||||
|
<li><%= link_to site[1], get_link(site[0]) %></li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
<!-- Language -->
|
<!-- Language -->
|
||||||
<li id="orbit-language" class="dropdown">
|
<li id="orbit-language" class="dropdown">
|
||||||
<a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown" title="<%= t('site.language')%>"><%= t(:_locale, :locale => I18n.locale) %></a>
|
<a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown" title="<%= t('site.language')%>"><%= t(:_locale, :locale => I18n.locale) %></a>
|
||||||
|
@ -30,7 +40,7 @@
|
||||||
<% if @site.desktop_closed %>
|
<% if @site.desktop_closed %>
|
||||||
<li><%= link_to content_tag(:i, nil, class: 'icons-screen') + ' ' + t(:desktop), desktop_path, tabindex: '-1' %></li>
|
<li><%= link_to content_tag(:i, nil, class: 'icons-screen') + ' ' + t(:desktop), desktop_path, tabindex: '-1' %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<li><%= link_to content_tag(:i, nil, class: 'icons-logout') + ' ' + t(:logout), destroy_user_session_path, tabindex: '-1' %></li>
|
<li><%= link_to content_tag(:i, nil, class: 'icons-logout') + ' ' + t(:logout), user_logout_path, tabindex: '-1' %></li>
|
||||||
<li class="divider"></li>
|
<li class="divider"></li>
|
||||||
<li><a tabindex="-1" href="#"><i class="icons-lifebuoy"></i> <%= t(:help) %></a></li>
|
<li><a tabindex="-1" href="#"><i class="icons-lifebuoy"></i> <%= t(:help) %></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -50,6 +60,12 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<%= form_for :user, url: user_session_path, html: {class: 'container'} do |f| %>
|
<%= form_for :user, url: user_session_path, html: {class: 'container'} do |f| %>
|
||||||
|
|
||||||
|
<div class="other-sign-in">
|
||||||
|
<% @request_hosts = request.host_with_port.split(".") %>
|
||||||
|
<a class="btn btn-primary" type="submit" href="https://adfs.ntu.edu.tw/adfs/ls/?wa=wsignin1.0&wtrealm=https://galogin.ntu.edu.tw/saml_login&wctx=<%= @request_hosts[0] %>">使用計中帳號登入</a>
|
||||||
|
<p>or</p>
|
||||||
|
</div>
|
||||||
<div class="input-prepend">
|
<div class="input-prepend">
|
||||||
<span class="add-on">
|
<span class="add-on">
|
||||||
<i class="icon-user"></i>
|
<i class="icon-user"></i>
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
#built-in-modules
|
#built-in-modules
|
||||||
gem 'archive', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-archive.git'
|
gem 'archive', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-archive.git', :branch => 'ntu_ga'
|
||||||
gem 'announcement', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-announcement.git'
|
gem 'announcement', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-announcement.git', :branch => 'ntu_ga'
|
||||||
gem 'gallery', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-gallery.git'
|
gem 'gallery', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-gallery.git'
|
||||||
gem 'member', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-member.git'
|
gem 'member', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-member.git'
|
||||||
gem 'member_staff', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-memberstaff.git'
|
gem 'member_staff', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-memberstaff.git', :branch => 'ntu_ga'
|
||||||
gem 'page_content', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-pagecontent.git'
|
gem 'page_content', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-pagecontent.git', :branch => 'ntu_ga'
|
||||||
gem 'personal_book', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-personalbook.git'
|
gem 'personal_book', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-personalbook.git'
|
||||||
gem 'personal_conference', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-personalconference.git'
|
gem 'personal_conference', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-personalconference.git'
|
||||||
gem 'personal_diploma', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-personaldiploma.git'
|
gem 'personal_diploma', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-personaldiploma.git'
|
||||||
|
@ -16,3 +16,6 @@ gem 'personal_patent', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orb
|
||||||
gem 'personal_project', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-personalproject.git'
|
gem 'personal_project', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-personalproject.git'
|
||||||
gem 'personal_research', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-personalresearch.git'
|
gem 'personal_research', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-personalresearch.git'
|
||||||
gem 'web_resource', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-webresource.git'
|
gem 'web_resource', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-webresource.git'
|
||||||
|
|
||||||
|
gem 'ask', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-ask.git', :branch => 'ntu_ga'
|
||||||
|
gem 'survey', '0.0.1', :git => 'http://gitlab.tp.rulingcom.com/root/orbit-survey.git', :branch => 'ntu_ga'
|
|
@ -397,6 +397,7 @@ en:
|
||||||
system_email: System Email
|
system_email: System Email
|
||||||
preview: Preview
|
preview: Preview
|
||||||
profile: Profile
|
profile: Profile
|
||||||
|
promoter: Promoter
|
||||||
publications: Publications
|
publications: Publications
|
||||||
purchase: Purchase
|
purchase: Purchase
|
||||||
quantity: Quantity
|
quantity: Quantity
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
en:
|
||||||
|
|
||||||
|
ntu:
|
||||||
|
rss_origin: Back to NTU Announcements
|
||||||
|
site_names:
|
||||||
|
"www": "Dean of General Affairs"
|
||||||
|
"sec": "Office of the Dean and Secretariat"
|
||||||
|
"doc": "Documentation Division"
|
||||||
|
"general": "General Service Division"
|
||||||
|
"property": "Property Management Division"
|
||||||
|
"construction": "Construction and Maintenance Division"
|
||||||
|
"cashier": "Cashier Division"
|
||||||
|
"procurement": "Procurement Division"
|
||||||
|
"fss": "Facilities Service Division"
|
||||||
|
"police": "Campus Security"
|
||||||
|
"social": "General Affairs Division, College of Social Science"
|
||||||
|
"medicine": "General Service Division, College of Medicine"
|
|
@ -0,0 +1,17 @@
|
||||||
|
zh_tw:
|
||||||
|
|
||||||
|
ntu:
|
||||||
|
rss_origin: 回臺大校園公佈欄
|
||||||
|
site_names:
|
||||||
|
"www": "總務處"
|
||||||
|
"sec": "總務長室暨總務處秘書室"
|
||||||
|
"doc": "文書組"
|
||||||
|
"general": "事務組"
|
||||||
|
"property": "保管組"
|
||||||
|
"construction": "營繕組"
|
||||||
|
"cashier": "出納組"
|
||||||
|
"procurement": "採購組"
|
||||||
|
"fss": "經營管理組"
|
||||||
|
"police": "駐警隊"
|
||||||
|
"social": "社科院總務分處"
|
||||||
|
"medicine": "醫學院總務分處"
|
|
@ -397,6 +397,7 @@ zh_tw:
|
||||||
sidebar_nav: 側欄導引
|
sidebar_nav: 側欄導引
|
||||||
system_email: 系統信箱
|
system_email: 系統信箱
|
||||||
profile: 基本資料
|
profile: 基本資料
|
||||||
|
promoter: 承辦人
|
||||||
publications: 著作
|
publications: 著作
|
||||||
purchase: 購買
|
purchase: 購買
|
||||||
quantity: 數量
|
quantity: 數量
|
||||||
|
|
|
@ -9,6 +9,11 @@ Orbit::Application.routes.draw do
|
||||||
match "/users_passwd" => "desktop/registrations#update", :as => :users_passwd, :via => :put
|
match "/users_passwd" => "desktop/registrations#update", :as => :users_passwd, :via => :put
|
||||||
end
|
end
|
||||||
|
|
||||||
|
devise_scope :user do
|
||||||
|
get 'user_login' => 'sessions#create'
|
||||||
|
match 'user_logout' => 'sessions#destroy'
|
||||||
|
end
|
||||||
|
|
||||||
mount Resque::Server, :at => "/admin/resque"
|
mount Resque::Server, :at => "/admin/resque"
|
||||||
mount Rack::GridFS::Endpoint.new(:db => Mongoid.database,:lookup=>:path), :at => "gridfs"
|
mount Rack::GridFS::Endpoint.new(:db => Mongoid.database,:lookup=>:path), :at => "gridfs"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue