<commit_before>.motion
  #motion-title.clearfix
    %h2.word-break= motion.name
    - if motion.closed?
      %span.label.label-important Closed
  .closing-info
    - if motion.has_closing_date?
      No close date
    - else
      - if motion.voting?
        = "Closing in #{time_ago_in_words(motion.close_date)}"
      - else
        %span= "Closed #{time_ago_in_words(motion.close_date)} ago"
  .proposed-by
    = "Proposed #{time_ago_in_words(motion.created_at)} ago by #{motion.author_name}"
    - if motion.updated_at != motion.created_at
      = "(edited: #{time_ago_in_words(motion.updated_at)} ago)"
  .description
    - too_long = true if motion.description && motion.description.length > 200
    .short-description
      = simple_format h(truncate(motion.description, length: 200, omission: '...', separator: ' '))
      = link_to "Show More >>", "#", title: "see the full description", class: 'see-more' if too_long
    .long-description{style: "display: none"}
      = simple_format h(motion.description)
      = link_to "Show Less", "#", title: "see the full description", class: 'see-more' if too_long
  #graph.pie
  .percentage-to-vote
    = "#{motion.percent_voted}% of members "
    = "have " unless motion.closed?
    = "stated their position on this proposal (#{motion.group_count - motion.no_vote_count}/#{motion.group_count})"
  .votes
    - if motion.voting? && @group.users_include?(current_user) && (not @user_already_voted)
      %h2 State your position
      .vote-buttons.clearfix
        =link_to image_tag("hand-yes.png", title:"I agree", alt:"I agree"), "#", "title" => "I agree",
          "data-content" => "I agree with this and want it to go ahead.",
          "data-toggle" => "modal", href: "#vote-statement", class: "position btn vote-yes",
          onclick: "$('#vote_position').val('yes'); $('#position-title').text('You have decided to agree');"
        =link_to image_tag("hand-abstain.png", title:"I abstain", alt:"I abstain"), "#", "title" => "I abstain",
          "data-content" =>  "I am happy with what the group decides without me.",
          "data-toggle" => "modal", href: "#vote-statement", class: "position btn vote-abstain",
          onclick: "$('#vote_position').val('abstain'); $('#position-title').text('You have decided to abstain');"
        =link_to image_tag("hand-no.png", title:"I disagree", alt:"I disagree"), "#", "title" => "I disagree",
          "data-content" => "I think we can do better and would like to see something else happen, but if the group feels like it is the best way then I am ok with that.",
          "data-toggle" => "modal", href: "#vote-statement", class: "position btn vote-disagree",
          onclick: "$('#vote_position').val('no'); $('#position-title').text('You have decided to disagree');"
        =link_to image_tag("hand-block.png",title:"I block", alt:"I block"), "#", "title" => "I block",
          "data-content" => "I have strong objections to this motion and am not ok with it going ahead.",
          "data-toggle" => "modal", href: "#vote-statement", class: "position btn vote-block",
          onclick: "$('#vote_position').val('block'); $('#position-title').text('You have decided to block');"

    .votes-table= render "motions/votes_table", motion: motion, unique_votes: unique_votes
    #vote-statement.modal.hidden
      .modal-header
        %button.close{"data-dismiss" => "modal"}×
        - position = :vote_position
        %h2#position-title
      = form_for([motion, @vote], html:{class:'form-stacked'}) do |f|
        .modal-body
          .control-group
            = f.text_area :statement, placeholder: "Give a reason for your decision (optional)", class: "statement inputError limit-250"
          .character-counter
          =f.hidden_field :position
        .modal-footer
          = submit_tag "Confirm position", class: "vote btn btn-info"
          = link_to "Cancel", "#", "data-dismiss" => "modal", class: "btn btn-small"

  :coffeescript
    $ ->
      # Display vote graph
      @pie_graph_view = new Loomio.Views.Utils.GraphView
        el: '#graph.pie'
        id_string: 'graph'
        legend: true
        data: #{@votes_for_graph.to_json.html_safe}
        type: 'pie'
        tooltip_selector: '#tooltip'

      @linkify = new Loomio.Views.Utils.Linkify
        el: $('#motion h2, #motion #description, #votes .statement, #content-proposal')<commit_msg>linkify specific text areas<commit_after>.motion
  #motion-title.clearfix
    %h2.word-break= motion.name
    - if motion.closed?
      %span.label.label-important Closed
  .closing-info
    - if motion.has_closing_date?
      No close date
    - else
      - if motion.voting?
        = "Closing in #{time_ago_in_words(motion.close_date)}"
      - else
        %span= "Closed #{time_ago_in_words(motion.close_date)} ago"
  .proposed-by
    = "Proposed #{time_ago_in_words(motion.created_at)} ago by #{motion.author_name}"
    - if motion.updated_at != motion.created_at
      = "(edited: #{time_ago_in_words(motion.updated_at)} ago)"
  .description
    - too_long = true if motion.description && motion.description.length > 200
    .short-description
      = simple_format h(truncate(motion.description, length: 200, omission: '...', separator: ' '))
      = link_to "Show More >>", "#", title: "see the full description", class: 'see-more' if too_long
    .long-description{style: "display: none"}
      = simple_format h(motion.description)
      = link_to "Show Less", "#", title: "see the full description", class: 'see-more' if too_long
  #graph.pie
  .percentage-to-vote
    = "#{motion.percent_voted}% of members "
    = "have " unless motion.closed?
    = "stated their position on this proposal (#{motion.group_count - motion.no_vote_count}/#{motion.group_count})"
  .votes
    - if motion.voting? && @group.users_include?(current_user) && (not @user_already_voted)
      %h2 State your position
      .vote-buttons.clearfix
        =link_to image_tag("hand-yes.png", title:"I agree", alt:"I agree"), "#", "title" => "I agree",
          "data-content" => "I agree with this and want it to go ahead.",
          "data-toggle" => "modal", href: "#vote-statement", class: "position btn vote-yes",
          onclick: "$('#vote_position').val('yes'); $('#position-title').text('You have decided to agree');"
        =link_to image_tag("hand-abstain.png", title:"I abstain", alt:"I abstain"), "#", "title" => "I abstain",
          "data-content" =>  "I am happy with what the group decides without me.",
          "data-toggle" => "modal", href: "#vote-statement", class: "position btn vote-abstain",
          onclick: "$('#vote_position').val('abstain'); $('#position-title').text('You have decided to abstain');"
        =link_to image_tag("hand-no.png", title:"I disagree", alt:"I disagree"), "#", "title" => "I disagree",
          "data-content" => "I think we can do better and would like to see something else happen, but if the group feels like it is the best way then I am ok with that.",
          "data-toggle" => "modal", href: "#vote-statement", class: "position btn vote-disagree",
          onclick: "$('#vote_position').val('no'); $('#position-title').text('You have decided to disagree');"
        =link_to image_tag("hand-block.png",title:"I block", alt:"I block"), "#", "title" => "I block",
          "data-content" => "I have strong objections to this motion and am not ok with it going ahead.",
          "data-toggle" => "modal", href: "#vote-statement", class: "position btn vote-block",
          onclick: "$('#vote_position').val('block'); $('#position-title').text('You have decided to block');"

    .votes-table= render "motions/votes_table", motion: motion, unique_votes: unique_votes
    #vote-statement.modal.hidden
      .modal-header
        %button.close{"data-dismiss" => "modal"}×
        - position = :vote_position
        %h2#position-title
      = form_for([motion, @vote], html:{class:'form-stacked'}) do |f|
        .modal-body
          .control-group
            = f.text_area :statement, placeholder: "Give a reason for your decision (optional)", class: "statement inputError limit-250"
          .character-counter
          =f.hidden_field :position
        .modal-footer
          = submit_tag "Confirm position", class: "vote btn btn-info"
          = link_to "Cancel", "#", "data-dismiss" => "modal", class: "btn btn-small"

  :coffeescript
    $ ->
      # Display vote graph
      @pie_graph_view = new Loomio.Views.Utils.GraphView
        el: '#graph.pie'
        id_string: 'graph'
        legend: true
        data: #{@votes_for_graph.to_json.html_safe}
        type: 'pie'
        tooltip_selector: '#tooltip'

      @linkify = new Loomio.Views.Utils.Linkify
        el: $('#motion-title h2, .motion .description, .votes')
{'fraction_non_alphanumeric': 0.15930312001821909, 'fraction_numerical': 0.002960601229788203, 'mean_word_length': 3.1157450796626054, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2213624', 'n_tokens_mistral': 2759, 'n_tokens_neox': 2678, 'n_words': 710}