- <%= form_tag oauth2_path, method: :post, authenticity_token: true, remote: true, class: 'login-form' do %>
- <%= hidden_field_tag :client_id, @app.uid %>
- <%= hidden_field_tag :call_url, @call_url %>
- <%= hidden_field_tag :state, params[:state] %>
-
- <%= text_field_tag :login, '', placeholder: '请输入邮箱地址/用户名' %>
-
- <%= password_field_tag :password, '', placeholder: '请输入密码'%>
-
- <%= submit_tag '授权登录', class: "btn btn-login btn-lg btn-block mt-20" %>
- <% end %>
-
- <%= link_to "注 册", '/register', class: 'reg-link' %>
+
+
+
+
+
+ <%= form_tag oauth2_path, method: :post, authenticity_token: true, remote: true, class: 'login-form' do %>
+ <%= hidden_field_tag :client_id, @app.uid %>
+ <%= hidden_field_tag :call_url, @call_url %>
+ <%= submit_tag '同意授权', class: "btn btn-login btn-lg btn-block mt-20" %>
+ <% end %>
+
+ <%= link_to "拒绝", '/access_denied', class: 'reg-link' %>
+
-
-
\ No newline at end of file
+
+<% else %>
+
+
+ 申请使用 GitLink 账号登录
+ <%= @app&.name %>
+
+
+
+
+ <%= form_tag oauth2_path, method: :post, authenticity_token: true, remote: true, class: 'login-form' do %>
+ <%= hidden_field_tag :client_id, @app.uid %>
+ <%= hidden_field_tag :call_url, @call_url %>
+
+ <%= text_field_tag :login, '', placeholder: '请输入邮箱地址/用户名' %>
+
+ <%= password_field_tag :password, '', placeholder: '请输入密码' %>
+
+ <%= submit_tag '授权登录', class: "btn btn-login btn-lg btn-block mt-20" %>
+ <% end %>
+
+ <%= link_to "注 册", '/register', class: 'reg-link' %>
+
+
+
+
+<% end %>
+
+
+
diff --git a/app/views/project_trends/_detail.json.jbuilder b/app/views/project_trends/_detail.json.jbuilder
index b9febc107..20977e6a1 100644
--- a/app/views/project_trends/_detail.json.jbuilder
+++ b/app/views/project_trends/_detail.json.jbuilder
@@ -20,14 +20,18 @@ elsif trend.trend_type == "VersionRelease"
json.partial! "version_releases/simple_version_release", locals: {version: trend.trend}
elsif trend.trend_type == "CommitLog"
commit_log = trend.trend
- json.name commit_log.message
- json.created_at format_time(commit_log.created_at)
- json.commit_log do
- json.user do
- json.partial! 'users/user_simple', locals: {user: commit_log.user}
+ if commit_log.present?
+ json.name commit_log.message
+ json.created_at format_time(commit_log.created_at)
+ json.commit_log do
+ json.user do
+ json.partial! 'users/user_simple', locals: {user: commit_log.user}
+ end
+ json.ref commit_log.ref.to_s.gsub("refs/heads/", "")
+ json.extract! commit_log, :id,:name,:full_name,:message, :commit_id,:created_at,:updated_at
end
- json.ref commit_log.ref.to_s.gsub("refs/heads/", "")
- json.extract! commit_log, :id,:name,:full_name,:message, :commit_id,:created_at,:updated_at
+ else
+ json.nil
end
else
json.name trend.trend&.title