Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task/48 #52

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/views/issues/_action_menu.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<div class="contextual">
<%= link_to l(:button_add_notes), edit_issue_path(@issue),
:onclick => 'showAndScrollToAddNotes(); return false;',
:class => 'icon icon-add' if @issue.editable? %>
<%= link_to l(:button_edit), edit_issue_path(@issue),
:onclick => 'showAndScrollTo("update", "issue_notes"); return false;',
:onclick => 'showAndScrollToEditIssue("update", "issue_notes"); return false;',
:class => 'icon icon-edit', :accesskey => accesskey(:edit) if @issue.editable? %>
<%= link_to l(:button_log_time), new_issue_time_entry_path(@issue),
:class => 'icon icon-time-add' if User.current.allowed_to?(:log_time, @project) %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/issues/_action_menu_edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<div style="clear: both;"></div>
<% if @issue.editable? %>
<div id="update" style="display:none;">
<div id="update" class="hidden">
<h3><%= l(:button_edit) %></h3>
<%= render :partial => 'edit' %>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/views/issues/_edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%= render :partial => 'conflict' if @conflict %>
<div class="box">
<% if @issue.attributes_editable? %>
<fieldset class="tabular"><legend><%= l(:label_change_properties) %></legend>
<fieldset id="attributes" class="tabular"><legend><%= l(:label_change_properties) %></legend>
<div id="all_attributes">
<%= render :partial => 'form', :locals => {:f => f} %>
</div>
Expand Down Expand Up @@ -75,7 +75,7 @@
<%= submit_tag l(:button_submit) %>
<%= link_to(
l(:button_cancel), issue_path(id: @issue.id),
:onclick => params[:action] == 'show' ? "$('#update').hide(); return false;" : ''
:onclick => params[:action] == 'show' ? "window.location.reload();" : ''
) %>
<%= hidden_field_tag 'prev_issue_id', @prev_issue_id if @prev_issue_id %>
<%= hidden_field_tag 'next_issue_id', @next_issue_id if @next_issue_id %>
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,7 @@ en:
button_edit: Edit
button_edit_associated_wikipage: "Edit associated Wiki page: %{page_title}"
button_add: Add
button_add_notes: Add notes
button_change: Change
button_apply: Apply
button_clear: Clear
Expand Down
14 changes: 14 additions & 0 deletions public/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,20 @@ function showAndScrollTo(id, focus) {
$('html, body').animate({scrollTop: $('#'+id).offset().top}, 100);
}

function showAndScrollToEditIssue() {
$('#update h3').show();
$('#attributes').show(); $('#attributes input, #attributes select').prop('disabled', false)
$('#log_time').show(); $('#log_time input, #log_time select').prop('disabled', false)
showAndScrollTo('update', 'issue_notes');
}

function showAndScrollToAddNotes() {
$('#update h3').hide();
$('#attributes').hide();$('#attributes input, #attributes select').prop('disabled', true)
$('#log_time').hide();$('#log_time input, #log_time select').prop('disabled', true)
showAndScrollTo('update', 'issue_notes');
}

function toggleRowGroup(el) {
var tr = $(el).parents('tr').first();
var n = tr.next();
Expand Down
2 changes: 1 addition & 1 deletion public/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ div.modal p.buttons {margin-bottom:0;}
div.modal .box p {margin: 0.3em 0;}

.clear:after{ content: "."; display: block; height: 0; clear: both; visibility: hidden; }

.hidden {display: none;}
.mobile-show {display: none;}
.hidden {display: none;}
.inline-flex {display: inline-flex;}
Expand Down