Browse Source

Merge branch 'interface' of github.com:martini/zammad into interface

Martin Edenhofer 10 years ago
parent
commit
72a25356fa

+ 3 - 0
app/assets/javascripts/app/controllers/_application_controller_form.js.coffee

@@ -172,6 +172,9 @@ class App.ControllerForm extends App.Controller
     # create item id
     attribute.id = classname + '_' + attribute.name
 
+    # set label class name
+    attribute.label_class = @model.labelClass
+
     # set autofocus
     if @autofocus && attribute_count is 1
       attribute.autofocus = 'autofocus'

+ 1 - 1
app/assets/javascripts/app/controllers/navigation.js.coffee

@@ -59,7 +59,7 @@ class App.Navigation extends App.Controller
       href = $(d).attr('href')
       active_tab[href] = true
     )
-    @el.find('.navbar-items-menu').html App.view('navigation/menu')(
+    @el.find('.main-navigation').html App.view('navigation/menu')(
       items:      items
       open_tab:   open_tab
       active_tab: active_tab

+ 28 - 2
app/assets/javascripts/app/controllers/ticket_overview.js.coffee

@@ -270,6 +270,8 @@ class Table extends App.ControllerContent
 
         # hide
         @el.find('.bulk-action').addClass('hide')
+
+        @resetBulkForm()
       else
 
         # show
@@ -282,6 +284,21 @@ class Table extends App.ControllerContent
         $(e.target).parents().find('[name="bulk_all"]').attr('checked', false)
     )
 
+    # bind bulk form buttons
+    @$('.js-confirm').click(@bulkFormConfirm)
+    @$('.js-cancel').click(@resetBulkForm)
+
+  bulkFormConfirm: =>
+    @$('.js-action-step').addClass('hide')
+    @$('.js-confirm-step').removeClass('hide')
+
+    # need a delay because of the click event
+    setTimeout ( => @$('.textarea.form-group textarea').focus() ), 0
+
+  resetBulkForm: =>
+    @$('.js-action-step').removeClass('hide')
+    @$('.js-confirm-step').addClass('hide')
+
   page: (e) =>
     e.preventDefault()
     id = $(e.target).data('id')
@@ -310,8 +327,7 @@ class Table extends App.ControllerContent
       { name: 'group_id',     display: 'Group',    tag: 'select',   multiple: false, null: true, relation: 'Group', filter: @bulk, nulloption: true, class: '', item_class: ''  },
       { name: 'owner_id',     display: 'Owner',    tag: 'select',   multiple: false, null: true, relation: 'User', filter: @bulk, nulloption: true, class: '', item_class: '' },
       { name: 'type_id',      display: 'Type',     tag: 'select',   multiple: false, null: true, relation: 'TicketArticleType', filter: articleTypeFilter, default: '9', translate: true, class: 'medium' },
-      { name: 'internal',     display: 'Visibility', tag: 'select', null: true, options: { true: 'internal', false: 'public' }, class: 'medium', item_class: '', default: false },
-      { name: 'body',         display: 'Text',     tag: 'textarea', rows: 8, null: true, upload: false },
+      { name: 'internal',     display: 'Visibility', tag: 'select', null: true, options: { true: 'internal', false: 'public' }, class: 'medium', item_class: '', default: false }
     ]
 
     # render init page
@@ -321,6 +337,16 @@ class Table extends App.ControllerContent
       model:
         configure_attributes: @configure_attributes_ticket
         className:            'create'
+        labelClass:           'input-group-addon'
+      form_data:   @bulk
+      noFieldset: true
+    )
+    new App.ControllerForm(
+      el: html.find('#form-ticket-bulk-text')
+      model:
+        configure_attributes: [{ name: 'body', display: 'Comment', tag: 'textarea', rows: 1, null: true, upload: false, item_class: 'flex' }]
+        className:            'create'
+        labelClass:           'input-group-addon'
       form_data:   @bulk
       noFieldset: true
     )

+ 1 - 1
app/assets/javascripts/app/views/agent_ticket_create.jst.eco

@@ -36,7 +36,7 @@
 
         <div class="form-actions horizontal">
           <a class="subtle-link standalone cancel" href="#/"><%- @T( 'Cancel & Go Back' ) %></a>
-          <button type="submit" class="btn btn-create submit align-right"><%- @T( 'Create' ) %></button>
+          <button type="submit" class="btn btn--create submit align-right"><%- @T( 'Create' ) %></button>
         </div>
       </form>
     </div>

+ 1 - 1
app/assets/javascripts/app/views/agent_ticket_merge.jst.eco

@@ -19,7 +19,7 @@
     </div>
     <div class="modal-footer horizontal">
       <a class="subtle-link standalone js-cancel" href="#/"><%- @T( 'Cancel & Go Back' ) %></a>
-      <button type="submit" class="btn btn-create js-submit align-right"><%- @T( 'Submit' ) %></button>
+      <button type="submit" class="btn btn--create js-submit align-right"><%- @T( 'Submit' ) %></button>
     </div>
   </div>
 </div>

+ 13 - 4
app/assets/javascripts/app/views/agent_ticket_view/bulk.jst.eco

@@ -1,9 +1,18 @@
-<form class="pull-left update-box bulk-action-form">
-  <div id="form-ticket-bulk"></div>
-  <input type="submit" class="btn primary submit" value="update">
+<form class="update-box bulk-action-form" role="form">
+  <div class="horizontal center js-action-step">
+    <div id="form-ticket-bulk" class="form-inline form-inline--enclosed flex horizontal"></div>
+    <div class="btn btn--primary js-confirm"><%- @T('Confirm') %></div>
+  </div>
+  <div class="horizontal center hide js-confirm-step">
+    <div id="form-ticket-bulk-text" class="form-inline flex horizontal"></div>
+    <div class="bulkAction-labelOffset">
+      <a class="subtle-link standalone js-cancel"><%- @T( 'Cancel' ) %></a>
+      <input type="submit" class="btn btn--primary submit" value="<%- @T('Update') %>">
+    </div>
+  </div>
 </form>
 <!--
-<form class="form-inline update-box bulk-action-form" role="form">
+<form class="form-inline update-box bulk-action-form">
   <div id="form-ticket-bulk2" class="horizontal">
     <div class="form-group">
       <label for="create_state_id" class="input-group-addon">Status</label>

+ 1 - 1
app/assets/javascripts/app/views/agent_user_create.jst.eco

@@ -10,7 +10,7 @@
     <div class="modal-body" id="form-user"></div>
     <div class="modal-footer horizontal">
       <a class="subtle-link standalone js-cancel" href="#/"><%- @T( 'Cancel & Go Back' ) %></a>
-      <button type="submit" class="btn btn-create js-submit align-right"><%- @T( 'Create' ) %></button>
+      <button type="submit" class="btn btn--create js-submit align-right"><%- @T( 'Create' ) %></button>
     </div>
   </div>
 </div>

+ 1 - 1
app/assets/javascripts/app/views/customer_not_ticket_exists.jst.eco

@@ -7,7 +7,7 @@
         <p><%- @T('The way to communicate with us is this thing called "Ticket".') %></p>
         <p><%- @T('Please click the button below to create your first one.') %></p>
 
-        <p><a class="btn btn-primary" href="#customer_ticket_new"><%- @T('Create your first Ticket') %></a></p>
+        <p><a class="btn btn--primary" href="#customer_ticket_new"><%- @T('Create your first Ticket') %></a></p>
       </div>
     </div>
   </div>

+ 1 - 1
app/assets/javascripts/app/views/customer_ticket_create.jst.eco

@@ -18,7 +18,7 @@
 
         <div class="form-actions horizontal">
           <a class="subtle-link standalone cancel" href="#/"><%- @T( 'Cancel & Go Back' ) %></a>
-          <button type="submit" class="btn btn-create submit align-right"><%- @T( 'Create' ) %></button>
+          <button type="submit" class="btn btn--create submit align-right"><%- @T( 'Create' ) %></button>
         </div>
       </form>
 

+ 2 - 2
app/assets/javascripts/app/views/generic/attribute.jst.eco

@@ -1,5 +1,5 @@
-<div class="form-group <%= @attribute.item_class %>">
-  <label for="<%= @attribute.id %>"><%- @T( @attribute.display ) %> <span><% if !@attribute.null: %>*<% end %></span></label>
+<div class="<%= @attribute.tag %> form-group<%= " #{ @attribute.item_class }" if @attribute.item_class %>">
+  <label for="<%= @attribute.id %>"<% if @attribute.label_class: %> class="<%= @attribute.label_class %>"<% end %>><%- @T( @attribute.display ) %> <span><% if !@attribute.null: %>*<% end %></span></label>
   <div class="controls">
     <%- @item %><% if @attribute.note: %><span class="glyphicon glyphicon-question-sign help-message" title="<%- @Ti( @attribute.note ) + ' ' %>"></span><% end %>
 	<% if @attribute.remove: %><span><a href="#" class="glyphicon glyphicon-minus"></a></span><% end %>

Some files were not shown because too many files changed in this diff