controller logic to show submission and registration radio buttons
[angular-drzb] / app / partials / registration.html.ep
index a7da14d..24e1364 100644 (file)
@@ -9,11 +9,11 @@
 
 <form ng-controller="RegistrationCtrl" name="RegistrationForm" class="span12">
 
-<fieldset class="controls">
+<fieldset class="controls" ng-show="show_submission_type()">
 
 <legend><%= locale
        en => 'Registration type',
-       hr => 'Odaberite tip registracije'
+       hr => 'Odaberite tip prijave'
 %></legend>
 
 <label class="radio"><input type="radio" ng-model="user.registration_type" value="lecture" ><%= locale
@@ -21,7 +21,7 @@
        hr => 'Prijava usmenog izlaganja',
 %></label>
 <label class="radio"><input type="radio" ng-model="user.registration_type" value="poster" ><%= locale
-       en => 'Poster prezentation',
+       en => 'Poster presentation',
        hr => 'Prijava poster prezentacije'
 %></label>
 <label class="radio"><input type="radio" ng-model="user.registration_type" value="symposium" ><%= locale
     en => 'Round table',
        hr => 'Prijava okruglog stola',
 %></label>
-<hr />
+
+</fieldset>
+
+<fieldset class="controls" ng-show="show_registration_type()">
+
+<legend><!-- show line -->
+</legend>
+
 <label class="radio"><input type="radio" ng-model="user.registration_type" value="participant" ><%= locale
     en => 'Registration',
        hr => 'Registracija'
 %></label>
+
 <label class="radio"><input type="radio" ng-model="user.registration_type" value="accomp" ><%= locale
     en => 'Registration for accompanying persons',
        hr => 'Registracija za osobe u pratnji' %>
 </label>
+
 </fieldset>
 
 <fieldset ng-show="user.registration_type">
@@ -196,13 +205,13 @@ hr => 'Organizator simpozija' %>
 </div>
 
 <div class="controls-row">
-<label class="{{class = abstract_class(work.abstract)}}">
+<label class="{{class = abstract_class(work)}}">
 <%= locale
-en => 'Abstract ({{abstract_length(work.abstract)}}  from max. 2000 characters with spaces)',
-hr => 'Sažetak ({{abstract_length(work.abstract)}}  od maks. 2000 znakova s razmacima)'
+en => 'Abstract ({{abstract_length(work)}}  from max. 2000 characters with spaces)',
+hr => 'Sažetak ({{abstract_length(work)}}  od maks. 2000 znakova s razmacima)'
 %>
 <textarea class="controls-row span11 {{class}}" ng-model="work.abstract" ng-minlength="2" rows="10" cols="80" ng-required="has_work"></textarea>
-<input type=text ng-model="work.abstract" ng-maxlength="2000" style="display: none">
+<input type="text" ng-maxlength="2000" ng-model="work.abstract" style="display: none">
 </label>
 </div>
 
@@ -212,14 +221,14 @@ hr => 'Sažetak ({{abstract_length(work.abstract)}}  od maks. 2000 znakova s raz
 
 </fieldset><!-- has_work -->
 
-<div ng-show="user.registration_type == 'symposium'">
+<div ng-show="user.registration_type == 'symposium'" id="symposium-works">
 
 <h2><%= locale
 en=>'Submission of works for the symposium {{work.title}}',
 hr=>'Prijava radova unutar simpozija {{work.title}}' %>
 </h2>
 
-<div ng-repeat="work in work.symposium_works" class="control-row">
+<div ng-repeat="work in work.symposium_works" class="control-row work">
 
 <h3><%= locale
 en=>'{{$index + 1}}. symposium work',
@@ -241,13 +250,14 @@ hr => 'Dodaj još jedan rad na simpoziju' %>
 
 </div><!-- user.registration_type == 'symposium' -->
 
-<button class="controls-row btn btn-primary" ng-click="update(registration)" ng-show="RegistrationForm.$valid"><%= locale en=>'Submit',hr=>'Pošalji' %></button>
+<button class="controls-row btn btn-primary" id="update-registration" ng-click="update(registration,'confirmation')" ng-show="RegistrationForm.$valid"><%= locale en=>'Submit',hr=>'Pošalji' %></button>
 
-<p class="well" style="color: red" ng-show="! RegistrationForm.$valid">
+<p class="well" style="color: red" ng-show="! RegistrationForm.$valid && RegistrationForm.$dirty">
 <%= locale
 en => 'Please fill all required fields correctly. Fields with red border call for your attention.',
 hr => 'Molimo ispunite sva obavezna polja označena crvenim okvirom.'
 %>
+<button class="controls-row btn btn-info" id="update-draft" ng-click="update(registration,'draft')" ng-show="RegistrationForm.$dirty"><%= locale en=>'Save draft',hr=>'Spremi privremeno' %></button>
 </p>
 
 <input style="float:right" title="validation errors" type=checkbox name=debug ng-click="debug = ! debug">