incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [4/5] git commit: [#5749] ticket:486 Add css class to radio buttons and bind js to it
Date Mon, 16 Dec 2013 17:46:28 GMT
[#5749] ticket:486 Add css class to radio buttons and bind js to it


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/2f4e88e6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/2f4e88e6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/2f4e88e6

Branch: refs/heads/master
Commit: 2f4e88e607f81bf2045cf6f3552cc18fc78f64c8
Parents: ea65121
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Thu Dec 5 14:45:28 2013 +0200
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Mon Dec 16 17:28:01 2013 +0000

----------------------------------------------------------------------
 .../forgetracker/templates/tracker/admin_fields.html     |  8 ++++----
 .../forgetracker/templates/tracker/milestones.html       | 11 ++++++-----
 ForgeTracker/forgetracker/widgets/admin_custom_fields.py |  6 +-----
 3 files changed, 11 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2f4e88e6/ForgeTracker/forgetracker/templates/tracker/admin_fields.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker/admin_fields.html b/ForgeTracker/forgetracker/templates/tracker/admin_fields.html
index ead5778..899c8ee 100644
--- a/ForgeTracker/forgetracker/templates/tracker/admin_fields.html
+++ b/ForgeTracker/forgetracker/templates/tracker/admin_fields.html
@@ -62,11 +62,11 @@
 {% block extra_js %}
 <script type="text/javascript">
     $(document).ready(function () {
-        $("input[value='on'][type='radio']").attr("checked", true);
-        $(":radio").click(function(){
-            $(":radio").attr("checked", false);
+        $(":radio.default-milestone[value='on']").attr("checked", true);
+        $(":radio.default-milestone").click(function(){
+            $(":radio.default-milestone").attr("checked", false);
             $(this).attr("checked", true);
         });
     });
 </script>
-{% endblock %}
\ No newline at end of file
+{% endblock %}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2f4e88e6/ForgeTracker/forgetracker/templates/tracker/milestones.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker/milestones.html b/ForgeTracker/forgetracker/templates/tracker/milestones.html
index d28228d..37bd20f 100644
--- a/ForgeTracker/forgetracker/templates/tracker/milestones.html
+++ b/ForgeTracker/forgetracker/templates/tracker/milestones.html
@@ -42,7 +42,7 @@
     <tbody>
       {% for m in milestones %}
       <tr class="{{loop.index0%2 and 'even' or ''}}">
-        <td><input type="radio" name="milestones-{{loop.index0}}.default" disabled="disabled"
{%if m.default %} checked {%endif%}>
+        <td><input type="radio" name="milestones-{{loop.index0}}.default" class="default-milestone"
disabled="disabled" {%if m.default %} checked {%endif%}>
         <td class="view">
           <input type="hidden" name="milestones-{{loop.index0}}.old_name" value="{{m.name}}">
           <strong><a href="{{c.app.url}}milestone/{{h.urlquote(m.name)}}/">{{m.name}}</a></strong></td>
@@ -122,6 +122,7 @@
         $save_controls.show();
         $add_button.hide();
         $new_row.show();
+        $(':radio.default-milestone').prop('disabled', false);
         return false;
       });
       $('a.edit_milestone').click(function(){
@@ -130,12 +131,12 @@
         $('td.edit', $row).show();
         $save_controls.show();
         $add_button.hide();
-        $(':radio').prop('disabled', false);
+        $(':radio.default-milestone').prop('disabled', false);
         $(this).css({opacity: 0.5});
         return false;
       });
-      $(':radio').click(function(){
-          $('input:radio').attr("checked", false);
+      $(':radio.default-milestone').click(function(){
+          $(':radio.default-milestone').attr("checked", false);
           $(this).attr("checked", true);
       });
       $('a.cancel_edit').click(function(){
@@ -144,7 +145,7 @@
         $save_controls.hide();
         $add_button.show();
         $new_row.hide();
-        $(':radio').prop('disabled', true);
+        $(':radio.default-milestone').prop('disabled', true);
         $('input', $new_row).val('');
         $('a.edit_milestone').css({opacity: 1});
         return false;

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2f4e88e6/ForgeTracker/forgetracker/widgets/admin_custom_fields.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/widgets/admin_custom_fields.py b/ForgeTracker/forgetracker/widgets/admin_custom_fields.py
index 505bde8..52af881 100644
--- a/ForgeTracker/forgetracker/widgets/admin_custom_fields.py
+++ b/ForgeTracker/forgetracker/widgets/admin_custom_fields.py
@@ -36,11 +36,7 @@ class MilestonesAdmin(ffw.SortableTable):
         repetitions=0)
     fields = [
         ew.HiddenField(name='old_name'),
-
-        ffw.Radio(
-            name='default',
-            label='Default'),
-
+        ffw.Radio(name='default', label='Default', css_class='default-milestone'),
         ew.Checkbox(name='complete', show_label=True, suppress_label=True),
         ew.TextField(name='name',
         attrs={'style':'width: 80px'}),


Mime
View raw message