Skip to content
This repository has been archived by the owner on Jan 23, 2020. It is now read-only.

Commit

Permalink
Merge branch 'pr/87'
Browse files Browse the repository at this point in the history
Conflicts:
	Gemfile.lock
	app/models/event.rb
	app/models/stash.rb
	app/views/stashes/_stash_row.html.haml
	config/routes.rb
  • Loading branch information
asebastian committed Jul 15, 2013
2 parents 7adc6f1 + 54e72eb commit 08b8831
Show file tree
Hide file tree
Showing 29 changed files with 318 additions and 210 deletions.
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ gem 'rails', '3.2.12'
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'

# bundle --without mysql if using sqlite
gem 'mysql2', "~> 0.3.11", :group => :mysql
gem 'mysql2', "~> 0.3.11", :group => :mysql

#Authentication Gems
gem 'devise'
Expand Down
68 changes: 35 additions & 33 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ GEM
i18n (~> 0.6)
multi_json (~> 1.0)
arel (3.0.2)
bcrypt-ruby (3.0.1)
bcrypt-ruby (3.1.1)
bootstrap-sass (2.1.1.0)
bootstrap-will_paginate (0.0.9)
will_paginate
builder (3.0.4)
cancan (1.6.9)
cancan (1.6.10)
capybara (2.1.0)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
Expand All @@ -48,13 +48,13 @@ GEM
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.6.2)
coffee-script-source (1.6.3)
daemons (1.1.9)
devise (2.2.3)
devise (3.0.0)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.1)
railties (~> 3.1)
warden (~> 1.2.1)
railties (>= 3.2.6, < 5)
warden (~> 1.2.3)
diff-lcs (1.2.4)
erubis (2.7.0)
eventmachine (1.0.3)
Expand All @@ -72,37 +72,39 @@ GEM
sass-rails (>= 3.1.1)
formtastic (2.2.1)
actionpack (>= 3.0)
haml (4.0.2)
haml (4.0.3)
tilt
haml-rails (0.4)
actionpack (>= 3.1, < 4.1)
activesupport (>= 3.1, < 4.1)
haml (>= 3.1, < 4.1)
railties (>= 3.1, < 4.1)
hike (1.2.2)
hike (1.2.3)
http_parser.rb (0.5.3)
i18n (0.6.4)
journey (1.0.4)
jquery-datatables-rails (1.11.2)
jquery-rails
jquery-rails (2.2.1)
jquery-rails (3.0.4)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.7.7)
json (1.8.0)
kgio (2.8.0)
libv8 (3.11.8.17)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.23)
multi_json (1.7.2)
mini_portile (0.5.1)
multi_json (1.7.7)
mysql2 (0.3.11)
nokogiri (1.5.9)
nokogiri (1.6.0)
mini_portile (~> 0.5.0)
orm_adapter (0.4.0)
poltergeist (1.2.0)
poltergeist (1.3.0)
capybara (~> 2.1.0)
faye-websocket (~> 0.4, >= 0.4.4)
faye-websocket (>= 0.4.4, < 0.5.0)
http_parser.rb (~> 0.5.3)
polyglot (0.3.3)
rack (1.4.5)
Expand Down Expand Up @@ -130,33 +132,33 @@ GEM
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
raindrops (0.11.0)
rake (10.0.4)
rake (10.1.0)
rdoc (3.12.2)
json (~> 1.4)
ref (1.0.4)
ref (1.0.5)
rest-client (1.6.7)
mime-types (>= 1.16)
rolify (3.1.0)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
rspec-core (2.14.3)
rspec-expectations (2.14.0)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.1)
rspec-rails (2.13.1)
rspec-mocks (2.14.1)
rspec-rails (2.14.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
sass (3.2.8)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
sass (3.2.9)
sass-rails (3.2.6)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
sinatra (1.3.6)
sinatra (1.4.3)
rack (~> 1.4)
rack-protection (~> 1.3)
tilt (~> 1.3, >= 1.3.3)
rack-protection (~> 1.4)
tilt (~> 1.3, >= 1.3.4)
sprockets (2.2.2)
hike (~> 1.2)
multi_json (~> 1.0)
Expand All @@ -171,21 +173,21 @@ GEM
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thor (0.18.1)
tilt (1.3.7)
treetop (1.4.12)
tilt (1.4.1)
treetop (1.4.14)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.37)
uglifier (2.0.1)
uglifier (2.1.2)
execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2)
unicorn (4.6.2)
unicorn (4.6.3)
kgio (~> 2.6)
rack
raindrops (~> 0.7)
warden (1.2.1)
warden (1.2.3)
rack (>= 1.0)
whenever (0.8.2)
whenever (0.8.3)
activesupport (>= 2.3.4)
chronic (>= 0.6.3)
will_paginate (3.0.4)
Expand Down
30 changes: 22 additions & 8 deletions app/assets/javascripts/clients.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,35 @@
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
$ ->
$('.subpopover').popover({'placement': 'bottom'})

$('td.moreinfo').click ->
$($(this).closest('tr').attr("rel")).modal("show")
$(this).closest('tr').attr("rel")
$.get "/clients/modal_data", { 'client_query': $(this).closest('tr').attr("rel") },
(data) ->
if data.code == 0
$('#client-data-modal').html(data['data'])
$('#client-data-modal').modal("show")
else
alert(data.msg)

$('a.delete-client').click ->
self = $(this)
if (confirm('Are you sure?'))
$.ajax $(this).attr("rel"),
type: 'DELETE'
success: (data) ->
$.post "/clients/delete_client", { 'key': $(this).attr('key') },
(data) ->
if data
$("#client_row_" + $(self).attr('key')).hide()
else
alert("Could not delete client")

use_environments = $("#use_environments").attr("rel")
if use_environments == "true"
aocolumns = [null, null, null, null, null, null, {bSortable: false}, {bSortable: false}]
else
aocolumns = [null, null, null, null, null, {bSortable: false}, {bSortable: false}]

dtable = $('#clients_table').dataTable
bAutoWidth: false
bSort: true
aoColumns: [null, null, null, null, null, null, {bSortable: false}, {bSortable: false}]
bPaginate: false
bAutoWidth: false
bSort: true
aoColumns: aocolumns
bPaginate: false
83 changes: 47 additions & 36 deletions app/assets/javascripts/events.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,18 @@ $ ->
$('#primary_events_table').dataTable().fnReloadAjax()
setTimeout (() -> $('#updating_event_list').hide()), 2500

runPermanentHooks = ()->
setPickers = ()->
$('.timepicker').timepicker({ 'step': 15, 'showDuration': true, 'timeFormat': 'g:ia', 'scrollDefaultNow': true })
$('.datepicker').datepicker({ 'autoclose': true, 'dateFormat': 'm/d/yy', 'format': 'mm/dd/yyyy' })

runPermanentHooks = ()->
$(document).on 'keydown', '.silence-input', ->
self = $(this)
misc = $(self).attr("misc")
$('#no_input_' + $(self).attr("misc")).hide()
if $(self).val().length > 12
$('[control="silence_grey_submit_' + misc + '"]').hide()
$('[control="silence_submit_' + misc + '"]').show()
misc = $(this).attr("misc")
$('#no_input_' + $(this).attr("misc")).hide()
if $(this).val().length >= $(this).data("min")
$('[control="silence_submit_' + misc + '"]').addClass('btn-success').removeClass('btn-inverse')
else
$('[control="silence_grey_submit_' + misc + '"]').show()
$('[control="silence_submit_' + misc + '"]').hide()

$(document).on 'click', '[control^=silence_grey_submit_]', ->
$('#no_input_' + $(this).attr("misc")).show()
$('[control="silence_submit_' + misc + '"]').addClass('btn-inverse').removeClass('btn-success')

$(document).on 'click', 'div.moreinfo', ->
$.get "/events/modal_data", { 'event_query': $(this).attr('misc'), 'i': $(this).attr('index_id') },
Expand All @@ -52,51 +47,67 @@ $ ->
$(self).text("Failed to resolve")
$(self).css("color", "red")

$(document).on 'click', '.silence-event', ->
self = $(this)
$(document).on 'click', '.silence-client', ->
$("#event-data-modal").modal("hide")
$.get "/events/modal_silence", { 'event_query': $(this).attr('misc'), 'i': $(this).attr('index_id'), 't':'client' },
(data) ->
if data
$('#event-data-modal').html(data['data'])
$('#event-data-modal').modal("show")
setPickers()
else
alert("Could not get modal info")

$(document).on 'click', '.silence-check', ->
$("#event-data-modal").modal("hide")
$("#modal_" + $(self).attr("misc")).modal("show")
$.get "/events/modal_silence", { 'event_query': $(this).attr('misc'), 'i': $(this).attr('index_id'), 't':'check' },
(data) ->
if data
$('#event-data-modal').html(data['data'])
$('#event-data-modal').modal("show")
setPickers()
else
alert("Could not get modal info")

$(document).on 'click', '.silence-submit-event', ->
self = $(this)
misc = $(self).attr("misc")
misc = $(this).attr("misc")
if $('#text_input_' + misc).val().length < $('#text_input_' + misc).data("min")
alert('Comment must be at least ' + $('#text_input_' + misc).data("min") + ' characters long')
return false
$.post $(this).attr("rel"), { 'expire_at_time': $('#silence_expire_at_time_' + misc).val(), 'expire_at_date': $('#silence_expire_at_date_' + misc).val(), 'description': $('#text_input_' + misc).val()},
(data) ->
if data
$("#modal_" + misc).modal("hide")
if data.code == 0
$("#event-data-modal").modal("hide")
$('i[event="' + misc + '"]').removeClass("icon-volume-up").addClass("icon-volume-off")
updateEventTable()
else
alert("Failed to silence...")
alert(data)

$(document).on 'click', '.unsilence-submit-event', ->
self = $(this)
misc = $(self).attr("misc")
misc = $(this).attr("misc")
$.post $(this).attr("rel"),
(data) ->
if data
$('[control="unsilence_' + misc + '"]').hide()
$('[control="silence_' + misc + '"]').show()
$('td[rel="' + misc + '_popup_info"]').attr('data-content', "No")
$('td[rel="' + misc + '_column_silenced"]').text("No")
$('i[event="' + misc + '"]').removeClass("icon-volume-off").addClass("icon-volume-up")
else
alert("Failed to unsilence...")

$(document).on 'click', '.delete-client', ->
self = $(this)
if (confirm('Are you sure?'))
$.ajax $(this).attr("rel"),
type: 'DELETE'
success: (data) ->
if data
updateEventTable()
else
alert("Could not delete client")
$(document).on 'click', 'a.delete-client', ->
if (confirm('Are you sure?'))
$.post "/clients/delete_client", { 'key': $(this).attr('key') },
(data) ->
if data
$("td:contains('" + this.data.split("=")[1] + "')").parent().hide()
else
alert("Could not delete client")

use_environments = $("#use_environments").attr("rel")
if use_environments == "true"
aocolumns = [{bVisible: false}, null, null, null, null, null, null, null, null]
aocolumns = [{bVisible: false}, null, null, null, null, null, null, null, {bSortable: false}]
else
aocolumns = [{bVisible: false}, null, null, null, null, null, null, null]
aocolumns = [{bVisible: false}, null, null, null, null, null, null, {bSortable: false}]

dtable = $('#primary_events_table').dataTable
bAutoWidth: false
Expand Down
35 changes: 23 additions & 12 deletions app/assets/stylesheets/bootstrap_and_overrides.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,42 @@ body {
top: 3%;
right: 3%;
left: 3%;
bottom: 3%;
width: auto;
margin: 0;
margin: 0 auto;
}

.small-modal {
height: 60%;
width: 60%;
width: 30%;
left: 8%;
top: 5%;
top: 20%;
}

.large-modal {
height: 65%;
width: 75%;
left: 8%;
top: 5%;
width: 50%;
left: 8%;
top: 5%;
}

.silence-reason {
float: left;
}

.silence-time {
float: left;
padding-left: 50px;
}

div.modal-body {
max-height: 60%;
padding-bottom: 80px;
max-height: 500px;
max-width: 95%;
}

div.modal-footer {
min-height: 20%;
position: absolute;
bottom: 0px;
right: 0px;
width: 100%;
}

table.events_table {
Expand Down Expand Up @@ -86,7 +96,8 @@ only screen and (max-width: 480px) {
.modal-footer {
min-height: 45px;
}



/* Force table to not be like tables anymore */
.events_table thead,.events_table tbody,.events_table th,.events_table td,.events_table tr {
display: block;
Expand Down
Loading

0 comments on commit 08b8831

Please sign in to comment.