Advertisement
Guest User

Untitled

a guest
May 19th, 2017
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5.46 KB | None | 0 0
  1. <html>
  2. <head>
  3.     <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
  4.     <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
  5.  
  6.     <style>
  7.         input[type=checkbox],
  8.         input[type=radio] {
  9.             width:25px!important;
  10.             display:inline-block;
  11.             float:left;
  12.             margin-top:0!important;
  13.             opacity:0;
  14.             margin-right:10px;
  15.             position:relative;
  16.             z-index:5;
  17.         }
  18.  
  19.         input[type=checkbox] + label,
  20.         input[type=radio] + label {
  21.             width:calc(100% - 35px)!important;
  22.             margin-left:0!important;
  23.             margin-right:0!important;
  24.             display:inline-block;
  25.             float:left;
  26.         }
  27.  
  28.         input[type=checkbox] + label:before,
  29.         input[type=radio] + label:before  {
  30.             content:'';
  31.             left:-36px;
  32.             top: 0;
  33.             z-index:-1;
  34.             right:0;
  35.             color:green;
  36.             position:absolute;
  37.             border:2px solid #222;
  38.             width:25px;
  39.             height:25px;
  40.             padding:4px;
  41.         }
  42.  
  43.         input[type=radio] + label:before  {
  44.             border-radius:100%;
  45.             left:-37px;
  46.         }
  47.  
  48.         input[type=checkbox]:checked + label:before,
  49.         input[type=radio]:checked + label:before  {
  50.             border-color:green;
  51.         }
  52.  
  53.         input[type=checkbox]:checked + label:after,
  54.         input[type=radio]:checked + label:after {
  55.             content:'\f00c';
  56.             font-family:'FontAwesome';
  57.             font-size:25px;
  58.             left:-36px;
  59.             top: 0;
  60.             z-index:-5;
  61.             right:0;
  62.             position:absolute;
  63.             color:green;
  64.         }
  65.  
  66.         input[type=radio]:checked + label:after {
  67.             content:'\f111';
  68.             font-size:18px;
  69.             left:-32px;
  70.         }
  71.  
  72.         .form-group input[type=checkbox]  ,
  73.         .form-group input[type=radio] {
  74.         z-index:20;
  75.         opacity:0;
  76.         }
  77.  
  78.         .form-group input[type=checkbox] + label ,
  79.         .form-group input[type=radio] + label {
  80.         z-index:10;
  81.         }
  82.  
  83.         table tr td input[type=checkbox]:checked + label:after,
  84.         table tr td input[type=radio]:checked + label:after {
  85.         top:5px;
  86.         }
  87.  
  88.          input[type=radio]:checked + label.eval-pass:before,
  89.         input[type=radio] + label.eval-pass:before{
  90.              border-color:#1F7F44;
  91.          }
  92.  
  93.         label.eval-pass,
  94.         input[type=radio]:checked + label.eval-pass:after {
  95.              color:#1F7F44;
  96.          }
  97.  
  98.          input[type=radio]:checked + label.eval-fail:before,
  99.         input[type=radio] + label.eval-fail:before{
  100.              border-color:#D80B0B;
  101.          }
  102.  
  103.         label.eval-fail,
  104.         input[type=radio]:checked + label.eval-fail:after {
  105.              color:#D80B0B;
  106.          }
  107.  
  108.           input[type=radio]:checked + label.eval-na:before,
  109.         input[type=radio] + label.eval-na:before{
  110.              border-color:#0E5A81;
  111.          }
  112.  
  113.         label.eval-na,
  114.         input[type=radio]:checked + label.eval-na:after {
  115.              color:#0E5A81;
  116.          }
  117.  
  118.           input[type=radio]:checked + label.eval-caution:before,
  119.         input[type=radio] + label.eval-caution:before{
  120.              border-color:#979700;
  121.          }
  122.  
  123.         label.eval-caution,
  124.         input[type=radio]:checked + label.eval-caution:after {
  125.              color:#979700;
  126.          }
  127.  
  128.           form label, form label.control-label {
  129.             font-weight: 700;
  130.             font-size: 0.9em;
  131.             font-family: "avenir-medium";
  132.             width: 100%;
  133.             position: relative;
  134.         }
  135.     </style>
  136. </head>
  137.  
  138. <body>
  139.  
  140. <div ng-app="myApp">
  141.   <div ng-controller="myController">
  142.     <form>
  143.       <fieldset data-ng-repeat="s in sections">
  144.         <div class="form-group">
  145.           <div class="col-md-12">
  146.             <h2>[[s.name]]</h2>
  147.           </div>
  148.         </div>
  149.  
  150.         <!-- Field Item -->
  151.         <div class="form-group m-b-20 bg-light" data-ng-repeat="f in s.fields">
  152.           <div class="col-md-12 m-b-30">
  153.             <h4>[[ f.name ]]</h4>
  154.             <input type="text" data-ng-model="f.comments" class="form-control input-md underline" placeholder="Comments">
  155.           </div>
  156.  
  157.           <div class="col-sm-3" data-ng-repeat="v in values">
  158.             <input type="radio" name="section-[[s.section]]-field-[[f.field]]" ng-value="v.value" class="form-control" data-ng-model="f.field_condition">
  159.             <label class="eval-[[ v.internal ]]"><i class="fa" ng-class="v.classes"></i> [[ v.external ]]</label>
  160.           </div>
  161.           [[ f.field_condition ]]
  162.         </div>
  163.         <hr>
  164.       </fieldset>
  165.     </form>
  166.   </div>
  167. </div>
  168.  
  169. <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.8/angular.min.js"></script>
  170. <script>
  171.  
  172. var app = angular.module("myApp", []);
  173.  
  174. app.config(function ($interpolateProvider) {
  175.     $interpolateProvider.startSymbol('[[').endSymbol(']]');
  176. });
  177.  
  178. app.controller("myController", ['$scope', function($scope) {
  179.   $scope.values = [{
  180.     value: 'pass',
  181.     external: 'Pass',
  182.     internal: 'pass',
  183.     classes: 'green fa-check-circle'
  184.   }, {
  185.     value: 'fail',
  186.     external: 'Fail',
  187.     internal: 'fail',
  188.     classes: 'red fa-exclamation-circle'
  189.   }, {
  190.     value: 'n/a',
  191.     external: 'N/A',
  192.     internal: 'na',
  193.     classes: 'blue fa-circle'
  194.   }, {
  195.     value: 'caution',
  196.     external: 'Caution',
  197.     internal: 'caution',
  198.     classes: 'yellow fa-exclamation-triangle'
  199.   }]
  200.  
  201.   $scope.sections = [{
  202.         name: 'Section 1*',
  203.         section: 1,
  204.         fields: [{
  205.           field_condition: 'pass',
  206.           name: 'Field1',
  207.           field: 1
  208.         }, {
  209.           field_condition: 'fail',
  210.           name: 'Field2',
  211.           field: 2
  212.         }]
  213.       }, {
  214.         name: 'Section 2',
  215.         section: 2,
  216.         fields: [{
  217.           field_condition: 'n/a',
  218.           name: 'Field3',
  219.           field: 3
  220.         }, {
  221.           field_condition: 'caution',
  222.           name: 'Field4',
  223.           field: 4
  224.         }]
  225.       }];
  226. }]);
  227.  
  228.  
  229. </script>
  230. </body>
  231. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement