You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by deathbearbrown <gi...@git.apache.org> on 2014/04/01 19:53:01 UTC

[GitHub] couchdb pull request: COUCHDB-2206: Changes redesign

Github user deathbearbrown commented on a diff in the pull request:

    https://github.com/apache/couchdb/pull/202#discussion_r11172077
  
    --- Diff: src/fauxton/app/addons/documents/templates/changes.html ---
    @@ -12,27 +12,57 @@
     the License.
     -->
     
    -<table id="changes-table" class="table">
    -  <thead>
    -    <th id="seq"> seq </th>
    -    <th> id </th>
    -    <th id="changes"> changes </th>
    -    <th id="deleted"> deleted? </th>
    -  </thead>
    -  <tbody>
    -  <% _.each(changes, function (change) { %>
    -    <tr>
    -      <td> <%= change.seq %> </td>
    -      <% if (change.deleted) { %>
    -        <td> <%= change.id %> </td>
    -      <% } else { %>
    -        <td> <a href="#<%= database.url('app') %>/<%= change.id %>"><%= change.id %></a> </td>
    -      <% } %>
    -        <td> 
    -          <pre class="prettyprint">  <%- JSON.stringify({changes: change.changes, doc: change.doc}, null, " ") %> </pre>
    -      </td>
    -      <td><%= change.deleted ? "true" : "false" %></td>
    -    </tr>
    -  <% }); %>
    -  </tbody>
    -</table>
    +<% _.each(changes, function (change) { %>
    +  <div class="change-wrapper">
    +    <div class="change-box">
    +      <div class="row-fluid">
    +        <div class="span2">
    +          seq
    +        </div>
    +        <div class="span8">
    +          <%= change.seq %>
    +        </div>
    +        <div class="span2">
    +          <a class="js-copy" data-clipboard-text="<%= change.seq %>" data-bypass="true" href="#">
    +            <i class="icon-share"></i>
    +          </a>
    +        </div>
    +      </div>
    +      <div class="row-fluid">
    +        <div class="span2">
    +          id
    +        </div>
    +        <div class="span8">
    +          <% if (change.deleted) { %>
    +            <%= change.id %>
    +          <% } else { %>
    +            <a href="#<%= database.url('app') %>/<%= change.id %>"><%= change.id %></a>
    --- End diff --
    
    Hi!  the change.id needs to be urlencoded like this:
    #/database/demovolcano/_design%2Fimpress-ca
    
    People can name docs like this "slash///slashy/slashy/slash" and sometimes they do. 
    
    If you rebase master in, I added a helper.js function  (we put template functions in helper.js)  so you can do 
    safeURL(change.id)  and it'll check to see if the id needs to be encoded. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---