diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 85b29861c..5db71c82b 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -942,16 +942,12 @@ img.avatar, img.admin-avatar, img.moderator-avatar, img.initialjs-avatar { } .author-deleted, .user-deleted { - background-color: rgba(255,255,255,.5); color: rgba(0,0,0,.4); - font-size: rem-calc(40); - left: 11px; - position: absolute; - top: 72px; -} - -.user-deleted { - top: -4px; + display: inline-block; + font-size: rem-calc(32); + line-height: rem-calc(32); + height: rem-calc(32); + vertical-align: top; } .user-permissions { @@ -1110,10 +1106,6 @@ img.avatar, img.admin-avatar, img.moderator-avatar, img.initialjs-avatar { background: #C0392B; } -.is-deleted { - background: #E7E7E7; -} - .level-1 { background: #1ABC9C; } @@ -1642,7 +1634,10 @@ table { } .comment-body { - margin-left: rem-calc(42); + + img { + margin-right: $line-height/2; + } .reply { background: white; @@ -1650,20 +1645,28 @@ table { border-left: 0; border-right: 0; font-size: $small-font-size; - margin: rem-calc(6) 0; - padding: rem-calc(6); + margin: $line-height/4 0; + padding: $line-height/4; position: relative; + a.relative, [class^="icon-arrow"] { + padding-left: $line-height/2; + } + [class^="icon-arrow"] { - font-size: rem-calc(18); + font-size: $base-font-size; left: -20px; position: absolute; - top: 0; + top: -1px; } .divider { color: $text-light; } + + form { + margin-top: $line-height/2; + } } .comment-user { @@ -1691,27 +1694,19 @@ table { } } - .is-deleted { - background: #E7E7E7; - margin-left: rem-calc(42); - padding: $line-height/4 $line-height/2; - } - .comment-children { border-left: 1px dashed $border; - margin-left: rem-calc(42); - padding-left: $line-height/4; - - @media only screen and (max-width: 40em) { - margin-left: rem-calc(16); - } + display: inline-block; + margin-left: rem-calc(16); + padding-left: rem-calc(8); + width: 100%; } .comment-info { color: $text-medium; + display: inline-block; font-size: $small-font-size; - margin-top: $line-height/4; - vertical-align: middle; + line-height: rem-calc(32); // Same as avatar height span.user-name { color: $text; @@ -1744,6 +1739,11 @@ table { } } +.comment-form { + display: inline-block; + width: 100%; +} + // 16. Flags // --------- diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index 9bcf391e7..5bed3ad32 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -328,9 +328,13 @@ clear: both; color: $text-medium; font-size: $small-font-size; - min-height: $line-height*2; + margin-bottom: $line-height/2; position: relative; + span { + line-height: rem-calc(32); // Same as avatar height + } + a { color: $text-medium; } @@ -340,15 +344,6 @@ line-height: $line-height; margin: 0; } - - .author-deleted { - left: 0; - top: 4px; - } - - .author.deleted { - margin-left: rem-calc(48); - } } .debate-description, .proposal-description { @@ -373,9 +368,9 @@ } .author-photo { - line-height: $line-height*2; + line-height: rem-calc(32); margin-right: rem-calc(6); - vertical-align: middle; + vertical-align: top; width: 32px; } diff --git a/app/models/proposal.rb b/app/models/proposal.rb index ebc62e364..32175f9f7 100644 --- a/app/models/proposal.rb +++ b/app/models/proposal.rb @@ -50,7 +50,7 @@ class Proposal < ActiveRecord::Base scope :last_week, -> { where("proposals.created_at >= ?", 7.days.ago)} scope :retired, -> { where.not(retired_at: nil) } scope :not_retired, -> { where(retired_at: nil) } - scope :successfull, -> { where("cached_votes_up + physical_votes >= ?", Proposal.votes_needed_for_success)} + scope :successfull, -> { where("cached_votes_up >= ?", Proposal.votes_needed_for_success)} def to_param "#{id}-#{title}".parameterize @@ -95,7 +95,7 @@ class Proposal < ActiveRecord::Base end def total_votes - cached_votes_up + physical_votes + cached_votes_up end def voters diff --git a/app/models/signature.rb b/app/models/signature.rb index 47408858a..06ade968c 100644 --- a/app/models/signature.rb +++ b/app/models/signature.rb @@ -10,6 +10,8 @@ class Signature < ActiveRecord::Base delegate :signable, to: :signature_sheet + before_validation :clean_document_number + def verified? user_exists? || in_census? end @@ -58,6 +60,11 @@ class Signature < ActiveRecord::Base User.create!(user_params) end + def clean_document_number + return if self.document_number.blank? + self.document_number = self.document_number.gsub(/[^a-z0-9]+/i, "").upcase + end + def random_password (0...20).map { ('a'..'z').to_a[rand(26)] }.join end diff --git a/app/models/signature_sheet.rb b/app/models/signature_sheet.rb index 6852820bb..9720c891f 100644 --- a/app/models/signature_sheet.rb +++ b/app/models/signature_sheet.rb @@ -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 diff --git a/app/views/admin/signature_sheets/show.html.erb b/app/views/admin/signature_sheets/show.html.erb index a3787b67d..0c2536b34 100644 --- a/app/views/admin/signature_sheets/show.html.erb +++ b/app/views/admin/signature_sheets/show.html.erb @@ -8,6 +8,11 @@ <%= @signature_sheet.author.name %> +
<%= t("admin.signature_sheets.show.documents") %>
<%= simple_format @signature_sheet.document_numbers %> diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb index 8322489dd..4960baba8 100644 --- a/app/views/comments/_comment.html.erb +++ b/app/views/comments/_comment.html.erb @@ -1,11 +1,10 @@ <% comment_flags ||= @comment_flags %> <% cache [locale_and_user_status(comment), comment, commentable_cache_key(comment.commentable), comment.author, (comment_flags[comment.id] if comment_flags)] do %> -<%= t("comments.comment.deleted") %>
<% child_comments_of(comment).each do |child| %> - <%= render 'comments/comment', comment: child %> +-
+ <%= render 'comments/comment', comment: child %>
+
<% end %>
- -