Skip to content
Extraits de code Groupes Projets
Valider 136eb61b rédigé par Daniel Vincent Grippi's avatar Daniel Vincent Grippi
Parcourir les fichiers

DG IZ; groups = relations. now you can rename groups in the manage relation page

parent f70ade67
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -2,15 +2,18 @@ ...@@ -2,15 +2,18 @@
= javascript_include_tag 'jquery-ui-1.8.4.custom.min.js' = javascript_include_tag 'jquery-ui-1.8.4.custom.min.js'
= javascript_include_tag 'group-edit.js' = javascript_include_tag 'group-edit.js'
- content_for :left_pane do
requests
%h1{:class => 'big_text', :id => 'group_title'} %h1{:class => 'big_text', :id => 'group_title'}
= "Editing Groups" = "Managing Relations"
%ul#group_list %ul#group_list
- for group in @groups - for group in @groups
%li.group %li.group
%h3= group.name %h3{:contenteditable => true}= group.name
%ul{:id => group.id} %ul{:id => group.id}
-if group.people.size < 1 -if group.people.size < 1
...@@ -20,8 +23,9 @@ ...@@ -20,8 +23,9 @@
-for person in group.people -for person in group.people
%li.person{:id => person.id, :from_group_id => group.id} %li.person{:id => person.id, :from_group_id => group.id}
= image_tag(person.profile.image_url(:thumb_small),:size => "30x30") unless person.profile.image_url.nil? = image_tag(person.profile.image_url(:thumb_small)) unless person.profile.image_url.nil?
= person.real_name .name
= person.real_name
%p %p
%br %br
= link_to 'Update Groups', '#', :class => 'button', :id => "move_friends_link" = link_to 'Update Groups', '#', :class => 'button', :id => "move_friends_link"
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
.span-5.last .span-5.last
- if @group == :all - if @group == :all
%h1 %h1
= link_to "All Groups", root_path = link_to "All Relations", root_path
- else - else
%h1 %h1
= link_to @group.name, @group = link_to @group.name, @group
...@@ -73,7 +73,6 @@ ...@@ -73,7 +73,6 @@
.container .container
.span-5.last .span-5.last
= yield :left_pane = yield :left_pane
.span-19.last .span-19.last
......
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
%li.new_group= link_to("+", "#add_group_pane", :id => "add_group_button") %li.new_group= link_to("+", "#add_group_pane", :id => "add_group_button")
#group_edit_button #group_manage_button
= link_to "edit", edit_group_path(Group.first), :class => "edit_group_button", :title => "Manage your facets." = link_to "manage", edit_group_path(Group.first), :class => "edit_group_button", :title => "Manage your facets."
%ul{ :style => "position:absolute;right:0;bottom:0;"} %ul{ :style => "position:absolute;right:0;bottom:0;"}
%li{:class => ("selected" if @group == :all)} %li{:class => ("selected" if @group == :all)}
= link_to "All Groups", root_url = link_to "All Relations", root_url
.yo{ :style => "display:none;"} .yo{ :style => "display:none;"}
#add_group_pane #add_group_pane
......
...@@ -24,8 +24,35 @@ $(document).ready(function(){ ...@@ -24,8 +24,35 @@ $(document).ready(function(){
$(".image_cycle img").load( function() { $(".image_cycle img").load( function() {
$(this).fadeIn("slow"); $(this).fadeIn("slow");
}); });
});//end document ready });//end document ready
$(".group h3").live( 'click', function() {
var $this = $(this);
var id = $this.closest("li").children("ul").attr("id");
var link = "/groups/"+ id;
$this.keypress(function(e) {
if (e.which == 13) {
e.preventDefault();
$this.blur();
//save changes
$.ajax({
type: "PUT",
url: link,
data: {"group" : {"name" : $this.text() }}
});
}
//update all other group links
$this.keyup(function(e) {
$("a[href='"+link+"']").text($this.text());
});
});
});
function pane_toggler_button( name ) { function pane_toggler_button( name ) {
$("#add_" + name + "_button").toggle( $("#add_" + name + "_button").toggle(
......
...@@ -453,11 +453,11 @@ h1.big_text { ...@@ -453,11 +453,11 @@ h1.big_text {
#group_nav { #group_nav {
position: relative; position: relative;
color: black; } color: black; }
#group_nav #group_edit_button { #group_nav #group_manage_button {
display: inline; display: inline;
margin-top: 1px; margin-top: 1px;
font-size: 12px; } font-size: 12px; }
#group_nav #group_edit_button a { #group_nav #group_manage_button a {
color: #999999; } color: #999999; }
#group_nav ul { #group_nav ul {
margin-bottom: 0; margin-bottom: 0;
...@@ -588,6 +588,8 @@ h1.big_text { ...@@ -588,6 +588,8 @@ h1.big_text {
.group { .group {
list-style: none; } list-style: none; }
.group h3 {
display: inline-block; }
.group ul { .group ul {
min-height: 20px; min-height: 20px;
margin: 0; margin: 0;
...@@ -598,11 +600,22 @@ h1.big_text { ...@@ -598,11 +600,22 @@ h1.big_text {
border-radius: 3px; border-radius: 3px;
list-style: none; list-style: none;
padding: 15px; } padding: 15px; }
.group ul li { .group ul li.person {
display: inline-block;
margin-left: 0; margin-left: 0;
padding: 5px; padding: 5px;
cursor: move; } cursor: move;
.group ul li img { margin: 5px;
background-color: #cccccc;
-webkit-border-radius: 3px;
text-align: center;
width: 75px;
height: 75px;
padding: 5px;
border: 1px solid #999999; }
.group ul li.person img {
height: 50px;
width: 50px;
display: inline-block; } display: inline-block; }
.group ul .grey { .group ul .grey {
font-style: italic; font-style: italic;
......
...@@ -579,7 +579,7 @@ h1.big_text ...@@ -579,7 +579,7 @@ h1.big_text
:color #000 :color #000
#group_edit_button #group_manage_button
:display inline :display inline
:margin :margin
:top 1px :top 1px
...@@ -770,6 +770,10 @@ h1.big_text ...@@ -770,6 +770,10 @@ h1.big_text
.group .group
:list :list
:style none :style none
h3
:display inline-block
ul ul
:min-height 20px :min-height 20px
:margin 0 :margin 0
...@@ -784,15 +788,33 @@ h1.big_text ...@@ -784,15 +788,33 @@ h1.big_text
:style none :style none
:padding 15px :padding 15px
li li.person
:display inline-block
:margin :margin
:left 0 :left 0
:padding 5px :padding 5px
:cursor move :cursor move
:margin 5px
:background
:color #ccc
:-webkit-border-radius 3px
:text
:align center
:width 75px
:height 75px
:padding 5px
:border 1px solid #999
img img
:height 50px
:width 50px
:display inline-block :display inline-block
.grey .grey
:font :font
:style italic :style italic
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter