Merge pull request #1312 from consul/signature-sheets-polish
Signature sheets polish
This commit is contained in:
@@ -22,14 +22,14 @@ class SignatureSheet < ActiveRecord::Base
|
||||
|
||||
def verify_signatures
|
||||
parsed_document_numbers.each do |document_number|
|
||||
signature = signatures.create(document_number: document_number)
|
||||
signature = self.signatures.where(document_number: document_number).first_or_create
|
||||
signature.verify
|
||||
end
|
||||
update(processed: true)
|
||||
end
|
||||
|
||||
def parsed_document_numbers
|
||||
document_numbers.split(/\W+/)
|
||||
document_numbers.split(/\r\n|\n|[,]/).collect {|d| d.gsub(/\s+/, '') }
|
||||
end
|
||||
|
||||
def signable_found
|
||||
|
||||
@@ -8,6 +8,11 @@
|
||||
<strong><%= @signature_sheet.author.name %></strong>
|
||||
</div>
|
||||
|
||||
<h3 id="document_count" class="block">
|
||||
<%= t("admin.signature_sheets.show.document_count") %>
|
||||
<%= @signature_sheet.signatures.count %>
|
||||
</h3>
|
||||
|
||||
<div class="callout margin-top">
|
||||
<p><strong><%= t("admin.signature_sheets.show.documents") %></strong></p>
|
||||
<%= simple_format @signature_sheet.document_numbers %>
|
||||
|
||||
Reference in New Issue
Block a user