checkbox to hide stuff for printed version
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 5 Mar 2013 14:36:17 +0000 (15:36 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 5 Mar 2013 14:36:17 +0000 (15:36 +0100)
app/css/app.css
app/js/controllers.js
app/partials/list.html.ep
app/registration/view.html.ep

index cffc395..53940f2 100644 (file)
@@ -49,3 +49,8 @@ textarea.ng-invalid {
 .review {
        color: #c80;
 }
+
+.print-center {
+       text-align: center;
+       display: block; /* wrap in new line */
+}
index c4783b4..092e07e 100644 (file)
@@ -310,6 +310,17 @@ function ListCtrl($scope, $log, Registration, RegistrationTypes, $filter, ValidS
                $log.info('reset', $scope.search );
                $scope.pager.page = 1;
        }
+
+       $scope.print_hide = function(v) {
+               $log.info('print_hide', v);
+               if ( v ) {
+                       angular.element('.print-hide').hide();
+                       angular.element('.print-add-center').addClass('print-center');
+               } else {
+                       angular.element('.print-hide').show();
+                       angular.element('.print-add-center').removeClass('print-center');
+               }
+       }
 }
 
 ListCtrl.$inject = [ '$scope', '$log', 'Registration', 'RegistrationTypes', '$filter', 'ValidStates' ];
index 8262dc3..d7c974b 100644 (file)
@@ -59,6 +59,11 @@ Search
 All results on single page <b>(can be slow!)</b>
 </label>
 
+<label>
+<input type="checkbox" ng-model="print_hide_status" ng-click="print_hide(print_hide_status)" >
+Hide parts for print
+</label>
+
 </fieldset>
 
 <fieldset ng-show="show.states">
index 41ea5b0..be6d902 100644 (file)
@@ -1,4 +1,4 @@
-<dt>
+<dt class="print-hide">
 % if ( my $before = stash('before') ) {
 %= $before->()
 % }
@@ -15,7 +15,7 @@
 
 <dd>
 
-       <p class="well">
+       <p class="well print-hide">
         {{registration.user.firstname}}
         {{registration.user.surname}}
         <em>{{registration.user.organization}}</em>,
  </p>
 </p>
 
-<h3 ng-show="registration.work.title">
+<h3 ng-show="registration.work.title" class="print-add-center">
 {{registration.work.title}}
 </h3>
 
-<p ng-repeat="author in registration.work.persons" >
+<p ng-repeat="author in registration.work.persons" class="print-add-center">
  {{author.firstname}}
- {{author.surname}},
- <em>{{author.organization}}</em>
- <tt>&lt;{{author.email}}&gt;</tt>
+ {{author.surname}}<span class="print-hide">,</span>
+ <em class="print-add-center">{{author.organization}}</em>
+ <tt class="print-hide">&lt;{{author.email}}&gt;</tt>
 </p>
 
 <p class="abstract">{{registration.work.abstract}}</p>