Skip to content

Commit

Permalink
Merge pull request #243 from hpi-swt2/dev
Browse files Browse the repository at this point in the history
Deployment #3
  • Loading branch information
FranzSw authored Feb 1, 2022
2 parents bc17ddb + d1c7e47 commit 8abaf50
Show file tree
Hide file tree
Showing 63 changed files with 1,099 additions and 225 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ jobs:
# Show rspec errors as GH annotations https://github.com/Drieam/rspec-github#usage
run: |
cp config/database.ci.yml config/database.yml
bundle exec rails db:create
bundle exec rails db:schema:load
bundle exec rails db:setup
bundle exec rspec spec/ --format documentation --format RSpec::Github::Formatter
# Name of the job
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ gem 'bootsnap', '>= 1.4.4', require: false
#
# Additional core gems
#
gem "aws-sdk-s3", require: false

# Use devise as an authentication solution
gem 'devise' # https://github.com/plataformatec/devise
Expand Down
36 changes: 27 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,22 @@ GEM
aes_key_wrap (1.1.0)
ast (2.4.2)
attr_required (1.0.1)
aws-eventstream (1.2.0)
aws-partitions (1.550.0)
aws-sdk-core (3.125.5)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.525.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.53.0)
aws-sdk-core (~> 3, >= 3.125.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.111.3)
aws-sdk-core (~> 3, >= 3.125.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
aws-sigv4 (1.4.0)
aws-eventstream (~> 1, >= 1.0.2)
bcrypt (3.1.16)
better_errors (2.9.1)
coderay (>= 1.0.0)
Expand All @@ -74,7 +90,7 @@ GEM
bindex (0.8.1)
binding_of_caller (1.0.0)
debug_inspector (>= 0.0.1)
bootsnap (1.10.1)
bootsnap (1.10.2)
msgpack (~> 1.2)
builder (3.2.4)
byebug (11.1.3)
Expand Down Expand Up @@ -107,10 +123,10 @@ GEM
mime-types (~> 3.3, >= 3.3.1)
multi_test (~> 0.1, >= 0.1.2)
sys-uname (~> 1.2, >= 1.2.2)
cucumber-core (10.1.0)
cucumber-core (10.1.1)
cucumber-gherkin (~> 22.0, >= 22.0.0)
cucumber-messages (~> 17.1, >= 17.1.1)
cucumber-tag-expressions (~> 4.0, >= 4.0.2)
cucumber-tag-expressions (~> 4.1, >= 4.1.0)
cucumber-create-meta (6.0.4)
cucumber-messages (~> 17.1, >= 17.1.1)
sys-uname (~> 1.2, >= 1.2.2)
Expand Down Expand Up @@ -168,6 +184,7 @@ GEM
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
jmespath (1.5.0)
json-jwt (1.13.0)
activesupport (>= 4.2)
aes_key_wrap
Expand All @@ -189,7 +206,7 @@ GEM
mini_mime (1.1.2)
mini_portile2 (2.7.1)
minitest (5.15.0)
msgpack (1.4.2)
msgpack (1.4.4)
multi_test (0.1.2)
nio4r (2.5.8)
nokogiri (1.13.1)
Expand Down Expand Up @@ -223,8 +240,8 @@ GEM
parallel (1.21.0)
parser (3.1.0.0)
ast (~> 2.4.1)
pg (1.2.3)
pg (1.2.3-x64-mingw32)
pg (1.3.0)
pg (1.3.0-x64-mingw32)
public_suffix (4.0.6)
puma (5.5.2)
nio4r (~> 2.0)
Expand Down Expand Up @@ -302,9 +319,9 @@ GEM
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.10.3)
rubocop (1.24.1)
rubocop (1.25.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
Expand All @@ -320,7 +337,7 @@ GEM
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-rspec (2.7.0)
rubocop-rspec (2.8.0)
rubocop (~> 1.19)
ruby-graphviz (1.2.5)
rexml
Expand Down Expand Up @@ -419,6 +436,7 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
aws-sdk-s3
better_errors
binding_of_caller
bootsnap (>= 1.4.4)
Expand Down
11 changes: 11 additions & 0 deletions app/assets/stylesheets/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@
display: inline-block;
}

.close-icon {
height: 2.5rem;
width: 2.5rem;
background-color: #bbb;
border-radius: 50%;
display: inline-block;
position: absolute;
right: 10px;
top: 10px;
}

.detail-tag {
background: $mediumgray;
}
Expand Down
4 changes: 4 additions & 0 deletions app/assets/stylesheets/components/_map_navigation_popup.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#routing-controller {
width: 100%;
padding: 5px;
}
3 changes: 3 additions & 0 deletions app/assets/stylesheets/courses.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the Courses controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: https://sass-lang.com/
77 changes: 69 additions & 8 deletions app/assets/stylesheets/map.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "values";
@import "colors";

.leaflet-tooltip.marker_label {
border-radius: 20px;
Expand All @@ -19,18 +20,68 @@
width: 100%;
height: 100%;
}
#welcome-routing-text {
.search-container {
position: absolute;
padding: 10px;
width: 100vw;
z-index: 999;
}
#mobile-view-welcome-routing-text {
width: 100%;
background-color: white;
text-align: center;
padding-top: 20px;
}
#StopNavigation {
background-color: $hpi-red;
color: $lightgray;
}
.leaflet-routing-container {
width: 100% !important;
background-color: transparent !important;
display: flex !important;
}
.leaflet-bar {
box-shadow: none !important;
}
.leaflet-routing-alt {
max-height: 200px !important;
}
.leaflet-routing-geocoders {
width: 100%;
border-bottom: none !important;
}
.leaflet-routing-alternatives-container {
display: none;
width: 45%;
max-height: 200px;
margin-left: 10px;
}
.leaflet-routing-alt table {
width: -moz-available !important;
}
.leaflet-navigation-button {
width: 48px;
height: 48px;
text-align: center;
}
.navigation-icon {
color: $mediumgray;
cursor: pointer;
margin-top: 3px;
}
.leaflet-routing-geocoder-result {
z-index: 10000 !important;
}
div.leaflet-top.leaflet-left, div.leaflet-top.leaflet-right {
margin-top: 50px;
}
@media only screen and (max-width: 640px) {
.hpi-map {
width: 100%;
height: 80%;
}
.leaflet-routing-container {
width: 100% !important;
height: 100% !important;
height: 100% !important;
flex-flow: column !important;
flex-direction: column-reverse !important;
}
.leaflet-routing-collapse-btn {
display: none !important;
Expand All @@ -41,11 +92,21 @@
#StopNavigation {
width: 100% !important;
}
.leaflet-routing-geocoders {
.leaflet-routing-geocoder {
display: none !important;
}
.leaflet-routing-geocoders {
width: 100% !important;
}
.leaflet-routing-alternatives-container {
width: 85% !important;
max-height: 100px;
}
.leaflet-routing-alt {
max-height: 100px !important;
}
table {
display: none !important;
max-height: 100px !important;
}
}

Expand Down
30 changes: 30 additions & 0 deletions app/assets/stylesheets/search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,33 @@
}
}
}

.form-control{
border-radius: 20px !important;
}

.form-control:focus{
box-shadow: none !important;
}

.cancel-input{
background: #F4F4F4;
color: #444444;
border: 0;
border-radius: 20px;
position: relative;
top: -3rem;
float: right;
margin-right: 5px;
visibility: hidden;
}

.col{
height: 38px;
}

@media only screen and (max-width: 400px){
.container.mt-5.mb-5 {
margin-top: 1.5rem !important;
}
}
69 changes: 69 additions & 0 deletions app/controllers/courses_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
class CoursesController < ApplicationController
before_action :set_course, only: %i[show edit update destroy]

# GET /courses or /courses.json
def index
@courses = Course.all
end

# GET /courses/1 or /courses/1.json
def show; end

# GET /courses/new
def new
@course = Course.new
end

# GET /courses/1/edit
def edit; end

# POST /courses or /courses.json
def create
@course = Course.new(course_params)

respond_to do |format|
if @course.save
format.html { redirect_to course_url(@course), notice: "Course was successfully created." }
format.json { render :show, status: :created, location: @course }
else
format.html { render :new, status: :unprocessable_entity }
format.json { render json: @course.errors, status: :unprocessable_entity }
end
end
end

# PATCH/PUT /courses/1 or /courses/1.json
def update
respond_to do |format|
if @course.update(course_params)
format.html { redirect_to course_url(@course), notice: "Course was successfully updated." }
format.json { render :show, status: :ok, location: @course }
else
format.html { render :edit, status: :unprocessable_entity }
format.json { render json: @course.errors, status: :unprocessable_entity }
end
end
end

# DELETE /courses/1 or /courses/1.json
def destroy
@course.destroy

respond_to do |format|
format.html { redirect_to courses_url, notice: "Course was successfully destroyed." }
format.json { head :no_content }
end
end

private

# Use callbacks to share common setup or constraints between actions.
def set_course
@course = Course.find(params[:id])
end

# Only allow a list of trusted parameters through.
def course_params
params.require(:course).permit(:name, :module_category, :exam_date)
end
end
3 changes: 2 additions & 1 deletion app/controllers/map_controller.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
require 'uri'
require 'net/http'

class MapController < ApplicationController
class MapController < SearchController
layout 'fullpage'

def index
super
# Map page, accessible without login
@buildings = Building.all
@points_of_interest = PointOfInterest.all.map(&:to_geojson)
Expand Down
2 changes: 2 additions & 0 deletions app/helpers/courses_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module CoursesHelper
end
Loading

0 comments on commit 8abaf50

Please sign in to comment.