Commit ddc73588 by Patryk Czarnik

Poprawki stylu

parent e29ae9eb
......@@ -27,7 +27,12 @@ public class WalutyController {
@GetMapping("/waluty")
public String wyswietlWaluty(String data, Model model) {
TabelaWalut tabela = null;
TabelaWalut tabela = pobierzTabele(data);
model.addAttribute("tabela", tabela);
return "waluty.html";
}
private TabelaWalut pobierzTabele(String data) {
String adres = "https://api.nbp.pl/api/exchangerates/tables/a";
if(data != null) {
adres += "/" + data;
......@@ -52,7 +57,7 @@ public class WalutyController {
String numerTabeli = xpath.evaluate("//No", doc);
LocalDate dataTabeli = LocalDate.parse(xpath.evaluate("//EffectiveDate", doc));
tabela = new TabelaWalut(nazwaTabeli, numerTabeli, dataTabeli);
TabelaWalut tabela = new TabelaWalut(nazwaTabeli, numerTabeli, dataTabeli);
NodeList rates = (NodeList) xpath.evaluate("//Rate", doc, XPathConstants.NODESET);
final int n = rates.getLength();
......@@ -65,12 +70,11 @@ public class WalutyController {
tabela.dodajWalute(waluta);
}
return tabela;
} catch (ParserConfigurationException | SAXException | XPathExpressionException | IOException e) {
e.printStackTrace();
return null;
}
model.addAttribute("tabela", tabela);
return "waluty.html";
}
}
......@@ -34,3 +34,17 @@ form {
color: red;
font-weight: bold;
}
table.tabela-walut {
background-color: #FFFFFF;
border-collapse: collapse;
border: 3px solid black;
margin: 0 auto;
}
table.tabela-walut td, table.tabela-walut th {
border: 1px solid black;
padding: 2px;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment