"Fossies" - the Fresh Open Source Software Archive

Member "redmine-4.1.1/app/views/timelog/bulk_edit.html.erb" (6 Apr 2020, 4344 Bytes) of package /linux/www/redmine-4.1.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) ERB Templates source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "bulk_edit.html.erb": 4.1.0_vs_4.1.1.

    1 <h2><%= l(:label_bulk_edit_selected_time_entries) %></h2>
    2 
    3 <% if @unsaved_time_entries.present? %>
    4 <div id="errorExplanation">
    5   <span>
    6     <%= l(:notice_failed_to_save_time_entries,
    7         :count => @unsaved_time_entries.size,
    8         :total => @saved_time_entries.size,
    9         :ids => @unsaved_time_entries.map {|i| "##{i.id}"}.join(', ')) %>
   10   </span>
   11   <ul>
   12   <% bulk_edit_error_messages(@unsaved_time_entries).each do |message| %>
   13     <li><%= message %></li>
   14   <% end %>
   15   </ul>
   16 </div>
   17 <% end %>
   18 
   19 <ul id="bulk-selection">
   20 <% @time_entries.each do |entry| %>
   21   <%=
   22     content_tag 'li',
   23       link_to(
   24         "#{format_date(entry.spent_on)} - #{entry.project}: #{l(:label_f_hour_plural, :value => entry.hours)} (#{entry.user})",
   25         edit_time_entry_path(entry)
   26       )
   27   %>
   28 <% end %>
   29 </ul>
   30 
   31 <%= form_tag(bulk_update_time_entries_path, :id => 'bulk_edit_form') do %>
   32 <%= @time_entries.collect {|i| hidden_field_tag('ids[]', i.id, :id => nil)}.join.html_safe %>
   33 <div class="box tabular">
   34   <div>
   35     <p>
   36       <label><%= l(:field_project) %></label>
   37       <%= select_tag('time_entry[project_id]', project_tree_options_for_select(@target_projects,
   38         :include_blank => l(:label_no_change_option), :selected => @target_project),
   39         :onchange => "updateBulkEditFrom('#{escape_javascript url_for(:action => 'bulk_edit', :format => 'js')}')" ) %>
   40     </p>
   41     <p>
   42       <label for="time_entry_issue_id"><%= l(:field_issue) %></label>
   43       <%= text_field :time_entry, :issue_id, :size => 6 %>
   44       <label class="inline"><%= check_box_tag 'time_entry[issue_id]', 'none', (@time_entry_params[:issue_id] == 'none'), :id => nil, :data => {:disables => '#time_entry_issue_id'} %><%= l(:button_clear) %></label>
   45       <span id="time_entry_issue"></span>
   46     </p>
   47 
   48     <p>
   49       <label for="time_entry_spent_on"><%= l(:field_spent_on) %></label>
   50       <%= date_field :time_entry, :spent_on, :size => 10, :value => @time_entry_params[:spent_on] %><%= calendar_for('time_entry_spent_on') %>
   51     </p>
   52 
   53     <p>
   54       <label for="time_entry_hours"><%= l(:field_hours) %></label>
   55       <%= text_field :time_entry, :hours, :size => 6, :value => @time_entry_params[:hours] %>
   56     </p>
   57 
   58     <% if @available_activities.any? %>
   59     <p>
   60       <label for="time_entry_activity_id"><%= l(:field_activity) %></label>
   61       <%= select_tag('time_entry[activity_id]', content_tag('option', l(:label_no_change_option), :value => '') + options_from_collection_for_select(@available_activities, :id, :name, @time_entry_params[:activity_id])) %>
   62     </p>
   63     <% end %>
   64 
   65     <p>
   66       <label for="time_entry_comments"><%= l(:field_comments) %></label>
   67       <%= text_field(:time_entry, :comments, :size => 100, :value => @time_entry_params[:comments]) %>
   68     </p>
   69 
   70     <% @custom_fields.each do |custom_field| %>
   71       <p><label><%= h(custom_field.name) %></label> <%= custom_field_tag_for_bulk_edit('time_entry', custom_field, @time_entries, @time_entry_params[:custom_field_values][custom_field.id.to_s]) %></p>
   72     <% end %>
   73 
   74     <%= call_hook(:view_time_entries_bulk_edit_details_bottom, { :time_entries => @time_entries }) %>
   75   </div>
   76 </div>
   77 
   78 <p><%= submit_tag l(:button_submit) %></p>
   79 <% end %>
   80 
   81 <%= javascript_tag do %>
   82   $(document).ready(function(){
   83     $('#time_entry_project_id').change(function(){
   84       <!-- $('#time_entry_issue_id').val(''); -->
   85       $('#time_entry_issue').text('');
   86     });
   87   });
   88 
   89   <% if @project || @target_project %>
   90     observeAutocompleteField('time_entry_issue_id',
   91       function(request, callback) {
   92         var url = '<%= j auto_complete_issues_path %>';
   93         var data = {
   94           term: request.term
   95         };
   96         var project_id;
   97         <% if @project %>
   98           project_id = '<%= @project.id %>';
   99         <% end %>
  100 
  101         current_project_id = $('#time_entry_project_id').val();
  102         if(current_project_id === ''){
  103           data['project_id'] = project_id;
  104         } else {
  105           data['project_id'] = current_project_id;
  106         }
  107 
  108         $.get(url, data, null, 'json')
  109           .done(function(data){
  110             callback(data);
  111           })
  112           .fail(function(jqXHR, status, error){
  113             callback([]);
  114           });
  115       },
  116       {
  117         select: function(event, ui, data) {
  118           $('#time_entry_issue').text(ui.item.label);
  119         }
  120       }
  121     );
  122   <% end %>
  123 <% end %>