diff options
author | Riyad Preukschas <riyad@informatik.uni-bremen.de> | 2012-12-23 04:03:57 +0400 |
---|---|---|
committer | Riyad Preukschas <riyad@informatik.uni-bremen.de> | 2012-12-23 04:03:57 +0400 |
commit | db2c15369c365340aeaf4e431e8838714b40396b (patch) | |
tree | 26ca045a337132370b67cc8f2ed4010e3087dfa5 /app/views/issues | |
parent | b47173da6a0fea0982d009f91e2c4d042f9b5c37 (diff) | |
parent | 68c43d59f09a66cca0da1b9a50c11421d52eac9a (diff) |
Merge branch 'master' into discussions
Conflicts:
app/assets/stylesheets/main.scss
app/models/project.rb
app/views/notes/_common_form.html.haml
app/views/notes/_per_line_form.html.haml
lib/gitlab/markdown.rb
spec/models/note_spec.rb
Diffstat (limited to 'app/views/issues')
-rw-r--r-- | app/views/issues/_form.html.haml | 53 | ||||
-rw-r--r-- | app/views/issues/_issues.html.haml | 2 | ||||
-rw-r--r-- | app/views/issues/_show.html.haml | 6 | ||||
-rw-r--r-- | app/views/issues/create.js.haml | 10 | ||||
-rw-r--r-- | app/views/issues/edit.js.haml | 4 | ||||
-rw-r--r-- | app/views/issues/index.html.haml | 11 | ||||
-rw-r--r-- | app/views/issues/new.js.haml | 3 | ||||
-rw-r--r-- | app/views/issues/show.html.haml | 18 | ||||
-rw-r--r-- | app/views/issues/update.js.haml | 10 |
9 files changed, 54 insertions, 63 deletions
diff --git a/app/views/issues/_form.html.haml b/app/views/issues/_form.html.haml index 670b4e059f4..030f797c088 100644 --- a/app/views/issues/_form.html.haml +++ b/app/views/issues/_form.html.haml @@ -1,18 +1,18 @@ %div.issue-form-holder %h3.page_title= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}" - = form_for [@project, @issue], remote: request.xhr? do |f| + = form_for [@project, @issue] do |f| -if @issue.errors.any? .alert-message.block-message.error - %ul - - @issue.errors.full_messages.each do |msg| - %li= msg + - @issue.errors.full_messages.each do |msg| + %span= msg + %br .issue_form_box .issue_title .clearfix = f.label :title do %strong= "Subject *" .input - = f.text_field :title, maxlength: 255, class: "xxlarge js-gfm-input", autofocus: true + = f.text_field :title, maxlength: 255, class: "xxlarge js-gfm-input", autofocus: true, required: true .issue_middle_block .issue_assignee = f.label :assignee_id do @@ -47,11 +47,38 @@ -else = f.submit 'Save changes', class: "save-btn btn" - - cancel_class = 'btn cancel-btn' - - if request.xhr? - = link_to "Cancel", "#back", onclick: "backToIssues();", class: cancel_class - - else - - if @issue.new_record? - = link_to "Cancel", project_issues_path(@project), class: cancel_class - - else - = link_to "Cancel", project_issue_path(@project, @issue), class: cancel_class + - cancel_path = @issue.new_record? ? project_issues_path(@project) : project_issue_path(@project, @issue) + = link_to "Cancel", cancel_path, class: 'btn cancel-btn' + + + + +:javascript + $(function(){ + $("#issue_label_list") + .bind( "keydown", function( event ) { + if ( event.keyCode === $.ui.keyCode.TAB && + $( this ).data( "autocomplete" ).menu.active ) { + event.preventDefault(); + } + }) + .autocomplete({ + minLength: 0, + source: function( request, response ) { + response( $.ui.autocomplete.filter( + #{raw labels_autocomplete_source}, extractLast( request.term ) ) ); + }, + focus: function() { + return false; + }, + select: function(event, ui) { + var terms = split( this.value ); + terms.pop(); + terms.push( ui.item.value ); + terms.push( "" ); + this.value = terms.join( ", " ); + return false; + } + }); + }); + diff --git a/app/views/issues/_issues.html.haml b/app/views/issues/_issues.html.haml index f82ae8bde58..d7ba4300ce7 100644 --- a/app/views/issues/_issues.html.haml +++ b/app/views/issues/_issues.html.haml @@ -6,7 +6,7 @@ .row .span7= paginate @issues, remote: true, theme: "gitlab" .span3.right - %span.cgray.right + %span.cgray.right %span.issue_counter #{@issues.total_count} issues for this filter - else diff --git a/app/views/issues/_show.html.haml b/app/views/issues/_show.html.haml index 8aa92ebfd6a..4641e8bdc63 100644 --- a/app/views/issues/_show.html.haml +++ b/app/views/issues/_show.html.haml @@ -1,4 +1,4 @@ -%li.wll{ id: dom_id(issue), class: issue_css_classes(issue), url: project_issue_path(issue.project, issue) } +%li{ id: dom_id(issue), class: issue_css_classes(issue), url: project_issue_path(issue.project, issue) } - if controller.controller_name == 'issues' .issue_check = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue", disabled: !can?(current_user, :modify_issue, issue) @@ -16,7 +16,7 @@ = link_to 'Reopen', project_issue_path(issue.project, issue, issue: {closed: false }, status_only: true), method: :put, class: "btn small grouped reopen_issue", remote: true - else = link_to 'Close', project_issue_path(issue.project, issue, issue: {closed: true }, status_only: true), method: :put, class: "btn small grouped close_issue", remote: true - = link_to edit_project_issue_path(issue.project, issue), class: "btn small edit-issue-link grouped", remote: true do + = link_to edit_project_issue_path(issue.project, issue), class: "btn small edit-issue-link grouped" do %i.icon-edit Edit @@ -28,7 +28,7 @@ %p= link_to_gfm truncate(issue.title, length: 100), project_issue_path(issue.project, issue), class: "row_title" %span.update-author - %small.cdark= "##{issue.id}" + %span.cdark= "##{issue.id}" - if issue.assignee assigned to #{issue.assignee_name} - else diff --git a/app/views/issues/create.js.haml b/app/views/issues/create.js.haml deleted file mode 100644 index d90cbf0d30c..00000000000 --- a/app/views/issues/create.js.haml +++ /dev/null @@ -1,10 +0,0 @@ -- if @issue.valid? - :plain - switchFromNewIssue(); - $("#issues-table").prepend("#{escape_javascript(render(partial: 'show', locals: {issue: @issue}))}"); - $.ajax({type: "GET", url: location.href, dataType: "script"}); -- else - :plain - $("#new_issue_dialog").empty(); - $("#new_issue_dialog").append("#{escape_javascript(render('form'))}"); - $('select#issue_assignee_id').chosen(); diff --git a/app/views/issues/edit.js.haml b/app/views/issues/edit.js.haml deleted file mode 100644 index a994572f9b9..00000000000 --- a/app/views/issues/edit.js.haml +++ /dev/null @@ -1,4 +0,0 @@ -:plain - $("#edit_issue_dialog").html("#{escape_javascript(render('form'))}"); - switchToEditIssue(); - diff --git a/app/views/issues/index.html.haml b/app/views/issues/index.html.haml index d89b183d360..08d4393b201 100644 --- a/app/views/issues/index.html.haml +++ b/app/views/issues/index.html.haml @@ -6,7 +6,7 @@ .right .span5 - if can? current_user, :write_issue, @project - = link_to new_project_issue_path(@project), class: "right btn", title: "New Issue", remote: true, id: "new_issue_link" do + = link_to new_project_issue_path(@project, issue: { assignee_id: params[:assignee_id], milestone_id: params[:milestone_id]}), class: "right btn", title: "New Issue", id: "new_issue_link" do %i.icon-plus New Issue = form_tag search_project_issues_path(@project), method: :get, remote: true, id: "issue_search_form", class: :right do @@ -27,7 +27,7 @@ .left = select_tag('update[status]', options_for_select(['open', 'closed']), prompt: "Status") = select_tag('update[assignee_id]', options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee") - = select_tag('update[milestone_id]', options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), prompt: "Milestone") + = select_tag('update[milestone_id]', options_from_collection_for_select(issues_active_milestones, "id", "title", params[:milestone_id]), prompt: "Milestone") = hidden_field_tag 'update[issues_ids]', [] = hidden_field_tag :f, params[:f] = button_tag "Save", class: "btn update_selected_issues" @@ -51,16 +51,13 @@ = form_tag project_issues_path(@project), method: :get, class: :right do = select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), prompt: "Labels") = select_tag(:assignee_id, options_from_collection_for_select([unassigned_filter] + @project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee") - = select_tag(:milestone_id, options_from_collection_for_select([unassigned_filter] + @project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), prompt: "Milestone") + = select_tag(:milestone_id, options_from_collection_for_select([unassigned_filter] + issues_active_milestones, "id", "title", params[:milestone_id]), prompt: "Milestone") = hidden_field_tag :f, params[:f] .clearfix - %ul#issues-table.unstyled.issues_table + %ul#issues-table.well-list.issues_table = render "issues" -#new_issue_dialog -#edit_issue_dialog - :javascript $(function(){ issuesPage(); diff --git a/app/views/issues/new.js.haml b/app/views/issues/new.js.haml deleted file mode 100644 index 4cbcc563e28..00000000000 --- a/app/views/issues/new.js.haml +++ /dev/null @@ -1,3 +0,0 @@ -:plain - $("#new_issue_dialog").html("#{escape_javascript(render('form'))}"); - switchToNewIssue(); diff --git a/app/views/issues/show.html.haml b/app/views/issues/show.html.haml index 3d3164fed20..b1014edc6c5 100644 --- a/app/views/issues/show.html.haml +++ b/app/views/issues/show.html.haml @@ -26,22 +26,16 @@ .main_box .top_box_content - %h4 + %h4.box-title - if @issue.closed - .alert-message.error.status_info Closed - - else - .alert-message.success.status_info Open + .error.status_info Closed = gfm escape_once(@issue.title) .middle_box_content - %cite.cgray Created by - = image_tag gravatar_icon(@issue.author_email), width: 16, class: "lil_av" - %strong.author= link_to_issue_author(@issue) - - - if @issue.assignee - %cite.cgray and currently assigned to - = image_tag gravatar_icon(@issue.assignee_email), width: 16, class: "lil_av" - %strong.author= link_to_issue_assignee(@issue) + %cite.cgray + Created by #{link_to_member(@project, @issue.author)} + - if @issue.assignee + \ and currently assigned to #{link_to_member(@project, @issue.assignee)} - if @issue.milestone - milestone = @issue.milestone diff --git a/app/views/issues/update.js.haml b/app/views/issues/update.js.haml index 44722895025..7f66022a2de 100644 --- a/app/views/issues/update.js.haml +++ b/app/views/issues/update.js.haml @@ -2,13 +2,3 @@ - if @issue.valid? :plain $("##{dom_id(@issue)}").fadeOut(); -- else - - if @issue.valid? - :plain - updatePage(); - switchFromEditIssue(); - - else - :plain - $("#edit_issue_dialog").empty(); - $("#edit_issue_dialog").append("#{escape_javascript(render('form'))}"); - $('select#issue_assignee_id').chosen(); |