Changeset - 574825da0d4e
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 13 years ago 2013-04-30 02:06:56
marcin@python-works.com
added compare option into bookmarks
2 files changed with 21 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rhodecode/templates/bookmarks/bookmarks.html
Show inline comments
 
@@ -22,13 +22,27 @@ ${self.context_bar('switch-to')}
 
        ${self.breadcrumbs()}
 
    </div>
 
    <!-- end box / title -->
 
    %if c.repo_bookmarks:
 
    <div class="info_box" id="compare_bookmarks" style="clear: both;padding: 10px 19px;text-align: right;"><a href="#" class="ui-btn small">${_('Compare bookmarks')}</a></div>
 
    %endif
 
    <div class="table">
 
        <%include file='bookmarks_data.html'/>
 
    </div>
 
</div>
 

	
 
<script type="text/javascript">
 
YUE.on('compare_bookmarks','click',function(e){
 
    YUE.preventDefault(e);
 
    var org = YUQ('input[name=compare_org]:checked')[0];
 
    var other = YUQ('input[name=compare_other]:checked')[0];
 

	
 
    if(org && other){
 
        var compare_url = "${h.url('compare_url',repo_name=c.repo_name,org_ref_type='book',org_ref='__ORG__',other_ref_type='book',other_ref='__OTHER__')}";
 
        var u = compare_url.replace('__ORG__',org.value)
 
                           .replace('__OTHER__',other.value);
 
        window.location=u;
 
    }
 
});
 
// main table sorting
 
var myColumnDefs = [
 
    {key:"name",label:"${_('Name')}",sortable:true},
 
@@ -37,6 +51,7 @@ var myColumnDefs = [
 
    {key:"author",label:"${_('Author')}",sortable:true},
 
    {key:"revision",label:"${_('Revision')}",sortable:true,
 
        sortOptions: { sortFunction: revisionSort }},
 
    {key:"compare",label:"${_('Compare')}",sortable:false,},
 
];
 

	
 
var myDataSource = new YAHOO.util.DataSource(YUD.get("bookmarks_data"));
 
@@ -49,6 +64,7 @@ myDataSource.responseSchema = {
 
        {key:"date"},
 
        {key:"author"},
 
        {key:"revision"},
 
        {key:"compare"},
 
    ]
 
};
 

	
rhodecode/templates/bookmarks/bookmarks_data.html
Show inline comments
 
@@ -7,6 +7,7 @@
 
            <th class="left">${_('Date')}</th>
 
            <th class="left">${_('Author')}</th>
 
            <th class="left">${_('Revision')}</th>
 
            <th class="left">${_('Compare')}</th>
 
        </tr>
 
    </thead>
 
    %for cnt,book in enumerate(c.repo_bookmarks.items()):
 
@@ -24,6 +25,10 @@
 
                  <pre><a href="${h.url('files_home',repo_name=c.repo_name,revision=book[1].raw_id)}">r${book[1].revision}:${h.short_id(book[1].raw_id)}</a></pre>
 
              </div>
 
            </td>
 
            <td>
 
                <input class="branch-compare" type="radio" name="compare_org" value="${book[0]}"/>
 
                <input class="branch-compare" type="radio" name="compare_other" value="${book[0]}"/>
 
            </td>
 
        </tr>
 
    %endfor
 
    </table>
0 comments (0 inline, 0 general)