mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-05 11:53:53 +00:00
show even less of LeaderboardGroup stuff in embedded mode
This commit is contained in:
1 parent
004e6fb456
commit
09769677bc
2 files changed
+41
-39
No files matched your search
+28
-26
@@ -111,31 +111,29 @@ public class LeaderboardGroupPanel extends FormPanel implements HasWelcomeWidget
|
||||
}
|
||||
|
||||
private void buildGUI() {
|
||||
// Create breadcrumb panel
|
||||
BreadcrumbPanel breadcrumbPanel = createBreadcrumbPanel();
|
||||
if (breadcrumbPanel != null) {
|
||||
mainPanel.add(breadcrumbPanel);
|
||||
}
|
||||
|
||||
// Create group details GUI
|
||||
FlowPanel groupDetailsPanel = new FlowPanel();
|
||||
groupDetailsPanel.setStyleName(STYLE_NAME_PREFIX + "GroupDetailsPanel");
|
||||
mainPanel.add(groupDetailsPanel);
|
||||
|
||||
Label groupNameLabel = new Label(group.name + ":");
|
||||
groupNameLabel.setStyleName(STYLE_NAME_PREFIX + "GroupName");
|
||||
groupDetailsPanel.add(groupNameLabel);
|
||||
|
||||
// Using HTML to display the line breaks in the description
|
||||
HTML groupDescriptionLabel = new HTML(new SafeHtmlBuilder().appendEscapedLines(group.description).toSafeHtml());
|
||||
groupDescriptionLabel.setStyleName(STYLE_NAME_PREFIX + "GroupDescription");
|
||||
groupDetailsPanel.add(groupDescriptionLabel);
|
||||
|
||||
// Create group leaderboards GUI
|
||||
Label leaderboardsTableLabel = new Label(stringConstants.leaderboards());
|
||||
leaderboardsTableLabel.setStyleName(STYLE_NAME_PREFIX + "LeaderboardsTableLabel");
|
||||
mainPanel.add(leaderboardsTableLabel);
|
||||
|
||||
if (!embedded) {
|
||||
// Create breadcrumb panel
|
||||
BreadcrumbPanel breadcrumbPanel = createBreadcrumbPanel();
|
||||
if (breadcrumbPanel != null) {
|
||||
mainPanel.add(breadcrumbPanel);
|
||||
}
|
||||
// Create group details GUI
|
||||
FlowPanel groupDetailsPanel = new FlowPanel();
|
||||
groupDetailsPanel.setStyleName(STYLE_NAME_PREFIX + "GroupDetailsPanel");
|
||||
mainPanel.add(groupDetailsPanel);
|
||||
Label groupNameLabel = new Label(group.name + ":");
|
||||
groupNameLabel.setStyleName(STYLE_NAME_PREFIX + "GroupName");
|
||||
groupDetailsPanel.add(groupNameLabel);
|
||||
// Using HTML to display the line breaks in the description
|
||||
HTML groupDescriptionLabel = new HTML(new SafeHtmlBuilder().appendEscapedLines(group.description)
|
||||
.toSafeHtml());
|
||||
groupDescriptionLabel.setStyleName(STYLE_NAME_PREFIX + "GroupDescription");
|
||||
groupDetailsPanel.add(groupDescriptionLabel);
|
||||
// Create group leaderboards GUI
|
||||
Label leaderboardsTableLabel = new Label(stringConstants.leaderboards());
|
||||
leaderboardsTableLabel.setStyleName(STYLE_NAME_PREFIX + "LeaderboardsTableLabel");
|
||||
mainPanel.add(leaderboardsTableLabel);
|
||||
}
|
||||
if (group.leaderboards.size() <= MAX_COLUMNS_IN_ROW) {
|
||||
LeaderboardGroupFullTableResources tableResources = GWT.create(LeaderboardGroupFullTableResources.class);
|
||||
CellTable<Integer> leaderboardsTable = new CellTable<Integer>(200, tableResources);
|
||||
@@ -257,7 +255,11 @@ public class LeaderboardGroupPanel extends FormPanel implements HasWelcomeWidget
|
||||
if (viewMode != null && !viewMode.isEmpty()) {
|
||||
link += "&viewMode=" + viewMode;
|
||||
}
|
||||
b.append(ANCHORTEMPLATE.anchor(link, linkText, STYLE_NAME_PREFIX + "ActiveRace"));
|
||||
if (embedded) {
|
||||
b.append(ANCHORTEMPLATE.anchorWithTarget(link, linkText, STYLE_NAME_PREFIX + "ActiveRace", "_blank"));
|
||||
} else {
|
||||
b.append(ANCHORTEMPLATE.anchor(link, linkText, STYLE_NAME_PREFIX + "ActiveRace"));
|
||||
}
|
||||
} else {
|
||||
b.append(TEXTTEMPLATE.textWithClass(linkText, STYLE_NAME_PREFIX + "InactiveRace"));
|
||||
}
|
||||
|
||||
+13
-13
@@ -65,22 +65,22 @@ public class SpectatorEntryPoint extends AbstractEntryPoint implements RegattaRe
|
||||
LeaderboardGroupPanel groupPanel = new LeaderboardGroupPanel(sailingService, stringMessages, this,
|
||||
groupName, root, viewModeParamValue, embedded);
|
||||
groupPanel.getElement().getStyle().setFloat(Style.Float.LEFT);
|
||||
groupPanel.setWelcomeWidget(new SimpleWelcomeWidget( stringMessages.welcomeToSailingAnalytics(), stringMessages.welcomeToSailingAnalyticsBody()));
|
||||
SimplePanel feedbackPanel = new SimplePanel();
|
||||
feedbackPanel.getElement().getStyle().setProperty("clear", "right");
|
||||
feedbackPanel.addStyleName("feedbackPanel");
|
||||
Anchor feedbackLink = new Anchor(new SafeHtmlBuilder().appendHtmlConstant(
|
||||
"<img class=\"linkNoBorder\" src=\"/gwt/images/feedbackPanel-bg.png\"/>").toSafeHtml());//TODO set image
|
||||
feedbackLink.setHref("mailto:sailing_analytics%40sap.com?subject=[SAP Sailing] Feedback");
|
||||
feedbackLink.addStyleName("feedbackLink");
|
||||
feedbackPanel.add(feedbackLink);
|
||||
|
||||
groupAndFeedbackPanel.add(groupPanel);
|
||||
groupAndFeedbackPanel.add(feedbackPanel);
|
||||
|
||||
if (!embedded) {
|
||||
groupPanel.setWelcomeWidget(new SimpleWelcomeWidget(stringMessages.welcomeToSailingAnalytics(),
|
||||
stringMessages.welcomeToSailingAnalyticsBody()));
|
||||
SimplePanel feedbackPanel = new SimplePanel();
|
||||
feedbackPanel.getElement().getStyle().setProperty("clear", "right");
|
||||
feedbackPanel.addStyleName("feedbackPanel");
|
||||
Anchor feedbackLink = new Anchor(new SafeHtmlBuilder().appendHtmlConstant(
|
||||
"<img class=\"linkNoBorder\" src=\"/gwt/images/feedbackPanel-bg.png\"/>").toSafeHtml());// TODO set image
|
||||
feedbackLink.setHref("mailto:sailing_analytics%40sap.com?subject=[SAP Sailing] Feedback");
|
||||
feedbackLink.addStyleName("feedbackLink");
|
||||
feedbackPanel.add(feedbackLink);
|
||||
groupAndFeedbackPanel.add(feedbackPanel);
|
||||
}
|
||||
rootPanel.add(groupAndFeedbackPanel);
|
||||
}
|
||||
|
||||
fillRegattas();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user