This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create | |
@alert = current_user.alerts.build params[:alert] | |
if params[:send] | |
@alert.save | |
@alert.deliver | |
flash[:notice] = "Successfully sent the alert" | |
redirect_to logs_path | |
else | |
render :template => "alerts/preview" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% form_for @alert, :url => cancel_alert_path(@alert.original_alert.nil? ? @alert : @alert.original_alert) do |form| %> | |
<div id="edit"> | |
<%= render form %> | |
<%= form.submit "Preview Message" %> | |
</div> | |
<div id="preview"> | |
<%= render @alert %> | |
<%= link_to 'Edit', '#edit', :class => 'edit' %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AlertPresenter < CachingPresenter | |
presents :alert, :accepts => [:action, :current_user] | |
attr_reader :action | |
def acknowledged_by_user? | |
if attempt = @alert.alert_attempts.find_by_user_id(@current_user) | |
attempt.acknowledged? | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Acknowledging an alert | |
In order to report that I read an alerts | |
As a user | |
I can acknowledge an alert | |
Background: | |
Given the following users exist: | |
| Martin Fowler | martin@example.com | Health Official | Dallas County | | |
And the role "Health Official" is an alerter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HashRowColumn | |
include MongoMapper::Document | |
key :row, String | |
key :column, Hash | |
key :column_ids, Array | |
def self.[](r = nil) | |
return HashRowColumns if(r.nil?) | |
hr = HashRowColumn.find_by_row(r) | |
if(hr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> HashRowColumn.all | |
=> [#<HashRowColumn column: {}, row: "3", _id: 4b95d9ca24b0441937000001, column_ids: []>, #<HashRowColumn column: {}, row: nil, _id: 4b95de0324b0441be6000001, column_ids: []>, #<HashRowColumn column: {"2"=>"This", "3"=>"Test", "4"=>"Test", "5"=>"Me"}, row: "2", _id: 4b95d55a24b04415aa000001, column_ids: ["2", "3", "4", "5"]>, #<HashRowColumn column: {"2"=>"Blue"}, row: "1", _id: 4b95c91d24b0440ceb000001, column_ids: ["2"]>, #<HashRowColumn column: {"22"=>"You", "2"=>"Me Too!"}, row: "16", _id: 4b95c96224b0440ceb000002, column_ids: ["2"]>] | |
>> HashRowColumn["1"]["17"] = "My Test" | |
=> "My Test" | |
>> HashRowColumn.all | |
=> [#<HashRowColumn column: {}, row: "3", _id: 4b95d9ca24b0441937000001, column_ids: []>, #<HashRowColumn column: {}, row: nil, _id: 4b95de0324b0441be6000001, column_ids: []>, #<HashRowColumn column: {"2"=>"This", "3"=>"Test", "4"=>"Test", "5"=>"Me"}, row: "2", _id: 4b95d55a24b04415aa000001, column_ids: ["2", "3", "4", "5"]>, #<HashRowColumn column: {"17"=>"My Test", "2"=>"Blue"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@cloud CloudStack-2.2.3-1-fedora14-oss]# cloud-setup-management | |
Welcome to the CloudStack Management setup | |
cloud.texashan.org | |
The hostname of this machine is properly set up | |
Executing the following reconfiguration script: | |
rm /files/etc/sudoers/Defaults[1] | |
save | |
sudoers reconfiguration failed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@cloud ~]# cobbler repo report | |
Name : FC15-x86_64 | |
Arch : x86_64 | |
Breed : yum | |
Comment : | |
Createrepo Flags : <<inherit>> | |
Environment Variables : {} | |
Keep Updated : True | |
Mirror : http://mirror.anl.gov/pub/fedora/linux/releases/15/Everything/x86_64/os/ | |
Mirror locally : True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rspec/core' | |
require 'rspec/core/rake_task' | |
require 'jasmine-headless-webkit' | |
# Run Jasmine headless via webkit | |
Jasmine::Headless::Task.new('jasmine:headless') | |
# Add to default rake task | |
if default = Rake.application.instance_variable_get('@tasks')['default'] | |
default.prerequisites.unshift('jasmine:headless') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*globals Raphael,jQuery, window*/ | |
/* | |
* | |
* Wijmo Library 2.0.0 | |
* http://wijmo.com/ | |
* | |
* Copyright(c) ComponentOne, LLC. All rights reserved. | |
* | |
* Dual licensed under the Wijmo Commercial or GNU GPL Version 3 licenses. | |
* licensing@wijmo.com |
OlderNewer