Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

small bugfixes

  • Loading branch information...
commit 766c38b7a7b203268661df4c2adc5abac69115ad 1 parent 9af9380
Abigail Cabunoc authored
View
2  lib/WormBase/Web/Controller/REST.pm
@@ -1106,7 +1106,7 @@ sub comment_rss {
my $time = ago((time() - $_->submit_time), 1);
push @rss, { time=>$_->submit_time,
time_lapse=>$time,
- people=>$_->reporter_id,
+ people=>$_->reporter,
page=>$_->page,
content=>$_->content,
id=>$_->id,
View
8 root/js/layout.js
@@ -142,7 +142,7 @@
$jq("#widget-holder").children().children("li").removeClass("visible");
columns(leftWidth, (100-leftWidth), 1);
- for(widget in leftList){
+ for(var widget = 0; widget < leftList.length; widget++){
var widget_name = leftList[widget];
if(widget_name.length > 0){
var nav = $jq("#nav-" + widget_name);
@@ -150,7 +150,7 @@
openWidget(widget_name, nav, content, ".left");
}
}
- for(widget in rightList){
+ for(var widget = 0; widget < rightList.length; widget++){
var widget_name = rightList[widget];
if(widget_name.length > 0){
var nav = $jq("#nav-" + widget_name);
@@ -158,7 +158,9 @@
openWidget(widget_name, nav, content, ".right");
}
}
- updateLayout();
+ if(location.hash.length > 0){
+ updateLayout();
+ }
}
View
28 root/templates/config/main
@@ -29,21 +29,20 @@
# Link a hash of objects
# Suitable for hashes of objects created by _pack_objects()
- MACRO link_objects(data,separator) BLOCK;
- IF separator == ''; separator = '<br />'; END;
+ MACRO link_objects(data) BLOCK;
# Is this a hash?
IF data.keys;
result = [];
FOREACH key IN data.sort;
result.push(tag2link(data.$key));
END;
- result.join(separator);
+ result.join('<br />');
# An array (or possibly even a scalar: TT seems to treat single element arrays as scalars?)
ELSE;
FOREACH item IN data;
result.push(tag2link(item));
END;
- result.join(seperator);
+ result.join('<br />');
END;
END;
@@ -64,30 +63,13 @@
c.uri_for('/species', taxonomy,class, id);
ELSIF (class == 'bench');
c.uri_for('/me', id);
- # ELSIF (class == 'picture');
- # c.uri_for('/rest', 'widget', 'picture', id, 'lightbox');
+ ELSIF (class == 'picture');
+ c.uri_for('/rest', 'widget', 'picture', id, 'lightbox');
ELSE;
c.uri_for('/resources', class, id);
END;
END;
-
- MACRO get_layout(page_class) BLOCK;
- '<script>';
-
- 'if(location.hash.length > 0){';
- 'readHash();';
- '}else{';
- IF c.user_session.layout.$page_class.0.defined;
- 'location.hash = "' + c.user_session.layout.$page_class.0.lstring + '";';
- 'readHash();';
- END;
- '}';
-
-
- '</script>';
- END;
-
# Like tag2link, but for cases where we only have text and no object.
# You must provide both the id and text.
# URLs
View
3  root/templates/index.tt2
@@ -38,10 +38,11 @@
[% PROCESS "shared/sidebar_structure.tt2" widgets=widgets no_layout=1%]
<script>
-
+ 'if(location.hash.length == 0){';
[% UNLESS c.user_session.layout.$class.defined %]
var leftList = ["news", "discussion"];
var rightList = ["activity"];
resetLayout(leftList, rightList, 60);
[% END %]
+ '}';
</script>
View
7 root/templates/shared/page_elements.tt2
@@ -1328,11 +1328,12 @@ END;
# Open some sections by default, depending on what we are displaying.
'<script>';
+ 'if(location.hash.length == 0){';
UNLESS c.user_session.layout.$page_class.0.defined;
IF is_class_index;
- defaults = section_fetch.default_widgets_summary.keys;
+ defaults = section_fetch.default_widgets_summary.keys;
ELSE;
- defaults = section_fetch.default_widgets.keys;
+ defaults = section_fetch.default_widgets.keys;
END;
FOREACH defaults.grep('^overview$');
defaults.unshift('overview');
@@ -1351,7 +1352,7 @@ END;
END;
'updateLayout();';
END;
- 'updateCounts("' _ c.req.base _ c.req.path _ '");';
+ '}';
'</script>';
END;
View
25 root/templates/shared/sidebar_structure.tt2
@@ -14,6 +14,12 @@
[%# type = "title" %]
[%# } %]
+[% UNLESS object %]
+ [% page_class = c.req.path.replace('[/_]', '-') %]
+ [% UNLESS page_class;page_class='home'; END;%]
+[% ELSE; page_class = class; END; %]
+
+
[% UNLESS c.req.action == 'me' %]
[% widgets.push({ title="My WormBase" type="title"}) %]
[% FOREACH widget_name IN ['reports', 'my_library'] -%]
@@ -26,16 +32,13 @@
%]
[% widgets.push(w) %]
[% END %]
- [% END %]
+[% END %]
[% UNLESS no_layout %]
<div id="buttons-nav">
[% UNLESS c.req.action == 'me' %]
<a tip="report a problem" class="button section-button tip-simple ui-corner-all" name="issue" ><span class="ui-icon ui-icon-notice"></span></a>
<a tip="view comments" class="button section-button tip-simple ui-corner-all" name="comment" ><span class="ui-icon ui-icon-comment"></span></a>
- <!-- TH: quick test of drawing help text from wiki -->
- <a tip="page help" class="button section-button tip-simple ui-corner-all" name="help" href="Website:Help:[%- section -%]_Summary"><span class="ui-icon ui-icon-help"></span></a>
-
<a tip="toggle empty fields" class="button tip-simple ui-corner-all" id="hide-empty-fields" href="javascript:void(0)"><span class="ui-icon ui-icon-carat-2-e-w ui-button"></span></a>
[% END %]
@@ -152,7 +155,7 @@
<script>
ajaxGet($jq(".user-history"), "/rest/history?count=3");
- ajaxGet($jq(".list-layouts"), "/rest/layout_list/" + $jq(".list-layouts").attr("type"));
+ [% UNLESS no_layout %] ajaxGet($jq(".list-layouts"), "/rest/layout_list/" + $jq(".list-layouts").attr("type")); [% END %]
[% PROCESS page_info %]
[% lclass = object.name.data.class FILTER lcfirst %]
@@ -162,6 +165,14 @@
$jq(".workbench-status-[% wbid %]").load("/rest/workbench/star?wbid=[% wbid %]&name=[% label | uri %]&class=[% object.name.data.class FILTER lower %]&type=[% c.stash.section | uri %]&id=[% object.name.data.id | uri %]&url=[% url | uri %]&save_to=[% save %]&is_obj=[% is_obj %]");
- [% get_layout($page_class) %]
-
+ if(location.hash.length > 0){
+ readHash();
+ }else{
+ [% IF c.user_session.layout.$page_class.0.defined; %]
+ location.hash = "[% c.user_session.layout.$page_class.0.lstring %]";
+ readHash();
+ [% END %]
+ }
+
+ updateCounts("[% c.req.base _ c.req.path%]");
</script>
Please sign in to comment.
Something went wrong with that request. Please try again.