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

Fix fonts in webapp. #15

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
14 changes: 14 additions & 0 deletions i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@
<translation>sync</translation>
</message>
</context>
<context>
<name>refresh</name>
<message>
<source>refresh</source>
<translation>refresh</translation>
</message>
</context>
<context>
<name>delete</name>
<message>
Expand Down Expand Up @@ -267,6 +274,13 @@
<translation>manage</translation>
</message>
</context>
<context>
<name>clear_progress</name>
<message>
<source>clear_progress</source>
<translation>clear</translation>
</message>
</context>

</TS>

4 changes: 2 additions & 2 deletions public/css/fonts.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
font-family: 'Source Code Pro';
font-style: normal;
font-weight: 300;
src: local('Source Code Pro Light'), local('SourceCodePro-Light'), url(/ttf/SourceCodePro-Light.ttf) format('truetype');
src: url(/ttf/SourceCodePro-Light.ttf) format('truetype');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 300;
src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), url(/ttf/SourceSansPro-Light.ttf) format('truetype');
src: url(/ttf/SourceSansPro-Light.ttf) format('truetype');
}
18 changes: 17 additions & 1 deletion sdk_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ class SdkHelper < Sinatra::Base
redirect to('/'+params[:locale]+'/')
end

#clear the operation progress output
post '/actions/clear_output' do
$status_out.clear
process_tail_update
redirect to(request.referer)
end

#add target
post '/:locale/targets/add' do
targets_available_update
Expand Down Expand Up @@ -272,19 +279,28 @@ def sdk_upgrade
# -------------------------------- Process

def process_tail_update
# progress background color
@process_result_class = "process_result_ok"

if $process
@refresh_time = 10
$process_tail += $process.stdout_read(timeout: 0) + $process.stderr_read(timeout: 0)
split = $process_tail.split("\n",-1).collect { |nline| nline.split("\r",-1)[-1] }
$process_tail = (split[(-[10,split.size].min)..-1] or []).join("\n")
$status_out = $process_tail.split("\n").join("<br/>\n").gsub(" ","&nbsp;")
if $process.status[0] == "Z"
$process_exit = (_ :finished) + ": " + $process_description + " - " + (_ :exited_with_status) + " " + $process.reap.exitstatus.to_s
$process_exitstatus = $process.reap.exitstatus

$process_exit = (_ :finished) + ": " + $process_description + " - " + (_ :exited_with_status) + " " + $process_exitstatus.to_s
@refresh_time = $process = nil
if $process_exitstatus != 0
@process_result_class = "process_result_fail"
end
elsif $process.runtime > $process_timeout
$process.reap
$process_exit = (_ :timeout) + ": " + $process_description + " - " + (_ :process_killed)
@refresh_time = $process = nil
@process_result_class = "process_result_fail"
end
if $process
$status_out = "<b>" + "-"*40 + " " + $process_description + "</b><br/>\n<br/>\n" + $status_out
Expand Down
35 changes: 29 additions & 6 deletions views/default.sass
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,22 @@ html, body
margin-left: 230px
padding-bottom: 180px

.progress
height: 180px
position: absolute
bottom: 0
.progress_blocker
position: fixed
top: 0
left: 0
height: 100%
width: 100%
z-index: 99
background-color: rgba(45, 91, 112, 0.6)

.progress
position: relative
top: 50%
left: 0
height: 100%
width: 100%
z-index: 100

/* style */ /*-------------------------------------------------------------------------------------------*/

Expand Down Expand Up @@ -140,8 +149,8 @@ body
color: #e3ebed

.progress_background
background-color: rgba(45, 91, 112, 0.2)
height: 180px
background-color: rgba(45, 91, 112, 0)
height: 100%
margin-left: 230px
padding-top: 30px
padding-left: 30px
Expand All @@ -155,6 +164,20 @@ body
padding-bottom: 20px
font-size: 18px

.progress_table
padding: 10px 10px 10px 10px
border-spacing: 4px
box-shadow: 3px 3px 5px rgba(0,0,0,0.2)
min-width: 100%
max-width: 100%

.process_result_ok
background-color: #3D819B

.process_result_fail
background-color: #FF0000


.clear
clear: both

Expand Down
24 changes: 17 additions & 7 deletions views/layout.haml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,23 @@
.content_wrap
=yield
- if @status_out and @status_out.size > 0
.progress
.progress_background
#progress_view
.progress_header
= _ :operation_progress
.monospace
#{@status_out}
.progress_blocker
.progress
.progress_background
#progress_view
%table(class="progress_table #{@process_result_class}")
%tbody
%tr
%td
%form{:action => "/actions/clear_output", :method => "post"}
%input{:type => "submit", :value => (_ :clear_progress), :class => "button"}
.progress_header
= _ :operation_progress
%tr
%td
.monospace
#{@status_out}




4 changes: 2 additions & 2 deletions views/packages.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#manage
%div.sync_button
%form{:action => "/#{@language}/targets/#{@target}/sync", :method => :post}
%input{:type => 'submit', :value => "sync", :class => "button", :name => "_method"}
%input{:type => 'submit', :value => (_ :sync), :class => "button", :name => "_method"}
= _(:explain_sync)
%div.sync_button
%form{:action => "/#{@language}/targets/#{@target}/refresh", :method => :post}
%input{:type => 'submit', :value => "refresh", :class => "button", :name => "_method"}
%input{:type => 'submit', :value => (_ :refresh), :class => "button", :name => "_method"}
= _(:explain_refresh)
#packages_table
%form{:action => "/#{@language}/targets/add", :method => 'post'}
Expand Down
4 changes: 2 additions & 2 deletions views/toolchains.haml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
%td.delete_button
- if installed
%form{:action => "/toolchains/#{toolchain}", :method => "post"}
%input{:type => "submit", :value => "delete", :class => "button", :name=> "_method"}
%input{:type => "submit", :value => (_ :delete), :class => "button", :name=> "_method"}
- else
%input{:type => "button", :value => "delete", :disabled => "true", :class => "button disabled", :name=> "_method"}
%input{:type => "button", :value => (_ :delete), :disabled => "true", :class => "button disabled", :name=> "_method"}
%td.install_button
- if not installed
%form{:action => "/#{@language}/toolchains/#{toolchain}", :method => "post"}
Expand Down