Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

CIRCLE / cloud

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 94
  • Merge Requests 10
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Merged
Merge request !102 opened Jun 18, 2014 by Kálmán Viktor@kviktor 
  • Report abuse
Report abuse

Issue Vm Ops

VM operations with form were kinda after an unsuccessful try. Without Javascript they still redirect to a page that seems to miss context data, but if javascript is enabled they work nice.

  • Discussion 6
  • Commits 10
  • Changes
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Őry Máté
    @orymate started a discussion on the diff Jun 25, 2014
    Last updated by Kálmán Viktor Jun 25, 2014
    circle/dashboard/static/dashboard/vm-common.js
    30 30 });
    31 31 return false;
    32 32 });
    33
    34 /* if the operation fails show the modal again */
    35 $("body").on("click", "#op-form-send", function() {
    • Őry Máté @orymate commented Jun 25, 2014
      Owner

      does this work if user submits with return key in a field? what's wrong with form onsubmit?

      does this work if user submits with return key in a field? what's wrong with form onsubmit?
    • Kálmán Viktor @kviktor commented Jun 25, 2014
      Owner

      Yup!

      Yup!
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on the diff Jun 25, 2014
    circle/dashboard/static/dashboard/vm-common.js
    33
    34 /* if the operation fails show the modal again */
    35 $("body").on("click", "#op-form-send", function() {
    36 var url = $(this).closest("form").prop("action");
    37 $.ajax({
    38 url: url,
    39 headers: {"X-CSRFToken": getCookie('csrftoken')},
    40 type: 'POST',
    41 data: $(this).closest('form').serialize(),
    42 success: function(data, textStatus, xhr) {
    43 $('#confirmation-modal').modal("hide");
    44
    45 if(data.redirect) {
    46 $('a[href="#activity"]').trigger("click");
    47 }
    48 else {
    • Őry Máté @orymate commented Jun 25, 2014
      Owner

      pls add a comment about what's this doing. fixed

      Edited Jun 25, 2014
      ~~pls add a comment about what's this doing.~~ fixed
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on an old version of the diff Jun 25, 2014
    Last updated by Kálmán Viktor Jun 25, 2014
    circle/dashboard/templates/dashboard/operate.html
    19 19 <div class="pull-right">
    20 20 <a class="btn btn-default" href="{{object.get_absolute_url}}"
    21 21 data-dismiss="modal">{% trans "Cancel" %}</a>
    22 <button class="btn btn-danger" type="submit">{% if op.icon %}<i class="icon-{{op.icon}}"></i> {% endif %}{{ op|capfirst }}</button>
    22 <button class="btn btn-danger" type="submit"
    23 {% if form %}id="op-form-send"{% endif %}
    • Őry Máté @orymate commented Jun 25, 2014
      Owner

      is this condition really needed?

      is this condition really needed?
    • Kálmán Viktor @kviktor commented Jun 25, 2014
      Owner

      Nop, removed.

      Nop, removed.
    Please register or sign in to reply
  • Őry Máté @orymate commented Jun 26, 2014
    Owner

    +1

    +1
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment
Assignee
No assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View labels
2
2 participants
Reference: circle/cloud!102