casopisi 2010
authorMarijana Glavica <mglavica@ffzg.hr>
Mon, 6 Dec 2010 22:30:42 +0000 (23:30 +0100)
committerMarijana Glavica <mglavica@ffzg.hr>
Mon, 6 Dec 2010 22:30:42 +0000 (23:30 +0100)
public/app/casopisi2010/upitnik.css [new file with mode: 0644]
public/app/casopisi2010/upitnik.html [new file with mode: 0644]
public/app/casopisi2010/upitnik.js [new file with mode: 0644]

diff --git a/public/app/casopisi2010/upitnik.css b/public/app/casopisi2010/upitnik.css
new file mode 100644 (file)
index 0000000..cde7f0a
--- /dev/null
@@ -0,0 +1,200 @@
+body {
+       background: #F6F6F6;
+       margin: 0 auto;
+       font-family: Arial;
+       color: #374E5A;
+       font-size: 14px;
+       line-height: 140%;
+       width: 861px;
+}
+
+h2, h3 {
+       margin-top: 60px;
+       font-size: 14px;
+       padding: 2px 0;
+       border-bottom: 2px solid #D74F25;
+       border-bottom: 1px solid #46d0fe;
+}
+
+h3 {
+       margin-top: 20px;
+}
+
+a {
+       color: #D74F25;
+}
+
+input, textarea {
+       font: 14px arial;
+       color: #000000;
+       border: solid 1px #dedede;
+       padding: 6px;
+       background: #f6f6f6;
+}
+
+input:focus, textarea:focus
+{
+       background: #ffffff;
+       font-family: arial;
+       color: #000000;
+}
+.input {
+       color: #afafaf;
+       float: left;
+       margin: 2px;
+       padding: 0 6px;
+}
+
+.text1 {
+       width: 30em;
+}
+
+img {
+       border: 0;
+}
+
+label {
+       display: block;
+       margin-top: 10px;
+       font-size: 14px;
+       font-family: Arial;
+       color: #afafaf;
+}
+
+.radio { 
+       color: #374E5A;
+}
+
+h1
+{
+       float: left;
+/*     margin-bottom: 6px;     */
+       padding-left: 20px;
+       font: 18px arial;
+       color: #0c1426;
+       text-align: center;
+       text-decoration: none;
+       display: block;
+       background: url(http://mjesec.ffzg.hr/drzb2011/images/kvadrat.gif) no-repeat left;
+       margin: 0;
+}
+
+
+
+.clear {
+       clear: both;
+}
+
+
+
+.ng-validation-error {
+       border: 1px solid #FF6666;
+       border: 1px solid #EDC8BC;
+       border: 1px solid #FF9966;
+       border: 1px solid #EAB3A2;
+       border: 1px solid #D74F25;
+       border: 1px solid #DC6844;
+       border: 1px solid #DE7F61;
+}
+
+.ng-exception {
+       border: 0;
+}
+
+
+
+.button {
+       margin-top: 20px;
+       width: 40.8em;
+}
+
+.button input {
+       margin-bottom: 10px;
+       float: left;
+       color: #ffffff;
+       display: block;
+       text-decoration: none;
+       background: #d74f25;
+}
+
+.button input:hover, .gohome:hover {
+       /* background: #dc6844; */
+}
+
+.button2 input {
+       background: #F6F6F6;
+       color: #374E5A;
+       border: 1px solid #d74f25;
+       display: inline;
+}
+
+
+.gohome  {
+       float: left;
+       color: #374E5A;
+       border: 1px solid #d74f25;
+       text-decoration: none;
+       background: #f6f6f6;
+       padding: 7px;
+       margin-top: 20px;
+       font: 14px arial;
+       border: solid 1px #dedede;
+       border: solid 1px #f6f6f6;
+}
+
+.gohome a {
+}
+
+.gohome a:hover {
+       text-decoration: none;
+}
+
+.list {
+       margin-top: 20px;
+       font-weight: bold;
+}
+
+.warrning {
+       color: #FF6666;
+}
+
+#footer {
+       position: relative;
+       float: left;
+       width: 961px;
+       height: 18px;
+       padding-top: 5px;
+       margin-top: 180px;
+       margin-bottom: 20px;
+       font: 10px arial;
+       color: #374e5a;
+       text-align: center;
+       background: url(http://mjesec.ffzg.hr/drzb2011/images/footer_bg.jpg) repeat-x;
+       clear: both;
+}
+       
+#foot a
+{
+       position: relative;
+       top: 12px;
+       margin-bottom: 20px;
+       font: 12px arial;
+       color: #374e5a;
+       text-align: center;
+       text-decoration: none;
+}
+
+#foot a:hover
+{
+       color: #374e5a;
+       text-decoration: underline;
+}
+
+
+hr {
+       border: 1px solid #ccc;
+}
+
+.lengthCount {
+       color:red;
+}
diff --git a/public/app/casopisi2010/upitnik.html b/public/app/casopisi2010/upitnik.html
new file mode 100644 (file)
index 0000000..29c7981
--- /dev/null
@@ -0,0 +1,80 @@
+<!DOCTYPE HTML>
+<html xmlns:ng="http://angularjs.org">
+<head>
+<meta charset="utf-8">
+<script src="angular.js" ng:autobind></script>
+
+<title>Upitnik o stranim časopisima</title>
+
+<script src="upitnik.js"></script>
+
+<link rel="stylesheet" href="upitnik.css" type="text/css">
+
+</head>
+<body>
+
+<div class="root" ng:controller="Upitnik" ng:init="$window.$root = this;">
+
+<h2>
+1. Koji su Vam strani časopisi najpotrebniji?
+</h2>
+<div>
+<p>Navedite naslove stranih časopisa u kojima nalazite najveći broj članaka potrebnih u Vašem istraživanju i nastavi, koje najčešće citirate ili koje redovito pratite, bez obzira na to da li su Vam sada dostupni ili ne.</p>
+<p>Navedite <b>barem 3 naslova</b>.</p>
+</div>
+
+<div ng:repeat="casopis in upitnik.casopisi">
+<input class="text1" name="casopis.naslov" ng:required>
+<a href="" ng:click="upitnik.casopisi.$remove(casopis)">obriši</a>
+</div>
+<a href="" ng:click="upitnik.casopisi.$add({naslov:''})">Dodaj još jedan naslov</a>
+
+<h2>
+2. Odaberite i obrazložite svoj izbor:
+</h2>
+
+<label class="radio">
+<input type="radio" name="upitnik.inacica" value="elektronicka"> Važnije mi je da knjižnica osigura stalni pristup elektroničkoj inačici časopisa.
+</label>
+
+<label class="radio">
+<input type="radio" name="upitnik.inacica" value="tiskana"> Važnije mi je da knjižnica nabavi tiskani primjerak časopisa.
+</label>
+
+<label class="radio">
+<input type="radio" name="upitnik.inacica" value="svejedno"> Svejedo mi je.
+</label>
+
+<h2>
+3. Koji elektronički izvori informacija su Vam potrebni?
+</h2>
+<div>
+<p>Navedite poznate Vam digitalne zbirke časopisa, knjiga ili drugih vrsta građe, bibliografske baze podataka i slično.</p>
+</div>
+<div ng:repeat="eizvor in upitnik.eizvori">
+       <input name="eizvor.naziv" class="text1">
+       <a href="" ng:click="upitnik.eizvori.$remove(eizvor)">obriši</a>
+</div>
+<a href="" ng:click="upitnik.eizvori.$add({naslov:''})">Dodaj još jedan izvor</a>
+
+
+<div class="button">
+       <input type=submit ng:click="save()" value="save">
+       <input type=reset ng:click="reset()" value="reset">
+</div>
+
+<div style="clear: both">
+<input type=checkbox name=debug style="float: right; clear: both">
+<pre ng:show="debug">
+
+dirty= invalid={{$invalidWidgets.visible()}}
+
+upitnik = {{upitnik}}
+
+</pre>
+</div>
+
+</div><!-- ng:controller="Upitnik" -->
+
+</body>
+</html>
diff --git a/public/app/casopisi2010/upitnik.js b/public/app/casopisi2010/upitnik.js
new file mode 100644 (file)
index 0000000..dba95a4
--- /dev/null
@@ -0,0 +1,49 @@
+
+if (typeof (console) === 'undefined') console = { debug: function() {} }; // mock console.debug
+
+var database = 'casopisi2010';
+
+function Upitnik($resource,$xhr){
+       this.master = {
+               casopisi: [{naslov:''},{naslov:''},{naslov:''}],
+               eizvori: [{naziv:''}]
+       };
+       this.Upitnik = $resource( '/data/:database/Upitnik/:id', { id:'', database: database } );
+       this.reset();
+       this.$watch('$location.hashPath', this.hash_change);
+       this.$xhr = $xhr;
+       console.debug( 'database', database, this.upitnik );
+}
+Upitnik.$inject=['$resource','$xhr'];
+
+Upitnik.prototype = {
+       hash_change: function() {
+               var id = this.$location.hashPath;
+console.debug( 'hash_change', id, this.upitnik.$id );
+               if ( id != this.upitnik.$id ) {
+                       if (id) {
+                               var self = this;
+                               this.Upitnik.get({ id: id }, function(upitnik) {
+console.debug('upitnik', id, upitnik);
+                                       self.last_saved = angular.copy(upitnik);
+                                       self.upitnik = upitnik; // needed for load_symposium below
+                               });
+                       }
+                       else this.reset();
+               }
+       },
+       reset: function() {
+               console.debug( this.Upitnik );
+               this.upitnik = new this.Upitnik( this.master );
+console.debug( 'reset', this.upitnik );
+               this.last_saved = this.upitnik;
+       },
+       save: function(){
+               var self = this;
+               this.upitnik.$save(function(upitnik){
+                       self.$location.hashPath = upitnik.$id;
+                       self.last_saved = angular.copy(upitnik);
+               });
+       }
+};
+