Module: SortingHelper

Instance Method Summary collapse

Instance Method Details

#admin_groups_sort_options_hashObject


101
102
103
104
105
# File 'app/helpers/sorting_helper.rb', line 101

def admin_groups_sort_options_hash
  groups_sort_options_hash.merge(
    sort_value_largest_group => sort_title_largest_group
  )
end

#audit_logs_sort_order_hashObject


208
209
210
211
212
213
# File 'app/helpers/sorting_helper.rb', line 208

def audit_logs_sort_order_hash
  {
    sort_value_recently_created => sort_title_recently_created,
    sort_value_oldest_created   => sort_title_oldest_created
  }
end

#branches_sort_options_hashObject


131
132
133
134
135
136
137
# File 'app/helpers/sorting_helper.rb', line 131

def branches_sort_options_hash
  {
    sort_value_name             => sort_title_name,
    sort_value_oldest_updated   => sort_title_oldest_updated,
    sort_value_recently_updated => sort_title_recently_updated
  }
end

#groups_sort_options_hashObject


84
85
86
87
88
89
90
91
92
93
# File 'app/helpers/sorting_helper.rb', line 84

def groups_sort_options_hash
  {
    sort_value_name             => sort_title_name,
    sort_value_name_desc        => sort_title_name_desc,
    sort_value_recently_created => sort_title_recently_created,
    sort_value_oldest_created   => sort_title_oldest_created,
    sort_value_recently_updated => sort_title_recently_updated,
    sort_value_oldest_updated   => sort_title_oldest_updated
  }
end

#issuable_reverse_sort_order_hashObject


195
196
197
198
199
200
201
202
203
204
205
206
# File 'app/helpers/sorting_helper.rb', line 195

def issuable_reverse_sort_order_hash
  {
    sort_value_created_date => sort_value_oldest_created,
    sort_value_recently_created => sort_value_oldest_created,
    sort_value_recently_updated => sort_value_oldest_updated,
    sort_value_milestone => sort_value_milestone_later,
    sort_value_due_date => sort_value_due_date_later,
    sort_value_due_date_soon => sort_value_due_date_later,
    sort_value_popularity => sort_value_least_popular,
    sort_value_most_popular => sort_value_least_popular
  }.merge(issuable_sort_option_overrides)
end

#issuable_sort_direction_button(sort_value) ⇒ Object


245
246
247
248
249
250
# File 'app/helpers/sorting_helper.rb', line 245

def issuable_sort_direction_button(sort_value)
  reverse_sort = issuable_reverse_sort_order_hash[sort_value]
  url = page_filter_path(sort: reverse_sort)

  sort_direction_button(url, reverse_sort, sort_value)
end

#issuable_sort_option_overridesObject


185
186
187
188
189
190
191
192
193
# File 'app/helpers/sorting_helper.rb', line 185

def issuable_sort_option_overrides
  {
    sort_value_oldest_created => sort_value_created_date,
    sort_value_oldest_updated => sort_value_recently_updated,
    sort_value_milestone_later => sort_value_milestone,
    sort_value_due_date_later => sort_value_due_date,
    sort_value_least_popular => sort_value_popularity
  }
end

#issuable_sort_option_title(sort_value) ⇒ Object


215
216
217
218
219
# File 'app/helpers/sorting_helper.rb', line 215

def issuable_sort_option_title(sort_value)
  sort_value = issuable_sort_option_overrides[sort_value] || sort_value

  sort_options_hash[sort_value]
end

#label_sort_options_hashObject


147
148
149
150
151
152
153
154
155
156
# File 'app/helpers/sorting_helper.rb', line 147

def label_sort_options_hash
  {
    sort_value_name => sort_title_name,
    sort_value_name_desc => sort_title_name_desc,
    sort_value_recently_created => sort_title_recently_created,
    sort_value_oldest_created => sort_title_oldest_created,
    sort_value_recently_updated => sort_title_recently_updated,
    sort_value_oldest_updated => sort_title_oldest_updated
  }
end

#member_sort_options_hashObject


107
108
109
110
111
112
113
114
115
116
117
118
# File 'app/helpers/sorting_helper.rb', line 107

def member_sort_options_hash
  {
    sort_value_access_level_asc  => sort_title_access_level_asc,
    sort_value_access_level_desc => sort_title_access_level_desc,
    sort_value_last_joined       => sort_title_last_joined,
    sort_value_name              => sort_title_name_asc,
    sort_value_name_desc         => sort_title_name_desc,
    sort_value_oldest_joined     => sort_title_oldest_joined,
         => ,
       => 
  }
end

#milestone_sort_options_hashObject


120
121
122
123
124
125
126
127
128
129
# File 'app/helpers/sorting_helper.rb', line 120

def milestone_sort_options_hash
  {
    sort_value_name             => sort_title_name_asc,
    sort_value_name_desc        => sort_title_name_desc,
    sort_value_due_date_later   => sort_title_due_date_later,
    sort_value_due_date_soon    => sort_title_due_date_soon,
    sort_value_start_date_later => sort_title_start_date_later,
    sort_value_start_date_soon  => sort_title_start_date_soon
  }
end

#packages_reverse_sort_order_hashObject


600
601
602
603
604
605
606
607
608
609
610
611
612
613
# File 'app/helpers/sorting_helper.rb', line 600

def packages_reverse_sort_order_hash
  {
    sort_value_recently_created  => sort_value_oldest_created,
    sort_value_oldest_created    => sort_value_recently_created,
    sort_value_name              => sort_value_name_desc,
    sort_value_name_desc         => sort_value_name,
    sort_value_version_desc      => sort_value_version_asc,
    sort_value_version_asc       => sort_value_version_desc,
    sort_value_type_desc         => sort_value_type_asc,
    sort_value_type_asc          => sort_value_type_desc,
    sort_value_project_name_desc => sort_value_project_name_asc,
    sort_value_project_name_asc  => sort_value_project_name_desc
  }
end

#packages_sort_direction_button(sort_value) ⇒ Object


619
620
621
622
623
624
# File 'app/helpers/sorting_helper.rb', line 619

def packages_sort_direction_button(sort_value)
  reverse_sort = packages_reverse_sort_order_hash[sort_value]
  url = package_sort_path(sort: reverse_sort)

  sort_direction_button(url, reverse_sort, sort_value)
end

#packages_sort_option_title(sort_value) ⇒ Object


615
616
617
# File 'app/helpers/sorting_helper.rb', line 615

def packages_sort_option_title(sort_value)
  packages_sort_options_hash[sort_value] || sort_title_created_date
end

#packages_sort_options_hashObject


585
586
587
588
589
590
591
592
593
594
595
596
597
598
# File 'app/helpers/sorting_helper.rb', line 585

def packages_sort_options_hash
  {
    sort_value_recently_created  => sort_title_created_date,
    sort_value_oldest_created    => sort_title_created_date,
    sort_value_name              => sort_title_name,
    sort_value_name_desc         => sort_title_name,
    sort_value_version_desc      => sort_title_version,
    sort_value_version_asc       => sort_title_version,
    sort_value_type_desc         => sort_title_type,
    sort_value_type_asc          => sort_title_type,
    sort_value_project_name_desc => sort_title_project_name,
    sort_value_project_name_asc  => sort_title_project_name
  }
end

#project_sort_direction_button(sort_value) ⇒ Object


252
253
254
255
256
257
# File 'app/helpers/sorting_helper.rb', line 252

def project_sort_direction_button(sort_value)
  reverse_sort = projects_reverse_sort_options_hash[sort_value]
  url = filter_projects_path(sort: reverse_sort)

  sort_direction_button(url, reverse_sort, sort_value)
end

#projects_reverse_sort_options_hashObject


71
72
73
74
75
76
77
78
79
80
81
82
# File 'app/helpers/sorting_helper.rb', line 71

def projects_reverse_sort_options_hash
  {
    sort_value_latest_activity  => sort_value_oldest_activity,
    sort_value_recently_created => sort_value_oldest_created,
    sort_value_name             => sort_value_name_desc,
    sort_value_stars_desc       => sort_value_stars_asc,
    sort_value_oldest_activity  => sort_value_latest_activity,
    sort_value_oldest_created   => sort_value_recently_created,
    sort_value_name_desc        => sort_value_name,
    sort_value_stars_asc        => sort_value_stars_desc
  }
end

#projects_sort_option_titlesObject


61
62
63
64
65
66
67
68
69
# File 'app/helpers/sorting_helper.rb', line 61

def projects_sort_option_titles
  # Only used for the project filter search bar
  projects_sort_options_hash.merge({
    sort_value_oldest_activity  => sort_title_latest_activity,
    sort_value_oldest_created   => sort_title_created_date,
    sort_value_name_desc        => sort_title_name,
    sort_value_stars_asc        => sort_title_stars
  })
end

#projects_sort_options_hashObject


35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'app/helpers/sorting_helper.rb', line 35

def projects_sort_options_hash
  use_old_sorting = Feature.disabled?(:project_list_filter_bar) || current_controller?('admin/projects')

  options = {
    sort_value_latest_activity  => sort_title_latest_activity,
    sort_value_recently_created => sort_title_created_date,
    sort_value_name             => sort_title_name,
    sort_value_stars_desc       => sort_title_stars
  }

  if use_old_sorting
    options = options.merge({
      sort_value_oldest_activity  => sort_title_oldest_activity,
      sort_value_oldest_created   => sort_title_oldest_created,
      sort_value_recently_created => sort_title_recently_created,
      sort_value_stars_desc       => sort_title_most_stars
    })
  end

  if current_controller?('admin/projects')
    options[sort_value_largest_repo] = sort_title_largest_repo
  end

  options
end

#sort_direction_button(reverse_url, reverse_sort, sort_value) ⇒ Object


230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'app/helpers/sorting_helper.rb', line 230

def sort_direction_button(reverse_url, reverse_sort, sort_value)
  link_class = 'btn btn-default has-tooltip reverse-sort-btn qa-reverse-sort rspec-reverse-sort'
  icon = sort_direction_icon(sort_value)
  url = reverse_url

  unless reverse_sort
    url = '#'
    link_class += ' disabled'
  end

  link_to(url, type: 'button', class: link_class, title: s_('SortOptions|Sort direction')) do
    sprite_icon(icon)
  end
end

#sort_direction_icon(sort_value) ⇒ Object


221
222
223
224
225
226
227
228
# File 'app/helpers/sorting_helper.rb', line 221

def sort_direction_icon(sort_value)
  case sort_value
  when sort_value_milestone, sort_value_due_date, /_asc\z/
    'sort-lowest'
  else
    'sort-highest'
  end
end

#sort_options_hashObject


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'app/helpers/sorting_helper.rb', line 4

def sort_options_hash
  {
    sort_value_created_date      => sort_title_created_date,
    sort_value_downvotes         => sort_title_downvotes,
    sort_value_due_date          => sort_title_due_date,
    sort_value_due_date_later    => sort_title_due_date_later,
    sort_value_due_date_soon     => sort_title_due_date_soon,
    sort_value_label_priority    => sort_title_label_priority,
    sort_value_largest_group     => sort_title_largest_group,
    sort_value_largest_repo      => sort_title_largest_repo,
    sort_value_milestone         => sort_title_milestone,
    sort_value_milestone_later   => sort_title_milestone_later,
    sort_value_milestone_soon    => sort_title_milestone_soon,
    sort_value_name              => sort_title_name,
    sort_value_name_desc         => sort_title_name_desc,
    sort_value_oldest_created    => sort_title_oldest_created,
         => ,
    sort_value_oldest_updated    => sort_title_oldest_updated,
    sort_value_recently_created  => sort_title_recently_created,
       => ,
    sort_value_recently_updated  => sort_title_recently_updated,
    sort_value_popularity        => sort_title_popularity,
    sort_value_priority          => sort_title_priority,
    sort_value_upvotes           => sort_title_upvotes,
    sort_value_contacted_date    => sort_title_contacted_date,
    sort_value_relative_position => sort_title_relative_position,
    sort_value_size              => sort_title_size,
    sort_value_expire_date       => sort_title_expire_date
  }
end

#sort_title_access_level_ascObject

Titles.


260
261
262
# File 'app/helpers/sorting_helper.rb', line 260

def sort_title_access_level_asc
  s_('SortOptions|Access level, ascending')
end

#sort_title_access_level_descObject


264
265
266
# File 'app/helpers/sorting_helper.rb', line 264

def sort_title_access_level_desc
  s_('SortOptions|Access level, descending')
end

#sort_title_contacted_dateObject


392
393
394
# File 'app/helpers/sorting_helper.rb', line 392

def sort_title_contacted_date
  s_('SortOptions|Last Contact')
end

#sort_title_created_dateObject


268
269
270
# File 'app/helpers/sorting_helper.rb', line 268

def sort_title_created_date
  s_('SortOptions|Created date')
end

#sort_title_downvotesObject


272
273
274
# File 'app/helpers/sorting_helper.rb', line 272

def sort_title_downvotes
  s_('SortOptions|Least popular')
end

#sort_title_due_dateObject


276
277
278
# File 'app/helpers/sorting_helper.rb', line 276

def sort_title_due_date
  s_('SortOptions|Due date')
end

#sort_title_due_date_laterObject


280
281
282
# File 'app/helpers/sorting_helper.rb', line 280

def sort_title_due_date_later
  s_('SortOptions|Due later')
end

#sort_title_due_date_soonObject


284
285
286
# File 'app/helpers/sorting_helper.rb', line 284

def sort_title_due_date_soon
  s_('SortOptions|Due soon')
end

#sort_title_expire_dateObject


420
421
422
# File 'app/helpers/sorting_helper.rb', line 420

def sort_title_expire_date
  s_('SortOptions|Expired date')
end

#sort_title_label_priorityObject


288
289
290
# File 'app/helpers/sorting_helper.rb', line 288

def sort_title_label_priority
  s_('SortOptions|Label priority')
end

#sort_title_largest_groupObject


292
293
294
# File 'app/helpers/sorting_helper.rb', line 292

def sort_title_largest_group
  s_('SortOptions|Largest group')
end

#sort_title_largest_repoObject


296
297
298
# File 'app/helpers/sorting_helper.rb', line 296

def sort_title_largest_repo
  s_('SortOptions|Largest repository')
end

#sort_title_last_joinedObject


300
301
302
# File 'app/helpers/sorting_helper.rb', line 300

def sort_title_last_joined
  s_('SortOptions|Last joined')
end

#sort_title_latest_activityObject


304
305
306
# File 'app/helpers/sorting_helper.rb', line 304

def sort_title_latest_activity
  s_('SortOptions|Last updated')
end

#sort_title_milestoneObject


308
309
310
# File 'app/helpers/sorting_helper.rb', line 308

def sort_title_milestone
  s_('SortOptions|Milestone due date')
end

#sort_title_milestone_laterObject


312
313
314
# File 'app/helpers/sorting_helper.rb', line 312

def sort_title_milestone_later
  s_('SortOptions|Milestone due later')
end

#sort_title_milestone_soonObject


316
317
318
# File 'app/helpers/sorting_helper.rb', line 316

def sort_title_milestone_soon
  s_('SortOptions|Milestone due soon')
end

#sort_title_most_starsObject


396
397
398
# File 'app/helpers/sorting_helper.rb', line 396

def sort_title_most_stars
  s_('SortOptions|Most stars')
end

#sort_title_nameObject


320
321
322
# File 'app/helpers/sorting_helper.rb', line 320

def sort_title_name
  s_('SortOptions|Name')
end

#sort_title_name_ascObject


324
325
326
# File 'app/helpers/sorting_helper.rb', line 324

def sort_title_name_asc
  s_('SortOptions|Name, ascending')
end

#sort_title_name_descObject


328
329
330
# File 'app/helpers/sorting_helper.rb', line 328

def sort_title_name_desc
  s_('SortOptions|Name, descending')
end

#sort_title_oldest_activityObject


332
333
334
# File 'app/helpers/sorting_helper.rb', line 332

def sort_title_oldest_activity
  s_('SortOptions|Oldest updated')
end

#sort_title_oldest_createdObject


336
337
338
# File 'app/helpers/sorting_helper.rb', line 336

def sort_title_oldest_created
  s_('SortOptions|Oldest created')
end

#sort_title_oldest_joinedObject


340
341
342
# File 'app/helpers/sorting_helper.rb', line 340

def sort_title_oldest_joined
  s_('SortOptions|Oldest joined')
end

#sort_title_oldest_last_activityObject


404
405
406
# File 'app/helpers/sorting_helper.rb', line 404

def sort_title_oldest_last_activity
  s_('SortOptions|Oldest last activity')
end

#sort_title_oldest_signinObject


344
345
346
# File 'app/helpers/sorting_helper.rb', line 344

def 
  s_('SortOptions|Oldest sign in')
end

#sort_title_oldest_starredObject


348
349
350
# File 'app/helpers/sorting_helper.rb', line 348

def sort_title_oldest_starred
  s_('SortOptions|Oldest starred')
end

#sort_title_oldest_updatedObject


352
353
354
# File 'app/helpers/sorting_helper.rb', line 352

def sort_title_oldest_updated
  s_('SortOptions|Oldest updated')
end

#sort_title_popularityObject


356
357
358
# File 'app/helpers/sorting_helper.rb', line 356

def sort_title_popularity
  s_('SortOptions|Popularity')
end

#sort_title_priorityObject


360
361
362
# File 'app/helpers/sorting_helper.rb', line 360

def sort_title_priority
  s_('SortOptions|Priority')
end

#sort_title_recently_createdObject


364
365
366
# File 'app/helpers/sorting_helper.rb', line 364

def sort_title_recently_created
  s_('SortOptions|Last created')
end

#sort_title_recently_last_activityObject


408
409
410
# File 'app/helpers/sorting_helper.rb', line 408

def sort_title_recently_last_activity
  s_('SortOptions|Recent last activity')
end

#sort_title_recently_signinObject


368
369
370
# File 'app/helpers/sorting_helper.rb', line 368

def 
  s_('SortOptions|Recent sign in')
end

#sort_title_recently_starredObject


372
373
374
# File 'app/helpers/sorting_helper.rb', line 372

def sort_title_recently_starred
  s_('SortOptions|Recently starred')
end

#sort_title_recently_updatedObject


376
377
378
# File 'app/helpers/sorting_helper.rb', line 376

def sort_title_recently_updated
  s_('SortOptions|Last updated')
end

#sort_title_relative_positionObject


412
413
414
# File 'app/helpers/sorting_helper.rb', line 412

def sort_title_relative_position
  s_('SortOptions|Manual')
end

#sort_title_sizeObject


416
417
418
# File 'app/helpers/sorting_helper.rb', line 416

def sort_title_size
  s_('SortOptions|Size')
end

#sort_title_starsObject


400
401
402
# File 'app/helpers/sorting_helper.rb', line 400

def sort_title_stars
  s_('SortOptions|Stars')
end

#sort_title_start_date_laterObject


380
381
382
# File 'app/helpers/sorting_helper.rb', line 380

def sort_title_start_date_later
  s_('SortOptions|Start later')
end

#sort_title_start_date_soonObject


384
385
386
# File 'app/helpers/sorting_helper.rb', line 384

def sort_title_start_date_soon
  s_('SortOptions|Start soon')
end

#sort_title_upvotesObject


388
389
390
# File 'app/helpers/sorting_helper.rb', line 388

def sort_title_upvotes
  s_('SortOptions|Most popular')
end

#sort_value_access_level_ascObject

Values.


425
426
427
# File 'app/helpers/sorting_helper.rb', line 425

def sort_value_access_level_asc
  'access_level_asc'
end

#sort_value_access_level_descObject


429
430
431
# File 'app/helpers/sorting_helper.rb', line 429

def sort_value_access_level_desc
  'access_level_desc'
end

#sort_value_contacted_dateObject


553
554
555
# File 'app/helpers/sorting_helper.rb', line 553

def sort_value_contacted_date
  'contacted_asc'
end

#sort_value_created_dateObject


433
434
435
# File 'app/helpers/sorting_helper.rb', line 433

def sort_value_created_date
  'created_date'
end

#sort_value_downvotesObject


437
438
439
# File 'app/helpers/sorting_helper.rb', line 437

def sort_value_downvotes
  'downvotes_desc'
end

#sort_value_due_dateObject


441
442
443
# File 'app/helpers/sorting_helper.rb', line 441

def sort_value_due_date
  'due_date'
end

#sort_value_due_date_laterObject


445
446
447
# File 'app/helpers/sorting_helper.rb', line 445

def sort_value_due_date_later
  'due_date_desc'
end

#sort_value_due_date_soonObject


449
450
451
# File 'app/helpers/sorting_helper.rb', line 449

def sort_value_due_date_soon
  'due_date_asc'
end

#sort_value_expire_dateObject


581
582
583
# File 'app/helpers/sorting_helper.rb', line 581

def sort_value_expire_date
  'expired_asc'
end

#sort_value_label_priorityObject


453
454
455
# File 'app/helpers/sorting_helper.rb', line 453

def sort_value_label_priority
  'label_priority'
end

#sort_value_largest_groupObject


457
458
459
# File 'app/helpers/sorting_helper.rb', line 457

def sort_value_largest_group
  'storage_size_desc'
end

#sort_value_largest_repoObject


461
462
463
# File 'app/helpers/sorting_helper.rb', line 461

def sort_value_largest_repo
  'storage_size_desc'
end

#sort_value_last_joinedObject


465
466
467
# File 'app/helpers/sorting_helper.rb', line 465

def sort_value_last_joined
  'last_joined'
end

#sort_value_latest_activityObject


469
470
471
# File 'app/helpers/sorting_helper.rb', line 469

def sort_value_latest_activity
  'latest_activity_desc'
end

521
522
523
# File 'app/helpers/sorting_helper.rb', line 521

def sort_value_least_popular
  'popularity_asc'
end

#sort_value_milestoneObject


473
474
475
# File 'app/helpers/sorting_helper.rb', line 473

def sort_value_milestone
  'milestone'
end

#sort_value_milestone_laterObject


477
478
479
# File 'app/helpers/sorting_helper.rb', line 477

def sort_value_milestone_later
  'milestone_due_desc'
end

#sort_value_milestone_soonObject


481
482
483
# File 'app/helpers/sorting_helper.rb', line 481

def sort_value_milestone_soon
  'milestone_due_asc'
end

517
518
519
# File 'app/helpers/sorting_helper.rb', line 517

def sort_value_most_popular
  'popularity_desc'
end

#sort_value_nameObject


485
486
487
# File 'app/helpers/sorting_helper.rb', line 485

def sort_value_name
  'name_asc'
end

#sort_value_name_descObject


489
490
491
# File 'app/helpers/sorting_helper.rb', line 489

def sort_value_name_desc
  'name_desc'
end

#sort_value_oldest_activityObject


493
494
495
# File 'app/helpers/sorting_helper.rb', line 493

def sort_value_oldest_activity
  'latest_activity_asc'
end

#sort_value_oldest_createdObject


497
498
499
# File 'app/helpers/sorting_helper.rb', line 497

def sort_value_oldest_created
  'created_asc'
end

#sort_value_oldest_joinedObject


505
506
507
# File 'app/helpers/sorting_helper.rb', line 505

def sort_value_oldest_joined
  'oldest_joined'
end

#sort_value_oldest_last_activityObject


565
566
567
# File 'app/helpers/sorting_helper.rb', line 565

def sort_value_oldest_last_activity
  'last_activity_on_asc'
end

#sort_value_oldest_signinObject


501
502
503
# File 'app/helpers/sorting_helper.rb', line 501

def 
  'oldest_sign_in'
end

#sort_value_oldest_updatedObject


509
510
511
# File 'app/helpers/sorting_helper.rb', line 509

def sort_value_oldest_updated
  'updated_asc'
end

#sort_value_popularityObject


513
514
515
# File 'app/helpers/sorting_helper.rb', line 513

def sort_value_popularity
  'popularity'
end

#sort_value_priorityObject


525
526
527
# File 'app/helpers/sorting_helper.rb', line 525

def sort_value_priority
  'priority'
end

#sort_value_recently_createdObject


529
530
531
# File 'app/helpers/sorting_helper.rb', line 529

def sort_value_recently_created
  'created_desc'
end

#sort_value_recently_last_activityObject


569
570
571
# File 'app/helpers/sorting_helper.rb', line 569

def sort_value_recently_last_activity
  'last_activity_on_desc'
end

#sort_value_recently_signinObject


533
534
535
# File 'app/helpers/sorting_helper.rb', line 533

def 
  'recent_sign_in'
end

#sort_value_recently_updatedObject


537
538
539
# File 'app/helpers/sorting_helper.rb', line 537

def sort_value_recently_updated
  'updated_desc'
end

#sort_value_relative_positionObject


573
574
575
# File 'app/helpers/sorting_helper.rb', line 573

def sort_value_relative_position
  'relative_position'
end

#sort_value_sizeObject


577
578
579
# File 'app/helpers/sorting_helper.rb', line 577

def sort_value_size
  'size_desc'
end

#sort_value_stars_ascObject


561
562
563
# File 'app/helpers/sorting_helper.rb', line 561

def sort_value_stars_asc
  'stars_asc'
end

#sort_value_stars_descObject


557
558
559
# File 'app/helpers/sorting_helper.rb', line 557

def sort_value_stars_desc
  'stars_desc'
end

#sort_value_start_date_laterObject


541
542
543
# File 'app/helpers/sorting_helper.rb', line 541

def sort_value_start_date_later
  'start_date_desc'
end

#sort_value_start_date_soonObject


545
546
547
# File 'app/helpers/sorting_helper.rb', line 545

def sort_value_start_date_soon
  'start_date_asc'
end

#sort_value_upvotesObject


549
550
551
# File 'app/helpers/sorting_helper.rb', line 549

def sort_value_upvotes
  'upvotes_desc'
end

#sortable_item(item, path, sorted_by) ⇒ Object


181
182
183
# File 'app/helpers/sorting_helper.rb', line 181

def sortable_item(item, path, sorted_by)
  link_to item, path, class: sorted_by == item ? 'is-active' : ''
end

#starrers_sort_options_hashObject


172
173
174
175
176
177
178
179
# File 'app/helpers/sorting_helper.rb', line 172

def starrers_sort_options_hash
  {
    sort_value_name => sort_title_name,
    sort_value_name_desc => sort_title_name_desc,
    sort_value_recently_created => sort_title_recently_starred,
    sort_value_oldest_created => sort_title_oldest_starred
  }
end

#subgroups_sort_options_hashObject


95
96
97
98
99
# File 'app/helpers/sorting_helper.rb', line 95

def subgroups_sort_options_hash
  groups_sort_options_hash.merge(
    sort_value_stars_desc => sort_title_most_stars
  )
end

#tags_sort_options_hashObject


139
140
141
142
143
144
145
# File 'app/helpers/sorting_helper.rb', line 139

def tags_sort_options_hash
  {
    sort_value_name             => sort_title_name,
    sort_value_oldest_updated   => sort_title_oldest_updated,
    sort_value_recently_updated => sort_title_recently_updated
  }
end

#users_sort_options_hashObject


158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'app/helpers/sorting_helper.rb', line 158

def users_sort_options_hash
  {
    sort_value_name => sort_title_name,
     => ,
     => ,
    sort_value_recently_created => sort_title_recently_created,
    sort_value_oldest_created => sort_title_oldest_created,
    sort_value_recently_updated => sort_title_recently_updated,
    sort_value_oldest_updated => sort_title_oldest_updated,
    sort_value_recently_last_activity => sort_title_recently_last_activity,
    sort_value_oldest_last_activity => sort_title_oldest_last_activity
  }
end