Commit 335f58aceaa908bed39906e5987bd84d1dd6ef29

Authored by Nathan Broadbent
1 parent b7363466
Exists in master and in 1 other branch production

Refactored issue tracker icon css. Generates the icon background css dynamically…

…, based on IssueTracker subclasses.
app/views/issue_trackers/_icons.css.erb 0 → 100644
@@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
  1 +/* Issue Tracker inactive, select, create and goto icons */
  2 +<% trackers = IssueTracker.subclasses.map{|t| t::Label } << 'none' %>
  3 +<% trackers.each do |tracker| %>
  4 +div.issue_tracker.nested label.<%= tracker %> { background: url(/images/<%= tracker %>_inactive.png) no-repeat; }
  5 +div.issue_tracker.nested label.r_on.<%= tracker %>, #action-bar a.<%= tracker %>_create { background: url(/images/<%= tracker %>_create.png) no-repeat; }
  6 +#action-bar a.<%= tracker %>_goto { background: transparent url(/images/<%= tracker %>_goto.png) 6px 5px no-repeat; }
  7 +<% end %>
  8 +
app/views/layouts/application.html.haml
@@ -9,6 +9,9 @@ @@ -9,6 +9,9 @@
9 = csrf_meta_tag 9 = csrf_meta_tag
10 = javascript_include_tag :defaults 10 = javascript_include_tag :defaults
11 = stylesheet_link_tag 'reset', 'application' 11 = stylesheet_link_tag 'reset', 'application'
  12 + :css
  13 + #{render :partial => "issue_trackers/icons.css"}
  14 +
12 = yield :head 15 = yield :head
13 %body{:id => controller.controller_name, :class => controller.action_name} 16 %body{:id => controller.controller_name, :class => controller.action_name}
14 #header 17 #header
public/stylesheets/application.css
@@ -567,23 +567,6 @@ div.issue_tracker.nested label.r_on, div.issue_tracker.nested label.r_on:hover { @@ -567,23 +567,6 @@ div.issue_tracker.nested label.r_on, div.issue_tracker.nested label.r_on:hover {
567 color: #191919; 567 color: #191919;
568 } 568 }
569 569
570 -/* Inactive icons */  
571 -div.issue_tracker.nested label.none { background: url(/images/none_inactive.png) no-repeat; }  
572 -div.issue_tracker.nested label.redmine { background: url(/images/redmine_inactive.png) no-repeat; }  
573 -div.issue_tracker.nested label.lighthouseapp { background: url(/images/lighthouseapp_inactive.png) no-repeat; }  
574 -div.issue_tracker.nested label.mingle { background: url(/images/mingle_inactive.png) no-repeat; }  
575 -div.issue_tracker.nested label.fogbugz { background: url(/images/fogbugz_inactive.png) no-repeat; }  
576 -div.issue_tracker.nested label.pivotal { background: url(/images/pivotal_inactive.png) no-repeat; }  
577 -div.issue_tracker.nested label.github { background: url(/images/github_inactive.png) no-repeat; }  
578 -/* Active icons */  
579 -div.issue_tracker.nested label.r_on.none { background: url(/images/none_create.png) no-repeat; }  
580 -div.issue_tracker.nested label.r_on.redmine { background: url(/images/redmine_create.png) no-repeat; }  
581 -div.issue_tracker.nested label.r_on.lighthouseapp { background: url(/images/lighthouseapp_create.png) no-repeat; }  
582 -div.issue_tracker.nested label.r_on.mingle { background: url(/images/mingle_create.png) no-repeat; }  
583 -div.issue_tracker.nested label.r_on.fogbugz { background: url(/images/fogbugz_create.png) no-repeat; }  
584 -div.issue_tracker.nested label.r_on.pivotal { background: url(/images/pivotal_create.png) no-repeat; }  
585 -div.issue_tracker.nested label.r_on.github { background: url(/images/github_create.png) no-repeat; }  
586 -  
587 /* Icons need to be preloaded, otherwise it looks bad */ 570 /* Icons need to be preloaded, otherwise it looks bad */
588 .image_preloader { display: none; } 571 .image_preloader { display: none; }
589 572
@@ -673,54 +656,6 @@ table.tally th.value { @@ -673,54 +656,6 @@ table.tally th.value {
673 background: transparent url(images/icons/thumbs-up.png) 6px 5px no-repeat; 656 background: transparent url(images/icons/thumbs-up.png) 6px 5px no-repeat;
674 } 657 }
675 658
676 -#action-bar a.lighthouseapp_create {  
677 - background: transparent url(/images/lighthouseapp_create.png) 6px 5px no-repeat;  
678 -}  
679 -  
680 -#action-bar a.redmine_create {  
681 - background: transparent url(/images/redmine_create.png) 6px 5px no-repeat;  
682 -}  
683 -  
684 -#action-bar a.pivotal_create {  
685 - background: transparent url(/images/pivotal_create.png) 6px 5px no-repeat;  
686 -}  
687 -  
688 -#action-bar a.fogbugz_create {  
689 - background: transparent url(/images/fogbugz_create.png) 6px 5px no-repeat;  
690 -}  
691 -  
692 -#action-bar a.mingle_create {  
693 - background: transparent url(/images/mingle_create.png) 6px 5px no-repeat;  
694 -}  
695 -  
696 -#action-bar a.github_create {  
697 - background: transparent url(/images/github_create.png) 6px 5px no-repeat;  
698 -}  
699 -  
700 -#action-bar a.lighthouseapp_goto {  
701 - background: transparent url(/images/lighthouseapp_goto.png) 6px 5px no-repeat;  
702 -}  
703 -  
704 -#action-bar a.redmine_goto {  
705 - background: transparent url(/images/redmine_goto.png) 6px 5px no-repeat;  
706 -}  
707 -  
708 -#action-bar a.pivotal_goto {  
709 - background: transparent url(/images/pivotal_goto.png) 6px 5px no-repeat;  
710 -}  
711 -  
712 -#action-bar a.fogbugz_goto {  
713 - background: transparent url(/images/fogbugz_goto.png) 6px 5px no-repeat;  
714 -}  
715 -  
716 -#action-bar a.mingle_goto {  
717 - background: transparent url(/images/mingle_goto.png) 6px 5px no-repeat;  
718 -}  
719 -  
720 -#action-bar a.github_goto {  
721 - background: transparent url(/images/github_goto.png) 6px 5px no-repeat;  
722 -}  
723 -  
724 /* Notices Pagination */ 659 /* Notices Pagination */
725 .notice-pagination { 660 .notice-pagination {
726 float: left; 661 float: left;