Commits

salvator  committed 1d0c73a

#10 fixed changelist actions

  • Participants
  • Parent commits 27875d1
  • Branches default

Comments (0)

Files changed (3)

File admintools_bootstrap/static/admintools_bootstrap/lib/style.less

 }
 
 
+.changelist-actions {
+	.changelist-action {
+		margin-top: 0.5em;
+		margin-bottom: 0.8em;
+		label, select, button {
+			margin-right: 0.5em;
+		}
 
-.changelist-action {
-	margin-top: 0.5em;
-	margin-bottom: 0.8em;
-
-	label, select, button {
-		margin-right: 0.5em;
+		label {
+			display: inline;
+			width: auto;
+		}
+		.action-wrapper {
+			float: left;
+		}
+		button {
+			height: 28px;
+			margin-left: 5px;
+			min-width: 80px;
+			* {
+				float: left;	
+			}
+			float: right;
+		}
 	}
 
-	label {
-		display: inline;
-		width: auto;
+	.ui-toolbar {
+		height: 28px;
 	}
-
-	button {
-		margin-left: 5px;
-		min-width: 70px;
-		* {
-			float: left;	
-		}
+	/* clearing bootstrap .actions class */
+	margin: 0;
+	padding: 0;
+	background: none;
+	border: none;
+	span.clear, span.question, .selection-info {
+		display: none;
+	}
+	.ui-icon {
+		float: left;
+		margin-right: 5px;
 	}
 }
 

File admintools_bootstrap/templates/admin/actions.html

 {% load i18n %}
 {% spaceless %}
-<div class="changelist-action">
-    {% for field in action_form %}
-      {% if field.label %}
-        <label>{{ field.label }}</label>
+<div class="actions changelist-actions">
+  <div class="changelist-action ui-toolbar ui-widget-header ui-corner-all">
+    <div class="action-wrapper">
+      {% for field in action_form %}
+        {% if field.label %}
+          <label>{{ field.label }}</label>
+        {% endif %}
+        {{ field }}
+      {% endfor %}
+      <button type="submit" class="ui-button ui-corner-all" title="{% trans "Run the selected action" %}" name="index" value="{{ action_index|default:0 }}">
+        <span class="ui-icon ui-icon-play"></span>
+        {% trans "Go" %}
+      </button>
+    </div>
+      {% if actions_selection_counter %}
+          {% if cl.result_count != cl.result_list|length %}
+            <span class="question">
+                <a href="javascript:;" class="btn" title="{% trans "Click here to select the objects across all pages" %}">
+                  <span class="ui-icon ui-icon-carat-2-n-s"></span>
+                {% blocktrans with cl.result_count as total_count %}Select all {{ total_count }} {{ module_name }}{% endblocktrans %}</a>
+            </span>
+            <span class="clear">
+              <a href="javascript:;" class="clear-selection btn">
+                  <span class="ui-icon ui-icon-close"></span>
+              {% trans "Clear selection" %}</a>
+            </span>
+          {% endif %}
       {% endif %}
-      {{ field }}
-    {% endfor %}
-    <button type="submit" class="btn" title="{% trans "Run the selected action" %}" name="index" value="{{ action_index|default:0 }}">
-      <span class="ui-icon ui-icon-play"></span>
-      {% trans "Go" %}
-    </button>
-    {% if actions_selection_counter %}
-        <script type="text/javascript">var _actions_icnt="{{ cl.result_list|length|default:"0" }}";</script>
-        <span class="action-counter">{{ selection_note }}</span>
-        {% if cl.result_count != cl.result_list|length %}
-        <span class="all">{{ selection_note_all }}</span>
-        <span class="question">
-            <a href="javascript:;" title="{% trans "Click here to select the objects across all pages" %}">{% blocktrans with cl.result_count as total_count %}Select all {{ total_count }} {{ module_name }}{% endblocktrans %}</a>
-        </span>
-        <span class="clear"><a href="javascript:;">{% trans "Clear selection" %}</a></span>
-        {% endif %}
-    {% endif %}
+  </div>
+  {% if actions_selection_counter %}
+  <div class="ui-widget selection-info">
+      <div class="ui-state-highlight ui-corner-all">
+        <p>
+          <span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
+          <span class="all">{{ selection_note_all }}</span>
+          <script type="text/javascript">var _actions_icnt="{{ cl.result_list|length|default:"0" }}";</script>
+          <span class="action-counter">{{ selection_note }}</span>
+        </p>
+      </div>
+  </div>
+{% endif %}
 </div>
 {% endspaceless %}

File admintools_bootstrap/templates/admin/change_list.html

 <script type="text/javascript">
 (function($) {
     $(document).ready(function($) {
-        $("tr input.action-select").actions();
+        $("tr input.action-select").actions({
+          actionContainer: 'div.actions',
+          counterContainer: '.selection_info, .selection-info span.action-counter',
+          allContainer: '.selection-info, .selection-info span.all',
+          acrossQuestions: 'span.question',
+          acrossClears: 'span.clear',
+          acrossInput: "div.changelist-actions input.select-across"
+        });
     });
 })(django.jQuery);
+
+$(function(){
+  $('.bts').buttonset();
+});
 </script>
 {% endif %}{% endif %}
+
 {% endblock %}
 
 {% block bodyclass %}change-list{% endblock %}