Skip to content

Commit

Permalink
Changes #591: view image, dashboard charts height changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lmarikannan committed Apr 26, 2016
1 parent 2282955 commit 3a7cc18
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Options -Indexes
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^client/img/([a-zA-Z_]*)/([a-zA-Z_]*)/([a-zA-Z0-9_\.]*)$ server/php/image.php?size=$1&model=$2&filename=$3 [L]
RewriteRule ^ical/([0-9]*)/([a-zA-Z0-9]*).ics$ server/php/ical.php?id=$1&hash=$2 [L]
RewriteRule ^download/([0-9]*)/([a-zA-Z0-9_\.]*)$ server/php/download.php?id=$1&hash=$2 [L]
RewriteRule ^download/([0-9]*)/([a-zA-Z0-9_\.]*)$ server/php/download.php?id=$1&hash=$2 [QSA,L]
RewriteRule ^oauth_callback/([a-zA-Z0-9_\.]*)/([a-zA-Z0-9_\.]*)$ server/php/oauth_callback.php?plugin=$1&code=$2 [L]
RewriteRule ^oauth/authorize$ server/php/authorize.php [QSA,L]
RewriteRule ^api/(.*)$ server/php/R/r.php?_url=$1 [QSA,L]
Expand Down
2 changes: 1 addition & 1 deletion api_explorer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
if (url && url.length > 1) {
url = decodeURIComponent(url[1]);
} else {
url = "/api_explorer/api.json";
url = "/api_explorer/swagger.json";
}
window.swaggerUi = new SwaggerUi({
url: url,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion client/js/templates/attachment.jst.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% if(attachment != null){ %>
<a target="_blank" href="<%= attachment.downloadLink('download', attachment.get('id')) %>" class="pull-left navbar-btn img-thumbnail thumb-img">
<a target="_blank" href="<%= attachment.downloadLink('download', attachment.get('id')) %>?view" class="pull-left navbar-btn img-thumbnail thumb-img">
<% if(attachment.get("name").match(/\.(jpg|jpeg|png|gif)$/)){
var picture_path = attachment.showImage('CardAttachment', attachment.attributes.id, 'large_thumb' );
%>
Expand Down
2 changes: 1 addition & 1 deletion client/js/templates/card_attachment.jst.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% if(_.isEmpty(attachment.attributes.link) && !_.isEmpty(attachment.attributes.name)){ %>
<a target="_blank" href="<%= attachment.downloadLink('download', attachment.attributes.id) %>" class="pull-left navbar-btn img-thumbnail">
<a target="_blank" href="<%= attachment.downloadLink('download', attachment.attributes.id) %>?view" class="pull-left navbar-btn img-thumbnail">
<% if(attachment.attributes.name.toLowerCase().match(/\.(jpg|jpeg|png|gif)$/)){
var picture_path = attachment.showImage('CardAttachment', attachment.attributes.id, 'large_thumb' );
%>
Expand Down
40 changes: 20 additions & 20 deletions client/js/templates/user_dashboard.jst.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@
</div>
</div>
<div class="col-sm-9 clearfix">
<div class="col-sm-4 col-xs-12 sep-right">
<div class="col-xs-12">
<div class="pull-left">
<h4 class="list-group-item-heading"><%- i18next.t('Today') %></h4>
<div class="col-sm-4 col-xs-12">
<div class="col-xs-12 thumbnail">
<div class="pull-left col-xs-4">
<h4><%- i18next.t('Today') %></h4>
<div class="thumbnail text-center navbar-btn">
<div class="sep-bot">
<div class="bg-default h6 text-muted"><%- current_month %></div>
<div class="h3"><%- d.getDate() %></div>
<div class="bg-default h6 text-muted list-group-item-heading"><%- current_month %></div>
<div class="h3 list-group-item-heading"><%- d.getDate() %></div>
</div>
<div><%- today %></div>
</div>
Expand All @@ -95,23 +95,23 @@
</ul>
</div>
</div>
<div class="col-sm-4 col-xs-12 sep-right">
<div class="col-xs-12">
<div class="pull-left">
<h4 class="list-group-item-heading"><%- i18next.t('Week') %> </h4>
<ul class="list-inline week-chart-date">
<li class="thumbnail text-center navbar-btn">
<div class="col-sm-4 col-xs-12">
<div class="col-xs-12 thumbnail">
<div class="pull-left col-xs-4">
<h4><%- i18next.t('Week') %> </h4>
<ul class="list-inline week-chart-date navbar-btn">
<li class="thumbnail text-center navbar-btn col-xs-4">
<div class="sep-bot">
<div class="bg-default h6 text-muted"><%- data.dashboard.week_start_month %></div>
<div class="h3"><%- data.dashboard.week_start_day %></div>
<div class="bg-default h6 text-muted list-group-item-heading "><%- data.dashboard.week_start_month %></div>
<div class="h3 list-group-item-heading "><%- data.dashboard.week_start_day %></div>
</div>
<div><%- i18next.t('Mon') %></div>
</li>
<li> <%- i18next.t('to') %> </li>
<li class="thumbnail text-center navbar-btn">
<li class="thumbnail text-center navbar-btn col-xs-4">
<div class="sep-bot">
<div class="bg-default h6 text-muted"><%- data.dashboard.week_end_month %></div>
<div class="h3"><%- data.dashboard.week_end_day %></div>
<div class="bg-default h6 text-muted list-group-item-heading "><%- data.dashboard.week_end_month %></div>
<div class="h3 list-group-item-heading "><%- data.dashboard.week_end_day %></div>
</div>
<div><%- i18next.t('Sun') %></div>
</li>
Expand All @@ -127,9 +127,9 @@
</div>
</div>
<div class="col-sm-4 col-xs-12">
<div class="col-xs-12">
<div class="pull-left">
<h4 class="list-group-item-heading"><%- i18next.t('Overall') %> </h4>
<div class="col-xs-12 thumbnail">
<div class="pull-left col-xs-4">
<h4><%- i18next.t('Overall') %> </h4>
</div>
<ul class="list-unstyled chart-block list-group-item-text pull-right">
<li class="list-group-item clearfix no-bor">
Expand Down
11 changes: 5 additions & 6 deletions client/js/views/application_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -745,21 +745,21 @@ App.ApplicationView = Backbone.View.extend({
fillColor: false,
lineColor: '#65cca9',
width: '750',
height: '200'
height: '100'
});
$(this).sparkline($(this).data('doing').split(','), {
composite: true,
fillColor: false,
lineColor: '#eca186',
width: '400',
height: '150'
width: '750',
height: '100'
});
$(this).sparkline($(this).data('done').split(','), {
composite: true,
fillColor: false,
lineColor: '#fee3e0',
width: '400',
height: '150'
width: '750',
height: '100'
});
});

Expand All @@ -769,7 +769,6 @@ App.ApplicationView = Backbone.View.extend({
var _data = {};
_data.title = index.toUpperCase();
_data.value = parseInt(value);

if (_data.title == 'TODO') {
_data.color = '#65cca9';
} else if (_data.title == 'DOING') {
Expand Down
27 changes: 18 additions & 9 deletions server/php/download.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,24 @@
$add_slash = addcslashes($basename, '"\\');
$quoted = sprintf('"%s"', $add_slash);
$size = filesize($file);
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' . $quoted);
header('Content-Transfer-Encoding: binary');
header('Connection: Keep-Alive');
header('Content-length: ' . $size);
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
if(isset($_GET['view'])) {
$path_info = pathinfo($file);
if($path_info['extension'] == 'jpg') {
header('Content-Type: image/jpeg');
} else {
header('Content-Type: image/'.$path_info['extension']);
}
} else {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' . $quoted);
header('Content-Transfer-Encoding: binary');
header('Connection: Keep-Alive');
header('Content-length: ' . $size);
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
}
readfile($file);
exit;
}
Expand Down

0 comments on commit 3a7cc18

Please sign in to comment.