diff --git a/app/views/errs/show.html.haml b/app/views/errs/show.html.haml index 7fce9a0..3b17e4e 100644 --- a/app/views/errs/show.html.haml +++ b/app/views/errs/show.html.haml @@ -20,7 +20,7 @@ - if @err.unresolved? %span= link_to 'resolve', resolve_app_err_path(@app, @err), :method => :put, :confirm => err_confirm, :class => 'resolve' -- if !@app.issue_tracker_configured? || @err.comments.any? +- if Errbit::Config.allow_comments_with_issue_tracker || !@app.issue_tracker_configured? || @err.comments.any? - content_for :comments do %h3 Comments on this Err - @err.comments.each do |comment| @@ -33,7 +33,7 @@ = link_to comment.user.email, user_path(comment.user) %tr %td= comment.body.gsub("\n", "
").html_safe - - unless @app.issue_tracker_configured? + - if Errbit::Config.allow_comments_with_issue_tracker || !@app.issue_tracker_configured? = form_for @comment, :url => create_comment_app_err_path(@app, @err) do |comment_form| %p Add a comment = comment_form.text_area :body, :style => "width: 420px; height: 80px;" diff --git a/config/config.example.yml b/config/config.example.yml index 1aaf1a6..be7761e 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -31,6 +31,10 @@ confirm_resolve_err: true # Helpful when you need to plug in a custom authentication strategy, such as LDAP. user_has_username: false +# Allow comments while an issue tracker is configured. +# This is useful when you don't need to create a ticket, +# and you want to attach a short note to the err. +allow_comments_with_issue_tracker: true # Configure SMTP settings. If you are running Errbit on Heroku, # sendgrid will be configured by default. diff --git a/spec/views/errs/show.html.haml_spec.rb b/spec/views/errs/show.html.haml_spec.rb index 7b5618f..aa03964 100644 --- a/spec/views/errs/show.html.haml_spec.rb +++ b/spec/views/errs/show.html.haml_spec.rb @@ -38,7 +38,11 @@ describe "errs/show.html.haml" do end - describe "content_for :comments" do + describe "content_for :comments with comments disabled for configured issue tracker" do + before do + Errbit::Config.stub(:allow_comments_with_issue_tracker).and_return(false) + end + it 'should display comments and new comment form when no issue tracker' do err = Factory(:err_with_comments) assign :err, err -- libgit2 0.21.2