-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #521 from rubymonsters/km-refactor-admin-panel
Refactor admin panel * rubymonsters/km-refactor-admin-panel: Refactor admin panel
- Loading branch information
Showing
56 changed files
with
1,390 additions
and
1,442 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
.secondary-navigation { | ||
display: flex; | ||
background-color: lighten($grey-mid, 20%); | ||
padding: 0 10px; | ||
height: 55px; | ||
margin-bottom: 25px; | ||
border-radius: 2px; | ||
|
||
ul { | ||
list-style: none; | ||
margin: 0; | ||
padding: 0px 0px 0px 30px; | ||
font-size: 15px; | ||
display: flex; | ||
flex-grow: 1; | ||
justify-content: end; | ||
} | ||
|
||
li { | ||
margin-right: 1.3em; | ||
line-height: $topbar-height; | ||
} | ||
|
||
a { | ||
display: inline-block; | ||
text-decoration: none; | ||
border-bottom: 1px solid transparent; | ||
color: $black; | ||
} | ||
|
||
a:hover, | ||
.active { | ||
background-color: inherit; | ||
color: $green; | ||
padding-bottom: 1px; | ||
border: none; | ||
&:after { | ||
content: ""; | ||
display: block; | ||
height: 1px; | ||
margin-top: -1px; | ||
background-color: $green; | ||
} | ||
} | ||
|
||
p { | ||
font-weight: 600; | ||
} | ||
} | ||
|
||
.approve-button { | ||
input[type="checkbox"] { | ||
margin-left: 10px; | ||
} | ||
} | ||
|
||
.admin-list, | ||
.tags-list { | ||
list-style: none; | ||
padding: 0; | ||
|
||
li { | ||
margin-bottom: 1em; | ||
border-bottom: 3px solid #f1f1f1; | ||
@media (min-width: $medium) { | ||
display: flex; | ||
flex-flow: row wrap; | ||
justify-content: space-between; | ||
border-bottom: none; | ||
margin-bottom: 0; | ||
} | ||
} | ||
.application-name { | ||
flex: 0 0 40%; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
margin-right: 1em; | ||
} | ||
.application-mail { | ||
flex-basis: 40%; | ||
overflow: hidden; | ||
margin-right: 1em; | ||
flex-grow: 1; | ||
} | ||
p { | ||
margin: 0 0 1em; | ||
} | ||
.admin-buttons>form { | ||
display:inline; | ||
} | ||
.event-name { | ||
flex-basis: 15em; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
} | ||
.application-process { | ||
flex-basis: 12em; | ||
} | ||
.application-deadline { | ||
flex-basis: 11em; | ||
} | ||
} | ||
|
||
.organizer-list, | ||
.applicant-list { | ||
list-style: none; | ||
padding: 0; | ||
|
||
li { | ||
margin-bottom: 1em; | ||
border-bottom: 3px solid #f1f1f1; | ||
display: flex; | ||
flex-flow: row wrap; | ||
justify-content: space-between; | ||
border-bottom: none; | ||
margin-bottom: 0; | ||
p:not(:last-child) { | ||
margin-right: 1em; | ||
} | ||
} | ||
p { | ||
margin: 0 0 1em; | ||
} | ||
.event-name { | ||
flex-grow: 1; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
} | ||
} | ||
|
||
ul.tags { | ||
padding-left: 0; | ||
|
||
li.tag { | ||
list-style: none; | ||
padding: 0.2em 0.5em; | ||
border-radius: 3px; | ||
display: inline-block; | ||
margin: 0 0 0.5em; | ||
&.programming-languages { | ||
background-color: lighten($blue-bg, 30%); | ||
} | ||
&.languages { | ||
background-color: lighten($green-bg, 20%); | ||
} | ||
&.fields-of-expertise { | ||
background-color: lighten($yellow, 20%); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#This controller manages the selection process of applications for a specific event (if selection | ||
#process is being handled by this app), only accessable for admins. | ||
module Admin | ||
class ApplicationsController < ApplicationController | ||
before_action :require_admin | ||
before_action :set_locale_to_english | ||
before_action :get_application | ||
before_action :skip_validation, except: [:destroy] | ||
|
||
def show | ||
if @application.event.deleted? | ||
redirect_to( | ||
admin_path, | ||
notice: "You cannot view your application as the event you applied for has been removed "\ | ||
"from Diversity Tickets" | ||
) | ||
elsif @application.draft? | ||
redirect_to admin_event_path(@application.event), notice: "You cannot view a draft." | ||
end | ||
end | ||
|
||
# to approve an application | ||
def approve | ||
get_event | ||
@application.update_attributes(status: 'approved') | ||
add_to_approved_tickets_count | ||
redirect_to admin_event_path(@application.event_id), | ||
notice: "#{ @application.name}'s application has been approved" | ||
end | ||
|
||
# to reject an application | ||
def reject | ||
@application.update_attributes(status: 'rejected') | ||
redirect_to admin_event_path(@application.event_id), | ||
flash: { info: "#{ @application.name}'s application has been rejected" } | ||
end | ||
|
||
# to set an application back to pending | ||
def revert | ||
remove_from_approved_tickets_count | ||
@application.update_attributes(status: 'pending') | ||
redirect_to admin_event_path(@application.event_id), | ||
flash: { info: "#{ @application.name}'s application has been changed to pending" } | ||
end | ||
|
||
def destroy | ||
@application.destroy | ||
redirect_to admin_event_path(@event.id) | ||
end | ||
|
||
private | ||
|
||
def get_application | ||
get_event | ||
@application = @event.applications.find(params[:id]) | ||
end | ||
|
||
def get_event | ||
@event = Event.find(params[:event_id]) | ||
end | ||
|
||
def skip_validation | ||
@application.skip_validation = true | ||
end | ||
|
||
def add_to_approved_tickets_count | ||
@event.update_attributes(approved_tickets: @event.approved_tickets + 1) | ||
end | ||
|
||
def remove_from_approved_tickets_count | ||
if @application.status == 'approved' | ||
@event.update_attributes(approved_tickets: @event.approved_tickets - 1) | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.