Skip to content
Browse files

WIP UX changes

  • Loading branch information...
1 parent 79dc88d commit 3b231e7a7976927c7a5dcf37a3ce21bf0b53c030 @elandesign elandesign committed Aug 21, 2012
Showing with 438 additions and 487 deletions.
  1. +11 −0 app/assets/javascripts/application.js.erb
  2. +72 −0 app/assets/javascripts/jquery.cookie.js
  3. +17 −0 app/assets/stylesheets/application.css.erb
  4. +1 −1 app/controllers/apps_controller.rb
  5. +5 −10 app/controllers/errs_controller.rb
  6. +14 −0 app/helpers/notices_helper.rb
  7. +4 −0 app/models/app.rb
  8. +1 −0 app/models/problem.rb
  9. +5 −5 app/views/apps/_configuration_instructions.html.haml
  10. +7 −7 app/views/apps/_fields.html.haml
  11. +12 −24 app/views/apps/edit.html.haml
  12. +10 −19 app/views/apps/index.html.haml
  13. +6 −19 app/views/apps/new.html.haml
  14. +20 −76 app/views/apps/show.html.haml
  15. +10 −10 app/views/deploys/_table.html.haml
  16. +0 −7 app/views/deploys/index.html.haml
  17. +13 −7 app/views/errs/_issue_tracker_links.html.haml
  18. +29 −34 app/views/errs/_table.html.haml
  19. +1 −8 app/views/errs/index.html.haml
  20. +0 −13 app/views/errs/search.html.haml
  21. +88 −111 app/views/errs/show.html.haml
  22. +1 −1 app/views/kaminari/_next_page.html.haml
  23. +1 −1 app/views/kaminari/_page.html.haml
  24. +1 −1 app/views/kaminari/_prev_page.html.haml
  25. +2 −4 app/views/layouts/application.html.haml
  26. +2 −2 app/views/modals/_app_delete_confirm.html.haml
  27. +14 −0 app/views/notices/_comments.html.haml
  28. +1 −3 app/views/notices/_params.html.haml
  29. +1 −3 app/views/notices/_session.html.haml
  30. +2 −2 app/views/shared/_navigation.html.haml
  31. +52 −55 app/views/users/_fields.html.haml
  32. +11 −19 app/views/users/edit.html.haml
  33. +9 −10 app/views/users/index.html.haml
  34. +6 −15 app/views/users/new.html.haml
  35. +8 −20 app/views/users/show.html.haml
  36. +1 −0 lib/amqp/subscriber.rb
View
11 app/assets/javascripts/application.js.erb
@@ -3,11 +3,22 @@
//= require rails
//= require form
//= require jquery.pjax
+//= require jquery.cookie
//= require rails.alerts
//= require errbit
//= require bootstrap/bootstrap
//= require_self
+$(document).ready(function(){
+ $('a[data-toggle=tab]').bind('shown', function(el){
+ $.cookie('current-tab', $(el.target).attr('href'))
+ })
+
+ if($.cookie('current-tab') != null) {
+ $('a[data-toggle=tab][href=' + $.cookie('current-tab') + ']').click()
+ }
+})
+
// Allow any gems named 'errbit_*' to require their own assets
<% Gem.loaded_specs.keys.grep(/^errbit_/).each do |plugin|
require_asset(plugin) rescue Sprockets::FileNotFound
View
72 app/assets/javascripts/jquery.cookie.js
@@ -0,0 +1,72 @@
+/*jshint eqnull:true */
+/*!
+ * jQuery Cookie Plugin v1.2
+ * https://github.com/carhartl/jquery-cookie
+ *
+ * Copyright 2011, Klaus Hartl
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.opensource.org/licenses/GPL-2.0
+ */
+(function ($, document, undefined) {
+
+ var pluses = /\+/g;
+
+ function raw(s) {
+ return s;
+ }
+
+ function decoded(s) {
+ return decodeURIComponent(s.replace(pluses, ' '));
+ }
+
+ $.cookie = function (key, value, options) {
+
+ // key and at least value given, set cookie...
+ if (value !== undefined && !/Object/.test(Object.prototype.toString.call(value))) {
+ options = $.extend({}, $.cookie.defaults, options);
+
+ if (value === null) {
+ options.expires = -1;
+ }
+
+ if (typeof options.expires === 'number') {
+ var days = options.expires, t = options.expires = new Date();
+ t.setDate(t.getDate() + days);
+ }
+
+ value = String(value);
+
+ return (document.cookie = [
+ encodeURIComponent(key), '=', options.raw ? value : encodeURIComponent(value),
+ options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
+ options.path ? '; path=' + options.path : '',
+ options.domain ? '; domain=' + options.domain : '',
+ options.secure ? '; secure' : ''
+ ].join(''));
+ }
+
+ // key and possibly options given, get cookie...
+ options = value || $.cookie.defaults || {};
+ var decode = options.raw ? raw : decoded;
+ var cookies = document.cookie.split('; ');
+ for (var i = 0, parts; (parts = cookies[i] && cookies[i].split('=')); i++) {
+ if (decode(parts.shift()) === key) {
+ return decode(parts.join('='));
+ }
+ }
+
+ return null;
+ };
+
+ $.cookie.defaults = {};
+
+ $.removeCookie = function (key, options) {
+ if ($.cookie(key, options) !== null) {
+ $.cookie(key, null, options);
+ return true;
+ }
+ return false;
+ };
+
+})(jQuery, document);
View
17 app/assets/stylesheets/application.css.erb
@@ -12,6 +12,23 @@
table.table table.tally td, table.table table.tally th { border-top: 0px solid black !important; }
table.table table.tally tr:first-child td, table.table table.tally tr:first-child th { padding-top: 1px; }
+legend { margin-bottom: 0; }
+
+.issue_tracker { }
+.issue_tracker .choose { float: left; margin-bottom: 1.2em !important; }
+.issue_tracker .choose label { float: left; width: 18%; }
+.issue_tracker .tracker_params { clear: both; }
+
+td.count, th.count, th.narrow, td.narrow { text-align: center; width: 10px; white-space: nowrap; }
+
+h2.error span.where { font-weight: 300; }
+
+span.label a { color: white; }
+span.label { text-transform: uppercase; }
+
+ul.occurrences li.current { font-weight: bold; }
+
+
// Allow any gems named 'errbit_*' to require their own assets
<% Gem.loaded_specs.keys.grep(/^errbit_/).each do |plugin|
require_asset(plugin) rescue Sprockets::FileNotFound
View
2 app/controllers/apps_controller.rb
@@ -6,7 +6,7 @@ class AppsController < InheritedResources::Base
def show
respond_to do |format|
format.html do
- @all_errs = !!params[:all_errs]
+ @all_errs = !!params[:resolved]
@sort = params[:sort]
@order = params[:order]
View
15 app/controllers/errs_controller.rb
@@ -10,7 +10,8 @@ class ErrsController < ApplicationController
def index
app_scope = current_user.admin? ? App.all : current_user.apps
- @problems = Problem.for_apps(app_scope).in_env(params[:environment]).unresolved.ordered_by(@sort, @order)
+ @problems = Problem.for_apps(app_scope).in_env(params[:environment]).ordered_by(@sort, @order)
+ @problems = @problems.unresolved unless params[:resolved]
@selected_problems = params[:problems] || []
respond_to do |format|
format.html do
@@ -31,15 +32,9 @@ def search
@selected_problems = params[:problems] || []
end
- def all
- app_scope = current_user.admin? ? App.all : current_user.apps
- @problems = Problem.for_apps(app_scope).ordered_by(@sort, @order).page(params[:page]).per(current_user.per_page)
- @selected_problems = params[:problems] || []
- end
-
def show
- @notices = @problem.notices.reverse_ordered.page(params[:notice]).per(1)
- @notice = @notices.first
+ @notices = @problem.notices.reverse_ordered.page(params[:page]).per(10)
+ @notice = params[:notice] ? @problem.notices.find(params[:notice]) : @notices.first
@comment = Comment.new
if request.headers['X-PJAX']
params["_pjax"] = nil
@@ -90,7 +85,7 @@ def unlink_issue
def resolve
@problem.resolve!
- flash[:success] = 'Great news everyone! The err has been resolved.'
+ flash[:success] = 'Great news everyone! The error has been resolved.'
redirect_to :back
rescue ActionController::RedirectBackError
redirect_to app_path(@app)
View
14 app/helpers/notices_helper.rb
@@ -20,6 +20,20 @@ def link_to_source_file(app, line, &block)
text
end
+ def environment_tag(environment, link = nil)
+ class_name = case environment
+ when 'production'
+ 'label-success'
+ when 'integration'
+ 'label-info'
+ when 'staging'
+ 'label-warning'
+ else
+ ''
+ end
+ content_tag(:span, link.present? ? link_to(environment, link) : environment, :class => "label #{class_name} environment")
+ end
+
def filepath_parts(file)
[file.split('/').last, file.gsub('[PROJECT_ROOT]', '')]
end
View
4 app/models/app.rb
@@ -112,6 +112,10 @@ def github_url
"https://github.com/#{github_repo}" if github_repo?
end
+ def github_url_to_revision(revision)
+ "#{github_url}/tree/#{revision}"
+ end
+
def github_url_to_file(file)
"#{github_url}/blob/master#{file}"
end
View
1 app/models/problem.rb
@@ -52,6 +52,7 @@ class Problem
indexes :environment, :index => :not_analyzed
indexes :resolved, :index => :not_analyzed
indexes :last_notice_at, :index => :not_analyzed
+ indexes :all_user_details, :index => :snowball
end
after_save :update_index, :if => lambda { Errbit::Config.elasticsearch_enabled }
View
10 app/views/apps/_configuration_instructions.html.haml
@@ -14,11 +14,11 @@
# -------------------------------------------------------
Airbrake.configure do |config|
- config.api_key = '#{app.api_key}'
- config.host = '#{request.host}'
- config.port = #{request.port}
- config.secure = config.port == 443
- end
+ config.api_key = '#{app.api_key}'
+ config.host = '#{request.host}'
+ config.port = #{request.port}
+ config.secure = config.port == 443
+ end
# Set up Javascript notifications
# -------------------------------
View
14 app/views/apps/_fields.html.haml
@@ -3,20 +3,23 @@
.row-fluid
.span8
%fieldset
- %legend App Details
+ %legend Application Details
%div.control-group
= f.label :name
%div.controls
= f.text_field :name, :placeholder => 'Application Name'
- %p.help-block Enter a name for your application
+ %p.help-inline Enter a name for your application
%div.control-group
= f.label :github_repo
%div.controls
= f.text_field :github_repo, :placeholder => "https://github.com/fac/errbit"
- %p.help-block Enter the location of the repository on Github
+ %p.help-inline Enter the location of the repository on Github
+ = render "issue_tracker_fields", :f => f
+
+ .span4
%fieldset.notifications
%legend Notifications
%div.control-group.well
@@ -44,9 +47,6 @@
= f.check_box :notify_all_users
Send notifications to all users
- = render "issue_tracker_fields", :f => f
-
- .span4
%fieldset.watchers.nested-wrapper{:style => f.object.notify_all_users ? 'display: none;' : ''}
%legend Watchers
= f.fields_for :watchers do |w|
@@ -63,4 +63,4 @@
%div.watcher_params.user{:class => w.object.email.blank? ? 'chosen' : nil}
= w.select :user_id, User.all.map{|u| [u.name,u.id.to_s]}, :include_blank => '-- Select a User --'
%div.watcher_params.email{:class => w.object.email.present? ? 'chosen' : nil}
- = w.text_field :email
+ = w.text_field :email
View
36 app/views/apps/edit.html.haml
@@ -1,28 +1,16 @@
-- content_for :title, 'Edit App'
-- content_for :action_bar do
- .btn-toolbar
- .btn-group
- = link_to_copy_attributes_from_other_app
- = link_to('#', { :class => 'btn btn-primary copy_config' }) do
- %i{ :class => 'icon-share icon-white' }
- Copy Configuration From Another App
-
- .btn-group.pull-right
- = link_to('#app-delete-confirm', { :class => 'btn btn-danger', :data => { :toggle => 'modal' } } ) do
- %i{ :class => 'icon-trash icon-white' }
- Delete
-
- = link_to(app_path(@app), { :class => 'btn btn-inverse pull-right' }) do
- %i{ :class => 'icon-chevron-left icon-white'}
- Cancel
+- content_for :title do
+ Edit Application
+ %span.label.pull-right= @app.api_key
= form_for @app do |f|
-
= render 'fields', :f => f
+ .form-actions
+ .btn-toolbar
+ %button{ :class => 'btn btn-primary' }
+ Update Application
+ = link_to 'Cancel', apps_path, :class => 'btn'
+ .btn-group.pull-right
+ = link_to('#app-delete-confirm', { :class => 'btn btn-danger', :data => { :toggle => 'modal' } } ) do
+ Delete Application
- .btn-toolbar
- %button{ :class => 'btn btn-success' }
- %i{ :class => 'icon-thumbs-up icon-white' }
- Update App
-
-= render 'modals/app_delete_confirm', :app => @app
+= render 'modals/app_delete_confirm', :app => @app
View
29 app/views/apps/index.html.haml
@@ -1,22 +1,13 @@
-- content_for :title, 'Apps'
-
-- content_for :action_bar do
- - if current_user.admin?
- .btn-toolbar
- .btn-group
- = link_to(new_app_path, { :class => 'btn btn-primary' }) do
- %i{ :class => 'icon-plus-sign icon-white' }
- Add New App
-
+- content_for :title, 'Applications'
%table.table.table-striped.table-bordered.apps
%thead
%tr
%th Name
- %th GitHub Repo
+ %th GitHub
%th Tracker
%th Last Deploy
- %th Active Errors
+ %th.count Errors
%tbody
- @apps.each do |app|
%tr
@@ -52,11 +43,11 @@
%a{ :class => 'badge badge-success', :href => app_path(app) }
0
- - if @apps.none?
- - if current_user.admin?
- %tr
- %td{:colspan => 5}
- = link_to(new_app_path, { :class => 'btn btn-primary' }) do
- %i{ :class => 'icon-plus-sign icon-white' }
- Add New App
+- if current_user.admin?
+ .btn-toolbar
+ .btn-group.pull-right
+ = link_to(new_app_path, { :class => 'btn btn-primary' }) do
+ %i{ :class => 'icon-plus-sign icon-white' }
+ Add a New Application
+
View
25 app/views/apps/new.html.haml
@@ -1,23 +1,10 @@
-- content_for :title, 'Add App'
-- content_for :action_bar do
- .btn-toolbar
- .btn-group
- = link_to_copy_attributes_from_other_app
- = link_to('#', { :class => 'btn btn-primary copy_config' })
- %i{ :class => 'icon-share icon-white' }
- Copy Configuration From Another App
-
- .btn-group.pull-right
- = link_to(apps_path, { :class => 'btn btn-inverse pull-right' })
- %i{ :class => 'icon-chevron-left icon-white'}
- Back To Apps
+- content_for :title, 'Add Application'
= form_for @app do |f|
-
= render 'fields', :f => f
-
- .btn-toolbar
- %button{ :class => 'btn btn-primary' }
- %i{ :class => 'icon-ok-sign icon-white' }
- Add App
+ .form-actions
+ .btn-toolbar
+ %button{ :class => 'btn btn-primary' }
+ Create Application
+ = link_to 'Cancel', apps_path, :class => 'btn'
View
96 app/views/apps/show.html.haml
@@ -1,85 +1,29 @@
-- content_for :title, @app.name
-
-- content_for :head do
- = auto_discovery_link_tag :atom, app_path(@app, User.token_authentication_key => current_user.authentication_token, :format => "atom"), :title => "Errbit notices for #{@app.name} at #{request.host}"
-
-- content_for :meta do
- .row-fluid
- - if @app.problems.count > 0
- %span.alert.alert-error.span4
- %strong Errors Caught:
- = @app.problems.count
- - else
- %span.alert.alert-success.span4
- %strong Errors Caught:
- = @app.problems.count
- %span.alert.alert-info.span4
- %strong Deploy Count:
- = @app.deploys.count
- %span.alert.alert-success.span4
- %strong API Key:
- = @app.api_key
- %hr
-
-- content_for :action_bar do
- .btn-toolbar
+- content_for :title do
+ = @app.name
+ .btn-toolbar.pull-right
.btn-group
- if current_user.admin?
- = link_to(edit_app_path(@app), { :class => 'btn btn-primary' }) do
- %i{ :class => 'icon-edit icon-white' }
- Edit App
-
- -if @app.deploys.count > 0
- = link_to(app_deploys_path(@app), { :class => 'btn btn-info' }) do
- %i{ :class => 'icon-play icon-white'}
- View Deploys
- - if @app.problems.any?
- - if @all_errs
- = link_to(app_path(@app), { :class => 'btn btn-inverse' }) do
- %i{ :class => 'icon-eye-close icon-white' }
- Show Only Unresolved Errors
- - else
- = link_to(app_path(@app, :all_errs => true), { :class => 'btn btn-info' }) do
- %i{ :class => 'icon-eye-open icon-white' }
- Show All Errors
-
+ = link_to(edit_app_path(@app), { :class => 'btn btn-primary pull-right' }) do
+ %i{ :class => 'icon-cog icon-white' }
+ Edit Settings
- if @app.github_repo?
= link_to(@app.github_url, { :class => 'btn btn-info', :target => '_blank' }) do
%i{ :class => 'icon-share icon-white' }
- Goto Github Repo
+ Go To Github
- .btn-group.pull-right
- = link_to(apps_path, { :class => 'btn btn-inverse pull-right' }) do
- %i{ :class => 'icon-chevron-left icon-white'}
- Back To Apps
+- content_for :head do
+ = auto_discovery_link_tag :atom, app_path(@app, User.token_authentication_key => current_user.authentication_token, :format => "atom"), :title => "Errbit notices for #{@app.name} at #{request.host}"
.row-fluid
- .span10
- - if @app.problems.any?
- = render 'errs/table', :errs => @problems
- = render 'deploys/table', :deploys => @deploys
-
- - else
- .well
- %h3.clear.alert.alert-warning No errs have been caught yet, make sure you setup your app
- = render 'configuration_instructions', :app => @app
+ - if @app.problems.any?
+ = render 'errs/table', :errs => @problems
+ %h3
+ Latest Deploys
+ = link_to('View All', app_deploys_path(@app), { :class => 'btn btn-mini pull-right' })
+ = render 'deploys/table', :deploys => @deploys
+
+ - else
+ .well
+ %h3.clear.alert.alert-warning No errs have been caught yet, make sure you setup your app
+ = render 'configuration_instructions', :app => @app
- .span2
- %table.watchers.table.table-striped.table-bordered
- %caption
- %h3 Watchers
- %thead
- %tr
- %th Watcher Username / Email
- %tbody
- - if @app.notify_all_users
- %tr
- %td All users will be notified when something happens.
- - else
- - if @app.watchers.none?
- %tr
- %td
- %em #{@app.name} has no watchers
- - @app.watchers.each do |watcher|
- %tr
- %td= watcher.label
View
20 app/views/deploys/_table.html.haml
@@ -1,31 +1,31 @@
%table.deploys.table.table-striped.table-bordered
- %caption
- %h3 Latest Deploys
%thead
%tr
- %th App
+ %th.narrow Environment
+ %th Application
%th When
%th Who
%th Message
- %th Repository
%th Revision
- if deploys.any?
%tbody
- deploys.each do |deploy|
%tr
- %td.app
- = deploy.app.name
- %span.label.label-info.environment= deploy.environment
+ %td.narrow.environment= environment_tag deploy.environment
+ %td.app= deploy.app.name
%td.when= deploy.created_at.to_s(:micro)
%td.who= deploy.username
%td.message= deploy.message
- %td.repository= deploy.repository
- %td.revision= deploy.short_revision
+ %td.revision
+ - if deploy.app.github_repo?
+ = link_to deploy.short_revision, deploy.app.github_url_to_revision(deploy.revision), :target => '_blank'
+ - else
+ = deploy.short_revision
- else
%tbody
%tr
%td{ :colspan => 6}
%p No deploys
--# = paginate deploys
+-# = paginate deploys
View
7 app/views/deploys/index.html.haml
@@ -1,11 +1,4 @@
- content_for :title, 'Deploys'
-- content_for :action_bar do
-
- - if current_user.authentication_token
- = link_to(app_deploys_path(@app, :format => "ics", :auth_token => current_user.authentication_token), { :class=> 'calendar_link btn btn-primary'}) do
- %i{ :class => 'icon-calendar icon-white'}
- iCal
-
= render 'table', :deploys => @deploys
View
20 app/views/errs/_issue_tracker_links.html.haml
@@ -2,14 +2,17 @@
- if @problem.issue_link.present?
- = link_to(@problem.issue_link, :class => "goto-issue btn btn-primary") do
+ = link_to(@problem.issue_link, :class => "goto-issue btn btn-primary", :target => '_blank') do
%i{ :class => 'icon-share icon-white'}
- Go to issue
+ - if @app.issue_tracker.is_a?(IssueTrackers::PivotalLabsTracker)
+ View on Pivotal Tracker
+ - else
+ Go to issue
- = render 'modals/err_unlink_issue', :app => @app, :problem => @problem
- = link_to('#error-unlink-issue-confirm', { :class => 'btn btn-danger', :data => { :toggle => 'modal'} }) do
- %i{ :class => 'icon-magnet icon-white'}
- Unlink Issue
+ / = render 'modals/err_unlink_issue', :app => @app, :problem => @problem
+ / = link_to('#error-unlink-issue-confirm', { :class => 'btn btn-danger', :data => { :toggle => 'modal'} }) do
+ / %i{ :class => 'icon-magnet icon-white'}
+ / Unlink Issue
- elsif @problem.issue_link == "pending"
= link_to('#', :class => "#{@problem.issue_type}_inactive create-issue btn", :disabled => true) do
@@ -38,5 +41,8 @@
= link_to(create_issue_app_err_path(@app, @problem), { :method => :post, :class => "create-issue btn btn-primary" }) do
%i{ :class => 'icon-share icon-white'}
- Create Issue
+ - if @app.issue_tracker.is_a?(IssueTrackers::PivotalLabsTracker)
+ Add to Pivotal Tracker
+ - else
+ Create Issue
View
63 app/views/errs/_table.html.haml
@@ -1,39 +1,44 @@
- any_issue_links = errs.any?{|e| e.issue_link.present? && e.issue_link != 'pending' }
=form_tag({}, :id => 'app-errors') do
+ %h3
+ Errors
+ - if errs.any?
+ - if @all_errs || params[:resolved]
+ = link_to(params.except(:resolved), { :class => 'btn btn-inverse btn-mini pull-right' }) do
+ %i{ :class => 'icon-eye-close icon-white' }
+ Show Only Unresolved Errors
+ - else
+ = link_to(params.merge(:resolved => true), { :class => 'btn btn-info btn-mini pull-right' }) do
+ %i{ :class => 'icon-eye-open icon-white' }
+ Show Resolved Errors
+
%table.errs.selectable.table.table-striped.table-bordered
- %caption
- %h3 Errors
%thead
%tr
%th= check_box_tag "toggle_problems_checkboxes"
- %th= link_for_sort "App"
+ - if !@app.present?
+ %th= link_for_sort "Application"
%th= link_for_sort "What &amp; Where".html_safe, "message"
%th= link_for_sort "Latest", "last_notice_at"
- %th= link_for_sort "Deploy", "last_deploy_at"
%th= link_for_sort "Count"
- - if any_issue_links
- %th Issue
- %th Resolve
+ %th Action
%tbody
- errs.each do |problem|
%tr{:class => problem.resolved? ? 'resolved' : 'unresolved'}
%td.select
= check_box_tag "problems[]", problem.id, @selected_problems.member?(problem.id.to_s)
-
- %td.app
- = link_to problem.app.name, app_path(problem.app)
- %br
- - if current_page?(:controller => 'errs')
- %span.environment.label.label-inverse
- = link_to problem.environment, errs_path(:environment => problem.environment)
- - else
- %span.environment.label.label-inverse
- = link_to problem.environment, app_path(problem.app, :environment => problem.environment)
-
+ - if !@app.present?
+ %td.app
+ = link_to problem.app.name, app_path(problem.app)
+ %br
+ = environment_tag problem.environment, params.merge(:environment => problem.environment)
+
%td.message
+ - if @app.present?
+ = environment_tag problem.environment, params.merge(:environment => problem.environment)
= link_to truncated_err_message(problem), app_err_path(problem.app, problem)
%em= problem.where
- if problem.comments_count > 0
@@ -44,12 +49,9 @@
%em.commenter= (Errbit::Config.user_has_username ? comment.user.username : comment.user.email).to_s << ":"
%em= truncate(comment.body, :length => 100, :separator => ' ')
- %td.latest
+ %td.latest.narrow
#{time_ago_in_words(last_notice_at problem)} ago
- %td.deploy
- =problem.last_deploy_at ? problem.last_deploy_at.to_s(:micro) : 'n/a'
-
%td.count
-if problem.notices_count > 0
%a{ :class => 'badge badge-important', :href => app_err_path(problem.app, problem) }
@@ -62,19 +64,13 @@
%a{ :class => 'badge badge-success', :href => app_err_path(problem.app, problem) }
=problem.notices_count
- - if any_issue_links
- %td.issue_link
- - if problem.app.issue_tracker_configured? && problem.issue_link.present? && problem.issue_link != 'pending'
- %a{ :class => 'btn btn-info', :href => problem.issue_link, :target => '_blank'}
- %i{ :class => 'icon-share icon-white'}
-
- %td.resolve
+ %td.resolve.narrow
-if problem.unresolved?
- %a{ :class => 'resolve btn btn-primary', :href => resolve_app_err_path(problem.app, problem), :data => { :method => 'put' } }
+ %a{ :class => 'resolve btn btn-primary btn-mini', :href => resolve_app_err_path(problem.app, problem), :data => { :method => 'put' } }
%i{ :class => 'icon-thumbs-up icon-white'}
Resolve
-else
- %a{ :class => 'resolve btn btn-warning', :href => unresolve_app_err_path(problem.app, problem), :data => { :method => 'put' } }
+ %a{ :class => 'resolve btn btn-warning btn-mini', :href => unresolve_app_err_path(problem.app, problem), :data => { :method => 'put' } }
%i{ :class => 'icon-thumbs-down icon-white'}
Unresolve
@@ -84,8 +80,6 @@
%td{:colspan => (any_issue_links ? 8 : 7)}
%em No errs here
- = paginate errs
-
.btn-toolbar
.btn-group
%button{ :id => 'merge_errs', :class => 'app-err-button btn btn-primary', :name => 'commit', :data => { :action => merge_several_errs_path} }
@@ -108,5 +102,6 @@
%i{ :class => 'icon-trash icon-white' }
Delete
+ = paginate errs
-= render 'modals/errs_delete_all_confirm'
+= render 'modals/errs_delete_all_confirm'
View
9 app/views/errs/index.html.haml
@@ -1,11 +1,4 @@
-- content_for :title, 'Unresolved Errors'
+- content_for :title, 'All Errors'
- content_for :head do
= auto_discovery_link_tag :atom, errs_path(User.token_authentication_key => current_user.authentication_token, :format => "atom"), :title => "Errbit notices at #{request.host}"
-- content_for :action_bar do
- .btn-toolbar
- .btn-group
- = link_to(all_errs_path, { :class => 'btn btn-info' }) do
- %i{ :class => 'icon-eye-open icon-white' }
- Show All Errors
-
= render 'table', :errs => @problems
View
13 app/views/errs/search.html.haml
@@ -1,16 +1,3 @@
- content_for :title, 'Search Results'
-- content_for :action_bar do
- .btn-toolbar
- .btn-group
- - if params[:resolved].present?
- = link_to(params.except(:resolved), { :class => 'btn btn-inverse' }) do
- %i{ :class => 'icon-eye-close icon-white' }
- Show Only Unresolved Errors
-
- - else
- = link_to(params.merge({:resolved => true}), { :class => 'btn btn-info' }) do
- %i{ :class => 'icon-eye-open icon-white' }
- Show All Errors
-
= render 'table', :errs => @problems
View
199 app/views/errs/show.html.haml
@@ -1,127 +1,104 @@
- content_for :page_title, @problem.message
- content_for :title_css_class, 'err_show'
-- content_for :title, @problem.error_class || truncate(@problem.message, :length => 32)
-- content_for :meta do
- .row-fluid
- %span.alert.alert-info.span3
- %strong App:
- = link_to @app.name, app_path(@app)
- %span.alert.alert-info.span3
- %strong Where:
+- content_for :title do
+ %h1
+ = link_to @problem.app.name, @problem.app
+ = environment_tag @problem.environment
+ .btn-toolbar.pull-right
+ .btn-group
+ - if @problem.unresolved?
+ = link_to(resolve_app_err_path(@app, @problem), {:class => 'btn btn-primary', :data => { :method => 'put' } }) do
+ %i{ :class => 'icon-thumbs-up icon-white' }
+ Resolve
+ - else
+ = link_to(unresolve_app_err_path(@app, @problem), {:class => 'btn btn-warning', :data => { :method => 'put' } }) do
+ %i{ :class => 'icon-thumbs-down icon-white' }
+ Unresolve
+ .btn-group
+ = render "issue_tracker_links"
+ %h2.error
+ = @problem.error_class || truncate(@problem.message, :length => 32)
+ %span.where
+ in
= @problem.where
- %span.alert.alert-info.span3
- %strong Environment:
- %span.label.label-info= @problem.environment
- %span.alert.alert-info.span3
- %strong Last Notice:
- = last_notice_at(@problem).to_s(:precise)
- %hr
-
-- content_for :action_bar do
- .btn-toolbar
- .btn-group
- - if @problem.unresolved?
- = link_to(resolve_app_err_path(@app, @problem), {:class => 'btn btn-primary', :data => { :method => 'put' } }) do
- %i{ :class => 'icon-thumbs-up icon-white' }
- Resolve
- - else
- = link_to(unresolve_app_err_path(@app, @problem), {:class => 'btn btn-warning', :data => { :method => 'put' } }) do
- %i{ :class => 'icon-thumbs-down icon-white' }
- Unresolve
-
- - if current_user.authentication_token
- = link_to(app_err_path(:app_id => @app.id, :id => @problem.id, :format => "ics", :auth_token => current_user.authentication_token), { :class => 'calendar_link btn btn-primary' }) do
- %i{ :class => 'icon-calendar icon-white'}
- iCal
-
- = render "issue_tracker_links"
-
- .btn-group.pull-right
- = link_to(errs_path, { :class => 'btn btn-inverse' }) do
- %i{ :class => 'icon-chevron-left icon-white'}
- Back To Errors
-
-- if Errbit::Config.allow_comments_with_issue_tracker || !@app.issue_tracker_configured? || @problem.comments.any?
- - content_for :comments do
- .row-fluid
- .well
- %h3 Comments
- - @problem.comments.each do |comment|
- .window
- %table.comment.table.table-bordered
- %tr
- %th
- %span= link_to '&#10008;'.html_safe, app_err_comment_path(@app, @problem, comment), :method => :delete, :data => { :confirm => "Are sure you don't need this comment?" }, :class => "destroy-comment"
- = time_ago_in_words(comment.created_at, true) << " ago by "
- = link_to comment.user.email, user_path(comment.user)
- %tr
- %td= comment.body.gsub("\n", "<br>").html_safe
- - if Errbit::Config.allow_comments_with_issue_tracker || !@app.issue_tracker_configured?
- .row-fluid
- .well
- = form_for @comment, :url => app_err_comments_path(@app, @problem) do |comment_form|
- %p Add a comment
- = comment_form.text_area :body, :style => "width: 100%; height: 80px;"
- = comment_form.submit "Save Comment", :class => 'btn btn-primary'
-
+ - if @problem.resolved?
+ %span.label Resolved
.alert.alert-block
%h4.alert-heading= @notice.try(:message)
- = paginate @notices, :param_name => :notice, :theme => :notices
-
-.btn-toolbar
- .btn-group.tab-bar
- = link_to('#summary', { :class => 'button btn btn-info', :rel => 'summary' }) do
- %i{ :class => 'icon-file icon-white'}
- Summary
-
- = link_to('#backtrace', { :class => 'button btn btn-info', :rel => 'backtrace' }) do
- %i{ :class => 'icon-fire icon-white'}
- Backtrace
- - if @notice && @notice.user_attributes.present?
- = link_to('#user_attributes', { :class => 'button btn btn-info', :rel => 'user_attributes' }) do
- %i{ :class => 'icon-user icon-white'}
- User Details
+/ = paginate @notices, :param_name => :notice, :theme => :notices
- = link_to('#environment', { :class => 'button btn btn-info', :rel => 'environment' }) do
- %i{ :class => 'icon-globe icon-white'}
- Environment
- = link_to('#params', { :class => 'button btn btn-info', :rel => 'params' }) do
- %i{ :class => 'icon-tags icon-white'}
- Parameters
+.row-fluid
+ .span3
+ .well
+ %p
+ %span.badge.badge-important= pluralize @notices.count, 'Occurrence'
+ %p
+ %strong Last Occurrence
+ %br
+ = last_notice_at(@problem).to_s(:precise)
+ %p
+ %strong Similar
+ %ul.unstyled.occurrences
+ - for notice in @notices.all
+ %li{:style => 'margin-bottom: 0.5em;', :class => (notice == @notice ? 'current' : nil)}
+ = link_to params.merge(:notice => notice.id) do
+ = notice.created_at.to_s(:precise)
+ - if notice.user_attributes['company']
+ %br
+ = "(#{notice.user_attributes['company']})"
+
+
+
+ .span9
+ %ul.nav.nav-tabs
+ %li.active= link_to('Summary', '#summary', :data => {:toggle => 'tab'})
+ %li= link_to('Backtrace', '#backtrace', :data => {:toggle => 'tab'})
+ - if @notice && @notice.user_attributes.present?
+ %li= link_to('User Details', '#user_attributes', :data => {:toggle => 'tab'})
+ %li= link_to('Environment', '#environment', :data => {:toggle => 'tab'})
+ %li= link_to('Parameters', '#params', :data => {:toggle => 'tab'})
+ %li= link_to('Session', '#session', :data => {:toggle => 'tab'})
+ %li= link_to('Comments', '#comments', :data => {:toggle => 'tab'})
+
+ - if @notice
+ .tab-content
+ #summary.tab-pane.active
+ .well
+ %h3 Summary
+ = render 'notices/summary', :notice => @notice, :problem => @problem
- = link_to('#session', { :class => 'button btn btn-info', :rel => 'session' }) do
- %i{ :class => 'icon-road icon-white'}
- Session
+ #backtrace.tab-pane
+ .well
+ %h3 Backtrace
+ = render 'notices/backtrace', :lines => @notice.backtrace
-- if @notice
- #summary
- %h3 Summary
- .well
- = render 'notices/summary', :notice => @notice, :problem => @problem
+ - if @notice.user_attributes.present?
+ #user_attributes.tab-pane
+ .well
+ %h3 User Details
+ = render 'notices/user_attributes', :user => @notice.user_attributes
- #backtrace
- %h3 Backtrace
- .well
- = render 'notices/backtrace', :lines => @notice.backtrace
+ #environment.tab-pane
+ .well
+ %h3 Environment
+ = render 'notices/environment', :notice => @notice
- - if @notice.user_attributes.present?
- #user_attributes
- %h3 User Details
- .well
- = render 'notices/user_attributes', :user => @notice.user_attributes
+ #params.tab-pane
+ .well
+ %h3 Parameters
+ = render 'notices/params', :notice => @notice
- #environment
- %h3 Environment
- .well
- = render 'notices/environment', :notice => @notice
+ #session.tab-pane
+ .well
+ %h3 Session
+ = render 'notices/session', :notice => @notice
- #params
- %h3 Parameters
- = render 'notices/params', :notice => @notice
+ - if Errbit::Config.allow_comments_with_issue_tracker || !@app.issue_tracker_configured? || @problem.comments.any?
+ #comments.tab-pane
+ .well
+ %h3 Comments
+ = render 'notices/comments', :problem => @problem
- #session
- %h3 Session
- = render 'notices/session', :notice => @notice
View
2 app/views/kaminari/_next_page.html.haml
@@ -6,4 +6,4 @@
-# per_page: number of items to fetch per page
-# remote: data-remote
%span.next
- = link_to_unless current_page.last?, raw('Next &raquo;'), url, :rel => 'next'
+ = link_to raw('Next &raquo;'), url, :rel => 'next', :class => (current_page.last? ? 'disabled' : nil)
View
2 app/views/kaminari/_page.html.haml
@@ -7,4 +7,4 @@
-# per_page: number of items to fetch per page
-# remote: data-remote
%span{:class => "page#{' current' if page.current?}"}
- = link_to_unless page.current?, page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil}
+ = link_to page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil}
View
2 app/views/kaminari/_prev_page.html.haml
@@ -6,4 +6,4 @@
-# per_page: number of items to fetch per page
-# remote: data-remote
%span.prev
- = link_to_unless current_page.first?, raw('&laquo; Previous'), url, :rel => 'prev'
+ = link_to raw('&laquo; Previous'), url, :rel => 'prev', :class => (current_page.first? ? 'disabled' : nil)
View
6 app/views/layouts/application.html.haml
@@ -42,9 +42,7 @@
- if content_for?(:comments)
#content-comments
= yield :comments
- %footer.navbar.navbar-fixed-bottom
- .navbar-inner
- .container-fluid
- = "Powered by #{link_to 'Errbit', 'http://github.com/errbit/errbit', :target => '_blank'}: the open source error catcher.".html_safe
+ %footer.footer
+ %p= "Powered by #{link_to 'Errbit', 'http://github.com/errbit/errbit', :target => '_blank'}: the open source error catcher.".html_safe
= yield :scripts
View
4 app/views/modals/_app_delete_confirm.html.haml
@@ -9,7 +9,7 @@
.modal-footer
= link_to(app_path(@app), { :method => :delete, :class => 'button btn btn-danger' }) do
%i{ :class => 'icon-thumbs-up icon-white' }
- Confirm
+ Yes
= link_to('#', { :class => 'btn btn-primary', :data => { :dismiss => 'modal' } }) do
%i{ :class => 'icon-thumbs-down icon-white' }
- Cancel
+ No
View
14 app/views/notices/_comments.html.haml
@@ -0,0 +1,14 @@
+- @problem.comments.each do |comment|
+ %table.comment.table.table-bordered
+ %tr
+ %th
+ %span= link_to '&#10008;'.html_safe, app_err_comment_path(@app, @problem, comment), :method => :delete, :data => { :confirm => "Are sure you don't need this comment?" }, :class => "destroy-comment"
+ = time_ago_in_words(comment.created_at, true) << " ago by "
+ = link_to comment.user.email, user_path(comment.user)
+ %tr
+ %td= comment.body.gsub("\n", "<br>").html_safe
+- if Errbit::Config.allow_comments_with_issue_tracker || !@app.issue_tracker_configured?
+ = form_for @comment, :url => app_err_comments_path(@app, @problem) do |comment_form|
+ %p Add a comment
+ = comment_form.text_area :body, :style => "width: 100%; height: 80px;"
+ = comment_form.submit "Save Comment", :class => 'btn btn-primary'
View
4 app/views/notices/_params.html.haml
@@ -1,4 +1,2 @@
-.window
- .raw_data
- %pre.hash= pretty_hash notice.params
+%pre= pretty_hash notice.params
View
4 app/views/notices/_session.html.haml
@@ -1,3 +1 @@
-.window
- .raw_data
- %pre.hash= pretty_hash notice.session
+%pre= pretty_hash notice.session
View
4 app/views/shared/_navigation.html.haml
@@ -5,14 +5,14 @@
- if current_app.present?
= current_app.name
- else
- Apps
+ Applications
%b.caret
%ul.dropdown-menu
- for app in available_apps
%li= link_to app.name, app_path(app)
- if current_user.admin?
%li.divider
- %li= link_to 'Add a New App', new_app_path
+ %li= link_to 'Add a New Application', new_app_path
%li.divider-vertical
%li.errs{:class => active_if_here(:errs)}= link_to 'Errors', errs_path
%li.divider-vertical
View
107 app/views/users/_fields.html.haml
@@ -1,57 +1,54 @@
= errors_for @user
-%fieldset
- %legend User Details
-
-.control-group
- = f.label :name, :class => 'control-label'
- .controls
- = f.text_field :name, :placeholder => 'Joe Bloggs'
- %p.help-block Enter the full name of this user
-
-- if Errbit::Config.user_has_username
- .control-group
- = f.label :username, :class => 'control-label'
- .controls
- = f.text_field :username, :placeholder => 'joebloggs'
- %p.help-block Enter the username of this user
-
-.control-group
- = f.label :email, :class => 'control-label'
- .controls
- = f.text_field :email, :placeholder => 'joe@joebloggs.com'
- %p.help-block Enter the users email address
-
-- if Errbit::Config.github_authentication
- .control-group
- = f.label :github_login, :class => 'control-label'
- .controls
- = f.text_field :github_login, :placeholder => 'joebloggs'
- %p.help-block Enter the users github username
-
-.control-group
- %label.control-label{:for => 'per_page'} Entries per page
- .controls
- = f.select :per_page, [10, 20, 30, 50, 75, 100]
-
-.control-group
- = f.label :time_zone, :class => 'control-label'
- .controls
- = f.time_zone_select :time_zone, ActiveSupport::TimeZone.us_zones
-
-.control-group
- = f.label :password, :class => 'control-label'
- .controls
- = f.password_field :password, :autocomplete => "off"
-
-.control-group
- = f.label :password_confirmation, :class => 'control-label'
- .controls
- = f.password_field :password_confirmation
-
-- if current_user.admin?
- .control-group
- %label.control-label.checkbox
- = f.check_box :admin
- Admin?
-
+.row-fluid
+ %fieldset.span6
+ %legend User Details
+
+ .control-group
+ = f.label :name, :class => 'control-label'
+ .controls
+ = f.text_field :name, :placeholder => 'Joe Bloggs'
+
+ - if Errbit::Config.user_has_username
+ .control-group
+ = f.label :username, :class => 'control-label'
+ .controls
+ = f.text_field :username, :placeholder => 'joebloggs'
+
+ .control-group
+ = f.label :email, :class => 'control-label'
+ .controls
+ = f.text_field :email, :placeholder => 'joe@joebloggs.com'
+
+ - if Errbit::Config.github_authentication
+ .control-group
+ = f.label :github_login, 'Github Username', :class => 'control-label'
+ .controls
+ = f.text_field :github_login, :placeholder => 'joebloggs'
+
+ .control-group
+ %label.control-label{:for => 'per_page'} Entries per page
+ .controls
+ = f.select :per_page, [10, 20, 30, 50, 75, 100]
+
+ .control-group
+ = f.label :time_zone, :class => 'control-label'
+ .controls
+ = f.time_zone_select :time_zone, ActiveSupport::TimeZone.us_zones
+ %fieldset.span6
+ %legend Password
+ .control-group
+ = f.label :password, :class => 'control-label'
+ .controls
+ = f.password_field :password, :autocomplete => "off"
+
+ .control-group
+ = f.label :password_confirmation, :class => 'control-label'
+ .controls
+ = f.password_field :password_confirmation
+
+ - if current_user.admin? && current_user != f.object
+ .control-group
+ %label.control-label.checkbox
+ = f.check_box :admin
+ Admin?
View
30 app/views/users/edit.html.haml
@@ -1,27 +1,19 @@
- content_for :title, "Edit #{@user.name}"
-- content_for :action_bar do
- .btn-toolbar
- .btn-group
- = render 'shared/link_github_account', :user => @user
-
- .btn-group.pull-right
- = link_to('#user-delete-confirm', :class => 'btn btn-danger', :data => { :toggle => 'modal' }) do
- %i{ :class => 'icon-trash icon-white' }
- Delete User
-
- = link_to(users_path(@user), { :class => 'btn btn-inverse' }) do
- %i{ :class => 'icon-chevron-left icon-white'}
- Cancel
= form_for @user, :html => {:autocomplete => "off"} do |f|
= @user.errors.full_messages.to_sentence
= render 'fields', :f => f
+ .form-actions
+ .btn-toolbar
+ %button{ :class => 'btn btn-primary' }
+ Update User
+ = link_to(users_path, { :class => 'btn' }) do
+ Cancel
+ - if current_user != @user
+ = link_to('#user-delete-confirm', :class => 'btn btn-danger pull-right', :data => { :toggle => 'modal' }) do
+ Delete User
- .btn-toolbar
- -# We can't seem to do f.submit as a block so replace with a button
- %button{ :class => 'btn btn-success' }
- %i{ :class => 'icon-thumbs-up icon-white' }
- Update User
+= render 'modals/user_delete_confirm', :user => @user
-= render 'modals/user_delete_confirm', :user => @user
+
View
19 app/views/users/index.html.haml
@@ -1,27 +1,26 @@
- content_for :title, 'Users'
-- content_for :action_bar do
- .btn-toolbar
- .btn-group
- = link_to(new_user_path, { :class => 'btn btn-primary' }) do
- %i{ :class => 'icon-plus-sign icon-white' }
- Add New User
-
%table.table.table-striped.table-bordered
%thead
%tr
%th Name
- if Errbit::Config.user_has_username
%th Username
%th.main Email
- %th Admin?
+ %th.narrow Admin?
%tbody
- @users.each do |user|
%tr
%td.nowrap= link_to user.name, user_path(user)
- if Errbit::Config.user_has_username
%td= user.username
%td= user.email
- %td= user.admin? ? 'Yes' : 'No'
+ %td.narrow= user.admin? ? 'Yes' : 'No'
+
+= paginate @users
-= paginate @users
+.btn-toolbar
+ .btn-group.pull-right
+ = link_to(new_user_path, { :class => 'btn btn-primary' }) do
+ %i{ :class => 'icon-plus-sign icon-white' }
+ Add a New User
View
21 app/views/users/new.html.haml
@@ -1,19 +1,10 @@
- content_for :title, 'New User'
-- content_for :action_bar do
- .btn-toolbar
- .btn-group
-
- .btn-group.pull-right
- = link_to(users_path, { :class => 'btn btn-inverse' }) do
- %i{ :class => 'icon-chevron-left icon-white'}
- Cancel
= form_for @user do |f|
-
= render 'fields', :f => f
-
- .btn-toolbar
- -# We can't seem to do f.submit as a block so replace with a button
- %button{ :class => 'btn btn-success' }
- %i{ :class => 'icon-thumbs-up icon-white' }
- Add User
+ .form-actions
+ .btn-toolbar
+ %button{ :class => 'btn btn-primary' }
+ Create User
+ = link_to(users_path, { :class => 'btn' }) do
+ Cancel
View
28 app/views/users/show.html.haml
@@ -1,23 +1,4 @@
- content_for :title, @user.name
-- content_for :action_bar do
- .btn-toolbar
- .btn-group
- = render 'shared/link_github_account', :user => @user
-
- = link_to(edit_user_path(@user), { :class => 'btn btn-primary' }) do
- %i{ :class => 'icon-edit icon-white' }
- Edit User
-
- .btn-group.pull-right
- = link_to(new_user_path, { :class => 'btn btn-primary' }) do
- %i{ :class => 'icon-plus-sign icon-white' }
- Add New User
-
- = link_to(users_path, { :class => 'btn btn-inverse' }) do
- %i{ :class => 'icon-chevron-left icon-white'}
- Back To Users
-
-
%table.single_user.table.table-striped.table-bordered
%tr
%th Email
@@ -35,4 +16,11 @@
%td= @user.admin? ? 'Yes' : 'No'
%tr
%th Created
- %td= @user.created_at.to_s(:micro)
+ %td= @user.created_at.to_s(:micro)
+.btn-toolbar
+ .btn-group
+ = render 'shared/link_github_account', :user => @user
+ - if current_user.admin? || current_user == @user
+ = link_to(edit_user_path(@user), { :class => 'btn btn-primary' }) do
+ %i{ :class => 'icon-edit icon-white' }
+ Edit User
View
1 lib/amqp/subscriber.rb
@@ -27,6 +27,7 @@ def subscribe(endpoint)
# onto the http endpoint.
# App.report_error!(message[:payload])
begin
+ puts message.inspect
request = Net::HTTP::Post.new(uri.path)
request.body = message[:payload]
response = Net::HTTP.start(uri.host, uri.port) {|http| http.request(request)}

0 comments on commit 3b231e7

Please sign in to comment.
Something went wrong with that request. Please try again.