Add verified state summary to top of safety number screen
FREEBIE
This commit is contained in:
		
					parent
					
						
							
								d462108e83
							
						
					
				
			
			
				commit
				
					
						31bf05e14a
					
				
			
		
					 7 changed files with 99 additions and 6 deletions
				
			
		| 
						 | 
					@ -87,7 +87,7 @@
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "sendAnyway": {
 | 
					    "sendAnyway": {
 | 
				
			||||||
      "message": "Send Anyway",
 | 
					      "message": "Send Anyway",
 | 
				
			||||||
      "description": "Used on a warning dialog to specifiy "
 | 
					      "description": "Used on a warning dialog to make it clear that it might be risky to send the message."
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "noLongerVerified": {
 | 
					    "noLongerVerified": {
 | 
				
			||||||
      "message": "$name$ is no longer verified. Click to show.",
 | 
					      "message": "$name$ is no longer verified. Click to show.",
 | 
				
			||||||
| 
						 | 
					@ -136,6 +136,26 @@
 | 
				
			||||||
    "verify": {
 | 
					    "verify": {
 | 
				
			||||||
      "message": "Verify"
 | 
					      "message": "Verify"
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    "isVerified": {
 | 
				
			||||||
 | 
					      "message": "$name$ is verified.",
 | 
				
			||||||
 | 
					      "description": "Summary state shown at top of the safety number screen if user has verified contact.",
 | 
				
			||||||
 | 
					      "placeholders": {
 | 
				
			||||||
 | 
					        "name": {
 | 
				
			||||||
 | 
					          "content": "$1",
 | 
				
			||||||
 | 
					          "example": "Bob"
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    "isNotVerified": {
 | 
				
			||||||
 | 
					      "message": "$name$ is not verified.",
 | 
				
			||||||
 | 
					      "description": "Summary state shown at top of the safety number screen if user has not verified contact.",
 | 
				
			||||||
 | 
					      "placeholders": {
 | 
				
			||||||
 | 
					        "name": {
 | 
				
			||||||
 | 
					          "content": "$1",
 | 
				
			||||||
 | 
					          "example": "Bob"
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
    "verified": {
 | 
					    "verified": {
 | 
				
			||||||
      "message": "Verified"
 | 
					      "message": "Verified"
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -335,6 +335,15 @@
 | 
				
			||||||
  </script>
 | 
					  </script>
 | 
				
			||||||
  <script type='text/x-tmpl-mustache' id='key-verification'>
 | 
					  <script type='text/x-tmpl-mustache' id='key-verification'>
 | 
				
			||||||
    <div class='container'>
 | 
					    <div class='container'>
 | 
				
			||||||
 | 
					      <div class='summary'>
 | 
				
			||||||
 | 
					        {{ #isVerified }}
 | 
				
			||||||
 | 
					          <span class='icon verified'></span>
 | 
				
			||||||
 | 
					        {{ /isVerified }}
 | 
				
			||||||
 | 
					        {{ ^isVerified }}
 | 
				
			||||||
 | 
					          <span class='icon shield'></span>
 | 
				
			||||||
 | 
					        {{ /isVerified }}
 | 
				
			||||||
 | 
					        {{ verifiedStatus }}
 | 
				
			||||||
 | 
					      </div>
 | 
				
			||||||
      {{ ^has_their_key }}
 | 
					      {{ ^has_their_key }}
 | 
				
			||||||
        <div class='placeholder'>{{ their_key_unknown }}</div>
 | 
					        <div class='placeholder'>{{ their_key_unknown }}</div>
 | 
				
			||||||
      {{ /has_their_key }}
 | 
					      {{ /has_their_key }}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -72,10 +72,11 @@
 | 
				
			||||||
            for (var i = 0; i < s.length; i += 5) {
 | 
					            for (var i = 0; i < s.length; i += 5) {
 | 
				
			||||||
                chunks.push(s.substring(i, i+5));
 | 
					                chunks.push(s.substring(i, i+5));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            var yourSafetyNumberWith = i18n(
 | 
					            var name = this.model.getTitle();
 | 
				
			||||||
                'yourSafetyNumberWith', this.model.getTitle()
 | 
					            var yourSafetyNumberWith = i18n('yourSafetyNumberWith', name);
 | 
				
			||||||
            );
 | 
					            var isVerified = this.model.isVerified();
 | 
				
			||||||
            var verifyButton = this.model.isVerified() ? i18n('markAsNotVerified') : i18n('verify');
 | 
					            var verifyButton = isVerified ? i18n('markAsNotVerified') : i18n('verify');
 | 
				
			||||||
 | 
					            var verifiedStatus = isVerified ? i18n('isVerified', name) : i18n('isNotVerified', name);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return {
 | 
					            return {
 | 
				
			||||||
                learnMore            : i18n('learnMore'),
 | 
					                learnMore            : i18n('learnMore'),
 | 
				
			||||||
| 
						 | 
					@ -85,6 +86,8 @@
 | 
				
			||||||
                verifyButton         : verifyButton,
 | 
					                verifyButton         : verifyButton,
 | 
				
			||||||
                has_their_key        : this.their_key !== undefined,
 | 
					                has_their_key        : this.their_key !== undefined,
 | 
				
			||||||
                chunks               : chunks,
 | 
					                chunks               : chunks,
 | 
				
			||||||
 | 
					                isVerified           : isVerified,
 | 
				
			||||||
 | 
					                verifiedStatus       : verifiedStatus
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -83,6 +83,25 @@
 | 
				
			||||||
    font-size: $font-size-small;
 | 
					    font-size: $font-size-small;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .summary {
 | 
				
			||||||
 | 
					    margin: 10px 0;
 | 
				
			||||||
 | 
					    text-align: center;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .icon {
 | 
				
			||||||
 | 
					    height: 1.25em;
 | 
				
			||||||
 | 
					    width: 1.25em;
 | 
				
			||||||
 | 
					    vertical-align: text-bottom;
 | 
				
			||||||
 | 
					    display: inline-block;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    &.verified {
 | 
				
			||||||
 | 
					      @include color-svg('/images/verified-check.svg', $grey_d);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    &.shield {
 | 
				
			||||||
 | 
					      @include color-svg('/images/shield.svg', $grey_d);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .key, .placeholder {
 | 
					  .key, .placeholder {
 | 
				
			||||||
    padding: 0 1em;
 | 
					    padding: 0 1em;
 | 
				
			||||||
    -webkit-user-select: text;
 | 
					    -webkit-user-select: text;
 | 
				
			||||||
| 
						 | 
					@ -124,6 +143,8 @@
 | 
				
			||||||
    font-weight: bold;
 | 
					    font-weight: bold;
 | 
				
			||||||
    padding: 10px;
 | 
					    padding: 10px;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.message-detail {
 | 
					.message-detail {
 | 
				
			||||||
| 
						 | 
					@ -253,7 +274,6 @@ li.entry .error-icon-container {
 | 
				
			||||||
  height: $error-icon-size;
 | 
					  height: $error-icon-size;
 | 
				
			||||||
  position: relative;
 | 
					  position: relative;
 | 
				
			||||||
  @include color-svg('/images/warning.svg', red);
 | 
					  @include color-svg('/images/warning.svg', red);
 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.group {
 | 
					.group {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -45,6 +45,14 @@ $text-dark_l2: darken($text-dark, 30%);
 | 
				
			||||||
    background-color: $grey-dark_l4;
 | 
					    background-color: $grey-dark_l4;
 | 
				
			||||||
    border-color: $grey-dark_l2;
 | 
					    border-color: $grey-dark_l2;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					  .key-verification .icon {
 | 
				
			||||||
 | 
					    &.verified {
 | 
				
			||||||
 | 
					      @include color-svg('/images/verified-check.svg', $text-dark);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    &.shield {
 | 
				
			||||||
 | 
					      @include color-svg('/images/shield.svg', $text-dark);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
  .menu-list {
 | 
					  .menu-list {
 | 
				
			||||||
    background-color: $grey-dark_l2;
 | 
					    background-color: $grey-dark_l2;
 | 
				
			||||||
    color: $text-dark;
 | 
					    color: $text-dark;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1084,6 +1084,22 @@ input.search {
 | 
				
			||||||
  display: block;
 | 
					  display: block;
 | 
				
			||||||
  margin: 10px 0;
 | 
					  margin: 10px 0;
 | 
				
			||||||
  font-size: 0.92857em; }
 | 
					  font-size: 0.92857em; }
 | 
				
			||||||
 | 
					.key-verification .summary {
 | 
				
			||||||
 | 
					  margin: 10px 0;
 | 
				
			||||||
 | 
					  text-align: center; }
 | 
				
			||||||
 | 
					.key-verification .icon {
 | 
				
			||||||
 | 
					  height: 1.25em;
 | 
				
			||||||
 | 
					  width: 1.25em;
 | 
				
			||||||
 | 
					  vertical-align: text-bottom;
 | 
				
			||||||
 | 
					  display: inline-block; }
 | 
				
			||||||
 | 
					  .key-verification .icon.verified {
 | 
				
			||||||
 | 
					    -webkit-mask: url("/images/verified-check.svg") no-repeat center;
 | 
				
			||||||
 | 
					    -webkit-mask-size: 100%;
 | 
				
			||||||
 | 
					    background-color: #454545; }
 | 
				
			||||||
 | 
					  .key-verification .icon.shield {
 | 
				
			||||||
 | 
					    -webkit-mask: url("/images/shield.svg") no-repeat center;
 | 
				
			||||||
 | 
					    -webkit-mask-size: 100%;
 | 
				
			||||||
 | 
					    background-color: #454545; }
 | 
				
			||||||
.key-verification .key, .key-verification .placeholder {
 | 
					.key-verification .key, .key-verification .placeholder {
 | 
				
			||||||
  padding: 0 1em;
 | 
					  padding: 0 1em;
 | 
				
			||||||
  -webkit-user-select: text; }
 | 
					  -webkit-user-select: text; }
 | 
				
			||||||
| 
						 | 
					@ -2003,6 +2019,14 @@ li.entry .error-icon-container {
 | 
				
			||||||
  .android-dark .key-verification .key {
 | 
					  .android-dark .key-verification .key {
 | 
				
			||||||
    background-color: #030303;
 | 
					    background-color: #030303;
 | 
				
			||||||
    border-color: #292929; }
 | 
					    border-color: #292929; }
 | 
				
			||||||
 | 
					  .android-dark .key-verification .icon.verified {
 | 
				
			||||||
 | 
					    -webkit-mask: url("/images/verified-check.svg") no-repeat center;
 | 
				
			||||||
 | 
					    -webkit-mask-size: 100%;
 | 
				
			||||||
 | 
					    background-color: #CCCCCC; }
 | 
				
			||||||
 | 
					  .android-dark .key-verification .icon.shield {
 | 
				
			||||||
 | 
					    -webkit-mask: url("/images/shield.svg") no-repeat center;
 | 
				
			||||||
 | 
					    -webkit-mask-size: 100%;
 | 
				
			||||||
 | 
					    background-color: #CCCCCC; }
 | 
				
			||||||
  .android-dark .menu-list {
 | 
					  .android-dark .menu-list {
 | 
				
			||||||
    background-color: #292929;
 | 
					    background-color: #292929;
 | 
				
			||||||
    color: #CCCCCC; }
 | 
					    color: #CCCCCC; }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -321,6 +321,15 @@
 | 
				
			||||||
  </script>
 | 
					  </script>
 | 
				
			||||||
  <script type='text/x-tmpl-mustache' id='key-verification'>
 | 
					  <script type='text/x-tmpl-mustache' id='key-verification'>
 | 
				
			||||||
    <div class='container'>
 | 
					    <div class='container'>
 | 
				
			||||||
 | 
					      <div class='summary'>
 | 
				
			||||||
 | 
					        {{ #isVerified }}
 | 
				
			||||||
 | 
					          <span class='icon verified'></span>
 | 
				
			||||||
 | 
					        {{ /isVerified }}
 | 
				
			||||||
 | 
					        {{ ^isVerified }}
 | 
				
			||||||
 | 
					          <span class='icon shield'></span>
 | 
				
			||||||
 | 
					        {{ /isVerified }}
 | 
				
			||||||
 | 
					        {{ verifiedStatus }}
 | 
				
			||||||
 | 
					      </div>
 | 
				
			||||||
      {{ ^has_their_key }}
 | 
					      {{ ^has_their_key }}
 | 
				
			||||||
        <div class='placeholder'>{{ their_key_unknown }}</div>
 | 
					        <div class='placeholder'>{{ their_key_unknown }}</div>
 | 
				
			||||||
      {{ /has_their_key }}
 | 
					      {{ /has_their_key }}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue