ScoDoc/static/mobile/static/js/main.9d1150c9.chunk.js

2 lines
33 KiB
JavaScript
Raw Normal View History

2021-05-18 22:47:33 +02:00
(this.webpackJsonpscodocmobile=this.webpackJsonpscodocmobile||[]).push([[0],{100:function(e,t,s){"use strict";s.r(t);var n=s(0),a=s(20),i=s.n(a),c=s(19),r=function(e){e&&e instanceof Function&&s.e(3).then(s.bind(null,116)).then((function(t){var s=t.getCLS,n=t.getFID,a=t.getFCP,i=t.getLCP,c=t.getTTFB;s(e),n(e),a(e),i(e),c(e)}))},o=s(14),d=s(7),l=s(8),h=s(17),j=s(10),u=s(9),b=(s(28),s(112)),p=s(105),m=s(76),O=s(72),f=s(1),x=function(e){Object(j.a)(s,e);var t=Object(u.a)(s);function s(e){var n;return Object(d.a)(this,s),(n=t.call(this,e)).state={logout:!1},n}return Object(l.a)(s,[{key:"logout",value:function(){var e=this,t=window.$api_url;fetch(t+"acl_users/logout").then((function(t){e.setState({logout:!0})})).catch(console.log)}},{key:"render",value:function(){var e=this;return Object(f.jsxs)(b.a,{bg:"light",expand:"sm",children:[Object(f.jsxs)(p.a,{children:[Object(f.jsxs)(b.a.Brand,{href:window.$api_url+"static/mobile/",children:[Object(f.jsx)("img",{alt:"ScodocLogo",src:"/ScoDoc/static/icons/scologo_img.png",width:"20",height:"30",className:"d-inline-block align-top"})," ","ScoDoc"]}),Object(f.jsx)(b.a.Toggle,{"aria-controls":"basic-navbar-nav"}),Object(f.jsx)(b.a.Collapse,{id:"basic-navbar-nav",children:Object(f.jsxs)(m.a,{className:"ml-auto",children:[Object(f.jsx)(m.a.Link,{href:"/ScoDoc",children:"Version Desktop"}),Object(f.jsx)(O.a,{variant:"primary",onClick:function(){e.logout()},children:"D\xe9connexion"})]})})]}),!0===this.state.logout&&Object(f.jsx)(o.a,{push:!0,to:window.$api_url+"static/mobile/"})]})}}]),s}(n.Component),v=s(73),w=s(106),y=function(e){Object(j.a)(s,e);var t=Object(u.a)(s);function s(e){var n;return Object(d.a)(this,s),(n=t.call(this,e)).state={students:[],search_status:0},n.handleChangeSearch=n.handleChangeSearch.bind(Object(h.a)(n)),n.searchStudent=n.searchStudent.bind(Object(h.a)(n)),n}return Object(l.a)(s,[{key:"handleChangeSearch",value:function(e){this.setState({search:e.target.value})}},{key:"searchStudent",value:function(){var e=this,t=window.location.href.split("/")[6],s=window.$api_url;fetch(s+t+"/Scolarite/Notes/search_etud_by_name?term="+this.state.search+"&format=json",{method:"GET",credentials:"include"}).then((function(t){return t.json().then((function(e){return{data:e}})).then((function(t){e.setState({students:t.data}),0===e.state.students.length?e.setState({search_status:1,toast:!0}):e.setState({search_status:2,toast:!1})}))})),this.setState({searched:!0})}},{key:"result",value:function(){return!0===this.state.toast?Object(f.jsx)("div",{id:"wrapDept",children:"Aucun \xe9l\xe8ve trouv\xe9"}):2===this.state.search_status?Object(f.jsx)(v.a,{children:this.state.students.map((function(e,t){return Object(f.jsx)(w.a,{id:"wrapDept",children:Object(f.jsx)(c.b,{to:"/ScoDoc/static/mobile/".concat(window.location.href.split("/")[6],"/Scolarite/Etudiant/").concat(e.value),children:Object(f.jsx)("span",{children:e.label})})})}))}):void 0}},{key:"render",value:function(){var e=this;return Object(f.jsxs)("div",{className:"wrapper",children:[Object(f.jsxs)("div",{className:"input-group",children:[Object(f.jsx)("input",{type:"text",id:"search",className:"form-control",onChange:this.handleChangeSearch}),Object(f.jsx)("div",{className:"input-group-append",children:Object(f.jsx)("button",{type:"button",className:"btn waves-effect waves-light btn-primary",onClick:function(){e.searchStudent()},children:"Rechercher"})})]}),this.result()]})}}]),s}(n.Component),g=s(113),S=s(114),C=function(e){Object(j.a)(s,e);var t=Object(u.a)(s);function s(e){var n;return Object(d.a)(this,s),(n=t.call(this,e)).state={semestres:[],students:[],toast:!1},n.dismissToast=n.dismissToast.bind(Object(h.a)(n)),n.getData=n.getData.bind(Object(h.a)(n)),n}return Object(l.a)(s,[{key:"componentWillMount",value:function(){var e=this,t=window.location.href.split("/")[6],s=window.$api_url;fetch(s+t+"/Scolarite/Notes/formsemestre_list?format=json",{method:"GET",verify:!1,credentials:"include"}).then((function(t){return t.json().then((function(e){return{data:e,status:t.status}})).then((function(t){e.setState({semestres:t.data})}))}))}}
//# sourceMappingURL=main.9d1150c9.chunk.js.map