mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
Set disputes starts_at as today date
This commit is contained in:
parent
481299453b
commit
4d200a1efc
4 changed files with 16 additions and 33 deletions
|
@ -38,7 +38,7 @@ module Admin
|
|||
|
||||
# PATCH/PUT /admin/disputes/1
|
||||
def update
|
||||
if @dispute.update(dispute_params.except(:domain_name))
|
||||
if @dispute.update(dispute_params.except(:domain_name, :starts_at))
|
||||
redirect_to admin_disputes_url, notice: 'Dispute was successfully updated.'
|
||||
else
|
||||
render :edit
|
||||
|
@ -68,7 +68,9 @@ module Admin
|
|||
|
||||
# Only allow a trusted parameter "white list" through.
|
||||
def dispute_params
|
||||
params.require(:dispute).permit(:domain_name, :password, :starts_at, :comment)
|
||||
params.require(:dispute)
|
||||
.permit(:domain_name, :password, :starts_at, :comment)
|
||||
.with_defaults(starts_at: Time.zone.today)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
</div>
|
||||
<div class="panel-body">
|
||||
<div>
|
||||
<p>As per domain law, expiry time is <%= Setting.dispute_period_in_months / 12 %> years ahead from start date.</p>
|
||||
<p>As per domain law, expiry time is <%= Setting.dispute_period_in_months / 12 %> years ahead from creation date (today).</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-4 control-label">
|
||||
|
@ -30,15 +30,6 @@
|
|||
<span class="help-block"><%= t '.password_hint' %></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-4 control-label">
|
||||
<%= f.label :starts_at %>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<%= f.text_field(:starts_at, class: 'form-control js-datepicker') %>
|
||||
<span class="help-block"><%= t '.past_or_today' %></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-4 control-label">
|
||||
<%= f.label :comment %>
|
||||
|
@ -47,6 +38,14 @@
|
|||
<%= f.text_field(:comment, placeholder: t(:optional), class: 'form-control') %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-4 control-label">
|
||||
<%= f.label :starts_at %>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<span class="help-block"><%= t '.today' %></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue