1 <% @title = t ".title", :name => @user_block.user.display_name %>
3 <% content_for :heading_class, "pb-0" %>
4 <% content_for :heading do %>
5 <h1><%= t(".heading_html", :name => link_to(@user_block.user.display_name, @user_block.user)) %></h1>
6 <%= render :partial => "navigation" %>
9 <%= bootstrap_form_for(@user_block) do |f| %>
10 <%= f.richtext_field :reason, :cols => 80, :rows => 20, :format => @user_block.reason_format %>
12 <% if @user_block.active? && @user_block.creator == current_user %>
13 <%= f.form_group do %>
14 <%= label_tag "user_block_period", t(".period"), :class => "form-label" %>
15 <%= select_tag "user_block_period",
16 options_for_select(UserBlock::PERIODS.collect { |h| [block_duration_in_words(h.hours), h.to_s] },
17 UserBlock::PERIODS.min_by { |h| (params[:user_block_period].to_i - h).abs }),
18 :class => "form-select" %>
21 <%= f.form_group :needs_view do %>
22 <%= f.check_box :needs_view %>
25 <div class="alert alert-info">
26 <% if @user_block.active? %>
27 <%= t "user_blocks.update.only_creator_can_edit_without_revoking" %>
29 <%= t "user_blocks.update.inactive_block_cannot_be_reactivated" %>
33 <%= hidden_field_tag "user_block_period", 0 %>
34 <%= hidden_field_tag "user_block[needs_view]", false %>