From 7858ee134e2b61d68c482c266eb12e76a25521bf Mon Sep 17 00:00:00 2001 From: 0x000nullpointer Date: Tue, 10 Jun 2025 16:17:04 -0300 Subject: [PATCH] Fixed UI elements --- .../tsi/news/controle/controleJornalista.java | 12 +-- .../tsi/news/controle/controleReportagem.java | 10 ++- .../serviceImp/ReportagemServicoImp.java | 1 + .../resources/static/styles/background.css | 15 ++++ src/main/resources/static/styles/form.css | 66 +++++++++++++++ .../resources/static/styles/images/logo.png | Bin 0 -> 2313 bytes .../resources/static/styles/images/logo.svg | 1 + src/main/resources/static/styles/lists.css | 58 +++++++++++++ .../resources/static/styles/reportagem.css | 80 ++++++++++++++++++ src/main/resources/static/styles/table.css | 54 ++++++++++++ src/main/resources/templates/assunto.html | 59 ++++++++----- src/main/resources/templates/assuntos.html | 30 +++---- src/main/resources/templates/index.html | 63 ++++++++++++-- src/main/resources/templates/jornalistas.html | 27 +++--- .../resources/templates/paineldecontrole.html | 59 +++++++++++++ src/main/resources/templates/reportagem.html | 33 ++++++-- src/main/resources/templates/reportagens.html | 63 +++++++------- .../templates/reportagensPublic.html | 44 ++++++++++ .../news/controle/controleJornalista.class | Bin 3979 -> 4024 bytes .../news/controle/controleReportagem.class | Bin 5900 -> 6169 bytes .../serviceImp/ReportagemServicoImp.class | Bin 1504 -> 1504 bytes target/classes/static/styles/background.css | 15 ++++ target/classes/static/styles/form.css | 66 +++++++++++++++ target/classes/static/styles/images/logo.png | Bin 0 -> 2313 bytes target/classes/static/styles/images/logo.svg | 1 + target/classes/static/styles/lists.css | 58 +++++++++++++ target/classes/static/styles/reportagem.css | 80 ++++++++++++++++++ target/classes/static/styles/table.css | 54 ++++++++++++ target/classes/templates/assunto.html | 59 ++++++++----- target/classes/templates/assuntos.html | 30 +++---- target/classes/templates/index.html | 63 ++++++++++++-- target/classes/templates/jornalistas.html | 27 +++--- .../classes/templates/paineldecontrole.html | 59 +++++++++++++ target/classes/templates/reportagem.html | 33 ++++++-- target/classes/templates/reportagens.html | 63 +++++++------- .../classes/templates/reportagensPublic.html | 44 ++++++++++ 36 files changed, 1118 insertions(+), 209 deletions(-) create mode 100644 src/main/resources/static/styles/background.css create mode 100644 src/main/resources/static/styles/form.css create mode 100644 src/main/resources/static/styles/images/logo.png create mode 100644 src/main/resources/static/styles/images/logo.svg create mode 100644 src/main/resources/static/styles/lists.css create mode 100644 src/main/resources/static/styles/reportagem.css create mode 100644 src/main/resources/static/styles/table.css create mode 100644 src/main/resources/templates/paineldecontrole.html create mode 100644 src/main/resources/templates/reportagensPublic.html create mode 100644 target/classes/static/styles/background.css create mode 100644 target/classes/static/styles/form.css create mode 100644 target/classes/static/styles/images/logo.png create mode 100644 target/classes/static/styles/images/logo.svg create mode 100644 target/classes/static/styles/lists.css create mode 100644 target/classes/static/styles/reportagem.css create mode 100644 target/classes/static/styles/table.css create mode 100644 target/classes/templates/paineldecontrole.html create mode 100644 target/classes/templates/reportagensPublic.html diff --git a/src/main/java/com/br/td/utfpr/edu/tsi/news/controle/controleJornalista.java b/src/main/java/com/br/td/utfpr/edu/tsi/news/controle/controleJornalista.java index 55943f8..71cc5e6 100644 --- a/src/main/java/com/br/td/utfpr/edu/tsi/news/controle/controleJornalista.java +++ b/src/main/java/com/br/td/utfpr/edu/tsi/news/controle/controleJornalista.java @@ -17,7 +17,7 @@ public class controleJornalista { @Autowired private JornalistaServico jornalistaServico; - @GetMapping("/jornalista") + @GetMapping("/paineldecontrole") public String exibirPaginaCadastrarJornalista(@RequestParam(required = false) String idJornalista, Model model) { Jornalista jornalista = null; if (idJornalista != null) { @@ -31,16 +31,16 @@ public String exibirPaginaCadastrarJornalista(@RequestParam(required = false) St jornalista = new Jornalista(null, ""); } model.addAttribute("jornalista", jornalista); - return "jornalista"; + return "paineldecontrole"; } - @PostMapping(value = "/jornalista") + @PostMapping(value = "/paineldecontrole") public String cadastrarJornalista(Jornalista jornalista) { if (jornalista.getId() == null || jornalista.getId().isEmpty()) { jornalista.setId(null); } jornalistaServico.cadastrar(jornalista); - return "redirect:/"; + return "redirect:/jornalistas"; } @GetMapping(value = "/jornalistas") @@ -53,6 +53,8 @@ public String exibirPaginaListarJornalista(Model model) { @GetMapping(value = "/removerJornalista") public String removerJornalista(@RequestParam String idJornalista) { jornalistaServico.remover(idJornalista); - return "redirect:/jornalista"; + return "redirect:/paineldecontrole"; } + + } diff --git a/src/main/java/com/br/td/utfpr/edu/tsi/news/controle/controleReportagem.java b/src/main/java/com/br/td/utfpr/edu/tsi/news/controle/controleReportagem.java index 119438a..cabedbc 100644 --- a/src/main/java/com/br/td/utfpr/edu/tsi/news/controle/controleReportagem.java +++ b/src/main/java/com/br/td/utfpr/edu/tsi/news/controle/controleReportagem.java @@ -77,7 +77,7 @@ public String cadastrarReportagem(Reportagem reportagem) { reportagem.setDataCriacao(java.time.LocalDateTime.now()); } reportagemServico.cadastrar(reportagem); - return "redirect:/"; + return "redirect:/reportagem"; } @GetMapping(value = "/reportagens") public String exibirPaginaListarReportagem(Model model) { @@ -89,7 +89,13 @@ public String exibirPaginaListarReportagem(Model model) { @GetMapping(value = "/removerReportagem") public String removerDocumentos(@RequestParam String idReportagem) { reportagemServico.remover(idReportagem); - return "index"; + return "redirect:/reportagensPublic"; + } + @GetMapping("/reportagensPublic") + public String exibirPaginaListarReportagemPublic(Model model) { + List reportagem = reportagemServico.listarTodos(); + model.addAttribute("reportagens", reportagem); + return "reportagensPublic"; } } diff --git a/src/main/java/com/br/td/utfpr/edu/tsi/news/servico/serviceImp/ReportagemServicoImp.java b/src/main/java/com/br/td/utfpr/edu/tsi/news/servico/serviceImp/ReportagemServicoImp.java index eda0c33..152aa06 100644 --- a/src/main/java/com/br/td/utfpr/edu/tsi/news/servico/serviceImp/ReportagemServicoImp.java +++ b/src/main/java/com/br/td/utfpr/edu/tsi/news/servico/serviceImp/ReportagemServicoImp.java @@ -14,6 +14,7 @@ public class ReportagemServicoImp implements ReportagemServico { @Override public void cadastrar(Reportagem reportagem) { + reportagemRepository.save(reportagem); } diff --git a/src/main/resources/static/styles/background.css b/src/main/resources/static/styles/background.css new file mode 100644 index 0000000..2bcf135 --- /dev/null +++ b/src/main/resources/static/styles/background.css @@ -0,0 +1,15 @@ +body { + min-height: 100vh; + background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%); + position: relative; + z-index: 1; +} + +body::before { + content: ""; + position: fixed; + top: 0; left: 0; right: 0; bottom: 0; + background: linear-gradient(120deg, rgba(59,130,246,0.15) 0%, rgba(16,185,129,0.15) 100%); + z-index: -1; + pointer-events: none; +} \ No newline at end of file diff --git a/src/main/resources/static/styles/form.css b/src/main/resources/static/styles/form.css new file mode 100644 index 0000000..71dc982 --- /dev/null +++ b/src/main/resources/static/styles/form.css @@ -0,0 +1,66 @@ +form { + background: #f5f5c6; + border: 3px solid #000080; + padding: 24px 32px; + width: 350px; + margin: 40px auto; + font-family: 'Comic Sans MS', 'Arial', sans-serif; + box-shadow: 6px 6px 0 #ff00cc; +} + +label { + color: #000080; + font-weight: bold; + font-size: 1.1em; + + margin-bottom: 6px; + display: block; +} + +input[type="text"], input[type="email"] { + width: 90%; + padding: 8px; + margin-bottom: 18px; + border: 2px inset #008000; + background: #fff; + color: #000; + font-size: 1em; + font-family: 'Courier New', monospace; + box-shadow: 2px 2px 0 #00ffff; +} + +input[type="submit"] { + background: #ffcc00; + color: #000080; + border: 3px outset #008000; + font-size: 1.1em; + font-family: 'Comic Sans MS', 'Arial', sans-serif; + padding: 10px 28px; + cursor: pointer; + box-shadow: 3px 3px 0 #ff00cc; + transition: background 0.2s; +} + +input[type="submit"]:hover { + background: #00ffff; + color: #ff00cc; +} +select { + width: 92%; + padding: 8px; + margin-bottom: 18px; + border: 2px inset #008000; + background: #ffcc00; + color: #000080; + font-size: 1em; + font-family: 'Comic Sans MS', 'Arial', sans-serif; + box-shadow: 2px 2px 0 #ff00cc; + border-radius: 4px; + outline: none; +} + +option { + background: #ffcc00; + color: #000080; + font-family: 'Comic Sans MS', 'Arial', sans-serif; +} \ No newline at end of file diff --git a/src/main/resources/static/styles/images/logo.png b/src/main/resources/static/styles/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..a16f4fa6ce8a9120eadfe0018441c89c109499b6 GIT binary patch literal 2313 zcmbtUdr%X19uJKQ2B96RT#LYLtq^3`BpV1OAqfNn65fz_$aCCm76=L1WwS90Dl$Mv zD%2LwdW9m+XvGJW3f3M>wM7JxDsZQW6nV8^VcMRG9)%Mhw+S4g(?2?Qf9&J?{e8Zl z@9+D3KQ3mA6U&vwU@)AN;fe(M8*F_XR?zR$y4+#x%&)w|U@W_; zQ*R@;MMsGdEQbSYF%8P0a&Q{WU`T=}97gmg324wvol(lZ|Mje#*$ECnji-yVSvgp7)@eI%C_-}>3^%5%cenuHbb1C2wQ;A zl9ZiAlDL@5wOA}1iysFgGP#gQB;xY;Ts|M95uhp0NWv6oG`&kRumBr}0yQCo4kvY( z5wLQ?8q7>e*=!cDKrJUpLZ?||H<~!GO=Gs2aOj}9u-3$dI6UjM06;R27t6IKt2pmO zh349XdC8!&dBS1BgsSs!RLV|3O_-TLP#c5QXn|xifx;xJmGOCe0musgA)bW$%8}K_ z3xiOKRBB~BKh&Sc3*du7(Iye-FG7T%a1+W01t{cCtAwy%lW>t}-sEMPFb&Nj;0yQx z0ukg7Z4wEDFFe~0U&gC3Gm>QuMaEy`eW9~qC0uKE4Z8WH*o1|wELzN`Y#z9zEPuRI zT4b?IxS256T0o0%Q3INT8cA!BpoJo75izMF4d{y!$qnSoC8B#zY=DiKQZ@x@(G1vZ zAlWiOOdQ}1@r3{dSl>9c5dZ<`cVb(hlW>=K`adGWm-M%_18rkw?LGQ{4$E&LELsxF z&14ov$Rc7@p+MADr3wg8&NR6WEyCg z*w)1up~f(SY%^@!0R!F%s8Nd&D6tXHVu(~B--0C}QQ4Fk0n8?pkZzTS#YDzys+>%RhqQ#Z+LTO+xO1Qkj9h^8y?h|el*r~?=IiP)Kq@;y8XZb z;o+N8&h@SLbN1i*aLjzfGFlNnsBB^suZb*rck+$;{uP6J154H(bLU*S_jCWb&N-*< z=_t4HAv=f}u>BZ*tI@3`<3gay{I;=`Bk9*Xe+xSNX0OLx2~(rQQ;O}lt7|5@`iIrY z)%GQln?Cv}Y??YB)mVq5rq%msg8h6b=eY;4<5QR|GdA33`<2gyoOF)&wRdZ~*pwE| zX}F$t>5$iJ!+P8Z)$4D3n^rs6nP+L47OtBZl~ntxReO5de|0%s_i^PniKX0QZ?1Ci zd{p~(WQ}ykcjKod%-<59yFw*W%KK*erRM0zvUfhe^-EP-m&;{}#YJP=R`qA)yPvfm z3DxW+yi$i1e;3|stqgJEt&A?Syn&s=tD^&4`&GevxgtT}qM{(VeJcj-8Ld5e&P1+A}i2 zp(=6z{tv(rv47H~+pC(+ojCE!cj&bPrB$&7uI_2cSnx2PYK>dc^j(F5w6w1Dolm)w z_aw89Bn>v~7e)jIwii-m~p@z6m9y&KZfeyYpF^l8%Q&1aH V14|Bf(<9GdC_`fu^f{sW!$a)$r_ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/styles/images/logo.svg b/src/main/resources/static/styles/images/logo.svg new file mode 100644 index 0000000..9823bf9 --- /dev/null +++ b/src/main/resources/static/styles/images/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main/resources/static/styles/lists.css b/src/main/resources/static/styles/lists.css new file mode 100644 index 0000000..acb6be4 --- /dev/null +++ b/src/main/resources/static/styles/lists.css @@ -0,0 +1,58 @@ +/* Nav bar container */ +#nav-bar { + background: #f5f5c6; + border: 3px solid #000080; + box-shadow: 4px 4px 0 #ff00cc; + padding: 10px 0; + margin-bottom: 24px; +} + +/* Nav list inline */ +.nav-bar-list { + list-style: none; + padding: 0; + margin: 0; + display: flex; + justify-content: center; + align-items: center; + gap: 18px; +} + +/* Nav list items */ +.nav-bar-list-item { + display: inline-block; + background: #ffcc00; + border: 2px outset #008000; + padding: 8px 18px; + margin: 0 4px ; + margin-right: 10px; + + font-family: 'Comic Sans MS', 'Arial', sans-serif; + font-size: 1.05em; + color: #000080; + box-shadow: 2px 2px 0 #00ffff; + transition: background 0.2s, color 0.2s; +} + +.nav-bar-list-item a { + color: #000080; + text-decoration: none; + font-weight: bold; + +} + +.nav-bar-list-item:hover, .nav-bar-list-item:focus { + background: #00ffff; + color: #ff00cc; + cursor: pointer; +} + +.nav-bar-list-item:hover a, .nav-bar-list-item:focus a { + color: #ff00cc; +} +.nav-bar-logo { + margin-right: auto; + margin-left: 20px; + border-radius: 50%; + box-shadow: none; +} \ No newline at end of file diff --git a/src/main/resources/static/styles/reportagem.css b/src/main/resources/static/styles/reportagem.css new file mode 100644 index 0000000..50684d5 --- /dev/null +++ b/src/main/resources/static/styles/reportagem.css @@ -0,0 +1,80 @@ +.news-list { + width: 90%; + margin: 32px auto; + display: flex; + flex-direction: column; + gap: 28px; +} + +.news-card { + background: #f7e6b2; + border-radius: 12px; + box-shadow: 0 2px 12px #c7a3c7; + padding: 18px 24px; + display: flex; + flex-direction: column; + gap: 10px; + text-align: center; + +} + +.news-title { + font-size: 1.25em; + font-weight: 700; + ; + color: black; + background: #b2e6e6; + border-radius: 8px 8px 0 0; + padding: 8px 12px; + text-shadow: 1px 1px 0 #fff, 2px 2px 0 #c7a3c7; +} + +.news-content { + color: #2d3250; + font-size: 1em; + margin-bottom: 6px; + text-align: justify; + display: flex; + align-items: center; + min-height: 80px; + max-width: 70%; /* text block is 70% of container */ + margin-left: auto; /* center the text block */ + margin-right: auto; +} + +.news-meta { + font-size: 0.95em; + color: #4b568f; + + text-align: justify; + gap: 12px; + margin-bottom: 8px; +} + +.news-actions { + display: flex; + gap: 16px; + justify-content: center; +} + +.btn-edit, .btn-delete { + text-decoration: none; + padding: 6px 14px; + border-radius: 6px; + font-weight: 600; + color: #fff; + background: #4b568f; + transition: background 0.2s; +} + +.btn-delete { + background: #c77dbb; +} + +.btn-edit:hover { + background: #6b8f6b; +} + +.btn-delete:hover { + background: #a05d99; +} \ No newline at end of file diff --git a/src/main/resources/static/styles/table.css b/src/main/resources/static/styles/table.css new file mode 100644 index 0000000..11e898d --- /dev/null +++ b/src/main/resources/static/styles/table.css @@ -0,0 +1,54 @@ +table { + width: 90%; + margin: 32px auto; + border-collapse: separate; + + background: transparent; + font-family: 'Arial', 'Verdana', sans-serif; + font-size: 1.15em; + letter-spacing: 0.02em; +} + +th, td { + + padding: 18px 28px; + font-size: 1em; + color: #2d3250; + background: #f7e6b2; + text-align: left; + font-family: 'Arial', 'Verdana', sans-serif; + font-weight: 500; +} + + +th { + background: #b2e6e6; + color: #a05d99; + text-shadow: 1px 1px 0 #fff, 2px 2px 0 #c7a3c7; + font-weight: 700; + font-size: 1.08em; + border-radius: 12px 12px 0 0; + border-bottom: 2px solid #c7a3c7; +} + +tbody tr { + box-shadow: 0 2px 12px #c7a3c7; + border-radius: 0 0 12px 12px; + overflow: hidden; + background: #f7e6b2; +} + +tr:nth-child(even) td { + background: #f9f9f9; +} + +tr:hover td { + background: #b2e6e6; + color: #a05d99; + cursor: pointer; + transition: background 0.2s, color 0.2s; +} + +td { + border-radius: 0 0 12px 12px; +} \ No newline at end of file diff --git a/src/main/resources/templates/assunto.html b/src/main/resources/templates/assunto.html index 3b3a3f6..6066421 100644 --- a/src/main/resources/templates/assunto.html +++ b/src/main/resources/templates/assunto.html @@ -2,46 +2,61 @@ - Title + + + + + + Cadastrar Assunto - + -
- -
-
- -
+
+ +
+
+ +
- - \ No newline at end of file + + \ No newline at end of file diff --git a/src/main/resources/templates/assuntos.html b/src/main/resources/templates/assuntos.html index c2a62b4..8026d78 100644 --- a/src/main/resources/templates/assuntos.html +++ b/src/main/resources/templates/assuntos.html @@ -2,6 +2,11 @@ + + + + + Assuntos @@ -9,22 +14,14 @@ @@ -33,6 +30,7 @@ ID Título + Ações diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 457df11..a879dc6 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -2,7 +2,12 @@ - Title + + + + + + Página Inicial @@ -10,34 +15,74 @@ -
- + + +
+
+ +

+ Cinco News Press é uma organização global de notícias independente dedicada à reportagem factual. Fundada em 1846, a 5NP continua sendo hoje a fonte mais confiável de notícias rápidas, precisas e imparciais em todos os formatos e o fornecedor essencial de tecnologia e serviços vitais para o setor de notícias. Mais da metade da população mundial vê o jornalismo da 5NP todos os dias.

+
+
+ + + \ No newline at end of file diff --git a/src/main/resources/templates/jornalistas.html b/src/main/resources/templates/jornalistas.html index 6502091..404d7b0 100644 --- a/src/main/resources/templates/jornalistas.html +++ b/src/main/resources/templates/jornalistas.html @@ -2,6 +2,11 @@ + + + + + Jornalistas @@ -9,21 +14,14 @@