summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRubén Dávila <rdavila84@gmail.com>2016-01-18 12:46:23 -0500
committerRubén Dávila <rdavila84@gmail.com>2016-01-20 00:17:21 -0500
commit91bd0bf99e0e25351c19bec28f9e5264a2fc469d (patch)
treed88a069f4e21c6f63b0536218016d20a5089f537 /app
parented4934dbca5a12001c13d804dd25775274dec8e7 (diff)
downloadgitlab-ce-91bd0bf99e0e25351c19bec28f9e5264a2fc469d.tar.gz
Some CSS and sorting fixes.
Diffstat (limited to 'app')
-rw-r--r--app/assets/stylesheets/pages/projects.scss43
-rw-r--r--app/controllers/projects/forks_controller.rb4
-rw-r--r--app/views/projects/forks/index.html.haml2
3 files changed, 30 insertions, 19 deletions
diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss
index a594cc43db2..0e2fccb80b4 100644
--- a/app/assets/stylesheets/pages/projects.scss
+++ b/app/assets/stylesheets/pages/projects.scss
@@ -391,22 +391,6 @@ pre.light-well {
padding-bottom: 0;
margin-bottom: 0px;
- &.fork-search-form {
- margin: 0;
- margin-top: -$gl-padding;
- padding-bottom: 0;
- width: 540px;
-
- input {
- width: calc(100% - 277px);
- }
-
- .fork_link {
- float: right;
- margin-left: $gl-padding;
- }
- }
-
input {
display: inline-block;
width: calc(100% - 151px);
@@ -414,6 +398,7 @@ pre.light-well {
.btn {
display: inline-block;
+ width: 135px;
}
}
@@ -584,6 +569,32 @@ pre.light-well {
* Forks list rendered on Project's forks page
*/
+.projects-search-form {
+ &.fork-search-form {
+ margin: 0;
+ margin-top: -$gl-padding;
+ padding-bottom: 0;
+ width: 540px;
+
+ input {
+ width: calc(100% - 300px);
+ }
+
+ button.sort-forks {
+ width: 160px;
+ }
+
+ .fork_link {
+ float: right;
+ margin-left: $gl-padding;
+
+ a.btn-new {
+ width: 110px;
+ }
+ }
+ }
+}
+
.private-forks-notice .private-fork-icon {
i.fa-circle {
color: #2AA056;
diff --git a/app/controllers/projects/forks_controller.rb b/app/controllers/projects/forks_controller.rb
index f6fabba26f9..e61e01c4a59 100644
--- a/app/controllers/projects/forks_controller.rb
+++ b/app/controllers/projects/forks_controller.rb
@@ -4,8 +4,8 @@ class Projects::ForksController < Projects::ApplicationController
before_action :authorize_download_code!
def index
- @all_forks = project.forks.includes(:creator)
- @all_forks = @all_forks.sort(params[:sort]) if params[:sort]
+ @sort = params[:sort] || 'id_desc'
+ @all_forks = project.forks.includes(:creator).order_by(@sort)
@public_forks, @protected_forks = @all_forks.partition do |project|
can?(current_user, :read_project, project)
diff --git a/app/views/projects/forks/index.html.haml b/app/views/projects/forks/index.html.haml
index 70f1392a878..ae866dedfbd 100644
--- a/app/views/projects/forks/index.html.haml
+++ b/app/views/projects/forks/index.html.haml
@@ -11,7 +11,7 @@
spellcheck: false, data: { 'filter-selector' => 'span.namespace-name' }
.dropdown.inline.prepend-left-10
- %button.dropdown-toggle.btn{type: 'button', 'data-toggle' => 'dropdown'}
+ %button.dropdown-toggle.btn.sort-forks{type: 'button', 'data-toggle' => 'dropdown'}
%span.light sort:
- if @sort.present?
= sort_options_hash[@sort]