miglioramenti ai css

This commit is contained in:
2015-07-08 22:48:25 +02:00
parent b0c026abea
commit d6cc71d959
11 changed files with 62 additions and 27 deletions

View File

@@ -3,17 +3,13 @@ package org.jpacrepo.context;
import lombok.Getter;
import lombok.Setter;
import org.jpacrepo.model.PkgData;
import org.jpacrepo.service.PacmanService;
import org.jpacrepo.service.PacmanServiceView;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.inject.Qualifier;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import java.util.Properties;
/**
@@ -33,7 +29,7 @@ public class ApplicationContext
private String repoFolder;
@Getter @Setter
private PacmanService pacmanService;
private PacmanServiceView pacmanService;
public ApplicationContext(String propertyFile)
{

View File

@@ -1,6 +1,6 @@
package org.jpacrepo.context;
import org.jpacrepo.service.PacmanService;
import org.jpacrepo.service.PacmanServiceView;
import javax.ejb.EJB;
import javax.enterprise.inject.Produces;
@@ -13,7 +13,7 @@ import javax.enterprise.inject.Produces;
public class ContextProducer
{
@EJB
PacmanService service;
PacmanServiceView service;
@Produces
@DefaultConfiguration

View File

@@ -44,9 +44,11 @@ public class JPacRepoApp extends WApplication
WBootstrapTheme theme = new WBootstrapTheme();
theme.setVersion(WBootstrapTheme.Version.Version3);
setTheme(theme);
useStyleSheet(new WLink(WApplication.getRelativeResourcesUrl() + "/themes/bootstrap/3/bootstrap-theme.min.css"));
useStyleSheet(new WLink("https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"));
useStyleSheet(new WLink("https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"));
require("https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js");
// useStyleSheet(new WLink(WApplication.getRelativeResourcesUrl() + "/themes/bootstrap/3/bootstrap-theme.min.css"));
useStyleSheet(new WLink("css/jpacrepo-web.css"));
// useStyleSheet(new WLink("css/everywidget.css"));
createView();
}

View File

@@ -15,7 +15,7 @@ public class PackageTable extends WTable
{
toggleStyleClass("table-bordered", true);
toggleStyleClass("table-condensed", true);
toggleStyleClass("table-striped", true);
toggleStyleClass("table-hover", true);
}
@@ -30,6 +30,8 @@ public class PackageTable extends WTable
getElementAt(0, 2).addWidget(new WText("Arch"));
getElementAt(0, 3).addWidget(new WText("Description"));
getElementAt(0, 4).addWidget(new WText("Size"));
getElementAt(0, 5).addWidget(new WText(""));
getElementAt(0, 5).setStyleClass("no-border");
for(int row =1 ; row<pkgs.size()+1; row++)
@@ -43,8 +45,11 @@ public class PackageTable extends WTable
//WPushButton button = new WPushButton("Download");
WAnchor button = new WAnchor();
button.setStyleClass("btn btn-default");
button.setStyleClass("btn btn-primary");
//text.setStyleClass("glyphicon glyphicon-download-alt");
// WText text = new WText();
// text.setStyleClass("glyphicons glyphicons-save");
// button.addWidget(text);
WImage img = new WImage("img/download.svg");
img.setStyleClass("download-icon");
@@ -52,8 +57,9 @@ public class PackageTable extends WTable
button.setImage(img);
button.setLink(new WLink(WLink.Type.Url, "rest/pkg/download/" + pkg.fileName));
button.addStyleClass("text-center");
WText text = new WText("Download",button);
new WText("Download",button);
getElementAt(row, 5).addWidget(button);
// getElementAt(row,5).setStyleClass("no-border");
}
}

View File

@@ -9,7 +9,6 @@ import org.jpacrepo.model.PkgData;
import org.jpacrepo.model.PkgName;
import org.jpacrepo.pacbase.Parser;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import javax.ejb.*;
import javax.enterprise.concurrent.ManagedThreadFactory;
@@ -32,7 +31,7 @@ import java.util.logging.Logger;
@Startup
@Singleton
@TransactionManagement(TransactionManagementType.BEAN)
public class PacmanServiceEJB implements PacmanService
public class PacmanServiceEJB implements PacmanServiceView
{
@PersistenceContext(unitName = "jpacrepo_pu")
private EntityManager em;

View File

@@ -0,0 +1,13 @@
package org.jpacrepo.service;
import javax.ejb.Remote;
/**
* Created by walter on 08/07/15.
*/
@Remote
public interface PacmanServiceRemote
{
public void deletePackage(String filename) throws Exception;
}

View File

@@ -11,10 +11,8 @@ import java.util.Map;
*/
@Local
public interface PacmanService
public interface PacmanServiceView extends PacmanServiceRemote
{
public void deletePackage(String filename) throws Exception;
public long countResults(String name, String version, String arch);
public List<PkgData> searchPackage(String name, String version, String arch, int page, int pageSize);

View File

@@ -0,0 +1,3 @@
<a class="btn btn-default" href="${link}">
<span class="glyphicons glyphicon-save"></span> Download
</a>

View File

@@ -5,11 +5,22 @@ div.input-control {
border-radius: 4px;
}
html body.Wt-ltr div.Wt-domRoot div div.container div.row table.table-bordered.table-condensed.table-striped tbody tr td {
html body.Wt-ltr div.Wt-domRoot div div.container div.row table.table-bordered.table-condensed.table-hover tbody tr td {
text-align: center;
vertical-align: middle;
}
html body.Wt-ltr div.Wt-domRoot div div.container div.row table.table-bordered.table-condensed.table-striped thead tr th {
html body.Wt-ltr div.Wt-domRoot div div.container div.row table.table-bordered.table-condensed.table-hover thead tr th.no-border {
border: none;
}
div.row table.table-hover {
border: none;
}
html body.Wt-ltr div.Wt-domRoot div div.container div.row table.table-bordered.table-condensed.table-hover thead tr th {
text-align: center;
vertical-align: middle;
}
div.search-input form.form-inline div.form-group
@@ -25,4 +36,15 @@ div.container.main-container
td a img.download-icon
{
margin-right: 5px;
}
}
div.container.main-container div.row table.table-bordered.table-condensed.table-hover tbody tr td:nth-child(6) a
{
visibility: hidden;
}
div.container.main-container div.row table.table-bordered.table-condensed.table-hover tbody tr:hover td:nth-child(6) a
{
visibility: visible;
}

View File

@@ -6,7 +6,7 @@ import org.jpacrepo.model.PkgData;
import org.jpacrepo.pacbase.Hasher;
import org.jpacrepo.pacbase.MD5InputStream;
import org.jpacrepo.pacbase.Parser;
import org.jpacrepo.service.PacmanService;
import org.jpacrepo.service.PacmanServiceView;
import org.junit.Test;
import javax.naming.*;
@@ -141,7 +141,7 @@ public class ClientTest
Context ctx = new InitialContext(prop);
traverseJndiNode("/", context);
// final PacmanService stateService = (PacmanService) ctx.lookup("/jpacrepo-1.0/remote/PacmanServiceEJB!service.PacmanService");
final PacmanService stateService = (PacmanService) ctx.lookup("/jpacrepo/PacmanServiceEJB!org.jpacrepo.service.PacmanService");
final PacmanServiceView stateService = (PacmanServiceView) ctx.lookup("/jpacrepo/PacmanServiceEJB!org.jpacrepo.service.PacmanService");
stateService.deletePackage("google-earth-7.1.4.1529-1-x86_64.pkg.tar.xz");
}

View File

@@ -4,16 +4,12 @@ import org.apache.commons.io.filefilter.DirectoryFileFilter;
import org.apache.commons.io.filefilter.RegexFileFilter;
import org.jpacrepo.model.PkgData;
import org.jpacrepo.pacbase.Parser;
import org.jpacrepo.service.PacmanService;
import org.junit.Test;
import javax.naming.*;
import java.io.File;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Properties;
/**
* Created by walter on 22/03/15.