Commit 368deb59 authored by Nihad Abbasov's avatar Nihad Abbasov

clean up whitespace from project

parent 415eddaf
......@@ -22,9 +22,9 @@ $(function(){
$('select#branch').selectmenu({style:'popup', width:200});
$('select#tag').selectmenu({style:'popup', width:200});
$(".account-box").mouseenter(showMenu);
$(".account-box").mouseleave(resetMenu);
$(".account-box").mouseenter(showMenu);
$(".account-box").mouseleave(resetMenu);
});
function updatePage(data){
......@@ -32,9 +32,9 @@ function updatePage(data){
}
function showMenu() {
$(this).toggleClass('hover');
$(this).toggleClass('hover');
}
function resetMenu() {
$(this).removeClass("hover");
$(this).removeClass("hover");
}
......@@ -8,25 +8,23 @@ $(document).ready(function(){
});
});
var CommitsList = {
var CommitsList = {
ref:null,
limit:0,
offset:0,
init:
function(ref, limit) {
this.ref=ref;
this.limit=limit;
this.offset=limit;
init:
function(ref, limit) {
this.ref=ref;
this.limit=limit;
this.offset=limit;
this.initLoadMore();
$('.loading').show();
},
getOld:
function() {
function() {
$('.loading').show();
$.ajax({
type: "GET",
......@@ -39,14 +37,14 @@ getOld:
append:
function(count, html) {
$("#commits_list").append(html);
if(count > 0) {
if(count > 0) {
this.offset += count;
this.initLoadMore();
}
}
},
initLoadMore:
function() {
function() {
$(window).bind('scroll', function(){
if($(window).scrollTop() == $(document).height() - $(window).height()){
$(window).unbind('scroll');
......
var NoteList = {
var NoteList = {
first_id: 0,
last_id: 0,
resource_name: null,
init:
function(resource_name, first_id, last_id) {
this.resource_name = resource_name;
this.first_id = first_id;
this.last_id = last_id;
init:
function(resource_name, first_id, last_id) {
this.resource_name = resource_name;
this.first_id = first_id;
this.last_id = last_id;
this.initRefresh();
this.initLoadMore();
},
getOld:
function() {
function() {
$('.loading').show();
$.ajax({
type: "GET",
......@@ -31,7 +31,7 @@ append:
this.initLoadMore();
},
replace:
replace:
function(fid, lid, html) {
this.first_id = fid;
this.last_id = lid;
......@@ -39,17 +39,16 @@ replace:
this.initLoadMore();
},
prepend:
function(id, html) {
if(id != this.last_id) {
if(id != this.last_id) {
this.last_id = id;
$("#notes-list").prepend(html);
}
},
getNew:
function() {
function() {
// refersh notes list
$.ajax({
type: "GET",
......@@ -59,7 +58,7 @@ getNew:
},
refresh:
function() {
function() {
// refersh notes list
$.ajax({
type: "GET",
......@@ -68,8 +67,6 @@ refresh:
dataType: "script"});
},
initRefresh:
function() {
// init timer
......@@ -78,7 +75,7 @@ initRefresh:
},
initLoadMore:
function() {
function() {
$(window).bind('scroll', function(){
if($(window).scrollTop() == $(document).height() - $(window).height()){
$(window).unbind('scroll');
......
......@@ -48,7 +48,6 @@ function taggifyForm(){
source: '/tags.json'
});
$('form').submit( function() {
var tag_field = $('#tag_field')
tag_field.val( tag_field.tagify('serialize') );
......
......@@ -15,10 +15,10 @@
.cgreen { color:#44aa22; }
/** COMMON STYLES **/
.left {
.left {
float:left;
}
.right {
.right {
float:right;
}
.width-50p{
......@@ -33,7 +33,7 @@
.width-65p{
width:65%;
}
.append-bottom-10 {
.append-bottom-10 {
margin-bottom:10px;
}
.prepend-top-10 {
......
......@@ -12,7 +12,7 @@
.issues_filter {
margin-top:10px;
.left {
.left {
margin-right:15px;
}
}
......@@ -38,11 +38,10 @@
/** ISSUES LIST **/
.issue .action-links {
display:none;
a {
display:none;
a {
margin-left:10px;
}
}
.issue:hover .action-links { display:block; }
......@@ -14,7 +14,6 @@
}
}
/* Note textare */
#note_note {
height:100px;
......
......@@ -99,15 +99,15 @@ a {
}
}
td.code {
td.code {
width: 100%;
.highlight {
.highlight {
margin-left: 55px;
overflow:auto;
overflow-y:hidden;
}
}
.highlight pre {
.highlight pre {
white-space: pre;
word-wrap:normal;
}
......@@ -115,12 +115,11 @@ td.code {
.highlighttable tr:hover {
background:white;
}
table.highlighttable pre{
table.highlighttable pre{
line-height:16px !important;
font-size:12px !important;
}
table.highlighttable .linenodiv pre {
text-align: right;
padding-right: 4px;
......@@ -235,7 +234,6 @@ input.ssh_project_url {
}
}
#user_projects_limit{
width: 60px;
}
......@@ -244,7 +242,7 @@ input.ssh_project_url {
cursor: move;
}
.project-refs-form {
.project-refs-form {
span {
background: none !important;
position:static !important;
......@@ -258,18 +256,18 @@ input.ssh_project_url {
}
.filter .left { margin-right:15px; }
body.project-page table .commit {
a.tree-commit-link {
body.project-page table .commit {
a.tree-commit-link {
color:gray;
&:hover {
&:hover {
text-decoration:underline;
}
}
}
/** NEW PROJECT **/
.new-project-hodler {
.new-project-hodler {
.icon span { background-position: -31px -70px; }
td { border-bottom: 1px solid #DEE2E3; }
}
......@@ -277,8 +275,8 @@ body.project-page table .commit {
/** Feed entry **/
.commit,
.snippet,
.message {
.title {
.message {
.title {
color:#666;
a { color:#666 !important; }
p { margin-top:0px; }
......@@ -295,21 +293,21 @@ body.project-page table .commit {
font-size:1.5em;
height:auto;
font-weight:bold;
.ui-selectmenu-status {
.ui-selectmenu-status {
padding:3px 10px;
}
}
/** Snippets **/
.new_snippet textarea,
.edit_snippet textarea {
.new_snippet textarea,
.edit_snippet textarea {
height:300px;
padding: 8px;
width: 95%;
}
.snippet .action-links {
display:none;
a {
display:none;
a {
margin-left:10px;
}
}
......@@ -348,11 +346,11 @@ body.project-page table .commit {
background: #2c5c66;
color:white;
}
&.issue {
&.issue {
background: #D12F19;
color:white;
}
&.commit {
&.commit {
background: #44aacc;
color:white;
}
......
This diff is collapsed.
.tags-list {
padding : 0px 10px 10px 10px;
padding : 0px 10px 10px 10px;
}
.tags-list a {
......@@ -15,7 +15,6 @@
font-size: 14px;
}
.small-tags a{
font-size: 9px;
......@@ -26,10 +25,9 @@
background-color: #72bbdf;
color: #FFF;
text-shadow: none;
font-weight: bold;
font-weight: bold;
}
.medium-tags a{
font-size: 12px;
......@@ -40,5 +38,5 @@
background-color: #72bbdf;
color: #FFF;
text-shadow: none;
font-weight: bold;
}
\ No newline at end of file
font-weight: bold;
}
......@@ -79,8 +79,8 @@ class ApplicationController < ActionController::Base
elsif params[:last_id]
@notes = @notes.where("id > ?", params[:last_id])
elsif params[:first_id]
@notes = @notes.where("id < ?", params[:first_id])
else
@notes = @notes.where("id < ?", params[:first_id])
else
nil
end
end
......
......@@ -10,7 +10,6 @@ class CommitsController < ApplicationController
before_filter :require_non_empty_project
before_filter :load_refs, :only => :index # load @branch, @tag & @ref
def index
@repo = project.repo
limit, offset = (params[:limit] || 20), (params[:offset] || 0)
......
......@@ -79,7 +79,7 @@ class ProjectsController < ApplicationController
@notes = @project.common_notes.order("created_at DESC")
@notes = @notes.fresh.limit(20)
respond_to do |format|
respond_to do |format|
format.html
format.js { respond_with_notes }
end
......@@ -168,7 +168,7 @@ class ProjectsController < ApplicationController
def add_refs(commit, ref_cache)
if ref_cache.empty?
@repo.refs.each do |ref|
@repo.refs.each do |ref|
ref_cache[ref.commit.id] ||= []
ref_cache[ref.commit.id] << ref
end
......
class TagsController < ApplicationController
def index
@tags = Project.tag_counts.order('count DESC')
@tags = @tags.where('name like ?', "%#{params[:term]}%") unless params[:term].blank?
def index
@tags = Project.tag_counts.order('count DESC')
@tags = @tags.where('name like ?', "%#{params[:term]}%") unless params[:term].blank?
respond_to do |format|
format.html
format.json { render json: @tags.limit(8).map {|t| t.name}}
end
end
respond_to do |format|
format.html
format.json { render json: @tags.limit(8).map {|t| t.name}}
end
end
end
......@@ -11,7 +11,7 @@ module ApplicationHelper
end
def body_class(default_class = nil)
main = content_for(:body_class).blank? ?
main = content_for(:body_class).blank? ?
default_class :
content_for(:body_class)
......@@ -42,7 +42,7 @@ module ApplicationHelper
else
"Never"
end
rescue
rescue
"Never"
end
......
......@@ -4,7 +4,7 @@ module DashboardHelper
when "Issue" then project_issue_path(project, project.issues.find(object.id))
when "Grit::Commit" then project_commit_path(project, project.repo.commits(object.id).first)
when "Note"
then
then
note = object
case note.noteable_type
when "Issue" then project_issue_path(project, note.noteable_id)
......@@ -12,9 +12,9 @@ module DashboardHelper
when "Commit" then project_commit_path(project, :id => note.noteable_id)
else wall_project_path(project)
end
else wall_project_path(project)
else wall_project_path(project)
end
rescue
rescue
"#"
end
......
......@@ -11,8 +11,8 @@ class Issue < ActiveRecord::Base
validates_presence_of :author_id
delegate :name,
:email,
:to => :author,
:email,
:to => :author,
:prefix => true
validates :title,
......
......@@ -8,8 +8,8 @@ class Note < ActiveRecord::Base
:class_name => "User"
delegate :name,
:email,
:to => :author,
:email,
:to => :author,
:prefix => true
attr_protected :author, :author_id
......
......@@ -121,9 +121,9 @@ class Project < ActiveRecord::Base
private_flag
end
def last_activity
def last_activity
updates(1).first
rescue
rescue
nil
end
......@@ -132,7 +132,7 @@ class Project < ActiveRecord::Base
end
def updates(n = 3)
[
[
fresh_commits(n),
issues.last(n),
notes.fresh.limit(n)
......
......@@ -9,7 +9,7 @@ class Repository
@project = project
end
def path
def path
@path ||= project.path
end
......
= form_for [:admin, @admin_project] do |f|
-if @admin_project.errors.any?
#error_explanation
%h2= "#{pluralize(@admin_project.errors.count, "error")} prohibited this admin_project from being saved:"
%h2= "#{pluralize(@admin_project.errors.count, "error")} prohibited this admin_project from being saved:"
%ul
- @admin_project.errors.full_messages.each do |msg|
%li= msg
......@@ -19,7 +19,6 @@
%br
= f.text_field :path
.form-row
= f.label :tag_list
%br
......@@ -36,4 +35,4 @@
:javascript
$(function(){
taggifyForm();
})
})
......@@ -6,7 +6,7 @@
%h2.icon
%span
%d
= link_to project_commits_path(@project) do
= link_to project_commits_path(@project) do
= @project.name
- if params[:path]
\/
......@@ -20,8 +20,6 @@
.loading{ :style => "display:none;"}
%center= image_tag "ajax-loader.gif"
:javascript
$(function(){
CommitsList.init("#{@ref}", 20);
......
......@@ -27,13 +27,13 @@
%a.project-update{:href => dashboard_feed_path(project, update)}
= image_tag gravatar_icon(update.author_email), :class => "left", :width => 40
%span.update-title
- if update.kind_of?(Grit::Commit)
- if update.kind_of?(Grit::Commit)
%span.right.tag.commit= update.head.name
= dashboard_feed_title(update)
%span.update-author
%strong= update.author_name
authored
= time_ago_in_words(update.created_at)
= time_ago_in_words(update.created_at)
ago
/ #news-feed
/ #dashboard-content
......@@ -18,7 +18,7 @@
- if can? current_user, :write_issue, issue
- if issue.closed
= link_to 'Reopen', project_issue_path(@project, issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "cgray", :remote => true
- else
- else
= link_to 'Resolve', project_issue_path(@project, issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "cgray", :remote => true
- if can? current_user, :write_issue, issue
= link_to 'Edit', edit_project_issue_path(@project, issue), :class => "cgray edit-issue-link", :remote => true
......
......@@ -31,7 +31,6 @@
var href = $('.issue_search').parent().attr('action');
var last_terms = '';
var setIssueFilter = function(form, value){
$.cookie('issue_filter', value, { expires: 140 });
form.submit();
......
......@@ -22,12 +22,12 @@
%td
= image_tag gravatar_icon(@issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;"
= @issue.assignee.name
%tr
%tr
%td Tags
%td
- if @issue.critical
%span.tag.high critical
- else
- else
%span.tag.normal normal
- if @issue.today?
......@@ -42,7 +42,6 @@
- else
= check_box_tag "closed", 1, @issue.closed, :disabled => true
- if can?(current_user, :write_issue, @issue)
.clear
%br
......
......@@ -10,7 +10,7 @@
<div class="account-links">
<%= link_to profile_path, :class => "username" do %>
<%#= current_user.name %>
<%#= current_user.name %>
My profile
<% end %>
<%= link_to 'Logout', destroy_user_session_path, :class => "logout", :method => :delete %>
......
......@@ -19,7 +19,7 @@
%aside
= link_to "Profile", profile_path, :class => current_page?(:controller => "profile", :action => :show) ? "current" : nil
= link_to "Password", profile_password_path, :class => current_page?(:controller => "profile", :action => :password) ? "current" : nil
= link_to keys_path, :class => controller.controller_name == "keys" ? "current" : nil do
= link_to keys_path, :class => controller.controller_name == "keys" ? "current" : nil do
Keys
- unless current_user.keys.empty?
%span{ :class => "number" }= current_user.keys.count
......
......@@ -14,7 +14,7 @@
%br
%br
= f.text_area :note, :size => 255
%div.attach_holder
%br
= f.label :attachment
......
......@@ -4,7 +4,6 @@
:plain
NoteList.replace(#{@notes.last.id}, #{@notes.first.id}, "#{escape_javascript(render(:partial => 'notes/notes_list'))}");
- elsif params[:last_id]
:plain
NoteList.prepend(#{@notes.first.id}, "#{escape_javascript(render(:partial => 'notes/notes_list'))}");
......
......@@ -7,7 +7,7 @@
ago
- if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project)
= link_to "Remove", [@project, note], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-note right"
%div.note-title
= markdown(note.note)
- if note.attachment.url
......
......@@ -5,11 +5,11 @@
%span.update-author
%strong= update.author_name
authored
= time_ago_in_words(update.created_at)
= time_ago_in_words(update.created_at)
ago
.right
- klass = update.class.to_s.split("::").last.downcase
%span.tag{ :class => klass }= klass
- if update.kind_of?(Grit::Commit)
- if update.kind_of?(Grit::Commit)
%span.tag.commit= update.head.name
= form_for(@project, :remote => true) do |f|
%div.form_content
- unless @project.new_record?
%h2.icon
%h2.icon
%span
= @project.name
- if @project.errors.any?
......@@ -56,4 +56,4 @@
:javascript
$(function(){
taggifyForm();
})
})
......@@ -14,7 +14,6 @@
= project.name
.small-tags= tag_list project
%td= truncate project.url_to_repo
%td= project.code
%td= check_box_tag "read", 1, project.readers.include?(current_user), :disabled => :disabled
......