oschina登录--授权页
This commit is contained in:
parent
ac0cd92c68
commit
ac1d3e8bf6
|
@ -1,3 +1,4 @@
|
||||||
|
#encoding: utf-8
|
||||||
class OauthController < ApplicationController
|
class OauthController < ApplicationController
|
||||||
before_filter :user_setup
|
before_filter :user_setup
|
||||||
before_filter :require_login, only: [:authorize, :token]
|
before_filter :require_login, only: [:authorize, :token]
|
||||||
|
@ -41,7 +42,11 @@ class OauthController < ApplicationController
|
||||||
|
|
||||||
redirect_to params["redirect_uri"] + "?code=#{code}&state=#{params[:state]}"
|
redirect_to params["redirect_uri"] + "?code=#{code}&state=#{params[:state]}"
|
||||||
end
|
end
|
||||||
|
respond_to do |format|
|
||||||
|
format.html {
|
||||||
|
render :layout => 'base_authorize_oschina'
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_callback
|
def test_callback
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
<% @nav_dispaly_home_path_label = 1
|
||||||
|
@nav_dispaly_main_course_label = 1
|
||||||
|
@nav_dispaly_main_project_label = 1
|
||||||
|
@nav_dispaly_main_contest_label = 1 %>
|
||||||
|
<% @nav_dispaly_forum_label = 1%>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="<%= current_language %>">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title><%=h html_title %></title>
|
||||||
|
<meta name="description" content="<%= Redmine::Info.app_name %>" />
|
||||||
|
<meta name="keywords" content="issue,bug,tracker" />
|
||||||
|
<%= csrf_meta_tag %>
|
||||||
|
<%= favicon %>
|
||||||
|
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan','prettify','//at.alicdn.com/t/font_930423_4z0tgi8hlb9.css', :media => 'all' %>
|
||||||
|
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
|
||||||
|
<%= javascript_heads %>
|
||||||
|
<%= javascript_include_tag "jquery.leanModal.min",'prettify' %>
|
||||||
|
<%= javascript_include_tag 'seems_rateable/jRating', 'seems_rateable/rateable'%>
|
||||||
|
<%= heads_for_theme %>
|
||||||
|
<%= call_hook :view_layouts_base_html_head %>
|
||||||
|
<!-- page specific tags -->
|
||||||
|
<%= yield :header_tags -%>
|
||||||
|
<%= stylesheet_link_tag 'css/common','css/structure','css/public', :media => 'all'%>
|
||||||
|
<!-- MathJax的配置 -->
|
||||||
|
<script type="text/javascript"
|
||||||
|
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||||
|
</script>
|
||||||
|
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||||
|
<script type="text/x-mathjax-config">
|
||||||
|
MathJax.Hub.Config({
|
||||||
|
showMathMenu: false,
|
||||||
|
showMathMenuMSIE: false,
|
||||||
|
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body class="<%=h body_css_classes %>" style="background-color: #fff;">
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div>
|
||||||
|
<%= yield %>
|
||||||
|
</div>
|
||||||
|
<%= call_hook :view_layouts_base_body_bottom %>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -1,19 +1,36 @@
|
||||||
授权页
|
<% if false %>
|
||||||
|
|
||||||
|
|
||||||
<p>当前用户: <%= current_user.login %></p>
|
<p>当前用户: <%= current_user.login %></p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
<%= form_for oauth_authorize_path do%>
|
||||||
|
<input type="hidden" name="gen_code" value="true">
|
||||||
<%= form_for oauth_authorize_path do%>
|
<input type="hidden" name="client_id" value="<%= @data["client_id"] %>">
|
||||||
<input type="hidden" name="gen_code" value="true">
|
<input type="hidden" name="redirect_uri" value="<%= @data["redirect_uri"] %>">
|
||||||
<input type="hidden" name="client_id" value="<%= @data["client_id"] %>">
|
<input type="hidden" name="response_type" value="<%= @data["response_type"] %>">
|
||||||
<input type="hidden" name="redirect_uri" value="<%= @data["redirect_uri"] %>">
|
<input type="hidden" name="scope" value="<%= @data["scope"] %>">
|
||||||
<input type="hidden" name="response_type" value="<%= @data["response_type"] %>">
|
<input type="hidden" name="state" value="<%= @data["state"] %>">
|
||||||
<input type="hidden" name="scope" value="<%= @data["scope"] %>">
|
<button type="submit">是否授权</button>
|
||||||
<input type="hidden" name="state" value="<%= @data["state"] %>">
|
<% end %>
|
||||||
<button type="submit">是否授权</button>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
<% end %>
|
||||||
|
<div class="authTop">
|
||||||
|
<div class="authmain">
|
||||||
|
<i class="iconfont icon-oschina f40 c_white fl"></i><span class="f18 ml10 fl mt20">oschina</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="mt60">
|
||||||
|
<div class="authmain clearfix">
|
||||||
|
<div class="fl l-f-login">
|
||||||
|
<div style="width: 220px;margin:0px auto;">
|
||||||
|
<p class="f18 mb20">帐号密码登录</p>
|
||||||
|
<input type="text" class="auth-login-input" placeholder="邮箱/手机号登录"/>
|
||||||
|
<input type="password" class="auth-login-input" placeholder="密码"/>
|
||||||
|
<a href="javascript:void(0)" class="auth-login-btn">授权并登录</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="fl l-r-trustie">
|
||||||
|
<p><span class="c_blue">trustie</span>将获得以下权限</p>
|
||||||
|
<p><input type="checkbox" checked="checked" disabled class="checked-choose"/>获得您的昵称、头像、性别</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
5528
db/schema.rb
5528
db/schema.rb
File diff suppressed because it is too large
Load Diff
|
@ -502,4 +502,16 @@ a.user_editinfo{border-top:1px solid #e5e5e5; height:30px; line-height:30px; tex
|
||||||
.messageInformationContents{ margin-right:10px; font-size:14px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height:49px; float:left; }
|
.messageInformationContents{ margin-right:10px; font-size:14px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height:49px; float:left; }
|
||||||
.homepageBackground{ background-color:#90C5EC; flex:1; text-align: center }
|
.homepageBackground{ background-color:#90C5EC; flex:1; text-align: center }
|
||||||
.homepageClickBackground{ background-color:#3b94d6; flex:1; text-align: center }
|
.homepageClickBackground{ background-color:#3b94d6; flex:1; text-align: center }
|
||||||
.flex-cell_homepage:hover{ background-color:#3b94d6;}
|
.flex-cell_homepage:hover{ background-color:#3b94d6;}
|
||||||
|
|
||||||
|
|
||||||
|
/*oschina授权页*/
|
||||||
|
.authTop{width: 100%;position: fixed;left: 0px;top:0px;background-color: #51B7EC;height: 58px;color: #fff;}
|
||||||
|
.authmain{width: 1200px;margin:0px auto;display: block!important;}
|
||||||
|
.l-f-login{padding: 20px 40px;border-right: 1px solid #eaeaea;text-align: center;width: 30%; margin-left: 143px;box-sizing: border-box}
|
||||||
|
.auth-login-input{width: 100%;height: 35px;border-radius: 2px;outline: none;padding: 5px;box-sizing: border-box;display: block;margin-bottom: 10px;}
|
||||||
|
.auth-login-btn{width: 100%;height: 32px;line-height: 32px;margin-top:20px;margin-bottom:20px;text-align: center;color: #fff!important;font-size: 14px;display: block;background-color: #4CACFF;border-radius: 2px;}
|
||||||
|
.l-r-trustie{padding:50px;}
|
||||||
|
.l-r-trustie p{line-height: 40px;border-bottom: 1px dashed #eaeaea;font-size: 15px;}
|
||||||
|
.l-r-trustie p:last-child{border-bottom: none;}
|
||||||
|
.checked-choose{margin-right: 5px;margin-top: 13px;float: left}
|
Loading…
Reference in New Issue