save created relationships; fix relative paths in css
Tara L Andrews [Mon, 20 Feb 2012 12:55:23 +0000 (13:55 +0100)]
stemmaweb/lib/stemmaweb/Controller/Relation.pm
stemmaweb/root/css/relationship.css

index 00c97eb..690f44e 100644 (file)
@@ -91,6 +91,7 @@ sub relationships :Chained('text') :PathPart :Args(0) {
        my( $self, $c ) = @_;
        my $tradition = delete $c->stash->{'tradition'};
        my $collation = $tradition->collation;
+       my $m = $c->model('Directory');
        if( $c->request->method eq 'GET' ) {
                my @pairs = $collation->relationships; # returns the edges
                my @all_relations;
@@ -114,6 +115,7 @@ sub relationships :Chained('text') :PathPart :Args(0) {
                try {
                        my @vectors = $collation->add_relationship( $node, $target, $opts );
                        $c->stash->{'result'} = \@vectors;
+                       $m->save( $tradition );
                } catch( Text::Tradition::Error $e ) {
                        $c->response->status( '403' );
                        $c->stash->{'result'} = { 'error' => $e->message };
@@ -124,6 +126,7 @@ sub relationships :Chained('text') :PathPart :Args(0) {
        
                try {
                        my @vectors = $collation->del_relationship( $node, $target );
+                       $m->save( $tradition );
                        $c->stash->{'result'} = \@vectors;
                } catch( Text::Tradition::Error $e ) {
                        $c->response->status( '403' );
index a260414..c0d1d8b 100644 (file)
@@ -68,7 +68,7 @@ span.apimore {
 #dialog_overlay {
     display: none;
     position: absolute;
-    background-image: url("/css/cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png");
+    background-image: url("cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png");
     background-repeat: repeat;
     background-attachment: scroll;
     background-position: 50% 50%;
@@ -86,7 +86,7 @@ span.apimore {
     width: 46px;
     margin-top: 17px;
     border: none;
-    background-image: url('/images/act_icons.png');
+    background-image: url('../images/act_icons.png');
     background-position: 0px 44px;
     background-color: none;
     background-repeat: none;
@@ -143,7 +143,7 @@ span.apimore {
     top: 140px;
     border: 2px solid #B0C6F7;
     background: #fff;
-    background: url("/css/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png");
+    background: url("cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png");
     background-repeat: repeat-x;
     background-scroll: scroll;
     background-position: 50% top;