Add settings screen for global diff preferences

The account preferences are available under the Settings menu, but not
the diff preferences. The diff preferences are only accessible from
the diff screen by clicking on the gear icon. It's confusing to users
that they cannot find all preferences under the Settings menu. This is
why it makes sense to make the diff preferences available in the
Settings menu too.

There are a few diff settings which are only applicable when looking
at a concrete file diff and which are not stored on server side
(show/hide left side, language). These settings are not available when
the diff preferences are accessed from the Settings menu.

The diff preferences in the Settings menu are rendered with the same
style as the diff preferences in the popup. This makes it easy for
users to see that these are actually the same settings, just accessed
through different paths.

Change-Id: I35f45a4784592b9ce2fe35d86fd6974acc14f5c6
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2015-10-07 14:40:10 +02:00
parent bd567a0d3b
commit 7b6af4ff35
8 changed files with 237 additions and 118 deletions

View File

@@ -155,15 +155,17 @@ limitations under the License.
</ui:style>
<g:HTMLPanel styleName='{style.box}'>
<table style='width: 100%'>
<tr>
<td><ui:msg>Diff Preferences</ui:msg></td>
<td style='text-align: right'>
<g:Anchor ui:field='close' href='javascript:;'><ui:msg>Close</ui:msg></g:Anchor>
</td>
</tr>
</table>
<hr/>
<div ui:field='header'>
<table style='width: 100%'>
<tr>
<td><ui:msg>Diff Preferences</ui:msg></td>
<td style='text-align: right'>
<g:Anchor ui:field='close' href='javascript:;'><ui:msg>Close</ui:msg></g:Anchor>
</td>
</tr>
</table>
<hr/>
</div>
<table class='{style.table}'>
<tr>
<th><ui:msg>Theme</ui:msg></th>
@@ -208,7 +210,7 @@ limitations under the License.
</g:ToggleButton></td>
</tr>
<tr>
<th><ui:msg>Language</ui:msg></th>
<th><div ui:field='modeLabel'><ui:msg>Language</ui:msg></div></th>
<td><g:ListBox ui:field='mode'/></td>
</tr>
<tr>
@@ -240,7 +242,7 @@ limitations under the License.
</g:ToggleButton></td>
</tr>
<tr>
<th><ui:msg>Left Side</ui:msg></th>
<th><div ui:field='leftSideLabel'><ui:msg>Left Side</ui:msg></div></th>
<td><g:ToggleButton ui:field='leftSide'>
<g:upFace><ui:msg>Hide</ui:msg></g:upFace>
<g:downFace><ui:msg>Show</ui:msg></g:downFace>