Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
WIP: update options panel css
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Eng committed Aug 12, 2014
1 parent 548d744 commit c5f9075
Show file tree
Hide file tree
Showing 16 changed files with 88 additions and 108 deletions.
Expand Up @@ -294,7 +294,7 @@ String undoUnsuccessful(@PluralCount int unsuccessfulCount,
@DefaultMessage("Show project-wide search view")
String showProjectWideSearch();

@DefaultMessage("Warning! This is a public channel")
@DefaultMessage("This is a public channel")
String thisIsAPublicChannel();

@DefaultMessage("Only show documents that contain the search text with matching case")
Expand Down
Expand Up @@ -38,6 +38,9 @@
import org.zanata.webtrans.shared.model.DocumentInfo;
import org.zanata.webtrans.shared.model.TransUnit;
import org.zanata.webtrans.shared.model.TransUnitId;
import org.zanata.webtrans.shared.model.TransUnitUpdateRequest;
import org.zanata.webtrans.shared.rpc.TransUnitUpdated;
import org.zanata.webtrans.shared.rpc.UpdateTransUnit;
import org.zanata.webtrans.shared.rpc.UpdateTransUnitResult;
import com.allen_sauer.gwt.log.client.Log;
import com.google.common.base.Objects;
Expand Down Expand Up @@ -109,28 +112,25 @@ public void onTransUnitSave(TransUnitSaveEvent event) {
}

private void performSave(TransUnitId idToSave) {
targetContentsPresenter.showSaveAsApprovedConfirmation(idToSave);


// TransUnitSaveEvent forSaving = queue.getNextPendingForSaving(idToSave);
// if (forSaving == null) {
// Log.info("no pending save for " + idToSave);
// return;
// }
//
// targetContentsPresenter.setEditingState(idToSave,
// TargetContentsDisplay.EditingState.SAVING);
//
// UpdateTransUnit updateTransUnit =
// new UpdateTransUnit(new TransUnitUpdateRequest(idToSave,
// forSaving.getTargets(), forSaving.getAdjustedStatus(),
// forSaving.getVerNum()),
// TransUnitUpdated.UpdateType.WebEditorSave);
// Log.info("about to save translation: " + updateTransUnit);
// dispatcher.execute(
// updateTransUnit,
// new UpdateTransUnitCallback(forSaving, documentListPresenter
// .getCurrentDocument(), idToSave));
TransUnitSaveEvent forSaving = queue.getNextPendingForSaving(idToSave);
if (forSaving == null) {
Log.info("no pending save for " + idToSave);
return;
}

targetContentsPresenter.setEditingState(idToSave,
TargetContentsDisplay.EditingState.SAVING);

UpdateTransUnit updateTransUnit =
new UpdateTransUnit(new TransUnitUpdateRequest(idToSave,
forSaving.getTargets(), forSaving.getAdjustedStatus(),
forSaving.getVerNum()),
TransUnitUpdated.UpdateType.WebEditorSave);
Log.info("about to save translation: " + updateTransUnit);
dispatcher.execute(
updateTransUnit,
new UpdateTransUnitCallback(forSaving, documentListPresenter
.getCurrentDocument(), idToSave));
}

/**
Expand Down
Expand Up @@ -3,8 +3,6 @@
xmlns:g="urn:import:com.google.gwt.user.client.ui">
<ui:style>
.unitStatus {
float: left;
width: 100px;
height: 1.2em;
}

Expand Down Expand Up @@ -33,14 +31,11 @@
}

.label {
font-weight: bold;
font-size: 13px;
text-align: left;
z-index: 0;
}

</ui:style>
<g:LayoutPanel ui:field='layoutPanel' styleName="{style.unitStatus}">
<g:LayoutPanel ui:field='layoutPanel' styleName="{style.unitStatus} new-zanata">
<g:layer left='0' width='0'>
<g:FlowPanel ui:field='approvedPanel' styleName="{style.approved}" />
</g:layer>
Expand All @@ -58,7 +53,7 @@
<g:FlowPanel ui:field='undefinedPanel' styleName="{style.undefined}" />
</g:layer>
<g:layer left='102px' width="120px">
<g:Label ui:field='label' styleName='{style.label}' />
<g:Label ui:field='label' styleName='{style.label} txt--align-left txt--understated' />
</g:layer>
</g:LayoutPanel>
</ui:UiBinder>
Expand Up @@ -29,7 +29,6 @@
.translationStats {
width: 230px;
height: 1.2em;
color: #595959;
cursor: pointer;
display: inline-block;
}
Expand Down
Expand Up @@ -85,12 +85,12 @@ public void onTwoHundredFiftyDocClicked(ClickEvent event) {
}

private void onPageSizeChanged(Anchor selectedWidget) {
twentyFiveDoc.addStyleName("txt--invert");
fiftyDoc.addStyleName("txt--invert");
hundredDoc.addStyleName("txt--invert");
twoHundredFiftyDoc.addStyleName("txt--invert");
twentyFiveDoc.removeStyleName("txt--important");
fiftyDoc.removeStyleName("txt--important");
hundredDoc.removeStyleName("txt--important");
twoHundredFiftyDoc.removeStyleName("txt--important");

selectedWidget.removeStyleName("txt--invert");
selectedWidget.addStyleName("txt--important");
}

@Override
Expand Down
Expand Up @@ -12,15 +12,13 @@

<g:HTMLPanel tag="ul" styleName="list--no-bullets">
<li>
<h5 class="txt--invert txt--align-center">
<ui:text from="{messages.pageSize}" />
</h5>
<h5><ui:text from="{messages.pageSize}"/></h5>
</li>
<li>
<g:Anchor ui:field="twentyFiveDoc" styleName="txt--lead txt--invert">25</g:Anchor>
<g:Anchor ui:field="fiftyDoc" styleName="txt--lead txt--invert">50</g:Anchor>
<g:Anchor ui:field="hundredDoc" styleName="txt--lead txt--invert">100</g:Anchor>
<g:Anchor ui:field="twoHundredFiftyDoc" styleName="txt--lead txt--invert">250
<g:Anchor ui:field="twentyFiveDoc" styleName="txt--lead">25</g:Anchor>
<g:Anchor ui:field="fiftyDoc" styleName="txt--lead">50</g:Anchor>
<g:Anchor ui:field="hundredDoc" styleName="txt--lead">100</g:Anchor>
<g:Anchor ui:field="twoHundredFiftyDoc" styleName="txt--lead">250
</g:Anchor>
</li>
</g:HTMLPanel>
Expand Down
Expand Up @@ -46,7 +46,7 @@
</g:HTMLPanel>
<g:HTMLPanel tag="li" styleName="{style.right-nav}">
<ul class="list--horizontal">
<li>
<li class="txt--understated">
<ui:msg>Stats by:</ui:msg>
</li>
<li>
Expand Down
Expand Up @@ -128,11 +128,11 @@ public void onPageSizeFiftyClicked(ClickEvent event) {
}

private void selectPage(Anchor selectedPage) {
five.addStyleName("txt--invert");
ten.addStyleName("txt--invert");
twentyFive.addStyleName("txt--invert");
fifty.addStyleName("txt--invert");
selectedPage.removeStyleName("txt--invert");
five.removeStyleName("txt--important");
ten.removeStyleName("txt--important");
twentyFive.removeStyleName("txt--important");
fifty.removeStyleName("txt--important");
selectedPage.addStyleName("txt--important");
}

@UiHandler("editorButtonsChk")
Expand Down
Expand Up @@ -15,7 +15,7 @@

<g:HTMLPanel tag="ul" styleName="list--no-bullets">
<li>
<h5 class="txt--invert txt--align-center">
<h5>
<ui:text from="{messages.editorOptions}" />
</h5>
</li>
Expand All @@ -35,21 +35,20 @@
</g:CheckBox>
</li>
<li>
<g:CheckBox ui:field="showSaveApprovedWarningChk"
styleName="txt--invert">
<g:CheckBox ui:field="showSaveApprovedWarningChk">
<ui:text from="{messages.showSaveApproveWarning}" />
</g:CheckBox>
</li>

<li class="l--push-v-half">
<h5 class="txt--invert txt--align-center">
<h5>
<ui:text from="{messages.navOption}" />
</h5>
<g:VerticalPanel ui:field="optionsContainer"
styleName="{style.nav-options}" />
</li>
<li class="l--push-v-half">
<h5 class="txt--invert txt--align-center">
<h5>
<ui:text from="{messages.transMemoryOption}" />
</h5>
</li>
Expand All @@ -62,21 +61,21 @@
</li>

<li class="l--push-v-half">
<h5 class="txt--invert txt--align-center">
<h5>
<ui:text from="{messages.pageSize}" />
</h5>
</li>
<li>
<g:Anchor ui:field="five" styleName="txt--lead txt--invert">5</g:Anchor>
<g:Anchor ui:field="ten" styleName="txt--lead txt--invert">10</g:Anchor>
<g:Anchor ui:field="twentyFive" styleName="txt--lead txt--invert">25</g:Anchor>
<g:Anchor ui:field="fifty" styleName="txt--lead txt--invert">50</g:Anchor>
<g:Anchor ui:field="five" styleName="txt--lead">5</g:Anchor>
<g:Anchor ui:field="ten" styleName="txt--lead">10</g:Anchor>
<g:Anchor ui:field="twentyFive" styleName="txt--lead">25
</g:Anchor>
<g:Anchor ui:field="fifty" styleName="txt--lead">50</g:Anchor>
</li>

<li class="l--push-v-half">
<h5 class="txt--invert txt--align-center"
title="{messages.displayConfigurationTooltip}">
<ui:text from="{messages.displayConfiguration}" />
<h5 title="{messages.displayConfigurationTooltip}">
<ui:text from="{messages.displayConfiguration}"/>
</h5>
</li>
<li>
Expand All @@ -88,9 +87,9 @@
<li>
<g:CheckBox ui:field="showOptionalTransUnitDetailsChk" />
</li>
<li>
<g:HTMLPanel ui:field="sourceLangListBoxContainer" />
</li>
<li>
<g:HTMLPanel ui:field="sourceLangListBoxContainer" />
</li>
</g:HTMLPanel>

</ui:UiBinder>
Expand Up @@ -200,7 +200,7 @@ public void onClick(ClickEvent event) {
"txt--align-center smallCol");

Anchor infoCell = new Anchor();
infoCell.setStyleName("icon-info-circle-2 txt--lead");
infoCell.setStyleName("i i--info txt--lead");
infoCell.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Expand Down
Expand Up @@ -8,7 +8,6 @@

<ui:style field="style">
.container label {
color: #f0f2f4 !important;
font-weight: initial;
}

Expand All @@ -24,17 +23,15 @@
styleName="list--no-bullets l--push-all-quarter l--scroll-auto {style.container}">
<g:HTMLPanel tag="li" ui:field="optionsContainer" />
<li>
<h5 class="txt--invert txt--align-center">
<ui:text from="{messages.otherConfiguration}" />
</h5>
<h5><ui:text from="{messages.otherConfiguration}"/></h5>
</li>
<li>
<ul class="list--horizontal">
<li>
<span>Layout</span>
</li>
<li>
<g:ListBox ui:field="themesList" styleName="txt--highlight"/>
<g:ListBox ui:field="themesList"/>
</li>
</ul>
</li>
Expand Down
Expand Up @@ -13,6 +13,7 @@
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.InlineLabel;
import com.google.gwt.user.client.ui.TabLayoutPanel;
import com.google.gwt.user.client.ui.UIObject;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;

Expand All @@ -24,13 +25,6 @@ public class SideMenuView extends Composite implements SideMenuDisplay {
interface SideMenuViewUiBinder extends UiBinder<Widget, SideMenuView> {
}

interface Styles extends CssResource {
String selectedButton();
}

@UiField
Styles style;

@UiField
Anchor notificationTab, optionsTab, validationOptionsTab, chatTab;

Expand Down Expand Up @@ -86,34 +80,44 @@ public void onChatClick(ClickEvent event) {

@Override
public void setSelectedTab(int view) {
optionsTab.removeStyleName(style.selectedButton());
validationOptionsTab.removeStyleName(style.selectedButton());
chatTab.removeStyleName(style.selectedButton());
notificationTab.removeStyleName(style.selectedButton());
setDefaultTabStyle(optionsTab);
setDefaultTabStyle(validationOptionsTab);
setDefaultTabStyle(chatTab);
setDefaultTabStyle(notificationTab);

switch (view) {
case OPTION_VIEW:
container.selectTab(OPTION_VIEW);
optionsTab.addStyleName(style.selectedButton());
setSelectTabStyle(optionsTab);
break;
case VALIDATION_OPTION_VIEW:
container.selectTab(VALIDATION_OPTION_VIEW);
validationOptionsTab.addStyleName(style.selectedButton());
setSelectTabStyle(validationOptionsTab);
break;
case WORKSPACEUSER_VIEW:
container.selectTab(WORKSPACEUSER_VIEW);
chatTab.addStyleName(style.selectedButton());
setSelectTabStyle(chatTab);
setChatTabAlert(false);
break;
case NOTIFICATION_VIEW:
container.selectTab(NOTIFICATION_VIEW);
notificationTab.addStyleName(style.selectedButton());
setSelectTabStyle(notificationTab);
break;
default:
break;
}
}

private void setDefaultTabStyle(UIObject tab) {
tab.removeStyleName("bg--low");
tab.addStyleName("bg--lowest");
}

private void setSelectTabStyle(UIObject tab) {
tab.addStyleName("bg--low");
tab.removeStyleName("bg--lowest");
}

@Override
public void setChatTabAlert(boolean alert) {
if (alert) {
Expand Down

0 comments on commit c5f9075

Please sign in to comment.