Unverified Commit f23ffeec authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge branch '6-5-dev'


Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	VERSION
v 6.5.0
- Dropdown menus on issue#show page for assignee and milestone (Jason Blanchard)
- Add color custimization and previewing to broadcast messages
v 6.4.0
- Added sorting to project issues page (Jason Blanchard)
- Assembla integration (Carlos Paramio)
......
......@@ -8,6 +8,23 @@ class Admin
else
elems.removeAttr 'disabled'
$('body').on 'click', '.js-toggle-colors-link', (e) ->
e.preventDefault()
$('.js-toggle-colors-link').hide()
$('.js-toggle-colors-container').show()
$('input#broadcast_message_color').on 'input', ->
previewColor = $('input#broadcast_message_color').val()
$('div.broadcast-message-preview').css('background-color', previewColor)
$('input#broadcast_message_font').on 'input', ->
previewColor = $('input#broadcast_message_font').val()
$('div.broadcast-message-preview').css('color', previewColor)
$('textarea#broadcast_message_message').on 'input', ->
previewMessage = $('textarea#broadcast_message_message').val()
$('div.broadcast-message-preview span').text(previewMessage)
$('.log-tabs a').click (e) ->
e.preventDefault()
$(this).tab('show')
......
......@@ -79,3 +79,9 @@
$("#update_issues_ids").val []
$(".issues_bulk_update").hide()
$(".issues-filters").show()
$ ->
$('.edit-issue.inline-update input[type="submit"]').hide();
$("body").on "change", ".edit-issue.inline-update select", ->
$(this).submit()
......@@ -361,6 +361,11 @@ table {
color: #BBB;
}
.broadcast-message-preview {
@extend .broadcast-message;
margin-bottom: 20px;
}
.ajax-users-select {
width: 400px;
......
......@@ -106,13 +106,11 @@ pre.well-pre {
/** Big Labels **/
.state-label {
font-size: 14px;
padding: 5px 15px;
padding: 6px 25px;
text-align: center;
float: right;
position: relative;
top: -5px;
@include border-radius(4px);
text-shadow: none;
margin-left: 10px;
&.state-label-green {
background: #4A4;
......
......@@ -119,3 +119,16 @@ input.check_all_issues {
background-color: #f4f4f4;
}
}
.edit-issue.inline-update select {
width: 100%;
max-width: 200px;
}
.issue-show-labels .label {
padding: 6px 10px;
}
form.edit-issue {
margin: 0;
}
......@@ -51,3 +51,7 @@
.chosen-container .chosen-drop .chosen-search input {
background-position-y: -24px !important;
}
.chosen-compact {
max-width: 170px !important;
}
module BroadcastMessagesHelper
def broadcast_styling(broadcast_message)
if(broadcast_message.color || broadcast_message.font)
"background-color:#{broadcast_message.color};color:#{broadcast_message.font}"
else
""
end
end
end
......@@ -76,4 +76,12 @@ def bulk_update_milestone_options
def bulk_update_assignee_options
options_for_select(["None (unassigned)", nil]) + options_from_collection_for_select(@project.team.members, "id", "name", params[:assignee_id])
end
def assignee_options object
options_from_collection_for_select(@project.team.members.sort_by(&:name), 'id', 'name', object.assignee_id)
end
def milestone_options object
options_from_collection_for_select(@project.milestones.active, 'id', 'title', object.milestone_id)
end
end
......@@ -9,15 +9,20 @@
# alert_type :integer
# created_at :datetime not null
# updated_at :datetime not null
# color :string(255)
# font :string(255)
#
class BroadcastMessage < ActiveRecord::Base
attr_accessible :alert_type, :ends_at, :message, :starts_at
attr_accessible :alert_type, :color, :ends_at, :font, :message, :starts_at
validates :message, presence: true
validates :starts_at, presence: true
validates :ends_at, presence: true
validates :color, format: { with: /\A\#[0-9A-Fa-f]{6}+\Z/ }, allow_blank: true
validates :font, format: { with: /\A\#[0-9A-Fa-f]{6}+\Z/ }, allow_blank: true
def self.current
where("ends_at > :now AND starts_at < :now", now: Time.zone.now).last
end
......
......@@ -2,7 +2,9 @@
Broadcast Messages
%p.light
Broadcast messages are displayed for every user and can be used to notify users about scheduled maintenance, recent upgrades and more.
%hr
.broadcast-message-preview
%i.icon-bullhorn
%span Your message here
= form_for [:admin, @broadcast_message] do |f|
-if @broadcast_message.errors.any?
......@@ -13,6 +15,19 @@
= f.label :message
.controls
= f.text_area :message, class: "input-xxlarge", rows: 2, required: true
%div
= link_to '#', class: 'js-toggle-colors-link' do
Customize colors
.control-group.js-toggle-colors-container.hide
= f.label :color, "Background Color"
.controls
= f.text_field :color, placeholder: "#AA33EE"
.light Hex values as 3 double digit numbers, starting with a # sign.
.control-group.js-toggle-colors-container.hide
= f.label :font, "Font Color"
.controls
= f.text_field :font, placeholder: "#224466"
.light Hex values as 3 double digit numbers, starting with a # sign.
.control-group
= f.label :starts_at
.controls.datetime-controls
......
- if broadcast_message.present?
.broadcast-message
.broadcast-message{ style: broadcast_styling(broadcast_message) }
%i.icon-bullhorn
= broadcast_message.message
......@@ -21,7 +21,7 @@
Assign to
.controls
.pull-left
= f.select(:assignee_id, @project.team.members.sort_by(&:name).map {|p| [ p.name, p.id ] }, { include_blank: "Select a user" }, {class: 'chosen'})
= f.select(:assignee_id, assignee_options(@issue), { include_blank: "Select a user" }, {class: 'chosen'})
.pull-right
&nbsp;
= link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link'
......@@ -29,7 +29,7 @@
= f.label :milestone_id do
%i.icon-time
Milestone
.controls= f.select(:milestone_id, @project.milestones.active.collect {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }, {class: 'chosen'})
.controls= f.select(:milestone_id, milestone_options(@issue), { include_blank: "Select milestone" }, {class: 'chosen'})
.ui-box-bottom
.control-group
......
= form_for [@project, @issue], remote: true, html: {class: 'edit-issue inline-update'} do |f|
.pull-right
Created by #{link_to_member(@project, issue.author)}&nbsp;
- if issue.assignee
\ and currently assigned to
- if can?(current_user, :modify_issue, @issue)
= link_to profile_path(issue.assignee) do
= image_tag(avatar_icon(issue.assignee.email), class: 'avatar avatar-inline s16 assignee') if issue.assignee
= f.select(:assignee_id, assignee_options(@issue), { include_blank: "Assign to user (none):" }, {class: 'chosen'})
- elsif issue.assignee
= link_to_member(@project, @issue.assignee)
.pull-right
- if issue.milestone
- milestone = issue.milestone
%cite.cgray Attached to milestone
- if can?(current_user, :modify_issue, @issue)
= f.select(:milestone_id, milestone_options(@issue), { include_blank: "Select milestone (none):" }, {class: 'chosen chosen-compact'})
= hidden_field_tag :issue_context
= f.submit class: 'btn'
- elsif issue.milestone
= link_to issue.milestone.title, project_milestone_path
......@@ -2,8 +2,12 @@
Issue ##{@issue.iid}
%small
created at
= @issue.created_at.stamp("Aug 21, 2011")
created #{time_ago_with_tooltip(@issue.created_at)} ago
- if @issue.closed?
%span.state-label.state-label-red Closed
- else
%span.state-label.state-label-green Open
%span.pull-right
- if can?(current_user, :write_issue, @project)
......@@ -26,34 +30,21 @@
.back-link
= link_to project_issues_path(@project) do
&larr; To issues list
%span.milestone-nav-link
- if @issue.milestone
|
= link_to project_milestone_path(@project, @issue.milestone) do
%span.light Milestone
= @issue.milestone.title
.ui-box.ui-box-show
.ui-box-head
%h4.box-title
- if @issue.closed?
.state-label.state-label-red Closed
- else
.state-label.state-label-green Open
= gfm escape_once(@issue.title)
.ui-box-body
%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
%cite.cgray and attached to milestone
%strong= link_to_gfm truncate(milestone.title, length: 20), project_milestone_path(milestone.project, milestone)
.pull-right
- @issue.labels.each do |label|
%span{class: "label #{label_css_class(label.name)}"}
%i.icon-tag
= label.name
&nbsp;
= render partial: 'issue_context', locals: { issue: @issue }
- if @issue.description.present?
.ui-box-bottom
......@@ -73,4 +64,11 @@
- @issue.participants.each do |participant|
= link_to_member(@project, participant, name: false, size: 24)
.voting_notes#notes= render "projects/notes/notes_with_form"
\ No newline at end of file
.issue-show-labels.pull-right
- @issue.labels.each do |label|
%span{class: "label #{label_css_class(label.name)}"}
%i.icon-tag
= label.name
&nbsp;
.voting_notes#notes= render "projects/notes/notes_with_form"
......@@ -2,3 +2,12 @@
- if @issue.valid?
:plain
$("##{dom_id(@issue)}").fadeOut();
- elsif params[:issue_context]
$('.ui-box-body').html("#{escape_javascript(render partial: 'issue_context', locals: { issue: @issue })}");
$('.ui-box-body').effect('highlight');
$('.chosen').chosen();
$('.edit-issue.inline-update input[type="submit"]').hide();
- if @issue.milestone
$('.milestone-nav-link').replaceWith("#{escape_javascript(link_to "| #{@issue.milestone.title}", project_milestone_path(@issue.project, @issue.milestone), :class => 'milestone-nav-link')}")
- else
$('.milestone-nav-link').html('')
......@@ -39,12 +39,12 @@
= f.label :assignee_id do
%i.icon-user
Assign to
.controls= f.select(:assignee_id, @project.team.members.sort_by(&:name).map {|p| [ p.name, p.id ] }, { include_blank: "Select user" }, {class: 'chosen span3'})
.controls= f.select(:assignee_id, assignee_options(@merge_request), { include_blank: "Select user" }, {class: 'chosen span3'})
.left
= f.label :milestone_id do
%i.icon-time
Milestone
.controls= f.select(:milestone_id, @project.milestones.active.map {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }, {class: 'chosen'})
.controls= f.select(:milestone_id, milestone_options(@merge_request), { include_blank: "Select milestone" }, {class: 'chosen'})
.control-group
= f.label :description, "Description"
.controls
......
......@@ -2,25 +2,18 @@
.ui-box-head
%h4.box-title
= gfm escape_once(@merge_request.title)
- if @merge_request.merged?
.state-label.state-label-green
%i.icon-ok
Merged
- elsif @merge_request.closed?
.state-label.state-label-red
Closed
.ui-box-body
%div
%cite.cgray
Created on #{@merge_request.created_at.stamp("Aug 21, 2011")} by #{link_to_member(@project, @merge_request.author)}.
Created by #{link_to_member(@project, @merge_request.author)}.
- if @merge_request.assignee
Currently assigned to #{link_to_member(@project, @merge_request.assignee)}.
- if @merge_request.milestone
- milestone = @merge_request.milestone
%cite.cgray Attached to milestone
%strong= link_to_gfm truncate(milestone.title, length: 20), project_milestone_path(milestone.project, milestone)
\.
.pull-right
- milestone = @merge_request.milestone
%cite.cgray Attached to milestone
%strong= link_to_gfm truncate(milestone.title, length: 20), project_milestone_path(milestone.project, milestone)
- if @merge_request.description.present?
......
%h3.page-title
= "Merge Request ##{@merge_request.iid}:"
&nbsp;
-if @merge_request.for_fork?
%span.label-branch
%span.label-project= truncate(@merge_request.source_project_path, length: 25)
#{@merge_request.source_branch}
&rarr;
%span.label-branch= @merge_request.target_branch
= "Merge Request ##{@merge_request.iid}"
%small
created #{time_ago_with_tooltip(@merge_request.created_at)} ago
- if @merge_request.merged?
%span.state-label.state-label-green
%i.icon-ok
Merged
- elsif @merge_request.closed?
%span.state-label.state-label-red
Closed
- else
%span.label-branch= @merge_request.source_branch
&rarr;
%span.label-branch= @merge_request.target_branch
%span.state-label.state-label-green
Open
%span.pull-right
- if can?(current_user, :modify_merge_request, @merge_request)
......@@ -36,3 +40,16 @@
.back-link
= link_to project_merge_requests_path(@project) do
&larr; To merge requests
%span.prepend-left-20.monospace
-if @merge_request.for_fork?
%span
%strong
#{truncate(@merge_request.source_project_path, length: 25)}:
#{@merge_request.source_branch}
&rarr;
%span= @merge_request.target_branch
- else
%span= @merge_request.source_branch
&rarr;
%spanh= @merge_request.target_branch
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment