diff --git a/members/static/html/jasenlista.html b/members/static/html/jasenlista.html index e5cc157..cf0f86b 100644 --- a/members/static/html/jasenlista.html +++ b/members/static/html/jasenlista.html @@ -1,18 +1,16 @@ -

Jäsenlista

+

Jäsenlista

- - -
- +
+ - - + + @@ -32,5 +30,5 @@
ID Etunimi SukunimiSähköpostiAYY-jäsenSähköpostiAYY-jäsen JAS-listalla Asuinpaikka
- -
\ No newline at end of file + +
diff --git a/members/static/html/lisaa_jasen.html b/members/static/html/lisaa_jasen.html index 6b14b4d..30aba46 100644 --- a/members/static/html/lisaa_jasen.html +++ b/members/static/html/lisaa_jasen.html @@ -1,37 +1,31 @@ -

Lisää jäsen

- - - -
+

Lis�� j�sen

- - + +
- - + +
- +
- +
- +
- +
- -
diff --git a/members/static/js/appData.js b/members/static/js/appData.js deleted file mode 100644 index 3dcf9fc..0000000 --- a/members/static/js/appData.js +++ /dev/null @@ -1,5 +0,0 @@ -var appData = { - "views": { - - } -} \ No newline at end of file diff --git a/members/static/js/dynamicpage.js b/members/static/js/dynamicpage.js deleted file mode 100644 index 90e3c7d..0000000 --- a/members/static/js/dynamicpage.js +++ /dev/null @@ -1,43 +0,0 @@ -$(function() { - -// if(Modernizr.history){ - - var $mainContent = $("#main-content"), - $pageWrap = $("#page-content-wrapper"), - baseHeight = 0, - $el; - - $pageWrap.height($pageWrap.height()); - baseHeight = $pageWrap.height() - $mainContent.height(); - - $("nav").delegate("a", "click", function() { - _link = $(this).attr("href"); - //history.pushState(null, null, _link); - loadContent(_link); - return false; - }); - - function loadContent(href){ - $mainContent - .find("#main-content") - .fadeOut(200, function() { - $mainContent.hide().load(href + " #main-content", function() { - $mainContent.fadeIn(200, function() { - $pageWrap.animate({ - height: baseHeight + $mainContent.height() + "px" - }); - }); - console.log(href); - }); - }); - } - - $(window).bind('popstate', function(){ - _link = location.pathname.replace(/^.*[\\\/]/, ''); //get filename only - loadContent(_link); - }); - -//} // otherwise, history is not supported, so nothing fancy here. - - -}); \ No newline at end of file diff --git a/members/static/js/getmembers.js b/members/static/js/getmembers.js deleted file mode 100644 index 094f757..0000000 --- a/members/static/js/getmembers.js +++ /dev/null @@ -1,59 +0,0 @@ -//Here are the links to put inside index -//https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js -//https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.map - -//https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.6/angular.min.js -//https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.6/angular.min.js.map - -/*Lataa koko data js:ään controlleri, jolla oma scope, jossa muuttujia -https://docs.angularjs.org/api/ng/directive/ngRepeat check this - -*/ -/* -Hae koko datapaketti serveriltä. Näytä lista kokonaan. -Typeeminen hakukenttään -> datapaketin filteröintiä -interaktiivinen, reaaliaikainen setti -*/ - -var app = angular.module("getMemberApp", []); - -app.controller("getController", function($scope, $http){ - $http.get("/members/api/members").then(function(response){ - $scope.members = response.data.records; - }); - $scope.removeMember = function(id){ - var index = -1; - var comArr = eval( $scope.members ); - for( var i = 0; i < comArr.length; i++ ) { - if( comArr[i].id === id ) { - index = i; - break; - } - } - if( index === -1 ) { - alert( "Something gone wrong" ); - } - $scope.members.splice( index, 1 ); - }; -}); - -/*$.get("/members/api/members", function(data){ - alert(data); -}); - -function getAll() { - return $http.get('/members/api/members'); -} - -function createUser(user) { - return $http.post('members/api/members', user); -} - -function updateUser(user) { - return $http.put('/members/api/members', user.id, user); -} - -function deleteUser(user) { - return $http.delete('/members/api/members', user); -} -*/ diff --git a/members/static/js/members_controllers.js b/members/static/js/members_controllers.js new file mode 100644 index 0000000..c148298 --- /dev/null +++ b/members/static/js/members_controllers.js @@ -0,0 +1,18 @@ + +app.controller("getController", function($scope, $http){ + $http.get("/members/api/members").then(function(response){ + $scope.members = response.data; + }); +}); + +app.controller("postController", function($scope, $http) { + $scope.firstName = ""; + $scope.lastName = ""; + $scope.email = ""; + $scope.AYY = ""; + $scope.JAS = ""; + $scope.POR = ""; + $scope.send = function() { + $http.post("/members/api/member", {"first_name":$scope.firstName, "last_name":$scope.lastName, "email":$scope.email, "AYY":$scope.AYY, "jas":$scope.JAS, "POR":$scope.POR}); + } +}); diff --git a/members/static/js/members_routers.js b/members/static/js/members_routers.js new file mode 100644 index 0000000..d407423 --- /dev/null +++ b/members/static/js/members_routers.js @@ -0,0 +1,20 @@ +var app = angular.module('memberApp', ['ngRoute']); + +app.config(['$routeProvider', function($routeProvider){ + $routeProvider + .when('/',{ + templateUrl:"/static/html/jasenlista.html", + controller:'getController', + }) + .when('/list',{ + templateUrl:"/static/html/jasenlista.html", + controller:'getController', + }) + .when('/add',{ + templateUrl:"/static/html/lisaa_jasen.html", + controller:'postController', + }) + .otherwise({ + 'redirectTo':"/" + }) +}]); diff --git a/members/static/js/modernizr.js b/members/static/js/modernizr.js deleted file mode 100644 index 04a7f7d..0000000 --- a/members/static/js/modernizr.js +++ /dev/null @@ -1,4 +0,0 @@ -/* Modernizr 2.6.2 (Custom Build) | MIT & BSD - * Build: http://modernizr.com/download/#-history-shiv-cssclasses-load - */ -;window.Modernizr=function(a,b,c){function u(a){j.cssText=a}function v(a,b){return u(prefixes.join(a+";")+(b||""))}function w(a,b){return typeof a===b}function x(a,b){return!!~(""+a).indexOf(b)}function y(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:w(f,"function")?f.bind(d||b):f}return!1}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m={},n={},o={},p=[],q=p.slice,r,s={}.hasOwnProperty,t;!w(s,"undefined")&&!w(s.call,"undefined")?t=function(a,b){return s.call(a,b)}:t=function(a,b){return b in a&&w(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=q.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(q.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(q.call(arguments)))};return e}),m.history=function(){return!!a.history&&!!history.pushState};for(var z in m)t(m,z)&&(r=z.toLowerCase(),e[r]=m[z](),p.push((e[r]?"":"no-")+r));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)t(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},u(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+p.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f -

Comments

- - - - ); - } -}); -*/ \ No newline at end of file diff --git a/members/templates/index.html b/members/templates/index.html deleted file mode 100644 index f27671c..0000000 --- a/members/templates/index.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - - - - Jäsenrekisteri - - - - - - - - - - - - - - - - - - - - - - - - {%load staticfiles %} - - - - -
- - - - - - -
-

Aalto-yliopiston Sähköinsinöörikilta RY:n jäsenrekisteri

-
- - - - - -
- - - - - - -
- - diff --git a/members/templates/members_index.html b/members/templates/members_index.html new file mode 100644 index 0000000..da331ee --- /dev/null +++ b/members/templates/members_index.html @@ -0,0 +1,46 @@ + + + + + + + + + Jäsenrekisteri + + + + + + + + + + {%load staticfiles %} + + + + + + + +
+ + + + + + +
+

Aalto-yliopiston Sähköinsinöörikilta RY:n jäsenrekisteri

+
+ +
+ + + diff --git a/members/views.py b/members/views.py index 7d60d18..52e7e90 100644 --- a/members/views.py +++ b/members/views.py @@ -5,7 +5,7 @@ from members.models import Member, MemberRequest import json def index(request, *args, **kwargs): - return render(request, 'index.html',{}) + return render(request, 'members_index.html',{}) def members(request, *args, **kwargs): mems = list(map(lambda m: m.get_dict(),Member.objects.all())) diff --git a/sikweb/urls.py b/sikweb/urls.py index dee74ef..df7ca9f 100644 --- a/sikweb/urls.py +++ b/sikweb/urls.py @@ -16,6 +16,7 @@ Including another URLconf """ from django.conf.urls import url from django.contrib import admin +# members from members.views import index as mindex from members.views import members as mems from members.views import member as mem @@ -23,9 +24,12 @@ from members.views import handle_mem_request from members.views import new_member_request from members.views import member_requests +#infoscreen +from infoscreen.views import index as infoindex urlpatterns = [ url(r'^admin/', admin.site.urls), + # members url(r'^members/$', mindex), url(r'^members/api/members$', mems), url(r'^members/api/member/(?P\d+)$', mem), @@ -34,4 +38,6 @@ urlpatterns = [ url(r'^members/api/requests$', member_requests), url(r'^members/api/request$', new_member_request), url(r'^members/api/request/(?P\d+)$', handle_mem_request), + #infoscreen + url(r'^infoscreen/$', infoindex), ]