Commit ad63bc0477e82f5a68a2246d21ad30cada1fa7ec
1 parent
ee0034e2
Exists in
master
Signs module integraded with PyBossa API and added the presentation video
Showing
20 changed files
with
308 additions
and
44 deletions
Show diff stats
assets/css/base.css
... | ... | @@ -34,6 +34,12 @@ img { |
34 | 34 | background-color: #337ab7; |
35 | 35 | } |
36 | 36 | |
37 | +.clean-modal .modal-content { | |
38 | + background: none; | |
39 | + border: none; | |
40 | + box-shadow: none; | |
41 | +} | |
42 | + | |
37 | 43 | /* Header */ |
38 | 44 | #wl-header { |
39 | 45 | position: relative; |
... | ... | @@ -190,6 +196,26 @@ img { |
190 | 196 | opacity: 0.7; |
191 | 197 | } |
192 | 198 | |
199 | +.presentation-modal .modal-dialog { | |
200 | + width: auto; | |
201 | + height: 85%; | |
202 | + margin: 45px 30px 45px 45px; | |
203 | +} | |
204 | + | |
205 | +.presentation-modal .modal-content { | |
206 | + height: 100%; | |
207 | +} | |
208 | +.presentation-modal .modal-body { | |
209 | + height: 100%; | |
210 | + padding: 0; | |
211 | +} | |
212 | + | |
213 | +#presentation-player { | |
214 | + width: 100%; | |
215 | + height: 100%; | |
216 | + | |
217 | +} | |
218 | + | |
193 | 219 | /* Contribution Overview Section */ |
194 | 220 | #wl-overview { |
195 | 221 | position: relative; |
... | ... | @@ -258,7 +284,7 @@ img { |
258 | 284 | } |
259 | 285 | |
260 | 286 | .wl-zigzag-border { |
261 | - background: url(../img/zigzag-border.png) repeat-x; | |
287 | + background: url('../img/zigzag-border.png') repeat-x; | |
262 | 288 | height: 7px; |
263 | 289 | width: 100%; |
264 | 290 | position: absolute; |
... | ... | @@ -365,7 +391,6 @@ img { |
365 | 391 | |
366 | 392 | /* Signs and Ranking Section */ |
367 | 393 | #wl-signs-and-ranking { |
368 | - position: relative; | |
369 | 394 | z-index: 1; |
370 | 395 | background: #ffffff; |
371 | 396 | height: 100vh; |
... | ... | @@ -375,6 +400,7 @@ img { |
375 | 400 | display: flex; |
376 | 401 | flex-direction: row; |
377 | 402 | flex-wrap: wrap; |
403 | + background: white; | |
378 | 404 | } |
379 | 405 | |
380 | 406 | .wl-signs-and-ranking-wrapper { |
... | ... | @@ -387,6 +413,7 @@ img { |
387 | 413 | padding: 0 15px; |
388 | 414 | } |
389 | 415 | |
416 | +/* Sign Section */ | |
390 | 417 | .wl-signs-container { |
391 | 418 | display: flex; |
392 | 419 | flex-wrap: wrap; |
... | ... | @@ -398,6 +425,22 @@ img { |
398 | 425 | padding: 3px; |
399 | 426 | } |
400 | 427 | |
428 | +.sign-modal .sign-name { | |
429 | + font-size: 20px; | |
430 | + color: #ffffff; | |
431 | + font-weight: bold; | |
432 | +} | |
433 | + | |
434 | +.sign-modal .created-by { | |
435 | + font-size: 18px; | |
436 | +} | |
437 | + | |
438 | +.sign-video-container video { | |
439 | + height: 100%; | |
440 | + width: 100%; | |
441 | +} | |
442 | + | |
443 | +/* Ranking Section */ | |
401 | 444 | .wl-ranking-header-wrapper { |
402 | 445 | padding-left: 0; |
403 | 446 | padding-right: 0; | ... | ... |
... | ... | @@ -0,0 +1,15 @@ |
1 | +/* | |
2 | + AngularJS v1.5.7 | |
3 | + (c) 2010-2016 Google, Inc. http://angularjs.org | |
4 | + License: MIT | |
5 | +*/ | |
6 | +(function(q,e){'use strict';function A(a){var c=[];v(c,e.noop).chars(a);return c.join("")}function h(a,c){var b={},d=a.split(","),l;for(l=0;l<d.length;l++)b[c?e.lowercase(d[l]):d[l]]=!0;return b}function B(a,c){null===a||void 0===a?a="":"string"!==typeof a&&(a=""+a);g.innerHTML=a;var b=5;do{if(0===b)throw w("uinput");b--;q.document.documentMode&&r(g);a=g.innerHTML;g.innerHTML=a}while(a!==g.innerHTML);for(b=g.firstChild;b;){switch(b.nodeType){case 1:c.start(b.nodeName.toLowerCase(),C(b.attributes)); | |
7 | +break;case 3:c.chars(b.textContent)}var d;if(!(d=b.firstChild)&&(1==b.nodeType&&c.end(b.nodeName.toLowerCase()),d=b.nextSibling,!d))for(;null==d;){b=b.parentNode;if(b===g)break;d=b.nextSibling;1==b.nodeType&&c.end(b.nodeName.toLowerCase())}b=d}for(;b=g.firstChild;)g.removeChild(b)}function C(a){for(var c={},b=0,d=a.length;b<d;b++){var l=a[b];c[l.name]=l.value}return c}function x(a){return a.replace(/&/g,"&").replace(D,function(a){var b=a.charCodeAt(0);a=a.charCodeAt(1);return"&#"+(1024*(b-55296)+ | |
8 | +(a-56320)+65536)+";"}).replace(E,function(a){return"&#"+a.charCodeAt(0)+";"}).replace(/</g,"<").replace(/>/g,">")}function v(a,c){var b=!1,d=e.bind(a,a.push);return{start:function(a,f){a=e.lowercase(a);!b&&F[a]&&(b=a);b||!0!==n[a]||(d("<"),d(a),e.forEach(f,function(b,f){var g=e.lowercase(f),h="img"===a&&"src"===g||"background"===g;!0!==G[g]||!0===y[g]&&!c(b,h)||(d(" "),d(f),d('="'),d(x(b)),d('"'))}),d(">"))},end:function(a){a=e.lowercase(a);b||!0!==n[a]||!0===z[a]||(d("</"),d(a),d(">"));a== | |
9 | +b&&(b=!1)},chars:function(a){b||d(x(a))}}}function r(a){if(a.nodeType===q.Node.ELEMENT_NODE)for(var c=a.attributes,b=0,d=c.length;b<d;b++){var e=c[b],f=e.name.toLowerCase();if("xmlns:ns1"===f||0===f.lastIndexOf("ns1:",0))a.removeAttributeNode(e),b--,d--}(c=a.firstChild)&&r(c);(c=a.nextSibling)&&r(c)}var w=e.$$minErr("$sanitize"),D=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,E=/([^\#-~ |!])/g,z=h("area,br,col,hr,img,wbr"),m=h("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),k=h("rp,rt"),u=e.extend({},k,m), | |
10 | +m=e.extend({},m,h("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")),k=e.extend({},k,h("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),H=h("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"), | |
11 | +F=h("script,style"),n=e.extend({},z,m,k,u),y=h("background,cite,href,longdesc,src,xlink:href"),u=h("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"),k=h("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan", | |
12 | +!0),G=e.extend({},y,k,u),g;(function(a){if(a.document&&a.document.implementation)a=a.document.implementation.createHTMLDocument("inert");else throw w("noinert");var c=(a.documentElement||a.getDocumentElement()).getElementsByTagName("body");1===c.length?g=c[0]:(c=a.createElement("html"),g=a.createElement("body"),c.appendChild(g),a.appendChild(c))})(q);e.module("ngSanitize",[]).provider("$sanitize",function(){var a=!1;this.$get=["$$sanitizeUri",function(c){a&&e.extend(n,H);return function(a){var d= | |
13 | +[];B(a,v(d,function(a,b){return!/^unsafe:/.test(c(a,b))}));return d.join("")}}];this.enableSvg=function(c){return e.isDefined(c)?(a=c,this):a}});e.module("ngSanitize").filter("linky",["$sanitize",function(a){var c=/((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,b=/^mailto:/i,d=e.$$minErr("linky"),g=e.isString;return function(f,h,k){function m(a){a&&p.push(A(a))}function q(a,b){var c,d=r(a);p.push("<a ");for(c in d)p.push(c+'="'+d[c]+'" ');!e.isDefined(h)|| | |
14 | +"target"in d||p.push('target="',h,'" ');p.push('href="',a.replace(/"/g,"""),'">');m(b);p.push("</a>")}if(null==f||""===f)return f;if(!g(f))throw d("notstring",f);for(var r=e.isFunction(k)?k:e.isObject(k)?function(){return k}:function(){return{}},s=f,p=[],t,n;f=s.match(c);)t=f[0],f[2]||f[4]||(t=(f[3]?"http://":"mailto:")+t),n=f.index,m(s.substr(0,n)),q(t,f[0].replace(b,"")),s=s.substring(n+f[0].length);m(s);return a(p.join(""))}}])})(window,window.angular); | |
15 | +//# sourceMappingURL=angular-sanitize.min.js.map | ... | ... |
assets/js/main.controller.js
1 | 1 | (function () { |
2 | 2 | 'use strict'; |
3 | 3 | |
4 | - angular.module('wikilibras').controller('wikilibrasCtrl', ['$scope', function ($scope) {}]); | |
4 | + angular.module('wikilibras').controller('wikilibrasCtrl', ['$scope', '$window', '$document', function ($scope, $window) { | |
5 | + $scope.openUrl = function(url) { | |
6 | + $window.open(url, "_self"); | |
7 | + }; | |
8 | + }]); | |
5 | 9 | }()); |
6 | 10 | \ No newline at end of file | ... | ... |
assets/js/main.module.js
1 | 1 | (function () { |
2 | 2 | 'use strict'; |
3 | 3 | |
4 | - angular.module('wikilibras', ['wikilibras.progress', 'wikilibras.ranking', 'wikilibras.volunteers', 'duScroll', 'angularMoment']).value('duScrollOffset', 70); | |
4 | + angular.module('wikilibras', ['wikilibras.progress', 'wikilibras.ranking', 'wikilibras.volunteers', 'wikilibras.signs', 'wikilibras.presentation', 'duScroll', 'angularMoment', 'ngSanitize']).value('duScrollOffset', 70); | |
5 | 5 | }()); |
6 | 6 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,11 @@ |
1 | +<div class="modal clean-modal presentation-modal fade" tabindex="-1" | |
2 | + role="dialog" aria-labelledby="modalUserSignal"> | |
3 | + <div class="modal-dialog" role="document"> | |
4 | + <div class="modal-content"> | |
5 | + <div class="modal-body"> | |
6 | + <div id="presentation-player"> | |
7 | + </div> | |
8 | + </div> | |
9 | + </div> | |
10 | + </div> | |
11 | +</div> | ... | ... |
... | ... | @@ -0,0 +1,38 @@ |
1 | +(function () { | |
2 | + 'use strict'; | |
3 | + | |
4 | + angular.module('wikilibras.presentation').directive('presentationModal', ['$window', function($window) { | |
5 | + return { | |
6 | + restrict: 'E', | |
7 | + templateUrl: 'assets/js/presentation/presentation-modal.html', | |
8 | + link: function(scope, element, attr) { | |
9 | + var player = undefined; | |
10 | + | |
11 | + function loadVideo() { | |
12 | + var tag = document.createElement('script'); | |
13 | + tag.src = "https://www.youtube.com/iframe_api"; | |
14 | + var firstScriptTag = document.getElementsByTagName('script')[0]; | |
15 | + firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); | |
16 | + } | |
17 | + $window.onYouTubeIframeAPIReady = function() { | |
18 | + player = new YT.Player(document.getElementById('presentation-player'), { | |
19 | + videoId: 'lKA-QsdeHFo', | |
20 | + events: { | |
21 | + 'onReady': setupPlayer | |
22 | + } | |
23 | + }); | |
24 | + }; | |
25 | + function setupPlayer() { | |
26 | + $('.presentation-modal').off('hidden.bs.modal').on('hidden.bs.modal', function () { | |
27 | + player.stopVideo(); | |
28 | + }); | |
29 | + $('.wl-video-control').off('click').on('click', function() { | |
30 | + player.playVideo(); | |
31 | + $('.presentation-modal').modal('show'); | |
32 | + }); | |
33 | + }; | |
34 | + loadVideo(); | |
35 | + } | |
36 | + } | |
37 | + }]); | |
38 | +}()); | |
0 | 39 | \ No newline at end of file | ... | ... |
assets/js/progress/progress.controller.js
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | 'use strict'; |
3 | 3 | |
4 | 4 | angular.module('wikilibras.progress').controller('progressCtrl', ['$scope', 'progressService', function ($scope, progressService) { |
5 | - $scope.progress = {"wikilibras": initProgressData(), "corretor_sinais": initProgressData(), "validador_sinais": initProgressData()}; | |
5 | + $scope.progress = {"wikilibras": initProgressData(), "corretor_sinais": initProgressData(), "validador_sinais": initProgressData(), 'uploaded_signs': initProgressData()}; | |
6 | 6 | |
7 | 7 | function initProgressData() { |
8 | 8 | return {"n_tasks": 0, "n_task_runs": 0, "n_completed_tasks": 0, "last_activity": new Date(), "goal_n_tasks": 0, "goal_deadline": new Date()}; | ... | ... |
assets/js/progress/progress.service.js
1 | 1 | (function () { |
2 | 2 | 'use strict'; |
3 | 3 | |
4 | - angular.module('wikilibras.progress').service("progressService", ['$http', function ($http) { | |
4 | + angular.module('wikilibras.progress').service("progressService", ['$http', '$q', function ($http, $q) { | |
5 | 5 | var PROJECT_CONF_URL = 'conf/app-conf.json'; |
6 | 6 | var PROJECTS_PROGRESS_ENDPOINT = '/api/projects_progress'; |
7 | + var UPLOADED_SIGNS = '/countVideo'; | |
7 | 8 | |
8 | 9 | function accessGoalsData(goals, projectName, param) { |
9 | 10 | var projectGoals = goals[projectName]; |
... | ... | @@ -16,18 +17,31 @@ |
16 | 17 | return { |
17 | 18 | getProjectsProgressData: function() { |
18 | 19 | return $http.get(PROJECT_CONF_URL).then(function(response) { |
19 | - var baseApiUrl = response.data.pybossa_url; | |
20 | + var basePyBossaApiUrl = response.data.pybossa_url; | |
21 | + var baseDBApiUrl = response.data.db_api_url; | |
20 | 22 | var responseGoals = response.data.goals; |
21 | 23 | |
22 | - return $http.get(baseApiUrl + PROJECTS_PROGRESS_ENDPOINT).then(function(response) { | |
23 | - var responseProgress = response.data; | |
24 | - angular.forEach(responseProgress, function(progress) { | |
25 | - progress['goal_n_tasks'] = accessGoalsData(responseGoals, progress.short_name,'goal_n_tasks'); | |
26 | - progress['goal_deadline'] = moment(accessGoalsData(responseGoals, progress.short_name,'goal_deadline'), "DD/MM/YYYY"); | |
27 | - progress['last_activity'] = moment(progress['last_activity']); | |
24 | + return $q.all([ | |
25 | + $http.get(basePyBossaApiUrl + PROJECTS_PROGRESS_ENDPOINT), | |
26 | + $http.get(baseDBApiUrl + UPLOADED_SIGNS) | |
27 | + ]).then(function(response) { | |
28 | + var responseProgress = response[0].data; | |
29 | + var uploadSignsProgress = { | |
30 | + 'short_name': 'uploaded_signs', | |
31 | + 'n_completed_tasks': response[1].data[0] | |
32 | + }; | |
33 | + responseProgress.push(uploadSignsProgress); | |
34 | + | |
35 | + angular.forEach(responseProgress, function(progress) { | |
36 | + progress['goal_n_tasks'] = accessGoalsData(responseGoals, progress.short_name, 'goal_n_tasks'); | |
37 | + progress['goal_deadline'] = moment(accessGoalsData(responseGoals, progress.short_name, 'goal_deadline'), "DD/MM/YYYY"); | |
38 | + progress['last_activity'] = moment(progress['last_activity']); | |
39 | + }); | |
40 | + | |
41 | + console.log(responseProgress); | |
42 | + | |
43 | + return responseProgress; | |
28 | 44 | }); |
29 | - return responseProgress; | |
30 | - }); | |
31 | 45 | }); |
32 | 46 | } |
33 | 47 | }; | ... | ... |
assets/js/ranking/ranking.controller.js
... | ... | @@ -0,0 +1,21 @@ |
1 | +(function () { | |
2 | + 'use strict'; | |
3 | + | |
4 | + angular.module('wikilibras.signs').controller('signsCtrl', ['$scope', 'signsService', function ($scope, signsService) { | |
5 | + $scope.signsData = []; | |
6 | + $scope.activeSignId = -1; | |
7 | + | |
8 | + signsService.getSignsData().then(function(response) { | |
9 | + $scope.signsData = response; | |
10 | + }); | |
11 | + | |
12 | + $scope.getSignData = function(id) { | |
13 | + return $scope.signsData[id]; | |
14 | + }; | |
15 | + | |
16 | + $scope.showSignModal = function(id) { | |
17 | + $scope.activeSignId = id; | |
18 | + $('.sign-modal').modal('show'); | |
19 | + }; | |
20 | + }]); | |
21 | +}()); | |
0 | 22 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,39 @@ |
1 | +(function () { | |
2 | + 'use strict'; | |
3 | + | |
4 | + angular.module('wikilibras.signs').service("signsService", ['$http', '$sce', function ($http, $sce) { | |
5 | + var PROJECT_CONF_URL = 'conf/app-conf.json'; | |
6 | + var PROJECT_LAST_ANSWERS_ENDPOINT = '/api/project_last_answers'; | |
7 | + | |
8 | + function buildSignUrl(baseUrl, parameterJson) { | |
9 | + var signUrl = baseUrl + '/public/' + parameterJson.userId + '/' + parameterJson.sinal; | |
10 | + return [{'path': $sce.trustAsResourceUrl(signUrl + '.webm'), 'type': 'video/webm'}, {'path': $sce.trustAsResourceUrl(signUrl + '.mp4'), 'type': 'video/mp4'}]; | |
11 | + } | |
12 | + | |
13 | + return { | |
14 | + getSignsData: function() { | |
15 | + return $http.get(PROJECT_CONF_URL).then(function(response) { | |
16 | + var basePyBossaApiUrl = response.data.pybossa_url; | |
17 | + var baseWikiLibrasApiUrl = response.data.wikilibras_api_url; | |
18 | + | |
19 | + return $http.get(basePyBossaApiUrl + PROJECT_LAST_ANSWERS_ENDPOINT).then(function(response) { | |
20 | + var projects = response.data; | |
21 | + var signsData = []; | |
22 | + angular.forEach(projects, function(data) { | |
23 | + if (data.project_name !== 'wikilibras') return; | |
24 | + angular.forEach(data.last_answers, function(answer) { | |
25 | + var signData = {}; | |
26 | + signData.signName = answer.taskrun_info.parameter_json.sinal; | |
27 | + signData.userId = answer.taskrun_info.parameter_json.userId; | |
28 | + signData.sources = buildSignUrl(baseWikiLibrasApiUrl, answer.taskrun_info.parameter_json); | |
29 | + signsData.push(signData); | |
30 | + }); | |
31 | + }); | |
32 | + console.log(signsData); | |
33 | + return signsData; | |
34 | + }); | |
35 | + }); | |
36 | + } | |
37 | + }; | |
38 | + }]); | |
39 | +}()); | |
0 | 40 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,12 @@ |
1 | +(function () { | |
2 | + 'use strict'; | |
3 | + | |
4 | + angular.module('wikilibras.signs').directive('html5vfix', function() { | |
5 | + return { | |
6 | + restrict: 'A', | |
7 | + link: function(scope, element, attr) { | |
8 | + attr.$set('src', attr.vsrc); | |
9 | + } | |
10 | + } | |
11 | + }); | |
12 | +}()); | |
0 | 13 | \ No newline at end of file | ... | ... |
assets/js/volunteers/volunteers.service.js
... | ... | @@ -3,16 +3,22 @@ |
3 | 3 | |
4 | 4 | angular.module('wikilibras.volunteers').service("volunteersService", ['$http', function ($http) { |
5 | 5 | var PROJECT_CONF_URL = 'conf/app-conf.json'; |
6 | - var VOLUNTEERS_ENDPOINT = '/api/user?limit=50'; | |
6 | + var VOLUNTEERS_ENDPOINT = '/api/user'; | |
7 | 7 | |
8 | 8 | return { |
9 | 9 | getVolunteersData: function() { |
10 | 10 | return $http.get(PROJECT_CONF_URL).then(function(response) { |
11 | 11 | var baseApiUrl = response.data.pybossa_url; |
12 | 12 | return $http.get(baseApiUrl + VOLUNTEERS_ENDPOINT).then(function(response) { |
13 | - var volunteersData = response.data; | |
14 | - angular.forEach(volunteersData, function(data) { | |
13 | + var volunteersData = {}; | |
14 | + volunteersData['users_data'] = response.data; | |
15 | + volunteersData['avatars_data'] = []; | |
16 | + | |
17 | + angular.forEach(volunteersData['users_data'], function(data) { | |
15 | 18 | data.info['avatar_url'] = data.info.container && data.info.avatar? baseApiUrl + '/uploads/' + data.info.container + '/' + data.info.avatar : ''; |
19 | + if (data.info['avatar_url'] !== '') { | |
20 | + volunteersData['avatars_data'].push(data.info['avatar_url']); | |
21 | + } | |
16 | 22 | }); |
17 | 23 | console.log(volunteersData); |
18 | 24 | return volunteersData; | ... | ... |
assets/templates/header.html
... | ... | @@ -34,14 +34,14 @@ |
34 | 34 | </div> |
35 | 35 | <div class="col-xs-8 wl-scroll-links-wrapper"> |
36 | 36 | <div class="hidden-xs wl-scroll-links pull-left"> |
37 | - <span du-smooth-scroll="wl-volunteers" accesskey="1">Ir para o conteúdo (alt+1)</span> | |
37 | + <span du-smooth-scroll="wl-overview" accesskey="1">Ir para o conteúdo (alt+1)</span> | |
38 | 38 | <span du-smooth-scroll="wl-presentation-video" offset="42" accesskey="2">Ir para o menu (alt+2)</span> |
39 | 39 | </div> |
40 | 40 | <div class="wl-login-btn-wrapper pull-right"> |
41 | - <div class="btn btn-info wl-btn wl-participate-btn"> | |
41 | + <div class="btn btn-info wl-btn wl-participate-btn" ng-click="openUrl('/pybossa/account/register')"> | |
42 | 42 | Participar |
43 | 43 | </div> |
44 | - <a href="" class="wl-login-link">Entrar</a> | |
44 | + <a href="/pybossa/account/signin" class="wl-login-link">Entrar</a> | |
45 | 45 | </div> |
46 | 46 | </div> |
47 | 47 | </div> |
... | ... | @@ -59,11 +59,11 @@ |
59 | 59 | </button> |
60 | 60 | <div class="col-xs-12 collapse navbar-collapse pull-right" id="bs-navbar-collapse"> |
61 | 61 | <ul class="nav navbar-nav wl-sections-link-wrapper"> |
62 | - <li class="section-link">o projeto</li> | |
62 | + <li class="section-link" du-smooth-scroll="wl-presentation-video" offset="42">o projeto</li> | |
63 | 63 | <li class="section-link" du-smooth-scroll="wl-overview">o que já produzimos</li> |
64 | 64 | <li class="section-link">tutoriais</li> |
65 | 65 | <li class="section-link" du-smooth-scroll="wl-features">quem faz o que</li> |
66 | - <li class="section-link" du-smooth-scroll="wl-volunteers">ranking</li> | |
66 | + <li class="section-link" du-smooth-scroll="wl-signs-and-ranking">ranking</li> | |
67 | 67 | </ul> |
68 | 68 | </div> |
69 | 69 | </div> | ... | ... |
assets/templates/sections.html
... | ... | @@ -6,6 +6,7 @@ |
6 | 6 | </div> |
7 | 7 | </div> |
8 | 8 | </div> |
9 | + <presentation-modal></presentation-modal> | |
9 | 10 | </section> |
10 | 11 | <section id="wl-overview" ng-controller="progressCtrl"> |
11 | 12 | <div class="container-fluid container"> |
... | ... | @@ -35,17 +36,17 @@ |
35 | 36 | </div> |
36 | 37 | <div class="progress"> |
37 | 38 | <div class="progress-bar -brown" role="progressbar" aria-valuenow="0" aria-valuemin="0" |
38 | - aria-valuemax="100" style="width: 10%"></div> | |
39 | + aria-valuemax="100" style="width: {{ (progress.uploaded_signs.n_completed_tasks/progress.uploaded_signs.goal_n_tasks)*100 }}%"></div> | |
39 | 40 | </div> |
40 | 41 | <div class="row progress-values"> |
41 | 42 | <div class="col-xs-4"> |
42 | - Feitos: <span class="value">150</span> | |
43 | + Feitos: <span class="value">{{ progress.uploaded_signs.n_completed_tasks }}</span> | |
43 | 44 | </div> |
44 | 45 | <div class="col-xs-4"> |
45 | - Meta: <span class="value">410</span> | |
46 | + Meta: <span class="value">{{ progress.uploaded_signs.goal_n_tasks }}</span> | |
46 | 47 | </div> |
47 | 48 | <div class="col-xs-4"> |
48 | - <span class="value">10 dias restantes</span> | |
49 | + <span class="value">{{ progress.uploaded_signs.goal_deadline | amDifference : dateTo : 'days' }} dias restantes</span> | |
49 | 50 | </div> |
50 | 51 | </div> |
51 | 52 | </div> |
... | ... | @@ -57,7 +58,7 @@ |
57 | 58 | </div> |
58 | 59 | <div class="progress"> |
59 | 60 | <div class="progress-bar -yellow" role="progressbar" aria-valuenow="0" aria-valuemin="0" |
60 | - aria-valuemax="100" style="width: {{ (progress.wikilibras.n_tasks/progress.wikilibras.goal_n_tasks)*100 }}%"></div> | |
61 | + aria-valuemax="100" style="width: {{ (progress.wikilibras.n_completed_tasks/progress.wikilibras.goal_n_tasks)*100 }}%"></div> | |
61 | 62 | </div> |
62 | 63 | <div class="row progress-values"> |
63 | 64 | <div class="col-xs-4"> |
... | ... | @@ -79,7 +80,7 @@ |
79 | 80 | </div> |
80 | 81 | <div class="progress"> |
81 | 82 | <div class="progress-bar -blue" role="progressbar" aria-valuenow="0" aria-valuemin="0" |
82 | - aria-valuemax="100" style="width: {{ (progress.corretor_sinais.n_tasks/progress.corretor_sinais.goal_n_tasks)*100 }}%"></div> | |
83 | + aria-valuemax="100" style="width: {{ (progress.corretor_sinais.n_completed_tasks/progress.corretor_sinais.goal_n_tasks)*100 }}%"></div> | |
83 | 84 | </div> |
84 | 85 | <div class="row progress-values"> |
85 | 86 | <div class="col-xs-4"> |
... | ... | @@ -101,7 +102,7 @@ |
101 | 102 | </div> |
102 | 103 | <div class="progress"> |
103 | 104 | <div class="progress-bar -green" role="progressbar" aria-valuenow="0" aria-valuemin="0" |
104 | - aria-valuemax="100" style="width: {{ (progress.validador_sinais.n_tasks/progress.validador_sinais.goal_n_tasks)*100 }}%"></div> | |
105 | + aria-valuemax="100" style="width: {{ (progress.validador_sinais.n_completed_tasks/progress.validador_sinais.goal_n_tasks)*100 }}%"></div> | |
105 | 106 | </div> |
106 | 107 | <div class="row progress-values"> |
107 | 108 | <div class="col-xs-4"> |
... | ... | @@ -118,7 +119,6 @@ |
118 | 119 | </div> |
119 | 120 | </div> |
120 | 121 | </div> |
121 | - </div> | |
122 | 122 | </section> |
123 | 123 | <section id="wl-features"> |
124 | 124 | <span class="wl-zigzag-border"></span> |
... | ... | @@ -136,7 +136,7 @@ |
136 | 136 | <div class="wl-feature-img"> |
137 | 137 | <img src="assets/img/wl-feature-send-video.png"> |
138 | 138 | </div> |
139 | - <div class="btn btn-info wl-btn wl-feature-btn"> | |
139 | + <div class="btn btn-info wl-btn wl-feature-btn" ng-click="openUrl('/pybossa/project/wikilibras/newtask')"> | |
140 | 140 | enviar |
141 | 141 | video |
142 | 142 | </div> |
... | ... | @@ -154,7 +154,7 @@ |
154 | 154 | <div class="wl-feature-img"> |
155 | 155 | <img src="assets/img/wl-feature-create-sign.png"> |
156 | 156 | </div> |
157 | - <div class="btn btn-info wl-btn wl-feature-btn"> | |
157 | + <div class="btn btn-info wl-btn wl-feature-btn" ng-click="openUrl('/pybossa/project/wikilibras/newtask')"> | |
158 | 158 | criar |
159 | 159 | sinal |
160 | 160 | </div> |
... | ... | @@ -172,7 +172,7 @@ |
172 | 172 | <div class="wl-feature-img"> |
173 | 173 | <img src="assets/img/wl-feature-fix-sign.png"> |
174 | 174 | </div> |
175 | - <div class="btn btn-info wl-btn wl-feature-btn"> | |
175 | + <div class="btn btn-info wl-btn wl-feature-btn" ng-click="openUrl('/pybossa/project/corretor_sinais/newtask')"> | |
176 | 176 | corrigir |
177 | 177 | sinal |
178 | 178 | </div> |
... | ... | @@ -194,12 +194,8 @@ |
194 | 194 | colaborando</div> |
195 | 195 | </div> |
196 | 196 | <div class="col-xs-12 wl-volunteers-container"> |
197 | - <div ng-repeat="volunteers in volunteersData" class="wl-volunteers-wrapper" ng-if="volunteers.info.avatar_url !== ''"> | |
198 | - <img ng-src="{{ volunteers.info.avatar_url }}"> | |
199 | - </div> | |
200 | - <div ng-repeat="avatar in avatars" | |
201 | - ng-if="avatars.length % 10 === 0? false: $index <= avatars.length - avatars.length % 10" | |
202 | - class="wl-volunteers-wrapper"> | |
197 | + <div ng-repeat="avatar in volunteersData.avatars_data | limitTo: 50" class="wl-volunteers-wrapper"> | |
198 | + <img ng-src="{{ avatar }}"> | |
203 | 199 | </div> |
204 | 200 | </div> |
205 | 201 | </div> |
... | ... | @@ -209,7 +205,7 @@ |
209 | 205 | <div class="container-fluid"> |
210 | 206 | <div class="row"> |
211 | 207 | <div class="col-xs-12 wl-signs-and-ranking-container"> |
212 | - <div class="wl-signs-and-ranking-wrapper"> | |
208 | + <div class="wl-signs-and-ranking-wrapper" ng-controller="signsCtrl"> | |
213 | 209 | <div class="wl-section-title"> |
214 | 210 | <div class="title">sinais |
215 | 211 | construídos |
... | ... | @@ -219,8 +215,32 @@ |
219 | 215 | <p>Lorem Ipsum é simplesmente uma simulação de texto da indústria tipográfica e de impressos, e vem sendo utilizado desde o século XVI.</p> |
220 | 216 | </div> |
221 | 217 | <div class="wl-signs-container"> |
222 | - <div class="wl-signs-wrapper" ng-repeat="i in [1,2,3,4,5,6,7,8,9]"> | |
223 | - <img src="assets/img/sign-placeholder.png"> | |
218 | + <div class="wl-signs-wrapper sign-video-container" ng-repeat="sign in signsData | limitTo: 9 track by $index" ng-click="showSignModal($index)"> | |
219 | + <video preload="metadata"> | |
220 | + <source ng-repeat="source in sign.sources" vsrc="{{ source.path }}" type="{{ source.type }}" html5vfix> | |
221 | + Sem suporte a vídeos | |
222 | + </video> | |
223 | + </div> | |
224 | + <div ng-repeat="i in [1,2,3]" ng-if="signsData.length % 3 === 0? false: i <= 3 - signsData.length % 3" class="wl-signs-wrapper"> | |
225 | + </div> | |
226 | + </div> | |
227 | + <div class="modal clean-modal sign-modal fade" tabindex="-1" | |
228 | + role="dialog" aria-labelledby="modalUserSignal"> | |
229 | + <div class="modal-dialog" role="document"> | |
230 | + <div class="modal-content"> | |
231 | + <div class="modal-body"> | |
232 | + <div class="sign-video-container"> | |
233 | + <video autoplay loop> | |
234 | + <source ng-repeat="source in getSignData(activeSignId).sources" vsrc="{{ source.path }}" type="{{ source.type }}" html5vfix> | |
235 | + Sem suporte a vídeos | |
236 | + </video> | |
237 | + </div> | |
238 | + <p class="sign-name text-center"> | |
239 | + {{ getSignData(activeSignId).signName }}<br> | |
240 | + <span class="created-by">criado por: {{ getSignData(activeSignId).userId }}</span> | |
241 | + </p> | |
242 | + </div> | |
243 | + </div> | |
224 | 244 | </div> |
225 | 245 | </div> |
226 | 246 | </div> | ... | ... |
conf/app-conf.json
1 | 1 | { |
2 | 2 | "pybossa_url": "http://localhost/pybossa", |
3 | + "wikilibras_api_url": "http://localhost:5001", | |
4 | + "db_api_url": "http://150.165.204.35:200", | |
3 | 5 | "goals": { |
6 | + "uploaded_signs": { | |
7 | + "goal_n_tasks": 10, | |
8 | + "goal_deadline": "27/09/2016" | |
9 | + }, | |
4 | 10 | "wikilibras": { |
5 | 11 | "goal_n_tasks": 20, |
6 | 12 | "goal_deadline": "30/09/2016" | ... | ... |
... | ... | @@ -0,0 +1,19 @@ |
1 | +{ | |
2 | + "pybossa_url": "<pybossa-base-url>", | |
3 | + "wikilibras_api_url": "<wikilibras-api-base-url>", | |
4 | + "db_api_url": "<db-api-base-url>", | |
5 | + "goals": { | |
6 | + "wikilibras": { | |
7 | + "goal_n_tasks": 20, | |
8 | + "goal_deadline": "30/09/2016" | |
9 | + }, | |
10 | + "corretor_sinais": { | |
11 | + "goal_n_tasks": 30, | |
12 | + "goal_deadline": "29/09/2016" | |
13 | + }, | |
14 | + "validador_sinais": { | |
15 | + "goal_n_tasks": 40, | |
16 | + "goal_deadline": "28/09/2016" | |
17 | + } | |
18 | + } | |
19 | +} | |
0 | 20 | \ No newline at end of file | ... | ... |
index.html
... | ... | @@ -25,9 +25,16 @@ |
25 | 25 | <script src="assets/js/libs/bootstrap/bootstrap.min.js"></script> |
26 | 26 | <script src="assets/js/libs/angular/angular.min.js"></script> |
27 | 27 | <script src="assets/js/libs/angular-scroll.min.js"></script> |
28 | + <script src="assets/js/libs/angular-sanitize.min.js"></script> | |
28 | 29 | <script src="assets/js/libs/moment.min.js"></script> |
29 | 30 | <script src="assets/js/libs/angular-moment.min.js"></script> |
30 | 31 | |
32 | + <script src="assets/js/presentation/presentation.module.js"></script> | |
33 | + <script src="assets/js/presentation/presentation.directive.js"></script> | |
34 | + <script src="assets/js/signs/signs.module.js"></script> | |
35 | + <script src="assets/js/signs/video-fix.directive.js"></script> | |
36 | + <script src="assets/js/signs/signs.service.js"></script> | |
37 | + <script src="assets/js/signs/signs.controller.js"></script> | |
31 | 38 | <script src="assets/js/volunteers/volunteers.module.js"></script> |
32 | 39 | <script src="assets/js/volunteers/volunteers.service.js"></script> |
33 | 40 | <script src="assets/js/volunteers/volunteers.controller.js"></script> | ... | ... |