Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:elpassion/elranks

  • Loading branch information...
commit e546dbf2d26c514cc9f0286f493ec543dbba60d7 2 parents a83fd32 + 6fe4dca
@aserafin aserafin authored
View
BIN  app/assets/images/colon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app/assets/images/scorebg.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
4 app/assets/javascripts/app.js
@@ -29,10 +29,6 @@ var myAppModule = angular.module('MyApp', ['ui.select2','rails'])
console.log($scope.home, $scope.away);
};
- $scope.select2options = {
- 'multiple': true
- };
-
Player.query().then(function(data){
$scope.players = data;
});
View
1  app/assets/stylesheets/application.css
@@ -11,4 +11,5 @@
*= require_self
*= require select2
*= require main
+ *= require matches
*/
View
17 app/assets/stylesheets/main.css.scss
@@ -1,5 +1,13 @@
@import 'bootstrap';
+.c-b {
+ clear: both;
+}
+
+hr {
+ margin: 1em 0;
+}
+
.navbar {
background: #252525;
}
@@ -133,7 +141,7 @@ h1 {
padding-top: 70px;
- .newmatch {
+ .btn.newmatch {
margin-bottom: 25px;
}
@@ -148,7 +156,7 @@ h1 {
}
.standings {
-
+ margin: 20px auto 30px auto;
td.change {
.icon {
@@ -233,4 +241,9 @@ h1 {
}
}
+.btn {
+ border-radius: 0;
+}
+
+
View
127 app/assets/stylesheets/matches.css.scss
@@ -0,0 +1,127 @@
+
+input::-webkit-outer-spin-button,
+input::-webkit-inner-spin-button {
+ /* display: none; <- Crashes Chrome on hover */
+ -webkit-appearance: none;
+ visibility: hidden;
+ margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
+}
+
+
+
+.new-match {
+ /*border-top: 10px solid #000;*/
+ -webkit-box-shadow: 0px 0px 23px 0px rgba(0, 0, 0, 0.8);
+ -moz-box-shadow: 0px 0px 23px 0px rgba(0, 0, 0, 0.8);
+ box-shadow: 0px 0px 23px 0px rgba(0, 0, 0, 0.8);
+
+ width: 900px;
+ margin: 90px auto 20px auto;
+
+
+
+ .preview {
+ width: 370px;
+ margin: 0 auto;
+ padding-top: 1em;
+
+ .hometeam, .score {
+ float: left;
+ }
+
+ .awayteam {
+ float: right;
+ }
+
+ .hometeam, .awayteam {
+ margin-top: 35px;
+ display: block;
+ width: 60px;
+ img {
+ display: block;
+ border: 1px solid #eee;
+ }
+ }
+
+ .score {
+ margin-left: 7px;
+ background: transparent image-url('colon.png') 50% 50% no-repeat;
+
+
+ input {
+ outline-color: #299d4d;
+ float: left;
+ margin: 0 20px;
+ width: 80px;
+ height: 100px;
+ font-size: 5em;
+ padding: 0;
+ vertical-align: top;
+ line-height: 93px;
+ text-align: center;
+ color: #333;
+ border: 0;
+ background: transparent image-url('scorebg.png') 0 7px no-repeat;
+ }
+ }
+ }
+
+ .players, .teams {
+ box-sizing: border-box;
+ padding-left: 145px;
+ clear: both;
+
+ h4 {
+ color: #777;
+ font-size: 1.1em;
+ text-transform: uppercase;
+ }
+
+ .team, .player {
+ float: left;
+ width: 400px;
+ box-sizing: border-box;
+
+ .select2-container {
+ width: 200px;
+ }
+
+ &:first-child {
+ margin-right: 20px;
+ width: 400px;
+ }
+
+ &:last-child {
+ width: 250px;
+ }
+ }
+ }
+
+ .teams {
+ .team {
+ margin-bottom: 2em;
+ }
+
+
+ }
+
+
+ .players {
+ .player {
+
+ }
+ }
+
+ .actions {
+ margin: 2em auto;
+ padding-top: 0;
+ clear: both;
+ width: auto;
+
+ .save {
+ display: block;
+ margin: 2em auto;
+ }
+ }
+
+}
View
20 app/views/layouts/_navbar.html.slim
@@ -0,0 +1,20 @@
+header.navbar.navbar-inverse.navbar-fixed-top
+ .container
+ a( href='/' title='Best Fifa League... in the world. - EA.com' )
+ h1.logo El Ranks
+
+
+
+ section.loginbox
+ - if current_player.present?
+ .btn-group
+ button.dropdown-toggle(data-toggle='dropdown')
+ = image_tag 'shirt.png', class: 'shirt', width: '22', height: '18'
+ = current_player.name
+ span.caret
+ ul.dropdown-menu
+ li= link_to "Logout", "/sign_out"
+
+
+ - else
+ = link_to "Login", "/auth/google", class: 'btn btn-primary'
View
2  app/views/layouts/application.html.erb
@@ -8,6 +8,8 @@
</head>
<body ng-app="MyApp">
+<%= render :partial => 'layouts/navbar' %>
+
<%= yield %>
</body>
View
72 app/views/matches/new.html.slim
@@ -1,41 +1,43 @@
-table(ng-controller="PlayersCtrl" width="100%" border=1)
- tr
- td(width="25%")
- img(ng-src="{{logoUrl(home.team.id)}}" ng-show="home.team.id")
- td(width="25%")
- input(type='number' ng-model="home.score")
- td(width="25%")
- input(type='number' ng-model="away.score")
- td(width="25%")
- img(ng-src="{{logoUrl(away.team.id)}}" ng-show="away.team.id")
- tr
- td(colspan=2)
- select(name='home' ui-select2="select2options" ng-model="home.team.id" required)
- option(ng-repeat="team in teams" value="{{team.id}}")
- | {{team.name}}
- td(colspan=2)
- select(name='home' ui-select2="select2options" ng-model="away.team.id" required)
+.new-match(ng-controller="PlayersCtrl")
+ .preview.clearfix
+ .hometeam
+ img(ng-src="{{logoUrl(home.team.id)}}" ng-show="home.team.id" width="60" height="37")
+ .score
+ input(type='number' step="1" min="0" ng-model="home.score" autofocus)
+ input(type='number' step="1" min="0" ng-model="away.score")
+ .awayteam
+ img(ng-src="{{logoUrl(away.team.id)}}" ng-show="away.team.id" width="60" height="37")
+
+ hr.c-b
+
+
+ .teams
+
+ .team
+ h4 Choose team
+ select(name='home' ui-select2="" ng-model="home.team.id" required)
option(ng-repeat="team in teams" value="{{team.id}}")
| {{team.name}}
+ .team
+ h4 Choose team
+ select(name='home' ui-select2="" ng-model="away.team.id" required)
+ option(ng-repeat="team in teams" value="{{team.id}}")
+ | {{team.name}}
+
- tr
- td(colspan=2)
- select(name='home' ui-select2="select2options" ng-model="home.player_ids" multiple required)
- option(ng-repeat="player in players" value="{{player.id}}")
- | {{player.name}}
-
- td(colspan=2)
- select(name='away' ui-select2="select2options" ng-model="away.player_ids" multiple required)
- option(ng-repeat="player in players" value="{{player.id}}")
- | {{player.name}}
+ .players
+ .player
+ h4 Choose player
+ select(name='home' ui-select2="" ng-model="home.player_ids" required)
+ option(ng-repeat="player in players" value="{{player.id}}")
+ | {{player.name}}
+ .player
+ h4 Choose player
+ select(name='away' ui-select2="" ng-model="away.player_ids" required)
+ option(ng-repeat="player in players" value="{{player.id}}")
+ | {{player.name}}
- tr
- td(colspan=4)
- a(ng-click="save()" class="btn btn-large btn-success block") save
+ .actions.clearfix
+ button.btn.btn-lg.btn-success.save(ng-click="save()") Save match
- tr
- td
- | {{ home | json }}
- td
- | {{ away | json }}
View
21 app/views/welcome/index.html.slim
@@ -1,27 +1,8 @@
-header.navbar.navbar-inverse.navbar-fixed-top
- .container
- a( href='/' title='Best Fifa League... in the world. - EA.com' )
- h1.logo El Ranks
- section.loginbox
- - if current_player.present?
- .btn-group
- button.dropdown-toggle(data-toggle='dropdown')
- = image_tag 'shirt.png', class: 'shirt', width: '22', height: '18'
- = current_player.name
- span.caret
- ul.dropdown-menu
- li= link_to "Logout", "/sign_out"
-
-
- - else
- = link_to "Login", "/auth/google", class: 'btn btn-primary'
-
-
section.actions
- = link_to 'Add new match', '/matches/new', :class => "btn btn-success newmatch"
+ = link_to 'Add new match', '/matches/new', :class => "btn btn-success btn-lg newmatch"
section.table.standings
table.table.table-striped
Please sign in to comment.
Something went wrong with that request. Please try again.