Skip to content

Commit

Permalink
Merge pull request #58 from GPP-MDS-2015-2/last_adjustments
Browse files Browse the repository at this point in the history
Last adjustments
  • Loading branch information
gabrielssilva committed Nov 30, 2015
2 parents 3afdcb9 + 241ec7f commit 8feaa0d
Show file tree
Hide file tree
Showing 47 changed files with 15,645 additions and 504 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc

# Gem to create the table style 1: data table with jQuery
gem 'jquery-datatables-rails', github: 'rweng/jquery-datatables-rails'
#gem 'jquery-datatables-rails', github: 'rweng/jquery-datatables-rails'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

Expand Down
11 changes: 0 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
GIT
remote: git://github.com/rweng/jquery-datatables-rails.git
revision: a2fafcb2c78d817c5ad849d834ed259a1b43c269
specs:
jquery-datatables-rails (3.3.0)
actionpack (>= 3.1)
jquery-rails
railties (>= 3.1)
sass-rails

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -244,7 +234,6 @@ DEPENDENCIES
factory_girl_rails
fakeweb (~> 1.3)
jbuilder (~> 2.0)
jquery-datatables-rails!
jquery-rails
jquery-turbolinks
materialize-sass
Expand Down
Binary file added app/assets/images/facebook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/fga.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/orcamentogov.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/sort_asc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/sort_both.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/sort_desc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/wiki.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 58 additions & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
//= require_tree ../../../vendor/assets/javascripts/jQuery
//= require materialize-sprockets
//= require jquery.turbolinks
//= require dataTables/jquery.dataTables
//= require highcharts/highcharts
//= require Fireworks
//= require_tree ../../../vendor/assets/javascripts/slider
//= require_tree ../../../vendor/assets/javascripts/visjs
//= require_tree ../../../vendor/assets/javascripts/highcharts
//= require_tree ../../../vendor/assets/javascripts/dataTable
//= require visjs/vis
//= require turbolinks
//= require_tree .
Expand Down Expand Up @@ -114,3 +114,60 @@ function cloneObject(object){
}
return newObject;
}
Number.prototype.formatMoney = function(){
var n = this,
c = 2,
d = "," ,
t = ".",
s = n < 0 ? "-" : "",
i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "",
j = (j = i.length) > 3 ? j % 3 : 0;
return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
};

jQuery.fn.dataTableExt.aTypes.unshift(
function ( sData )
{
var sValidChars = "0123456789-,";
var Char;
var bDecimal = false;

/* Check the numeric part */
for ( i=0 ; i<sData.length ; i++ )
{
Char = sData.charAt(i);
if (sValidChars.indexOf(Char) == -1)
{
return null;
}

/* Only allowed one decimal place... */
if ( Char == "," )
{
if ( bDecimal )
{
return null;
}
bDecimal = true;
}
}

return 'numeric-comma';
}
);

jQuery.fn.dataTableExt.oSort['numeric-comma-asc'] = function(a,b) {
var x = (a == "-") ? 0 : a.replace(/./,"").replace( /,/, "." ).replace(/R$/, "");
var y = (b == "-") ? 0 : b.replace(/./,"").replace( /,/, "." ).replace(/R$/, "");
x = parseFloat( x );
y = parseFloat( y );
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
};

jQuery.fn.dataTableExt.oSort['numeric-comma-desc'] = function(a,b) {
var x = (a == "-") ? 0 : a.replace(/./,"").replace( /,/, "." ).replace(/R$/, "");
var y = (b == "-") ? 0 : b.replace(/./,"").replace( /,/, "." ).replace(/R$/, "");
x = parseFloat( x );
y = parseFloat( y );
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
};
2 changes: 2 additions & 0 deletions app/assets/javascripts/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ function budgetFilter(path,idEntity,updateChart){
console.info("Change the slider")
},*/
stop: function(event,ui){
$('#year_filter').empty();
$('#year_filter').append("Ano atual: "+ui.value);
console.debug(ui);
clearChart(idEntity,0);
clearChart(idEntity,1);
Expand Down
111 changes: 0 additions & 111 deletions app/assets/javascripts/menu.js
Original file line number Diff line number Diff line change
@@ -1,113 +1,3 @@
(function($) {

$.fn.menumaker = function(options) {

var cssmenu = $(this), settings = $.extend({
title: "Menu",
format: "dropdown",
breakpoint: 768,
sticky: false
}, options);

return this.each(function() {
cssmenu.find('li ul').parent().addClass('has-sub');
if (settings.format != 'select') {
cssmenu.prepend('<div id="menu-button">' + settings.title + '</div>');
$(this).find("#menu-button").on('click', function(){
$(this).toggleClass('menu-opened');
var mainmenu = $(this).next('ul');
if (mainmenu.hasClass('open')) {
mainmenu.hide().removeClass('open');
}
else {
mainmenu.show().addClass('open');
if (settings.format === "dropdown") {
mainmenu.find('ul').show();
}
}
});

multiTg = function() {
cssmenu.find(".has-sub").prepend('<span class="submenu-button"></span>');
cssmenu.find('.submenu-button').on('click', function() {
$(this).toggleClass('submenu-opened');
if ($(this).siblings('ul').hasClass('open')) {
$(this).siblings('ul').removeClass('open').hide();
}
else {
$(this).siblings('ul').addClass('open').show();
}
});
};

if (settings.format === 'multitoggle') multiTg();
else cssmenu.addClass('dropdown');
}

else if (settings.format === 'select')
{
cssmenu.append('<select style="width: 100%"/>').addClass('select-list');
var selectList = cssmenu.find('select');
selectList.append('<option>' + settings.title + '</option>', {
"selected": "selected",
"value": ""});
cssmenu.find('a').each(function() {
var element = $(this), indentation = "";
for (i = 1; i < element.parents('ul').length; i++)
{
indentation += '-';
}
selectList.append('<option value="' + $(this).attr('href') + '">' + indentation + element.text() + '</option');
});
selectList.on('change', function() {
window.location = $(this).find("option:selected").val();
});
}

if (settings.sticky === true) cssmenu.css('position', 'fixed');

resizeFix = function() {
if ($(window).width() > settings.breakpoint) {
cssmenu.find('ul').show();
cssmenu.removeClass('small-screen');
if (settings.format === 'select') {
cssmenu.find('select').hide();
}
else {
cssmenu.find("#menu-button").removeClass("menu-opened");
}
}

if ($(window).width() <= settings.breakpoint && !cssmenu.hasClass("small-screen")) {
cssmenu.find('ul').hide().removeClass('open');
cssmenu.addClass('small-screen');
if (settings.format === 'select') {
cssmenu.find('select').show();
}
}
};
resizeFix();
return $(window).on('resize', resizeFix);

});
};
})(jQuery);

(function($){

$(document).ready(function() {
$("#cssmenu").menumaker({
title: "Menu",
format: "dropdown"
});

$("#cssmenu a").each(function() {
var linkTitle = $(this).text();
$(this).attr('data-title', linkTitle);
});
});
})(jQuery);

(function($){
$(document).ready(function(){
$('.parallax').parallax();
Expand All @@ -122,4 +12,3 @@ $(document).ready(function() {
$('.tooltipped').tooltip({delay: 50});
});
})(jQuery);

51 changes: 36 additions & 15 deletions app/assets/javascripts/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,59 @@ $(document).ready( function(){
$('#tableData').dataTable({
autoWidth: true,
pagingType: "full_numbers",
searching: false,
searching: true,
columnDefs:[{
type: 'currency', targets: 2
}],
order: [1,'desc'],
//dom: "<'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>",
dom: "<'top'>t<'bottom'pi>",
oLanguage:{
sUrl: '//cdn.datatables.net/plug-ins/1.10.9/i18n/Portuguese-Brasil.json'
}
});

});

//Define the options to dataTable and control that
$(document).ready( function(){
$('#tableData1').dataTable({
autoWidth: true,
pagingType: "full_numbers",
searching: false,
searching: true,
columnDefs:[
{
type: 'currency', targets: 2
},{
visible: false,
targets:0
}],
order: [1,'desc'],
//dom: "<'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>",
dom: "<'top'>t<'bottom'pi>",
oLanguage:{
sUrl: '//cdn.datatables.net/plug-ins/1.10.9/i18n/Portuguese-Brasil.json'
}
});

});
$(document).ready( function(){
$('#tableData2').dataTable({
autoWidth: true,
pagingType: "full_numbers",
searching: false,
order: [1,'desc'],
//dom: "<'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>",
dom: "<'top'>t<'bottom'pi>",
oLanguage:{
sUrl: '//cdn.datatables.net/plug-ins/1.10.9/i18n/Portuguese-Brasil.json'
}
});
});

jQuery.extend( jQuery.fn.dataTableExt.oSort, {
"currency-pre": function ( a ) {
a = (a==="-") ? 0 : a.replace( /[^\d\-\,]/g, "" );
return parseFloat( a );
},

"currency-asc": function ( a, b ) {
return a - b;
},

"currency-desc": function ( a, b ) {
return b - a;
}
} );

function filterTable(name){
var table = $('#tableData1').DataTable();
table.column(0).search(name).draw();
}
11 changes: 9 additions & 2 deletions app/assets/stylesheets/contact.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
.conteiner_help{
margin-left: 14%;
margin-left: 6%;
font-size: 20px;
margin-right: 14%;
margin-right: 6%;
text-align: justify
}
.conteiner_help br{
margin-bottom: 18px;
}
.container_help p{
margin-bottom: 50px;
}

.conteiner_help img{
width:70px;
height: 70px;
margin-left: 60px;
}
Loading

0 comments on commit 8feaa0d

Please sign in to comment.