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

Mobile improvements #1516

Merged
merged 5 commits into from
Jul 2, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions app/static/app/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ html, body, section.main, .content, #wrapper, #page-wrapper{
}
[data-mapview], .model-view{
height: calc(100vh);
height: calc(100dvh);
}
}

Expand Down Expand Up @@ -110,13 +111,15 @@ ul#side-menu.nav{
}

.content{
clear: both;
padding-top: 8px;

h1,h2,h3,h4,h5{
padding-top: 4px;
margin-top: 0;
}
h3{
font-size: 24px;
}
}

.top-buffer {
Expand Down Expand Up @@ -147,6 +150,7 @@ ul#side-menu.nav{

.modal-body {
max-height: calc(100vh - 220px);
max-height: calc(100dvh - 220px);
overflow-y: auto;
}

Expand Down Expand Up @@ -216,7 +220,7 @@ button i.glyphicon{
float: right;
margin-right: 15px;
padding: 9px 10px;
margin-top: 5px;
margin-top: 7px;
margin-bottom: 5px;
}

Expand Down Expand Up @@ -263,9 +267,16 @@ footer{

.full-height{
height: calc(100vh - 110px);
height: calc(100dvh - 110px);
padding-bottom: 12px;
}

.floatfix{
clear: both;
}

.model-title{
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
25 changes: 14 additions & 11 deletions app/static/app/js/MapView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,21 @@ class MapView extends React.Component {
if (mapTypeButtons.length === 1) mapTypeButtons = [];

return (<div className="map-view">
<div className="map-type-selector btn-group" role="group">
{mapTypeButtons.map(mapType =>
<button
key={mapType.type}
onClick={this.handleMapTypeButton(mapType.type)}
className={"btn btn-sm " + (mapType.type === this.state.selectedMapType ? "btn-primary" : "btn-default")}><i className={mapType.icon}></i> {mapType.label}</button>
)}
<div className="map-view-header">
{this.props.title ?
<h3 className="map-title" title={this.props.title}><i className="fa fa-globe"></i> {this.props.title}</h3>
: ""}

<div className="map-type-selector btn-group" role="group">
{mapTypeButtons.map(mapType =>
<button
key={mapType.type}
onClick={this.handleMapTypeButton(mapType.type)}
title={mapType.label}
className={"btn btn-sm " + (mapType.type === this.state.selectedMapType ? "btn-primary" : "btn-default")}><i className={mapType.icon}></i><span className="hidden-sm hidden-xs"> {mapType.label}</span></button>
)}
</div>
</div>

{this.props.title ?
<h3><i className="fa fa-globe"></i> {this.props.title}</h3>
: ""}

<div className="map-container">
<Map
Expand Down
2 changes: 1 addition & 1 deletion app/static/app/js/components/AssetDownloadButtons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class AssetDownloadButtons extends React.Component {
: ""}

<button type="button" className={"btn btn-sm " + this.props.buttonClass} disabled={this.props.disabled} data-toggle="dropdown">
<i className="glyphicon glyphicon-download"></i>{this.props.showLabel ? " " + _("Download Assets") : ""}
<i className="glyphicon glyphicon-download"></i><span className="hidden-xs hidden-sm">{this.props.showLabel ? " " + _("Download Assets") : ""}</span>
</button>
{this.props.showLabel ?
<button type="button" className={"btn btn-sm dropdown-toggle " + this.props.buttonClass} data-toggle="dropdown" disabled={this.props.disabled}>
Expand Down
2 changes: 1 addition & 1 deletion app/static/app/js/components/EditProjectDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class EditProjectDialog extends React.Component {
getFormData={this.getFormData}
reset={this.reset}
onShow={this.onShow}
leftButtons={this.props.showDuplicate ? [<button key="duplicate" disabled={this.duplicating} onClick={this.handleDuplicate} className="btn btn-default"><i className={"fa " + (this.state.duplicating ? "fa-circle-notch fa-spin fa-fw" : "fa-copy")}></i> Duplicate</button>] : undefined}
leftButtons={this.props.showDuplicate ? [<button key="duplicate" disabled={this.duplicating} onClick={this.handleDuplicate} className="btn btn-default"><i className={"fa " + (this.state.duplicating ? "fa-circle-notch fa-spin fa-fw" : "fa-copy")}></i><span className="hidden-xs"> {_("Duplicate")}</span></button>] : undefined}
ref={(domNode) => { this.dialog = domNode; }}>
<ErrorMessage bind={[this, "error"]} />
<div className="form-group edit-project-dialog">
Expand Down
4 changes: 2 additions & 2 deletions app/static/app/js/components/FormDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ class FormDialog extends React.Component {
onClick={this.handleDelete}>
{this.state.deleting ?
<span>
<i className="fa fa-circle-notch fa-spin"></i> {_("Deleting...")}
<i className="fa fa-circle-notch fa-spin"></i><span className="hidden-xs"> {_("Deleting...")}</span>
</span>
: <span>
<i className="fa fa-trash"></i> {_("Delete")}
<i className="fa fa-trash"></i><span className="hidden-xs"> {_("Delete")}</span>
</span>}
</button>);
}
Expand Down
4 changes: 2 additions & 2 deletions app/static/app/js/components/ProjectListItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -638,12 +638,12 @@ class ProjectListItem extends React.Component {
onClick={this.handleUpload}
ref={this.setRef("uploadButton")}>
<i className="glyphicon glyphicon-upload"></i>
{_("Select Images and GCP")}
<span className="hidden-xs">{_("Select Images and GCP")}</span>
</button>
<button type="button"
className="btn btn-default btn-sm"
onClick={this.handleImportTask}>
<i className="glyphicon glyphicon-import"></i> {_("Import")}
<i className="glyphicon glyphicon-import"></i> <span className="hidden-xs">{_("Import")}</span>
</button>
{this.state.buttons.map((button, i) => <React.Fragment key={i}>{button}</React.Fragment>)}
</div>
Expand Down
26 changes: 6 additions & 20 deletions app/static/app/js/components/TaskListItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ class TaskListItem extends React.Component {

let buttonHtml = (<button type="button" className={"btn btn-sm " + button.className} onClick={button.onClick} disabled={disabled}>
<i className={button.icon}></i>
{button.label}
<span className="hidden-xs">{button.label}</span>
</button>);
if (subItems.length > 0){
// The button expands sub items
Expand Down Expand Up @@ -654,7 +654,7 @@ class TaskListItem extends React.Component {
return (<div
className={"status-label theme-border-primary " + type}
style={{background: `linear-gradient(90deg, ${color} ${progress}%, rgba(255, 255, 255, 0) ${progress}%)`}}
title={text}><i className={statusIcon}></i> {text}</div>);
title={text}><i className={statusIcon}></i><span> {text}</span></div>);
}

let statusLabel = "";
Expand Down Expand Up @@ -739,36 +739,22 @@ class TaskListItem extends React.Component {
/>
: ""}
<div className="row">
<div className="col-sm-5 col-xs-12 name">
<div className="col-xs-7 col-sm-6 col-md-5 name">
<i onClick={this.toggleExpanded} className={"clickable far " + (this.state.expanded ? "fa-minus-square" : " fa-plus-square")}></i> <a href="javascript:void(0);" onClick={this.toggleExpanded} className="name-link">{name}</a>
{userTags.length > 0 ?
userTags.map((t, i) => <div key={i} className="tag-badge small-badge" onClick={this.handleTagClick(t)}>{t}</div>)
: ""}
</div>
<div className="col-sm-1 col-xs-5 details">
<div className="col-md-1 hidden-xs hidden-sm details">
<i className="far fa-image"></i> {task.images_count}
</div>
<div className="col-sm-2 col-xs-5 details">
<div className="col-md-2 hidden-xs hidden-sm details">
<i className="far fa-clock"></i> {this.hoursMinutesSecs(this.state.time)}
</div>
<div className="col-xs-2 text-right visible-xs-block">
{taskActions.length > 0 ?
<div className="btn-group">
<button disabled={disabled || actionLoading} className="btn task-actions btn-secondary btn-xs dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i className={"fa " + taskActionsIcon}></i>
</button>
<ul className="dropdown-menu dropdown-menu-right">
{taskActions}
</ul>
</div>
: ""}
</div>
<div className="col-sm-3 col-xs-12">
<div className="col-xs-5 col-sm-6 col-md-4 actions">
{showEditLink ?
<a href="javascript:void(0);" onClick={this.startEditing}>{statusLabel}</a>
: statusLabel}
</div>
<div className="col-sm-1 text-right hidden-xs">
{taskActions.length > 0 ?
<div className="btn-group">
<button disabled={disabled || actionLoading} className="btn task-actions btn-secondary btn-xs dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Expand Down
4 changes: 4 additions & 0 deletions app/static/app/js/css/Map.scss
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,8 @@
right: 8px;
}
}

& > .leaflet-container{
width: 100%;
}
}
18 changes: 14 additions & 4 deletions app/static/app/js/css/MapView.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
[data-mapview]{
height: calc(100vh - 100px);
height: calc(100dvh - 100px);
}

.map-view{
.map-title{
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
height: calc(100% - 20px);
position: relative;

Expand All @@ -14,15 +20,19 @@
top: 6px;
}

.map-type-selector{
float: right;
}

.map-container{
height: 100%;
position: relative;
.standby{
z-index: 99999;
}
}

.map-view-header{
display: flex;
justify-content: space-between;
.map-type-selector{
flex: none;
}
}
}
4 changes: 4 additions & 0 deletions app/static/app/js/css/ModelView.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@
#show_2d_profile{
color: initial !important;
}

h3{
font-size: 14px;
}
}

#potree_map_header{
Expand Down
13 changes: 12 additions & 1 deletion app/static/app/js/css/Paginator.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
}
}
.btn-group.open > .dropdown-menu{
top: 22px;
top: 24px;
padding-right: 4px;
a{
border: none;
}
Expand All @@ -31,6 +32,10 @@
max-width: 210px;
}

.pagination>li{
display: inline-block;
}

.search-popup{
min-width: 256px;

Expand All @@ -48,6 +53,12 @@
}
}

@media (max-width: 576px) {
.search-popup{
min-width: 180px;
}
}

.clear-search{
margin-top: 1px;
font-weight: bold;
Expand Down
27 changes: 5 additions & 22 deletions app/static/app/js/css/ProjectListItem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@

.project-name{
font-weight: bold;

@media screen and (max-width: 768px){
font-size: x-large;
text-align: center;
margin-top: 5px;
margin-bottom: 5px;
}
}

.project-description{
Expand Down Expand Up @@ -85,21 +78,6 @@

.project-buttons {
float: right;

@media screen and (max-width: 768px){

.asset-download-buttons {
width: 100%;
}

float: none;

width: 100%;

.btn {
width: 100%;
}
}
}

.task-filters{
Expand Down Expand Up @@ -168,4 +146,9 @@
.quick-clear-filter{
margin-right: 6px !important;
}

.asset-download-buttons > button:last-child{
border-top-right-radius: 3px !important;
border-bottom-right-radius: 3px !important;
}
}
2 changes: 2 additions & 0 deletions app/static/app/js/css/TagsField.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.tags-field{
height: auto;
min-height: 45px;
padding-bottom: 2px;

&:hover{
Expand Down Expand Up @@ -31,6 +32,7 @@
}
.inputText{
display: inline-block;
position: fixed;
outline: none;
border: none;
margin-bottom: 10px;
Expand Down
16 changes: 14 additions & 2 deletions app/static/app/js/css/TaskListItem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,21 @@
border-style: solid;
border-width: 1px;
border-radius: 2px;
margin-right: 16px;
}

.actions{
display: flex;
align-items: center;
padding-right: 2px;
}

@media screen and (max-width: 768px){
margin-top: 5px;
@media screen and (max-width: 576px){
.status-label {
& > span{
display: none;
}
text-align: center;
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/templates/app/3d_model_display.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{% load render_bundle from webpack_loader %}
{% render_bundle 'ModelView' attrs='async' %}

<h3><i class="fa fa-cube"></i> {{title}}</h3>
<h3 class="model-title" title="{{title}}"><i class="fa fa-cube"></i> {{title}}</h3>

<div data-modelview class="full-height"
{% for key, value in params %}
Expand Down
2 changes: 1 addition & 1 deletion app/templates/app/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="author" content="WebODM Contributors">
<meta name="robots" content="noindex, nofollow">
<link rel="icon" type="image/png" href="{% settings_image_url 'app_logo_favicon' %}" sizes="32x32">
Expand Down
Loading
Loading