Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fullscreen view to group overview page #1435

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions assets/assetpack.def
Expand Up @@ -52,6 +52,7 @@
< javascripts/comments.js
< javascripts/keyevent.js
< javascripts/feature.js
< javascripts/fullscreen.js
< https://raw.githubusercontent.com/vsn4ik/bootstrap-submenu/v2.0.4/dist/js/bootstrap-submenu.js
< https://raw.githubusercontent.com/twbs/bootstrap-sass/5d6b2ebba0c2a5885ce2f0e01e9218db3d3b5e47/assets/javascripts/bootstrap/collapse.js
< https://raw.githubusercontent.com/twbs/bootstrap-sass/5d6b2ebba0c2a5885ce2f0e01e9218db3d3b5e47/assets/javascripts/bootstrap/tooltip.js
Expand Down
27 changes: 27 additions & 0 deletions assets/javascripts/fullscreen.js
@@ -0,0 +1,27 @@
function hideNavbar(fullscreen) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since i'm using this function related to fullscreen on more than one place, i thought it would be better to make a seperate file for it


var mouseY = 0;
var navbarHeight = $(".navbar").outerHeight();
navbarHeight -= 30;

if (($('#filter-fullscreen').is(':checked')) || (fullscreen == 1)) {
$("#content").attr('id', 'content_fullscreen');
$(".navbar").addClass('hidden');
$(".footer").addClass('hidden');
$(".jumbotron").addClass('hidden');
if (fullscreen == 1) {
$("#group_description").addClass('hidden');
}
document.addEventListener('mousemove', function(e){
mouseY = e.clientY || e.pageY;
if (mouseY < navbarHeight) {
$(".navbar").removeClass('hidden').addClass('show');
}
else if (mouseY > navbarHeight) {
if (!$("li").hasClass('dropdown open')) {
$(".navbar").removeClass('show').addClass('hidden');
}
}
}, false);
}
};
25 changes: 0 additions & 25 deletions assets/javascripts/index.js
Expand Up @@ -37,28 +37,3 @@ function setupIndexPage() {
}
});
}

function hideNavbar() {

var mouseY = 0;
var navbarHeight = $(".navbar").outerHeight();
navbarHeight -= 30;

if ($('#filter-fullscreen').is(':checked')) {
$("#content").attr('id', 'content_fullscreen');
$(".navbar").addClass('hidden');
$(".footer").addClass('hidden');
$(".jumbotron").addClass('hidden');
document.addEventListener('mousemove', function(e){
mouseY = e.clientY || e.pageY;
if (mouseY < navbarHeight) {
$(".navbar").removeClass('hidden').addClass('show');
}
else if (mouseY > navbarHeight) {
if (!$("li").hasClass('dropdown open')) {
$(".navbar").removeClass('show').addClass('hidden');
}
}
}, false);
}
};
1 change: 1 addition & 0 deletions lib/OpenQA/WebAPI/Controller/Main.pm
Expand Up @@ -89,6 +89,7 @@ sub group_overview {
my $only_tagged = $self->param('only_tagged') // 0;
my $group = $self->db->resultset($resultset)->find($self->param('groupid'));
return $self->reply->not_found unless $group;
$self->stash('fullscreen', $self->param('fullscreen') // 0);

my @comments;
my @pinned_comments;
Expand Down
1 change: 1 addition & 0 deletions templates/main/group_overview.html.ep
Expand Up @@ -5,6 +5,7 @@

% content_for 'ready_function' => begin
$('.timeago').timeago();
hideNavbar(<%= $fullscreen %>);
% end

% if (is_admin) {
Expand Down
9 changes: 9 additions & 0 deletions templates/main/more_builds.html.ep
Expand Up @@ -7,3 +7,12 @@
% my $selected = $rtagged{$only_tagged};
%= b join(' / ', map { $_ eq $selected ? "<b>$_</b>" : link_to($_ => url_with->query([only_tagged => $tagged{$_}])) } reverse sort keys %tagged);
</div>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@okurz after you pointed out the "limit to" section, i made the full screen mode part of it
screenshot_2017-08-21_14-41-18

<div id="mode_section">
Set mode to
% if ($fullscreen == 0) {
<%= link_to url_for->query(fullscreen => 1)->to_abs => begin %>full screen<% end %>
% } else {
<%= link_to url_for->query(fullscreen => 0)->to_abs => begin %>default view<% end %>
% }
</div>