Skip to content

Commit

Permalink
missing styling and messages
Browse files Browse the repository at this point in the history
  • Loading branch information
SugaryLump committed Nov 27, 2024
1 parent b2c0e01 commit 0f331bd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.databasepreservation.common.client.common.dialogs.DatabaseSelectDialog;
import com.databasepreservation.common.client.index.filter.Filter;
import com.databasepreservation.common.client.tools.FontAwesomeIconManager;
import com.google.gwt.event.logical.shared.HasValueChangeHandlers;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
Expand All @@ -16,15 +17,17 @@
* @author Alexandre Flores <[email protected]>
*/
public class SearchAllButtonWrapper extends SimplePanel implements HasValueChangeHandlers<Long> {
private ClientMessages messages;
public Long totalSelectedDatabases;

private Button button;
private DatabaseSelectDialog databaseSelectDialog;

public void init(Filter defaultFilter, String allFilter, ClientMessages messages,
SearchPanelWithSearchAll parentSearchPanel) {
this.messages = messages;
this.button = new Button();
this.button.addStyleName("btn-link-info btn");
this.button.addStyleName("btn-link-info btn btn-searchall-dialog");
this.databaseSelectDialog = new DatabaseSelectDialog(defaultFilter, allFilter, messages, parentSearchPanel);
this.button.addClickHandler(event -> {
this.databaseSelectDialog.center();
Expand All @@ -44,7 +47,9 @@ public HandlerRegistration addValueChangeHandler(ValueChangeHandler<Long> handle

public void setTotalSelectedDatabases(Long totalSelectedDatabases) {
this.totalSelectedDatabases = totalSelectedDatabases;
this.button.setHTML(SafeHtmlUtils.fromSafeConstant("Searching on " + this.totalSelectedDatabases + " databases"));
this.button
.setHTML(SafeHtmlUtils.fromSafeConstant(messages.manageDatabaseSearchAllSearchingOn(this.totalSelectedDatabases)
+ FontAwesomeIconManager.getTag("edit")));
ValueChangeEvent.fire(this, totalSelectedDatabases);
}

Expand Down
10 changes: 10 additions & 0 deletions src/main/resources/com/databasepreservation/common/public/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -1416,6 +1416,16 @@ html, body {
text-decoration: none;
}

.btn-searchall-dialog {
display: flex;
gap: 10px;
align-items: center;
}

.btn-searchall-dialog i {
font-size: 20px
}

.label-field {
display: inline-block;
text-align: left;
Expand Down

0 comments on commit 0f331bd

Please sign in to comment.