Commit 4da689177db1254eedfcdf7b2fce4647ccee68bc

Authored by Ryan Jones
1 parent 399e6339
Exists in master and in 1 other branch production

added serv notification partial, lots of css

@@ -49,7 +49,7 @@ group :development, :test do @@ -49,7 +49,7 @@ group :development, :test do
49 gem 'webmock', :require => false 49 gem 'webmock', :require => false
50 unless ENV["CI"] 50 unless ENV["CI"]
51 gem 'ruby-debug', :platform => :mri_18 51 gem 'ruby-debug', :platform => :mri_18
52 - gem (RUBY_VERSION == "1.9.2" ? 'ruby-debug19' : 'debugger'), :platform => :mri_19 52 + gem (RUBY_VERSION >= "1.9.2" ? 'ruby-debug19' : 'debugger'), :platform => :mri_19
53 end 53 end
54 # gem 'rpm_contrib', :git => "git://github.com/bensymonds/rpm_contrib.git", :branch => "mongo-1.4.0_update" 54 # gem 'rpm_contrib', :git => "git://github.com/bensymonds/rpm_contrib.git", :branch => "mongo-1.4.0_update"
55 end 55 end
app/assets/stylesheets/application.css.erb
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 *= require jquery.alerts 3 *= require jquery.alerts
4 *= require errbit 4 *= require errbit
5 *= require issue_tracker_icons 5 *= require issue_tracker_icons
  6 + *= require notification_service_icons
6 *= require_self 7 *= require_self
7 */ 8 */
8 9
app/assets/stylesheets/errbit.css
@@ -535,10 +535,11 @@ a.button.active { @@ -535,10 +535,11 @@ a.button.active {
535 display: inline-block; 535 display: inline-block;
536 } 536 }
537 537
538 -/* Watchers and Issue Tracker Forms */  
539 -div.watcher.nested .watcher_params, div.issue_tracker.nested .tracker_params { 538 +/* Watchers / Issue Tracker / Notification Forms */
  539 +div.watcher.nested .watcher_params, div.issue_tracker.nested .tracker_params, div.notification_service.nested .notification_params {
540 display: none; 540 display: none;
541 } 541 }
  542 +
542 div.nested .chosen { 543 div.nested .chosen {
543 display: block !important; 544 display: block !important;
544 } 545 }
@@ -546,35 +547,35 @@ div.nested .choose { @@ -546,35 +547,35 @@ div.nested .choose {
546 margin-bottom: 0.5em; 547 margin-bottom: 0.5em;
547 } 548 }
548 549
549 -div.issue_tracker.nested .choose { 550 +div.issue_tracker.nested .choose, div.notification_service.nested .choose {
550 background-color: #ebebeb; 551 background-color: #ebebeb;
551 border: 1px solid #dddddd; 552 border: 1px solid #dddddd;
552 margin: 0 0 15px; 553 margin: 0 0 15px;
553 padding: 12px; 554 padding: 12px;
554 } 555 }
555 -div.issue_tracker.nested img { 556 +div.issue_tracker.nested img, div.notification_service.nested img {
556 vertical-align: middle; 557 vertical-align: middle;
557 } 558 }
558 559
559 /* Icons for Issue Tracker Radio Buttons */ 560 /* Icons for Issue Tracker Radio Buttons */
560 -div.issue_tracker.nested label.label_radio { 561 +div.issue_tracker.nested label.label_radio, div.notification_service.nested label.label_radio {
561 color: #929292; 562 color: #929292;
562 padding-left: 33px; 563 padding-left: 33px;
563 margin-bottom: 6px; 564 margin-bottom: 6px;
564 margin-right: 8px; 565 margin-right: 8px;
565 line-height: 30px; 566 line-height: 30px;
566 } 567 }
567 -div.issue_tracker.nested .choose { 568 +div.issue_tracker.nested .choose, div.notification_service.nested .choose {
568 padding-bottom: 6px; 569 padding-bottom: 6px;
569 } 570 }
570 -div.issue_tracker.nested label.label_radio:hover { 571 +div.issue_tracker.nested label.label_radio:hover, div.notification_service.nested label.label_radio:hover {
571 color: #696969; 572 color: #696969;
572 } 573 }
573 -div.issue_tracker.nested .label_radio input { 574 +div.issue_tracker.nested .label_radio input, div.notification_service.nested .label_radio input {
574 position: absolute; left: -9999px; 575 position: absolute; left: -9999px;
575 } 576 }
576 577
577 -div.issue_tracker.nested label.r_on, div.issue_tracker.nested label.r_on:hover { 578 +div.issue_tracker.nested label.r_on, div.issue_tracker.nested label.r_on:hover, div.notification_service.nested label.r_on, div.notification_service.nested label.r_on:hover {
578 color: #191919; 579 color: #191919;
579 } 580 }
580 581
app/assets/stylesheets/issue_tracker_icons.css.erb
@@ -15,3 +15,4 @@ div.issue_tracker.nested label.r_on.<%= tracker %> { @@ -15,3 +15,4 @@ div.issue_tracker.nested label.r_on.<%= tracker %> {
15 background: transparent url(/assets/<%= tracker %>_goto.png) 6px 5px no-repeat; 15 background: transparent url(/assets/<%= tracker %>_goto.png) 6px 5px no-repeat;
16 } 16 }
17 <% end %> 17 <% end %>
  18 +
app/assets/stylesheets/notification_service_icons.css.erb 0 → 100644
@@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
  1 + /* Notification Service inactive, select, create and goto icons */
  2 +<% notification_services = NotificationService.subclasses.map{|t| t.label } << 'none' %>
  3 +
  4 +<% notification_services.each do |notification_service| %>
  5 +div.notification_service.nested label.<%= notification_service %> {
  6 + background: url(/assets/<%= notification_service %>_inactive.png) no-repeat;
  7 +}
  8 +div.notification_service.nested label.r_on.<%= notification_service %> {
  9 + background: url(/assets/<%= notification_service %>_create.png) no-repeat;
  10 +}
  11 +#action-bar a.<%= notification_service %>_create {
  12 + background: transparent url(/assets/<%= notification_service %>_create.png) 6px 5px no-repeat;
  13 +}
  14 +#action-bar a.<%= notification_service %>_goto {
  15 + background: transparent url(/assets/<%= notification_service %>_goto.png) 6px 5px no-repeat;
  16 +}
  17 +<% end %>
  18 +
app/views/apps/_service_notification_fields.html.haml
1 %fieldset 1 %fieldset
2 %legend Notification Service 2 %legend Notification Service
3 = f.fields_for :notification_service do |w| 3 = f.fields_for :notification_service do |w|
4 - %div.notification.nested 4 + %div.notification_service.nested
5 %div.choose 5 %div.choose
6 = label_tag :type_none, :for => label_for_attr(w, 'type_notificationservice'), :class => "label_radio none" do 6 = label_tag :type_none, :for => label_for_attr(w, 'type_notificationservice'), :class => "label_radio none" do
7 = w.radio_button :type, "NotificationService", 'data-section' => 'none' 7 = w.radio_button :type, "NotificationService", 'data-section' => 'none'
@@ -12,7 +12,6 @@ @@ -12,7 +12,6 @@
12 = notification_service.name[/::(.*)Service/,1].titleize 12 = notification_service.name[/::(.*)Service/,1].titleize
13 13
14 %div.notification_params.none{:class => (w.object && !(w.object.class < NotificationService)) ? 'chosen' : nil} 14 %div.notification_params.none{:class => (w.object && !(w.object.class < NotificationService)) ? 'chosen' : nil}
15 - %p When no issue tracker has been configured, you will be able to leave comments on errors.  
16 - NotificationService.subclasses.each do |notification_service| 15 - NotificationService.subclasses.each do |notification_service|
17 %div.notification_params{:class => (w.object.is_a?(notification_service) ? 'chosen ' : '') << notification_service.label} 16 %div.notification_params{:class => (w.object.is_a?(notification_service) ? 'chosen ' : '') << notification_service.label}
18 - notification_service::Fields.each do |field, field_info| 17 - notification_service::Fields.each do |field, field_info|