Commit 29b5aa2c authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Bootstrap: Issues restyled

parent 7f6e41fa
function switchToNewIssue(form){ function switchToNewIssue(form){
$("#issues-table").hide("slide", { direction: "left" }, 150, function(){ $(".issues_content").hide("fade", { direction: "left" }, 150, function(){
$("#issues-table").after(form); $(".issues_content").after(form);
$('select#issue_assignee_id').chosen(); $('select#issue_assignee_id').chosen();
$("#new_issue_dialog").show("slide", { direction: "right" }, 150); $("#new_issue_dialog").show("fade", { direction: "right" }, 150);
$('.top-tabs .add_new').hide(); $('.top-tabs .add_new').hide();
}); });
} }
function switchToEditIssue(form){ function switchToEditIssue(form){
$("#issues-table").hide("slide", { direction: "left" }, 150, function(){ $(".issues_content").hide("fade", { direction: "left" }, 150, function(){
$("#issues-table").after(form); $(".issues_content").after(form);
$('select#issue_assignee_id').chosen(); $('select#issue_assignee_id').chosen();
$("#edit_issue_dialog").show("slide", { direction: "right" }, 150); $("#edit_issue_dialog").show("fade", { direction: "right" }, 150);
$('.add_new').hide(); $('.add_new').hide();
}); });
} }
...@@ -25,8 +25,8 @@ function switchFromEditIssue(){ ...@@ -25,8 +25,8 @@ function switchFromEditIssue(){
} }
function backToIssues(){ function backToIssues(){
$("#edit_issue_dialog, #new_issue_dialog").hide("slide", { direction: "right" }, 150, function(){ $("#edit_issue_dialog, #new_issue_dialog").hide("fade", { direction: "right" }, 150, function(){
$("#issues-table").show("slide", { direction: "left" }, 150, function() { $(".issues_content").show("fade", { direction: "left" }, 150, function() {
$("#edit_issue_dialog").remove(); $("#edit_issue_dialog").remove();
$("#new_issue_dialog").remove(); $("#new_issue_dialog").remove();
$('.add_new').show(); $('.add_new').show();
......
...@@ -125,7 +125,9 @@ $blue_link: "#2fa0bb"; ...@@ -125,7 +125,9 @@ $blue_link: "#2fa0bb";
margin-top:20px; margin-top:20px;
} }
aside.projects { aside.projects,
aside.project-side
{
margin-left: 0; margin-left: 0;
padding-left: 20px; padding-left: 20px;
} }
......
.issue-number {
float: left;
border-radius: 5px;
text-shadow: none;
background: rgba(0, 0, 0, 0.12);
text-align: center;
padding: 14px 8px;
width: 40px;
margin-right: 10px;
color: #444;
}
#issue_assignee_id { #issue_assignee_id {
width:300px; width:300px;
} }
.main_links { .main_links {
width:130px; width:155px;
float:left; float:left;
a { a {
...@@ -68,10 +68,7 @@ body header { ...@@ -68,10 +68,7 @@ body header {
min-width:$min_app_width; min-width:$min_app_width;
max-width:$max_app_width; max-width:$max_app_width;
position:relative; position:relative;
padding:10px $app_padding;
.top_panel_content {
padding:10px $app_padding;
}
} }
.project_name { .project_name {
......
...@@ -95,4 +95,8 @@ class ApplicationController < ActionController::Base ...@@ -95,4 +95,8 @@ class ApplicationController < ActionController::Base
response.headers["Pragma"] = "no-cache" response.headers["Pragma"] = "no-cache"
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT" response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
end end
def render_full_content
@full_content = true
end
end end
...@@ -8,6 +8,8 @@ class RefsController < ApplicationController ...@@ -8,6 +8,8 @@ class RefsController < ApplicationController
before_filter :ref before_filter :ref
before_filter :define_tree_vars, :only => [:tree, :blob] before_filter :define_tree_vars, :only => [:tree, :blob]
before_filter :render_full_content
layout "project" layout "project"
def switch def switch
......
%div.issue-form-holder %div.issue-form-holder
= form_for [@project, @issue], :remote => request.xhr? do |f| = form_for [@project, @issue], :remote => request.xhr? do |f|
%div %h3= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}"
%span.entity-info %hr
- if request.xhr?
= link_to "#back", :onclick => "backToIssues();" do
.entity-button
Issues
%i
- else
- if @issue.new_record?
= link_to project_issues_path(@project) do
.entity-button
Issues
%i
- else
= link_to project_issue_path(@project, @issue) do
.entity-button
Show Issue
%i
%h2= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}"
%hr
-if @issue.errors.any? -if @issue.errors.any?
%ul.errors_holder .alert-message.block-message.error
- @issue.errors.full_messages.each do |msg| %ul
%li= msg - @issue.errors.full_messages.each do |msg|
%li= msg
%table.no-borders .clearfix
%tr = f.label :assignee_id
%td= f.label :assignee_id .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" })
%td= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" })
%tr .clearfix
%td= f.label :critical, "Critical" = f.label :critical, "Critical"
%td= f.check_box :critical .input= f.check_box :critical
- unless @issue.new_record?
%tr
%td= f.label :closed
%td= f.check_box :closed
= f.text_area :title, :style => "width:718px; height:100px", :maxlength => 255 - unless @issue.new_record?
%br .clearfix
%br = f.label :closed
.merge-tabs .input= f.check_box :closed
.clearfix
= f.label :title
.input= f.text_area :title, :maxlength => 255, :class => "xlarge"
.clearfix
= f.submit 'Save', :class => "primary btn" = f.submit 'Save', :class => "primary btn"
&nbsp;
- unless @issue.new_record? - if request.xhr?
= link_to "Cancel", "#back", :onclick => "backToIssues();", :class => "btn"
- else
- if @issue.new_record?
= link_to "Cancel", project_issues_path(@project), :class => "btn"
- else
= link_to "Cancel", project_issue_path(@project, @issue), :class => "btn"
-#- unless @issue.new_record?
.right .right
= link_to 'Remove', [@project, @issue], :confirm => 'Are you sure?', :method => :delete, :class => "red-button" = link_to 'Remove', [@project, @issue], :confirm => 'Are you sure?', :method => :delete, :class => "red-button"
...@@ -2,14 +2,3 @@ ...@@ -2,14 +2,3 @@
%li{:class => "#{'active' if current_page?(project_issues_path(@project))}"} %li{:class => "#{'active' if current_page?(project_issues_path(@project))}"}
= link_to project_issues_path(@project), :class => "tab" do = link_to project_issues_path(@project), :class => "tab" do
Issues Issues
-#= link_to project_issues_path(@project), :class => "tab" do
%span
Milestones
- if current_page?(project_issues_path(@project))
- if can? current_user, :write_issue, @project
%li
= link_to new_project_issue_path(@project), :class => "add_new", :title => "New Issue", :remote => true do
Add new
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
%td %td
= image_tag gravatar_icon(issue.assignee_email), :class => "left", :width => 40, :style => "padding-right:5px;" = image_tag gravatar_icon(issue.assignee_email), :class => "left", :width => 40, :style => "padding-right:5px;"
%span %span
= truncate(html_escape(issue.title), :length => 100) = truncate(html_escape(issue.title), :length => 50)
%div.note-author %div.note-author
%strong= issue.assignee.name %strong= issue.assignee.name
%cite.cgray %cite.cgray
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
.right.action-links .right.action-links
- if can? current_user, :write_issue, issue - if can? current_user, :write_issue, issue
- if issue.closed - if issue.closed
= link_to 'Reopen', project_issue_path(issue.project, issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "cgray", :remote => true = link_to 'Reopen', project_issue_path(issue.project, issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "btn small", :remote => true
- else - else
= link_to 'Resolve', project_issue_path(issue.project, issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "cgray", :remote => true = link_to 'Resolve', project_issue_path(issue.project, issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "success btn small", :remote => true
- if can? current_user, :write_issue, issue - if can? current_user, :write_issue, issue
= link_to 'Edit', edit_project_issue_path(issue.project, issue), :class => "cgray edit-issue-link", :remote => true = link_to 'Edit', edit_project_issue_path(issue.project, issue), :class => "btn small edit-issue-link", :remote => true
- if can?(current_user, :admin_issue, @project) || issue.author == current_user - if can?(current_user, :admin_issue, @project) || issue.author == current_user
= link_to 'Remove', [issue.project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-issue negative", :id => "destroy_issue_#{issue.id}" = link_to 'Remove', [issue.project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "danger btn small delete-issue", :id => "destroy_issue_#{issue.id}"
= render "issues/head" - if can? current_user, :write_issue, @project
= content_for :sidebar_top_block do
- if current_user.can_create_project?
.alert-message.block-message.error
You are able to create an issue. Click on button to add a new one
= link_to new_project_issue_path(@project), :class => "btn small", :title => "New Issue", :remote => true do
New Issue
- if current_user.private_token - if current_user.private_token
= content_for :rss_icon do = content_for :rss_icon do
.rss-icon .rss-icon
= link_to project_issues_path(@project, :atom, { :private_token => current_user.private_token }) do = link_to project_issues_path(@project, :atom, { :private_token => current_user.private_token }) do
= image_tag "Rss-UI.PNG", :width => 22, :title => "feed" = image_tag "Rss-UI.PNG", :width => 22, :title => "feed"
%div#issues-table-holder
.well .issues_content
= form_tag project_issues_path(@project), :method => :get, :class => :left do %h3 Issues
= label_tag "open_issues" do %hr
= radio_button_tag :f, 0, (params[:f] || "0") == "0", :onclick => "setIssueFilter(this.form, 0)", :id => "open_issues", :class => "status" %div#issues-table-holder
%span.tag.open Open %ul.pills.left
= label_tag "closed_issues" do %li{:class => ("active" if (params[:f] == "0" || !params[:f]))}
= radio_button_tag :f, 2, params[:f] == "2", :onclick => "setIssueFilter(this.form, 2)", :id => "closed_issues", :class => "status" = link_to project_issues_path(@project, :f => 0) do
%span.tag.closed Closed Open
= label_tag "my_issues" do %li{:class => ("active" if params[:f] == "2")}
= radio_button_tag :f, 3, params[:f] == "3", :onclick => "setIssueFilter(this.form, 3)", :id => "my_issues", :class => "status" = link_to project_issues_path(@project, :f => 2) do
%span To Me Closed
= label_tag "all_issues" do %li{:class => ("active" if params[:f] == "3")}
= radio_button_tag :f, 1, params[:f] == "1", :onclick => "setIssueFilter(this.form, 1)", :id => "all_issues", :class => "status" = link_to project_issues_path(@project, :f => 3) do
%span All To Me
%li{:class => ("active" if params[:f] == "1")}
= link_to project_issues_path(@project, :f => 1) do
All
= form_tag search_project_issues_path(@project), :method => :get, :remote => true, :id => "issue_search_form", :class => :right do = form_tag search_project_issues_path(@project), :method => :get, :remote => true, :id => "issue_search_form", :class => :right do
= hidden_field_tag :project_id, @project.id, { :id => 'project_id' } = hidden_field_tag :project_id, @project.id, { :id => 'project_id' }
= search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search' } = search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search' }
%table#issues-table %table#issues-table= render "issues"
= render "issues"
%br
:javascript :javascript
var href = $('.issue_search').parent().attr('action'); var href = $('.issue_search').parent().attr('action');
var last_terms = ''; var last_terms = '';
var setIssueFilter = function(form, value){
$.cookie('issue_filter', value, { expires: 140 });
form.submit();
}
$('.issue_search').keyup(function() { $('.issue_search').keyup(function() {
var terms = $(this).val(); var terms = $(this).val();
var project_id = $('#project_id').val(); var project_id = $('#project_id').val();
......
%aside.project-right
- if content_for? :sidebar_top_block
= yield :sidebar_top_block
- else
- if current_user.can_create_project?
.alert-message.block-message.info
You can create at least
= current_user.projects_limit
projects. Click on button to add a new one
= link_to new_project_path, :class => "btn small" do
New Project
%h4
Recent Projects:
%ul
- current_user.projects.order("id DESC").limit(5).each do |project|
%li
= link_to project_path(project) do
= project.name
%h4
Recent Issues:
%ul
- current_user.assigned_issues.order("id DESC").limit(5).each do |issue|
%li
= link_to project_issue_path(issue.project, issue) do
= truncate issue.title
%h4
Recent Requests:
%ul
- current_user.assigned_merge_requests.order("id DESC").limit(5).each do |issue|
%li
= link_to project_merge_request_path(issue.project, issue) do
= truncate issue.title
...@@ -18,4 +18,11 @@ ...@@ -18,4 +18,11 @@
= render :partial => "layouts/head_panel" = render :partial => "layouts/head_panel"
.container-fluid .container-fluid
.sidebar= render :partial => "layouts/project_side" .sidebar= render :partial => "layouts/project_side"
.content= yield .content
- if @full_content
= yield
- else
.row
.span10= yield
.span4= render "layouts/project_side_right"
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
= f.text_area :note, :size => 255 = f.text_area :note, :size => 255
.row .row
.span6 .span4
%h5 Notify via email: %h5 Notify via email:
.clearfix .clearfix
= label_tag :notify do = label_tag :notify do
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
= label_tag :notify_author do = label_tag :notify_author do
= check_box_tag :notify_author, 1 , @note.noteable_type == "Commit" = check_box_tag :notify_author, 1 , @note.noteable_type == "Commit"
%span Commit author %span Commit author
.span6 .span4.right
%h5 Attachment: %h5 Attachment:
.clearfix .clearfix
= f.label :attachment, "Any file, < 10 MB" = f.label :attachment, "Any file, < 10 MB"
......
- if update.kind_of?(Note) - if update.kind_of?(Note)
%a.project-update.titled{:href => dashboard_feed_path(project, update)} %a.project-update.titled{:href => dashboard_feed_path(project, update)}
= image_tag gravatar_icon(update.author_email), :class => "left", :width => 40 = image_tag gravatar_icon(update.author_email), :class => "avatar", :width => 32
%span.update-title %div
= dashboard_feed_title(update) = dashboard_feed_title(update)
%span.update-author %span.update-author
%strong= update.author_name %strong= update.author_name
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
- noteable = update.target - noteable = update.target
- if noteable.kind_of?(MergeRequest) - if noteable.kind_of?(MergeRequest)
.title-block .title-block
%span.update-title %div
%span.commit.tag %span.commit.tag
Merge Request # Merge Request #
= noteable.id = noteable.id
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
- elsif noteable.kind_of?(Issue) - elsif noteable.kind_of?(Issue)
.title-block .title-block
%span.update-title %div
%span.commit.tag %span.commit.tag
Issue # Issue #
= noteable.id = noteable.id
...@@ -30,29 +30,29 @@ ...@@ -30,29 +30,29 @@
- elsif noteable.kind_of?(Commit) - elsif noteable.kind_of?(Commit)
.title-block .title-block
%span.update-title %div
%span.commit.tag %span.commit.tag
commit commit
%span.update-author %span.update-author
.left= truncate noteable.id .left= truncate noteable.id
- else - else
.title-block .title-block
%span.update-title %div
%span.commit.tag %span.commit.tag
Project Wall Project Wall
- elsif update.kind_of?(MergeRequest) - elsif update.kind_of?(MergeRequest)
%a.project-update.titled{:href => project_merge_request_path(project, update)} %a.project-update.titled{:href => project_merge_request_path(project, update)}
= image_tag gravatar_icon(update.author_email), :class => "left", :width => 40 = image_tag gravatar_icon(update.author_email), :class => "avatar", :width => 32
%span.update-title %div
Opened merge request Opened merge request
%span.update-author %span.update-author
%strong= update.author_name %strong= update.author_name
= time_ago_in_words(update.created_at) = time_ago_in_words(update.created_at)
ago ago
.title-block .title-block
%span.update-title %div
%span.commit.tag %span.commit.tag
Merge Request # Merge Request #
= update.id = update.id
...@@ -63,15 +63,15 @@ ...@@ -63,15 +63,15 @@
- elsif update.kind_of?(Issue) - elsif update.kind_of?(Issue)
%a.project-update.titled{:href => dashboard_feed_path(project, update)} %a.project-update.titled{:href => dashboard_feed_path(project, update)}
= image_tag gravatar_icon(update.author_email), :class => "left", :width => 40 = image_tag gravatar_icon(update.author_email), :class => "avatar", :width => 32
%span.update-title %div
Created new Issue Created new Issue
%span.update-author %span.update-author
%strong= update.author_name %strong= update.author_name
= time_ago_in_words(update.created_at) = time_ago_in_words(update.created_at)
ago ago
.title-block .title-block
%span.update-title %div
%span.commit.tag %span.commit.tag
Issue # Issue #
= update.id = update.id
......
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