Skip to content
Browse files

Merge branch 'master' of github.com:machida/frontline

  • Loading branch information...
2 parents 75b145c + 0e9b3ee commit 80129e447915dea99461d97bf1c53ca323bb7fdb @amesel amesel committed Jul 8, 2012
View
66 app/assets/javascripts/jquery-autogrow.js
@@ -0,0 +1,66 @@
+/*!
+ * ----------------------------------------------------------------------------
+ * "THE BEER-WARE LICENSE" (Revision 42):
+ * <jevin9@gmail.com> wrote this file. As long as you retain this notice you
+ * can do whatever you want with this stuff. If we meet some day, and you think
+ * this stuff is worth it, you can buy me a beer in return. Jevin O. Sewaruth
+ * ----------------------------------------------------------------------------
+ *
+ * Autogrow Textarea Plugin Version v2.0
+ * http://www.technoreply.com/autogrow-textarea-plugin-version-2-0
+ *
+ * Date: March 13, 2011
+ */
+jQuery.fn.autoGrow = function(){
+ return this.each(function(){
+ // Variables
+ var colsDefault = this.cols;
+ var rowsDefault = this.rows;
+
+ //Functions
+ var grow = function() {
+ growByRef(this);
+ }
+
+ var growByRef = function(obj) {
+ var linesCount = 0;
+ var lines = obj.value.split('\n');
+
+ for (var i=lines.length-1; i>=0; --i)
+ {
+ linesCount += Math.floor((lines[i].length / colsDefault) + 1);
+ }
+
+ if (linesCount >= rowsDefault)
+ obj.rows = linesCount + 1;
+ else
+ obj.rows = rowsDefault;
+ }
+
+ var characterWidth = function (obj){
+ var characterWidth = 0;
+ var temp1 = 0;
+ var temp2 = 0;
+ var tempCols = obj.cols;
+
+ obj.cols = 1;
+ temp1 = obj.offsetWidth;
+ obj.cols = 2;
+ temp2 = obj.offsetWidth;
+ characterWidth = temp2 - temp1;
+ obj.cols = tempCols;
+
+ return characterWidth;
+ }
+
+ // Manipulations
+ this.style.width = "auto";
+ this.style.height = "auto";
+ this.style.overflow = "hidden";
+ this.style.width = ((characterWidth(this) * this.cols) + 6) + "px";
+ this.onkeyup = grow;
+ this.onfocus = grow;
+ this.onblur = grow;
+ growByRef(this);
+ });
+};
View
42 app/assets/stylesheets/sass/colors.css.sass
@@ -27,21 +27,32 @@ $label_font_size: 18px
$label_border_color: #103f68
$label_box_shadow: rgba(255, 255, 255, .4) 0 0 2px inset
-=label
- background-color: #7da8ca
- @include filter-gradient(#7da8ca, #6690b3, vertical)
+=label_basic_color
+ background-color: #84aac9
+ @include filter-gradient(#84aac9, #567a9a, vertical)
+ $experimental-support-for-svg: true
+ @include background-image(linear-gradient(top, hsla(207,39%,65%,1) 0%,hsla(208,28%,47%,1) 100%))
+
+=label_right_color
+ background-color: #48a6f5
+ @include filter-gradient(#48a6f5, #308ddc, vertical)
$experimental-support-for-svg: true
- @include background-image(linear-gradient(top, hsla(206,42%,64%,1) 0%,hsla(207,34%,55%,1) 100%))
+ @include background-image(linear-gradient(top, hsla(207,90%,62%,1) 0%,hsla(208,71%,53%,1) 100%))
+
+=label
+ +label_basic_color
box-shadow: $label_box_shadow
border-top: #103f68 solid 1px
border-bottom: #103f68 solid 1px
padding: 0 0 0 12px
cursor: pointer
+ display: block
+ font:
+ size: 13px
+ weight: bold
+ text-shadow: $label_text_shadow
&:hover
- background-color: #48a6f5
- @include filter-gradient(#48a6f5, #308ddc, vertical)
- $experimental-support-for-svg: true
- @include background-image(linear-gradient(top, hsla(207,90%,62%,1) 0%,hsla(208,71%,53%,1) 100%))
+ +label_right_color
h2
color: $label_font_color
text-shadow: $label_text_shadow
@@ -50,18 +61,15 @@ $label_box_shadow: rgba(255, 255, 255, .4) 0 0 2px inset
weight: bold
line-height: $label_height
-$blue_button_shadow: rgba(255, 255, 255, .6) 0 0 1px inset, rgba(0, 0, 0, .4) 0 2px 2px
-=blue_button_color
- background-color: #84aac9
- @include filter-gradient(#84aac9, #567a9a, vertical)
- $experimental-support-for-svg: true
- @include background-image(linear-gradient(top, hsla(207,39%,65%,1) 0%,hsla(208,28%,47%,1) 100%))
-
+$blue_button_shadow: rgba(255, 255, 255, .6) 0 0 1px inset, rgba(0, 0, 0, .4) 0 2px 1px
=blue_button
display: block
- +blue_button_color
+ +label_basic_color
+box-shadow($blue_button_shadow)
cursor: pointer
color: $label_font_color
font-weight: bold
- text-shadow: $label_text_shadow
+ text-shadow: $label_text_shadow
+ text-decoration: none
+ &:hover
+ +label_right_color
View
48 app/assets/stylesheets/sass/mixins.css.sass
@@ -1,3 +1,49 @@
=word-break
word-break: break-all
- word-wrap: break-word
+ word-wrap: break-word
+
+=activities
+ width: 300px
+ overflow: visible
+ z-index: 97
+ height: auto
+ position: absolute
+ left: 300px
+ background: rgba(0, 0, 0, .6)
+ border: 10px solid rgba(100, 100, 100, .3)
+ +border-radius(4px)
+ +box-shadow(rgba(0, 0, 0, 1) 0 2px 8px)
+ .add
+ padding: 10px 10px 0 10px
+ ul
+ li
+ +clearfix
+ border-bottom: dotted #333 1px
+ display: block
+ padding: 14px 10px
+ clear: both
+ &:first-child
+ padding: 14px 10px
+ &:last-child
+ border: none
+ .icon
+ float: left
+ padding: 0 8px 0 0
+ a
+ width: 36px
+ height: 36px
+ padding: 3px
+ background: rgba(0, 0, 0, .2)
+ +border-radius(21px)
+ display: block
+ +box-shadow(#495051 0 1px 0)
+ img
+ width: 36px
+ height: auto
+ +border-radius(18px)
+ p
+ font-size: 13px
+ line-height: 1.6
+ display: block
+ float: right
+ width: 220px
View
40 app/assets/stylesheets/sass/parties.css.sass
@@ -176,6 +176,10 @@ body.parties_show
background: $light_bg_color
cursor: pointer
+clearfix
+ .comments
+ a
+ +label
+ float: left
ul
li.task
p
@@ -223,8 +227,7 @@ body.parties_show
float: left
line-height: 22px
padding: 0 10px
- font-weight: bold
- text-decoration: none
+ +box-shadow(rgba(255, 255, 255, .6) 0 0 1px inset, rgba(0, 0, 0, .2) 0 1px 1px)
.hold
a
+border-radius(4px 0 0 4px)
@@ -234,6 +237,8 @@ body.parties_show
+border-radius(0 4px 4px 0)
border-left: $label_text_shadow 1px solid
+ .activities
+ +activities
.comments
clear: both
+clearfix
@@ -268,13 +273,15 @@ body.parties_show
font-size: 13px
line-height: 1.6
+>>>>>>> 3a87896a141829a5ffa448b42fb14071609b7eec
.backlog
clear: both
+clearfix
.label
+label
.add
padding: 10px 10px 10px 10px
+ background: #141f35
+clearfix
a
display: block
@@ -290,11 +297,27 @@ body.parties_show
form.new_task
clear: both
textarea
- width: 100%
+ width: 100% !important
padding: 0
+border-radius(4px)
- font-size: 14px
- margin: 10px 0 0 0
+ background: $light_bg_color
+ font-size: 13px
+ margin: 0 0 10px 0
+ input
+ +label
+ text:
+ align: center
+ width: 80px
+ line-height: 28px
+ margin: 0 auto
+ padding: 0
+ border: none
+ +border-radius(4px)
+ .activities
+ .activity
+ clear: both
+ padding: 0 0 14px 0
+ +clearfix
.close
display: none
ul
@@ -365,6 +388,9 @@ body.parties_show
p
font-size: 13px
line-height: 1.6
+ .comments
+ a
+ +label
.done
clear: both
+clearfix
@@ -421,4 +447,6 @@ body.parties_show
.redo
a
display: block
- float: left
+ float: left
+ .activities
+ +activities
View
9 app/views/parties/show.html.haml
@@ -75,13 +75,20 @@
- else
%li.empty
未選択
+ .comments
+ %a
+ aaaa
.backlog
.label
%h2 Backlog
- if user_signed_in? && current_user == member
.add
= form_for [@party, member.tasks.build], :remote => true do |f|
- = f.text_area :content, :rows => 3, :cols => 30
+ :javascript
+ $(document).ready(function(){
+ $("#task_content").autoGrow();
+ });
+ = f.text_area :content, :rows => 7, :cols => 29
= f.submit
%ul.tasks
= render member.tasks.backlog(@party.id)
View
10 app/views/tasks/_task.html.haml
@@ -1,4 +1,13 @@
= content_tag_for :li, task, :class => "task" do
+ .activities
+ %ul
+ = render task.activities
+ - if user_signed_in?
+ .add
+ = form_tag "/activities", :remote => true do
+ = hidden_field_tag :task_id, task.id
+ = text_area_tag :content, nil, :rows => 3, :cols => 15, :id => "new_activity_#{dom_id(task)}"
+ = submit_tag "new activity"
%p
= nl2br task.content
.helpme
@@ -38,3 +47,4 @@
.comments
%ul
= render task.comments
+>>>>>>> 3a87896a141829a5ffa448b42fb14071609b7eec

0 comments on commit 80129e4

Please sign in to comment.
Something went wrong with that request. Please try again.