Changeset - 11422edf4bea
[Not reviewed]
default
0 3 0
Mads Kiilerich - 11 years ago 2015-02-18 23:48:47
madski@unity3d.com
repos: fix redirect after repo creation (and user/group add focus) (Issue #98)

ec39e73be935 introduced a regression in the cases where templates contained
(javascript) snippets outside defined areas. Before, they were included anyway.
After, they were not.

Fixing by moving the chunks I could find inside the main def.
3 files changed with 4 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/templates/admin/repos/repo_creating.html
Show inline comments
 
@@ -22,48 +22,48 @@
 
<%def name="main()">
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
    </div>
 

	
 
    <div style="display:table; padding: 10px 0px; font-size: 14px;font-weight: bold;margin-right: auto;margin-left: auto">
 
        ${_('Repository "%(repo_name)s" is being created, you will be redirected when this process is finished.' % {'repo_name':c.repo_name})}
 
    </div>
 

	
 
    <div id="progress" style="width: 500px;margin-left: auto; margin-right: auto">
 
        <div class="progress progress-striped active">
 
          <div class="progress-bar progress-bar" role="progressbar"
 
               aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%">
 
          </div>
 
        </div>
 
    </div>
 
    <div id="progress_error" style="display: none;">
 
        <div style="font-weight: bold; color:#aa1111">
 
        ${_("We're sorry but error occurred during this operation. Please check your Kallithea server logs, or contact administrator.")}
 
        </div>
 
    </div>
 
</div>
 
</%def>
 

	
 
<script>
 
(function worker() {
 
  $.ajax({
 
    url: '${h.url('repo_check_home', repo_name=c.repo_name, repo=c.repo, task_id=c.task_id)}',
 
    success: function(data) {
 
      if(data.result === true){
 
          //redirect to created fork if our ajax loop tells us to do so.
 
          window.location = "${h.url('summary_home', repo_name = c.repo)}";
 
      }
 
    },
 
    complete: function(resp, status) {
 
      if (resp.status == 200){
 
          // Schedule the next request when the current one's complete
 
          setTimeout(worker, 1000);
 
      }
 
      else{
 
          $("#progress").html($('#progress_error').html())
 
      }
 
    }
 
  });
 
})();
 
</script>
 
</%def>
kallithea/templates/admin/user_groups/user_group_add.html
Show inline comments
 
@@ -42,31 +42,31 @@
 
                <div class="label label-textarea">
 
                    <label for="user_group_description">${_('Description')}:</label>
 
                </div>
 
                <div class="textarea text-area editor">
 
                    ${h.textarea('user_group_description')}
 
                    <span class="help-block">${_('Short, optional description for this user group.')}</span>
 
                </div>
 
             </div>
 
             <div class="field">
 
                <div class="label label-checkbox">
 
                    <label for="users_group_active">${_('Active')}:</label>
 
                </div>
 
                <div class="checkboxes">
 
                    ${h.checkbox('users_group_active',value=True, checked='checked')}
 
                </div>
 
             </div>
 

	
 
            <div class="buttons">
 
              ${h.submit('save',_('Save'),class_="btn")}
 
            </div>
 
        </div>
 
    </div>
 
    ${h.end_form()}
 
</div>
 
</%def>
 

	
 
<script>
 
    $(document).ready(function(){
 
        $('#users_group_name').focus();
 
    })
 
</script>
 
</%def>
kallithea/templates/admin/users/user_add.html
Show inline comments
 
@@ -81,30 +81,31 @@
 
                </div>
 
                <div class="input">
 
                    ${h.text('email',class_='small')}
 
                    ${h.hidden('extern_name', c.default_extern_type)}
 
                    ${h.hidden('extern_type', c.default_extern_type)}
 
                </div>
 
             </div>
 

	
 
             <div class="field">
 
                <div class="label label-checkbox">
 
                    <label for="active">${_('Active')}:</label>
 
                </div>
 
                <div class="checkboxes">
 
                    ${h.checkbox('active',value=True,checked='checked')}
 
                </div>
 
             </div>
 

	
 
            <div class="buttons">
 
              ${h.submit('save',_('Save'),class_="btn")}
 
            </div>
 
        </div>
 
    </div>
 
    ${h.end_form()}
 
</div>
 
</%def>
 

	
 
<script>
 
    $(document).ready(function(){
 
        $('#username').focus();
 
    })
 
</script>
 
</%def>
0 comments (0 inline, 0 general)