<commit_before>module NeedsHelper
  def start_work_link need
    start_work = "#{Plek.current.find("arbiter")}/artefacts/new"

    form_tag start_work, :method => 'get', :target => '_blank' do
      [
        hidden_field_tag("artefact[name]", "CHANGE ME: #{need.title}").html_safe,
        hidden_field_tag("artefact[owning_app]", "publisher").html_safe,
        hidden_field_tag("artefact[need_id]", need.id).html_safe,
        hidden_field_tag("artefact[kind]", need.kind.to_s.downcase).html_safe,
        hidden_field_tag("artefact[tags]", need.tag_list).html_safe,
        hidden_field_tag("artefact[department]", need.writing_department).html_safe
      ].join.html_safe + \
      submit_tag('Start work on this need', :disable_with => 'Working...', :class => 'fulfill').html_safe
    end.html_safe
  end

  def assign_work_link need
    start_work =  "#{Plek.current.find("arbiter")}/artefacts"
    start_work += "?return_to=#{CGI.escape(request.url)}"

    form_tag start_work, :method => 'post', :target => '_blank' do
      [
        hidden_field_tag("artefact[name]", "CHANGE ME: #{need.title}").html_safe,<commit_msg>button text should change depending on need status (you can't start something that's already started)<commit_after>module NeedsHelper
  def start_work_link need
    start_work = "#{Plek.current.find("arbiter")}/artefacts/new"
    
    if need.status == 'in-progress' || need.status == 'done'
      title = 'Continue work on this need'
    else
      title = 'Start work on this need'
    end

    form_tag start_work, :method => 'get', :target => '_blank' do
      [
        hidden_field_tag("artefact[name]", "CHANGE ME: #{need.title}").html_safe,
        hidden_field_tag("artefact[owning_app]", "publisher").html_safe,
        hidden_field_tag("artefact[need_id]", need.id).html_safe,
        hidden_field_tag("artefact[kind]", need.kind.to_s.downcase).html_safe,
        hidden_field_tag("artefact[tags]", need.tag_list).html_safe,
        hidden_field_tag("artefact[department]", need.writing_department).html_safe
      ].join.html_safe + \
      submit_tag(title, :disable_with => 'Working...', :class => 'fulfill').html_safe
    end.html_safe
  end

  def assign_work_link need
    start_work =  "#{Plek.current.find("arbiter")}/artefacts"
    start_work += "?return_to=#{CGI.escape(request.url)}"

    form_tag start_work, :method => 'post', :target => '_blank' do
      [
        hidden_field_tag("artefact[name]", "CHANGE ME: #{need.title}").html_safe,
{'fraction_non_alphanumeric': 0.15208667736757625, 'fraction_numerical': 0.0, 'mean_word_length': 3.995991983967936, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '3366489', 'n_tokens_mistral': 842, 'n_tokens_neox': 845, 'n_words': 144}