Skip to content

Commit

Permalink
Change archive modal window
Browse files Browse the repository at this point in the history
- Change button text
- Add seporators for dates
- Disable focus on input after open modal
  • Loading branch information
endenwer committed Mar 29, 2016
1 parent 5079489 commit 7d0f750
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/views/telegram_messages/_archive_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<% if User.current.allowed_to?(:view_telegram_chat_archive, @issue.project) and @issue.telegram_messages.present? %>
<%= form_tag publish_issue_telegram_messages_path, class: 'archive-form' do %>
<% messages_by_date.each do |date, messages| %>
<div class="message-date"><%= date %></div>
<fieldset class="message-date">
<legend><%= date %></legend>
</fieldset>
<% messages.each do |message| %>
<div class="telegram-message" data-sent-at=<%= message.sent_at.to_i %>>
<%= check_box_tag 'telegram_message_ids[]', message.id %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/telegram_messages/_modal_window.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<div class="archive-date-picker">
<span>Перейти к дате:</span>
<input id="datetimepicker" type="text" placeholder="Выберите дату">
<input id="datetimepicker" type="text" placeholder="выберите дату">
<hr>
</div>
<%= render partial: 'archive_form'%>
<hr>
<%= submit_tag 'Сохранить в задаче',
<%= submit_tag 'Скопировать в задачу',
onclick: "$('.archive-form').submit()",
class: 'archive-submit-button'%>
3 changes: 3 additions & 0 deletions app/views/telegram_messages/index.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ $('#ajax-modal').dialog({
},
resizable: false,
title: 'Архив',
open: function(){
$("#datetimepicker").blur()
},
close: function(){
$('#datetimepicker').datetimepicker('destroy')
}
Expand Down
3 changes: 3 additions & 0 deletions assets/stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@
}

.message-date{
border:0px;
border-top:1px solid gray;
text-align: center;
margin: 10px 0;
}

0 comments on commit 7d0f750

Please sign in to comment.