Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of heroku.com:simple-ice-37

  • Loading branch information...
commit ccf9a4019e956bdd789bed0781d8e4504eb4688f 2 parents 3bb7f09 + 4fdac4a
@fd fd authored
View
8 app/controllers/memberships_controller.rb
@@ -50,7 +50,7 @@ def create
def destroy
membership.destroy
- redirect_to project
+ redirect_to membership.project
end
private
@@ -70,17 +70,17 @@ def require_project_ownership
if current_user.member?(project)
redirect_to project
else
- redirect_to home_path
+ redirect_to project_path()
end
return false
end
end
def require_ownership
- unless current_user.owner?(membership)
+ unless current_user.owner?(membership) or current_user.owner?(membership.project)
store_location
flash[:notice] = "You must be the owner of this project"
- redirect_to home_path
+ redirect_to membership.project
return false
end
end
View
16 app/helpers/application_helper.rb
@@ -114,22 +114,6 @@ def block2(title=nil, &block)
concat(%{</div></div>})
end
- def css_class_first(value=nil, check=nil)
- unless value.nil? or check.nil?
- if value == check
- %{first}
- end
- end
- end
-
- def css_class_last(value=nil, check=nil)
- unless value.nil? or check.nil?
- if value == check
- %{last}
- end
- end
- end
-
def css_class(class_name='', value=nil, check=nil)
unless value.nil? or check.nil?
if value == check
View
63 app/styles/lib/base.sass
@@ -163,17 +163,22 @@ body
&.environment
:width 1000px
- &.projects, &.errors, &.occurrences
- :cursor pointer
-
th
:text-transform uppercase
:font-weight bold
:font-size 10px
- th span
+ th.sortable span
+ :padding-right 10px
:border-bottom 1px solid
:border-color= !grey_light
+ :cursor pointer
+
+ th.headerSortUp span
+ :background url(/images/backgrounds/bg-sortable-arrow-up.gif) no-repeat right center
+
+ th.headerSortDown span
+ :background url(/images/backgrounds/bg-sortable-arrow-down.gif) no-repeat right center
td, th
:padding 8px
@@ -232,7 +237,12 @@ body
+links
td.project
+ :padding 0
:font-size 1.4em
+
+ a
+ :padding 8px
+ :display block
td.count, th.count
:text-align center
@@ -262,7 +272,14 @@ body
:font
:size 12px
:weight bold
-
+
+ td.error
+ :padding 0
+
+ a
+ :display block
+ :padding 8px
+
div.pagination
:font-size 1em
a
@@ -285,6 +302,7 @@ body
:color= !orange
a:hover
:text-decoration none
+
form
label
:display block
@@ -407,12 +425,14 @@ body
:padding 0
:list-style none
li
+ :position relative
:clear both
:border-top 1px solid rgb(255,255,255)
:border-bottom 1px solid rgb(228,230,223)
img
:float left
.info
+ :position relative
:float left
:padding 7px 10px
:line-height 1em
@@ -421,6 +441,18 @@ body
.email
:font-size 10px
:color rgb(178,181,174)
+ .delete
+ :position absolute
+ :display block
+ :top 50%
+ :right 0
+ :margin -8px 0 0 0
+ :border none
+ :width 16px
+ :height 16px
+ :background url(/images/icons/delete.png) no-repeat center center
+ :text-indent -8888px
+
li.first
:border-top none
li.last
@@ -469,11 +501,12 @@ body
li.me
:background url(/images/backgrounds/bg-me-label.gif) no-repeat right center
li.form
- position: relative
-
+ :position relative
+ :border none
+ :padding 20px 0 0 0
textarea
- width: 100%
- height: 5em
+ :width 100%
+ :height 5em
#footer
@@ -590,4 +623,14 @@ body
.notice
:padding 10px 20px
:background #EEEF86
- :color rgb(94, 95, 23)
+ :color rgb(94, 95, 23)
+
+textarea
+ +border-radius-3
+ :border-width 1px
+ :border-style solid
+ :border-color #DCDCDC #EBEBEB #EBEBEB #DCDCDC
+ :padding 5px
+ :background #FFF
+ :font-family helvetica, arial, sans-serif
+
View
2  app/views/errors/_error.html.haml
@@ -6,7 +6,7 @@
%td.label
%span{:class => error.last_occurence.reporter}
= abbreviation(error.last_occurence.reporter)
- %td
+ %td.error
= link_to h(truncate(error.name, :length => 100)), error
%td.count
%div
View
2  app/views/errors/show.html.haml
@@ -18,7 +18,7 @@
%br
= will_paginate occurences
- %table.table.occurrences
+ %table.table.occurrences.sortable
=render occurences
= will_paginate occurences
View
11 app/views/layouts/home.html.haml
@@ -21,10 +21,11 @@
%a{ :href => "#", :title => "Newsletter" }
Newsletter
%li.invites-counter
- Only
- %strong
- = invites_left(50)
- invites left, so hurry!
+ - if invites_left(50).to_i > 0
+ Only
+ %strong
+ = invites_left(50)
+ invites left, so hurry!
%h1
%a{ :href => "/", :title => "Failtale (beta) - Telling you more about failing applications." }
@@ -124,7 +125,7 @@
%span.valid{:style => "display:none;"}
%span.invalid{:style => "display:none;"}
%p
- = f.submit "Request invitation", :class => 'button request'
+ = f.submit "Request invitation", :class => 'button'
#login{:style => "display:none;"}
- form_for UserSession.new, :url => user_session_path, :html => {:class => 'form'} do |f|
View
6 app/views/projects/show.html.haml
@@ -1,16 +1,16 @@
- sidebar_blocks[:members] = true
- sidebar_blocks[:api_key] = true
-%table.errors
+%table.errors.sortable
%thead
%tr
%th.select
= check_box_tag 'selectAll'
%th.label
%span label
- %th
+ %th.sortable
%span error
- %th{ :class => "count {sorter: 'digit'}" }
+ %th.count.sortable
%span count
%tbody
- unless open_errors.empty?
View
2  app/views/shared/_assets.html.haml
@@ -1,2 +1,2 @@
= stylesheet_link_tag 'http://jquery-ui.googlecode.com/svn/tags/latest/themes/base/jquery-ui.css', 'application'
-= javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js', 'jquery.autoSuggest.minified.js', 'jquery.clearfield.packed.js', 'application.js'
+= javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js', 'jquery.autoSuggest.minified.js', 'jquery.tablesorter.min.js', 'jquery.clearfield.packed.js', 'application.js'
View
2  app/views/shared/_home_assets.html.haml
@@ -1,2 +1,2 @@
= stylesheet_link_tag 'reset.css', 'general.css'
-= javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js', 'jquery.scrollTo-min.js', 'jquery.clearfield.packed.js', 'application.js'
+= javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js', 'jquery.scrollTo-min.js', 'jquery.clearfield.packed.js', 'jquery.tablesorter.min.js', 'application.js'
View
10 app/views/shared/_sidebar.html.haml
@@ -11,7 +11,8 @@
.block.members
%h3 Members
%ul
- - @project.members.each_with_index do |member, idx|
+ - @project.memberships.all(:include => :user).each_with_index do |membership, idx|
+ - member = membership.user
%li{:class => %{clearfix #{css_class('first', idx, 0)} #{css_class('last', idx, (@project.members.length - 1))} #{css_class('owner', member.owner?(@project), true)}} }
= image_tag member.gravatar_url(:size => 40)
%span.info
@@ -19,6 +20,9 @@
= member.name
%span.email
= member.email
+ - if current_user.owner?(@project) and current_user != member
+ = link_to 'Delete', membership_path(membership), :class => 'delete', :method => :delete, :confirm => "Are you sure you want to delete this member?"
+
- if current_user.owner?(@project)
%li.clearfix.last.add-member
@@ -29,7 +33,7 @@
%h3 Comments
%ul
- @error.comments.each_with_index do |comment, idx|
- %li{:class => %{clearfix #{css_class('first', idx, 0)} #{css_class('last', idx, (@project.members.length - 1))} #{css_class('me', comment.user.id == current_user.id, true)}} }
+ %li{:class => %{clearfix #{css_class('first', idx, 0)} #{css_class('last', idx, (@error.comments.length - 1))} #{css_class('me', comment.user.id == current_user.id, true)}} }
= image_tag comment.user.gravatar_url(:size => 40)
%span.info
%strong.user
@@ -41,4 +45,4 @@
%li.form
- form_for [@error, Comment.new] do |f|
= f.text_area :body
- = f.submit
+ = f.submit 'Comment', :class => 'button'
View
26 config/routes.rb
@@ -32,22 +32,22 @@
:shallow => true,
:member => member do |projects|
- projects.resources :memberships,
- :except => [:index, :show]
+ projects.resources :memberships,
+ :except => [:index, :show]
- projects.resources :errors,
- :shallow => true,
- :only => [:show, :update] do |errors|
+ projects.resources :errors,
+ :shallow => true,
+ :only => [:show, :update] do |errors|
- errors.resources :comments,
- :only => [:create]
-
- errors.resources :occurences,
- :only => [:show],
- :member => {
- :backtrace => :get,
- :environment => :get }
+ errors.resources :comments,
+ :only => [:create]
+ errors.resources :occurences,
+ :only => [:show],
+ :member => {
+ :backtrace => :get,
+ :environment => :get }
+
end
end
View
BIN  db/development.sqlite3 copy
Binary file not shown
View
BIN  public/images/backgrounds/bg-sortable-arrow-down.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  public/images/backgrounds/bg-sortable-arrow-up.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
36 public/javascripts/application.js
@@ -18,9 +18,12 @@ var switchContent = (function(sender){
var validateEmail = (function(address){
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
- !(reg.test(address) == false);
+ return reg.test(address);
});
+/*
+ * DOM Ready
+ */
$(document).ready(function() {
var header = $('#header'),
footer = $('#footer'),
@@ -114,16 +117,25 @@ $(document).ready(function() {
}
return false;
});
-
- /*
- * Clearfield
- */
+
+ /*
+ * Clearfield
+ */
$('.clear-field').clearField();
-
- $('table.projects a, table.errors a, table.occurrences a').each(function(){
- var a = $(this),
- row = a.parent('td');
- $(row).click(function(){ window.location.href = a.attr('href'); });
- })
-
+
+
+ try {
+ /*
+ * Table sorter
+ */
+ $("table.sortable").tablesorter({textExtraction: 'complex'});
+ $("table.sortable th").filter(function(idx){
+ if ($(this).hasClass('sortable')) {
+ return false;
+ } else {
+ return $(this);
+ }
+ }).unbind('click');
+ } catch (e) { /* ignore */ };
+
}); // End DOM ready
View
49 public/stylesheets/application.css
@@ -202,15 +202,19 @@ body {
margin: 0 0 10px 0; }
#container #content table.environment {
width: 1000px; }
- #container #content table.projects, #container #content table.errors, #container #content table.occurrences {
- cursor: pointer; }
#container #content table th {
text-transform: uppercase;
font-weight: bold;
font-size: 10px; }
- #container #content table th span {
+ #container #content table th.sortable span {
+ padding-right: 10px;
border-bottom: 1px solid;
- border-color: #b2b5ae; }
+ border-color: #b2b5ae;
+ cursor: pointer; }
+ #container #content table th.headerSortUp span {
+ background: url(/images/backgrounds/bg-sortable-arrow-up.gif) no-repeat right center; }
+ #container #content table th.headerSortDown span {
+ background: url(/images/backgrounds/bg-sortable-arrow-down.gif) no-repeat right center; }
#container #content table td, #container #content table th {
padding: 8px;
word-wrap: break-word; }
@@ -257,7 +261,11 @@ body {
color: inherit;
text-decoration: none; }
#container #content table td.project {
+ padding: 0;
font-size: 1.4em; }
+ #container #content table td.project a {
+ padding: 8px;
+ display: block; }
#container #content table td.count, #container #content table th.count {
text-align: center;
width: 75px; }
@@ -281,6 +289,11 @@ body {
line-height: 12px;
font-size: 12px;
font-weight: bold; }
+ #container #content table td.error {
+ padding: 0; }
+ #container #content table td.error a {
+ display: block;
+ padding: 8px; }
#container #content div.pagination {
font-size: 1em; }
#container #content div.pagination a {
@@ -407,12 +420,14 @@ body {
padding: 0;
list-style: none; }
#container #sidebar .members ul li {
+ position: relative;
clear: both;
border-top: 1px solid rgb(255,255,255);
border-bottom: 1px solid rgb(228,230,223); }
#container #sidebar .members ul li img {
float: left; }
#container #sidebar .members ul li .info {
+ position: relative;
float: left;
padding: 7px 10px;
line-height: 1em; }
@@ -421,6 +436,17 @@ body {
#container #sidebar .members ul li .info .email {
font-size: 10px;
color: rgb(178,181,174); }
+ #container #sidebar .members ul li .delete {
+ position: absolute;
+ display: block;
+ top: 50%;
+ right: 0;
+ margin: -8px 0 0 0;
+ border: none;
+ width: 16px;
+ height: 16px;
+ background: url(/images/icons/delete.png) no-repeat center center;
+ text-indent: -8888px; }
#container #sidebar .members ul li.first {
border-top: none; }
#container #sidebar .members ul li.last {
@@ -466,7 +492,9 @@ body {
#container #sidebar .block.comments ul li.me {
background: url(/images/backgrounds/bg-me-label.gif) no-repeat right center; }
#container #sidebar .block.comments ul li.form {
- position: relative; }
+ position: relative;
+ border: none;
+ padding: 20px 0 0 0; }
#container #sidebar .block.comments ul li.form textarea {
width: 100%;
height: 5em; }
@@ -577,3 +605,14 @@ body {
padding: 10px 20px;
background: #EEEF86;
color: rgb(94, 95, 23); }
+
+textarea {
+ border-radius: 3px;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-width: 1px;
+ border-style: solid;
+ border-color: #DCDCDC #EBEBEB #EBEBEB #DCDCDC;
+ padding: 5px;
+ background: #FFF;
+ font-family: helvetica, arial, sans-serif; }
Please sign in to comment.
Something went wrong with that request. Please try again.