<commit_before>- content_for :title do
  Contribute to
  = @project.name
- content_for :description do
  = @project.description
  
.row
  .col-md-12
    %h1
      = @project.name
      - if (url = @project.github_url).present?
        %small= link_to glyph(:github), url, target: '_blank'
      .pull-right
        - if can? :update, @project
          = link_to "Edit project", edit_project_path(@project), class: "btn btn-primary"
        - if can? :decide_tip_amounts, @project and @project.has_undecided_tips?
          = link_to "Decide tip amounts", decide_tip_amounts_project_path(@project), class: "btn btn-warning"
        - if can? :create, @project.distributions.build
          = link_to "New distribution", new_project_distribution_path(@project), class: "btn btn-warning"

.row
  .col-md-8
    - unless @project.description.blank?
      %h3= @project.description
    - unless @project.detailed_description.blank?
      = render_markdown @project.detailed_description

    - if @project.tipping_policies_text.try(:text).present?
      %h4 Tipping policies
      = auto_link simple_format @project.tipping_policies_text.text
      %small
        %em
          - user = @project.tipping_policies_text.user
          - name = user.nickname.presence || user.name if user
          - date = l(@project.tipping_policies_text.updated_at)
          - if name.present?
            = "(Last updated by #{name} on #{date})"
          - else
            = "(Last updated on #{date})"

    %h4 Tips Paid
    = btc_human @project.tips_paid_amount

    - if (failed_distributions = @project.distributions.error).any? and (amount = failed_distributions.map(&:tips).flatten.sum(&:amount)) > 0
      .alert.alert-danger
        %strong Some tip transactions failed.
        A total of #{btc_human amount} may not have been sent.

    - if (tips_paid_unclaimed_amount = @project.tips_paid_unclaimed_amount) > 0
      (#{btc_human tips_paid_unclaimed_amount} of this is unclaimed, and will be refunded to the project after being unclaimed for 1 month.)

    - if @project.tips.count > 0
      %h4
        Last Tips
        - if @project.tips.count > 5
          = link_to 'see all', project_tips_path(@project)
      %ul
        - @project.tips.includes(:user).order(created_at: :desc).first(5).each do |tip|
          %li
            = l tip.created_at, format: :short
            - if tip.user.nickname.blank?
              = tip.user.full_name
            - else
              = link_to tip.user.full_name, "https://github.com/#{tip.user.nickname}", target: '_blank'
            - if tip.decided?
              received
              = btc_human tip.amount
            - else
              will receive a tip
            - if tip.commit.present?
              for commit
              = link_to tip.commit[0..6], "https://github.com/#{@project.full_name}/commit/#{tip.commit}", target: :blank
            - if tip.undecided?
              when its amount is decided

    - if @project.next_tip_amount > 0
      %h4 Next Tip
      = btc_human @project.next_tip_amount

    %h4 Contribute and Earn
    Donate peercoins to this project or
    = link_to 'make commits', @project.github_url, target: '_blank'
    and get tips for it. If your commit is accepted by project maintainer and there are peercoins on its balance, you will get a tip!

    - if current_user
      - if current_user.bitcoin_address.blank?
        Just 
        = link_to 'tell us', current_user
        your peercoin address.      
    - else
      Just check your email or 
      %a{href: user_omniauth_authorize_path(:github)} Sign In.

    %h4 Promote #{@project.full_name}
    %p
      / AddThis Button BEGIN
      .addthis_toolbox.addthis_default_style.addthis_32x32_style(addthis:data_track_clickback="false" addthis:data_track_addressbar="false")
        %a.addthis_button_preferred_1
        %a.addthis_button_preferred_2
        %a.addthis_button_preferred_3
        %a.addthis_button_preferred_4
        %a.addthis_button_compact
        %a.addthis_counter.addthis_bubble_style
      / AddThis Button END

    %h4 Embed in README.md
    %p= link_to image_tag(project_url(@project, format: :svg), alt: 'Peer4Commit'), project_url(@project)
    %p
      %input.form-control{type: 'text', value: "[![tip for next commit](#{project_url(@project, format: :svg)})](#{project_url(@project)})"}

  .col-md-4
    - if @project.disabled?
      .panel.panel-danger
        .panel-heading
          %h4.panel-title
            Project Disabled
        .panel-body.text-center
          %p
            This project has been disabled.
            It doesn't accept donation and it will not distribute tips.
          - if (reason = @project.disabled_reason).present?
            %p Reason: #{reason}

    - else
      .panel.panel-default.project-panel
        .panel-heading
          %h4.panel-title
            Project informations
        .panel-body.text-center
          %table.table.text-left
            %tr
              %td Funds
              %td= btc_human @project.available_amount
            %tr
              %td Distributions
              %td
                %ul.list-unstyled#distribution-list
                  - @project.distributions.order(created_at: :desc).limit(5).each do |distribution|
                    %li.distribution-link
                      - label = btc_human(distribution.total_amount)
                      - if distribution.sent?
                        - label << " sent #{time_ago_in_words(distribution.sent_at)} ago"
                      - else
                        - label << " not sent"
                      = link_to label, [@project, distribution]
                = link_to "All distributions", project_distributions_path(@project)


      .panel.panel-default.project-panel
        .panel-heading
          %h4.panel-title
            Donate
        .panel-body.text-center
          %p To give to this project, send peercoins to this address:
          %p.bitcoin-address
            = @project.bitcoin_address
          %p
            = image_tag qrcode_project_path(@project, format: :svg), alt: @project.bitcoin_address, class: 'project qrcode'
          %p #{100-(CONFIG["our_fee"]*100).round}% of deposited funds will be used to tip for new commits. <commit_msg>Fixed crash when sent without date<commit_after>- content_for :title do
  Contribute to
  = @project.name
- content_for :description do
  = @project.description
  
.row
  .col-md-12
    %h1
      = @project.name
      - if (url = @project.github_url).present?
        %small= link_to glyph(:github), url, target: '_blank'
      .pull-right
        - if can? :update, @project
          = link_to "Edit project", edit_project_path(@project), class: "btn btn-primary"
        - if can? :decide_tip_amounts, @project and @project.has_undecided_tips?
          = link_to "Decide tip amounts", decide_tip_amounts_project_path(@project), class: "btn btn-warning"
        - if can? :create, @project.distributions.build
          = link_to "New distribution", new_project_distribution_path(@project), class: "btn btn-warning"

.row
  .col-md-8
    - unless @project.description.blank?
      %h3= @project.description
    - unless @project.detailed_description.blank?
      = render_markdown @project.detailed_description

    - if @project.tipping_policies_text.try(:text).present?
      %h4 Tipping policies
      = auto_link simple_format @project.tipping_policies_text.text
      %small
        %em
          - user = @project.tipping_policies_text.user
          - name = user.nickname.presence || user.name if user
          - date = l(@project.tipping_policies_text.updated_at)
          - if name.present?
            = "(Last updated by #{name} on #{date})"
          - else
            = "(Last updated on #{date})"

    %h4 Tips Paid
    = btc_human @project.tips_paid_amount

    - if (failed_distributions = @project.distributions.error).any? and (amount = failed_distributions.map(&:tips).flatten.sum(&:amount)) > 0
      .alert.alert-danger
        %strong Some tip transactions failed.
        A total of #{btc_human amount} may not have been sent.

    - if (tips_paid_unclaimed_amount = @project.tips_paid_unclaimed_amount) > 0
      (#{btc_human tips_paid_unclaimed_amount} of this is unclaimed, and will be refunded to the project after being unclaimed for 1 month.)

    - if @project.tips.count > 0
      %h4
        Last Tips
        - if @project.tips.count > 5
          = link_to 'see all', project_tips_path(@project)
      %ul
        - @project.tips.includes(:user).order(created_at: :desc).first(5).each do |tip|
          %li
            = l tip.created_at, format: :short
            - if tip.user.nickname.blank?
              = tip.user.full_name
            - else
              = link_to tip.user.full_name, "https://github.com/#{tip.user.nickname}", target: '_blank'
            - if tip.decided?
              received
              = btc_human tip.amount
            - else
              will receive a tip
            - if tip.commit.present?
              for commit
              = link_to tip.commit[0..6], "https://github.com/#{@project.full_name}/commit/#{tip.commit}", target: :blank
            - if tip.undecided?
              when its amount is decided

    - if @project.next_tip_amount > 0
      %h4 Next Tip
      = btc_human @project.next_tip_amount

    %h4 Contribute and Earn
    Donate peercoins to this project or
    = link_to 'make commits', @project.github_url, target: '_blank'
    and get tips for it. If your commit is accepted by project maintainer and there are peercoins on its balance, you will get a tip!

    - if current_user
      - if current_user.bitcoin_address.blank?
        Just 
        = link_to 'tell us', current_user
        your peercoin address.      
    - else
      Just check your email or 
      %a{href: user_omniauth_authorize_path(:github)} Sign In.

    %h4 Promote #{@project.full_name}
    %p
      / AddThis Button BEGIN
      .addthis_toolbox.addthis_default_style.addthis_32x32_style(addthis:data_track_clickback="false" addthis:data_track_addressbar="false")
        %a.addthis_button_preferred_1
        %a.addthis_button_preferred_2
        %a.addthis_button_preferred_3
        %a.addthis_button_preferred_4
        %a.addthis_button_compact
        %a.addthis_counter.addthis_bubble_style
      / AddThis Button END

    %h4 Embed in README.md
    %p= link_to image_tag(project_url(@project, format: :svg), alt: 'Peer4Commit'), project_url(@project)
    %p
      %input.form-control{type: 'text', value: "[![tip for next commit](#{project_url(@project, format: :svg)})](#{project_url(@project)})"}

  .col-md-4
    - if @project.disabled?
      .panel.panel-danger
        .panel-heading
          %h4.panel-title
            Project Disabled
        .panel-body.text-center
          %p
            This project has been disabled.
            It doesn't accept donation and it will not distribute tips.
          - if (reason = @project.disabled_reason).present?
            %p Reason: #{reason}

    - else
      .panel.panel-default.project-panel
        .panel-heading
          %h4.panel-title
            Project informations
        .panel-body.text-center
          %table.table.text-left
            %tr
              %td Funds
              %td= btc_human @project.available_amount
            %tr
              %td Distributions
              %td
                %ul.list-unstyled#distribution-list
                  - @project.distributions.order(created_at: :desc).limit(5).each do |distribution|
                    %li.distribution-link
                      - label = btc_human(distribution.total_amount)
                      - if distribution.sent?
                        - if distribution.sent_at
                          - label << " sent #{time_ago_in_words(distribution.sent_at)} ago"
                        - else
                          - label << " sent"
                      - else
                        - label << " not sent"
                      = link_to label, [@project, distribution]
                = link_to "All distributions", project_distributions_path(@project)


      .panel.panel-default.project-panel
        .panel-heading
          %h4.panel-title
            Donate
        .panel-body.text-center
          %p To give to this project, send peercoins to this address:
          %p.bitcoin-address
            = @project.bitcoin_address
          %p
            = image_tag qrcode_project_path(@project, format: :svg), alt: @project.bitcoin_address, class: 'project qrcode'
          %p #{100-(CONFIG["our_fee"]*100).round}% of deposited funds will be used to tip for new commits. 
{'fraction_non_alphanumeric': 0.1030441280578935, 'fraction_numerical': 0.006450090458585699, 'mean_word_length': 2.0739845261121856, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 4, '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': '4990353', 'n_tokens_mistral': 3867, 'n_tokens_neox': 3735, 'n_words': 888}