Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

792: Add projects count to project types in Dashboard Project #22

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
package org.sigmah.client.ui.presenter;

/*
* #%L
* Sigmah
* %%
* Copyright (C) 2010 - 2016 URD
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/

package org.sigmah.client.ui.presenter;
/*
* #%L
* Sigmah
* %%
* Copyright (C) 2010 - 2016 URD
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/

import java.util.Date;
import java.util.HashMap;
Expand Down Expand Up @@ -86,6 +86,9 @@
*/
@Singleton
public class CreateProjectPresenter extends AbstractPagePresenter<CreateProjectPresenter.View> {
public NGO.counter=0;
public FUNDING.counter=0;
public LOCAL_PARTNER.counter=0;

/**
* View interface.
Expand Down Expand Up @@ -433,6 +436,11 @@ public void componentSelected(ButtonEvent ce) {
}

});

if(type==NGO){NGO.counter++; }
else if(type==FUNDING){FUNDING.counter++;}
else if(type==LOCAL_PARTNER){LOCAL_PARTNER.counter++;}
else{}

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import org.sigmah.client.ui.res.icon.dashboard.funding.FundingIconProvider;
import org.sigmah.client.ui.res.icon.dashboard.funding.FundingIconProvider.IconSize;
import org.sigmah.client.ui.presenter;
import org.sigmah.client.util.ClientUtils;
import org.sigmah.shared.dto.referential.ProjectModelType;

Expand Down Expand Up @@ -104,7 +105,7 @@ public ProjectModelTypeField(final String fieldLabel, final boolean mandatory, f
icon.getElement().getStyle().setMarginTop(-2, Unit.PX);
icon.getElement().getStyle().setPaddingRight(6, Unit.PX);

radio.setBoxLabel(icon.toString() + ProjectModelType.getName(projectModelType));
radio.setBoxLabel(icon.toString() + ProjectModelType.getName(projectModelType) + "(" + ProjectModelType.counter + ")");

radioGroup.add(radio);
radios.put(projectModelType, radio);
Expand Down