Skip to content

Commit

Permalink
Merge branch 'main' of github.com:work-design/rails_auth
Browse files Browse the repository at this point in the history
  • Loading branch information
qinmingyuan committed Dec 14, 2024
2 parents 7d5658d + 03032f3 commit b3bef36
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 9 deletions.
9 changes: 8 additions & 1 deletion app/views/auth/board/accounts/_base/_account.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@
</td>
<td>
<% unless model.confirmed %>
<button id="token_<%= model.id %>" data-controller="common count-down" data-url="<%= url_for(action: 'token', id: model.id) %>" data-count-down-time-value="3" data-action="common#streamPost" class="button is-link">发送验证码</button>
<button
id="token_<%= model.id %>"
data-controller="common count-down"
data-common-url-value="<%= url_for(action: 'token', id: model.id) %>"
data-count-down-time-value="3"
data-action="common#streamPost"
class="button is-link"
>发送验证码</button>
<% end %>
<%= button_to({ action: 'destroy', id: model.id }, method: :delete, aria: { label: t('.destroy.title'), confirm: '删除后此账号无法用于登录' }, class: 'button') do %>
<i class="fa-solid fa-trash text-danger"></i>
Expand Down
13 changes: 12 additions & 1 deletion app/views/auth/board/accounts/token.turbo_stream.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
<%= turbo_stream.replace "token_#{@account.id}" do %>
<button id="token_<%= @account.id %>" type="button" data-url="<%= url_for(action: 'token', identity: @account.identity) %>" data-controller="common count-down" data-count-down-time-value="5" data-count-down-target="disabled" data-action="common#streamPost" disabled="disabled" class="button is-info">
<button
id="token_<%= @account.id %>"
type="button"
data-common-url-value="<%= url_for(action: 'token') %>"
data-common-body-value="<%= { identity: @account.identity }.to_json %>"
data-controller="common count-down"
data-count-down-time-value="5"
data-count-down-target="disabled"
data-action="common#streamPost"
disabled="disabled"
class="button is-info"
>
<span>重新发送(</span>
<span data-count-down-target="count"></span>
<span></span>
Expand Down
12 changes: 10 additions & 2 deletions app/views/auth/sign/_join.html+phone.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,17 @@
<div class="weui-cell weui-cell_active weui-cell_vcode">
<%= f.text_field :token, placeholder: Auth::VerifyToken.human_attribute_name(:token), all: { normal: nil } %>
<div class="weui-cell__ft" data-controller="common" id="sign_token">
<%= link_to({ action: 'code', identity: params[:identity] }, data: { action: 'common#link' }, class: 'weui-btn weui-btn_default weui-vcode-btn') do %>
<button
type="button"
data-controller="common count-down"
data-count-down-time-value="60"
data-common-url-value="<%= url_for(action: 'code') %>"
data-common-body-value="<%= { identity: params[:identity] }.to_json %>"
data-action="common#streamPost"
class="button"
>
<span><%= t('.token') %></span>
<% end %>
</button>
</div>
</div>
</div>
Expand Down
9 changes: 8 additions & 1 deletion app/views/auth/sign/_join.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@
<%= f.text_field :token, placeholder: Auth::VerifyToken.human_attribute_name(:token), autocomplete: 'off', class: 'input' %>
</div>
<div class="control" id="sign_token">
<button type="button" data-controller="common" data-url="<%= url_for(action: 'code', identity: params[:identity]) %>" data-action="common#streamPost" class="button is-info">
<button
type="button"
data-controller="common"
data-common-url-value="<%= url_for(action: 'code') %>"
data-common-body-value="<%= { identity: params[:identity] }.to_json %>"
data-action="common#streamPost"
class="button is-info"
>
<span><%= t('.token') %></span>
</button>
</div>
Expand Down
12 changes: 11 additions & 1 deletion app/views/auth/sign/_token.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@
<%= f.text_field :token, placeholder: Auth::VerifyToken.human_attribute_name(:token), autocomplete: 'off', class: 'input' %>
</div>
<div class="control" id="sign_token">
<button type="button" data-url="<%= url_for(action: 'code', identity: params[:identity]) %>" data-controller="common count-down" data-count-down-time-value="60" data-count-down-target="disabled" data-action="common#streamPost" disabled="disabled" class="button is-info">
<button
type="button"
data-common-url-value="<%= url_for(action: 'code') %>"
data-common-body-value="<%= { identity: params[:identity] }.to_json %>"
data-controller="common count-down"
data-count-down-time-value="60"
data-count-down-target="disabled"
data-action="common#streamPost"
disabled="disabled"
class="button is-info"
>
<span>重新发送(</span>
<span data-count-down-target="count"></span>
<span></span>
Expand Down
4 changes: 2 additions & 2 deletions app/views/auth/sign/code.turbo_stream+phone.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%= turbo_stream.update 'sign_token' do %>
<%= link_to({ action: 'code', identity: params[:identity] }, data: { controller: 'count-down', count_down_time_value: 60, action: 'common#link' }, disabled: true, class: 'weui-btn weui-btn_default weui-vcode-btn') do %>
<button data-controller="common count-down" data-count-down-time-value="60" data-common-url-value="<%= url_for(action: 'code', identity: params[:identity]) %>" class="button">
<span>重新发送(</span>
<span data-count-down-target="count"></span>
<span></span>
<% end %>
</button>
<% end %>
12 changes: 11 additions & 1 deletion app/views/auth/sign/code.turbo_stream.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
<%= turbo_stream.update 'sign_token' do %>
<button type="button" data-url="<%= url_for(action: 'code', identity: params[:identity]) %>" data-controller="common count-down" data-count-down-time-value="60" data-count-down-target="disabled" data-action="common#streamPost" disabled="disabled" class="button is-info">
<button
type="button"
data-controller="common count-down"
data-common-url-value="<%= url_for(action: 'code') %>"
data-common-body-value="<%= { identity: params[:identity] }.to_json %>"
data-count-down-time-value="60"
data-count-down-target="disabled"
data-action="common#streamPost"
disabled="disabled"
class="button is-info"
>
<span>重新发送(</span>
<span data-count-down-target="count"></span>
<span></span>
Expand Down

0 comments on commit b3bef36

Please sign in to comment.