Module: SortingHelper

Instance Method Summary collapse

Instance Method Details

#admin_groups_sort_options_hashObject


110
111
112
113
114
# File 'app/helpers/sorting_helper.rb', line 110

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


217
218
219
220
221
222
# File 'app/helpers/sorting_helper.rb', line 217

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


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

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


93
94
95
96
97
98
99
100
101
102
# File 'app/helpers/sorting_helper.rb', line 93

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_latest_activity  => sort_title_recently_updated,
    sort_value_oldest_activity  => sort_title_oldest_updated
  }
end

#issuable_reverse_sort_order_hashObject


204
205
206
207
208
209
210
211
212
213
214
215
# File 'app/helpers/sorting_helper.rb', line 204

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


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

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


194
195
196
197
198
199
200
201
202
# File 'app/helpers/sorting_helper.rb', line 194

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


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

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


156
157
158
159
160
161
162
163
164
165
# File 'app/helpers/sorting_helper.rb', line 156

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


116
117
118
119
120
121
122
123
124
125
126
127
# File 'app/helpers/sorting_helper.rb', line 116

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


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

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


628
629
630
631
632
633
634
635
636
637
638
639
640
641
# File 'app/helpers/sorting_helper.rb', line 628

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


647
648
649
650
651
652
# File 'app/helpers/sorting_helper.rb', line 647

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


643
644
645
# File 'app/helpers/sorting_helper.rb', line 643

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

#packages_sort_options_hashObject


613
614
615
616
617
618
619
620
621
622
623
624
625
626
# File 'app/helpers/sorting_helper.rb', line 613

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


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

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


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

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


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

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


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

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_name_desc        => sort_title_name_desc,
    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

#search_reverse_sort_options_hashObject


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

def search_reverse_sort_options_hash
  {
    sort_value_recently_created => sort_value_oldest_created,
    sort_value_oldest_created   => sort_value_recently_created
  }
end

#search_sort_direction_button(sort_value) ⇒ Object


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

def search_sort_direction_button(sort_value)
  reverse_sort = search_reverse_sort_options_hash[sort_value]
  url = page_filter_path(sort: reverse_sort)

  sort_direction_button(url, reverse_sort, sort_value)
end

#search_sort_option_title(sort_value) ⇒ Object


230
231
232
# File 'app/helpers/sorting_helper.rb', line 230

def search_sort_option_title(sort_value)
  sort_options_hash[sort_value]
end

#sort_direction_button(reverse_url, reverse_sort, sort_value) ⇒ Object


243
244
245
246
247
248
249
250
251
252
253
254
255
256
# File 'app/helpers/sorting_helper.rb', line 243

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


234
235
236
237
238
239
240
241
# File 'app/helpers/sorting_helper.rb', line 234

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
34
# 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,
    sort_value_relevant          => sort_title_relevant
  }
end

#sort_title_access_level_ascObject

Titles.


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

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

#sort_title_access_level_descObject


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

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

#sort_title_contacted_dateObject


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

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

#sort_title_created_dateObject


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

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

#sort_title_downvotesObject


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

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

#sort_title_due_dateObject


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

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

#sort_title_due_date_laterObject


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

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

#sort_title_due_date_soonObject


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

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

#sort_title_expire_dateObject


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

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

#sort_title_label_priorityObject


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

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

#sort_title_largest_groupObject


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

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

#sort_title_largest_repoObject


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

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

#sort_title_last_joinedObject


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

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

#sort_title_latest_activityObject


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

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

#sort_title_milestoneObject


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

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

#sort_title_milestone_laterObject


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

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

#sort_title_milestone_soonObject


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

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

#sort_title_most_starsObject


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

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

#sort_title_nameObject


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

def sort_title_name
  s_('SortOptions|Name')
end

#sort_title_name_ascObject


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

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

#sort_title_name_descObject


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

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

#sort_title_oldest_activityObject


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

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

#sort_title_oldest_createdObject


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

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

#sort_title_oldest_joinedObject


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

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

#sort_title_oldest_last_activityObject


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

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

#sort_title_oldest_signinObject


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

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

#sort_title_oldest_starredObject


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

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

#sort_title_oldest_updatedObject


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

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

#sort_title_popularityObject


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

def sort_title_popularity
  s_('SortOptions|Popularity')
end

#sort_title_priorityObject


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

def sort_title_priority
  s_('SortOptions|Priority')
end

#sort_title_recently_createdObject


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

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

#sort_title_recently_last_activityObject


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

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

#sort_title_recently_signinObject


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

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

#sort_title_recently_starredObject


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

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

#sort_title_recently_updatedObject


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

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

#sort_title_relative_positionObject


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

def sort_title_relative_position
  s_('SortOptions|Manual')
end

#sort_title_relevantObject


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

def sort_title_relevant
  s_('SortOptions|Relevant')
end

#sort_title_sizeObject


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

def sort_title_size
  s_('SortOptions|Size')
end

#sort_title_starsObject


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

def sort_title_stars
  s_('SortOptions|Stars')
end

#sort_title_start_date_laterObject


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

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

#sort_title_start_date_soonObject


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

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

#sort_title_upvotesObject


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

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

#sort_value_access_level_ascObject

Values.


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

def sort_value_access_level_asc
  'access_level_asc'
end

#sort_value_access_level_descObject


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

def sort_value_access_level_desc
  'access_level_desc'
end

#sort_value_contacted_dateObject


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

def sort_value_contacted_date
  'contacted_asc'
end

#sort_value_created_dateObject


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

def sort_value_created_date
  'created_date'
end

#sort_value_downvotesObject


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

def sort_value_downvotes
  'downvotes_desc'
end

#sort_value_due_dateObject


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

def sort_value_due_date
  'due_date'
end

#sort_value_due_date_laterObject


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

def sort_value_due_date_later
  'due_date_desc'
end

#sort_value_due_date_soonObject


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

def sort_value_due_date_soon
  'due_date_asc'
end

#sort_value_expire_dateObject


605
606
607
# File 'app/helpers/sorting_helper.rb', line 605

def sort_value_expire_date
  'expired_asc'
end

#sort_value_label_priorityObject


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

def sort_value_label_priority
  'label_priority'
end

#sort_value_largest_groupObject


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

def sort_value_largest_group
  'storage_size_desc'
end

#sort_value_largest_repoObject


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

def sort_value_largest_repo
  'storage_size_desc'
end

#sort_value_last_joinedObject


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

def sort_value_last_joined
  'last_joined'
end

#sort_value_latest_activityObject


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

def sort_value_latest_activity
  'latest_activity_desc'
end

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

def sort_value_least_popular
  'popularity_asc'
end

#sort_value_milestoneObject


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

def sort_value_milestone
  'milestone'
end

#sort_value_milestone_laterObject


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

def sort_value_milestone_later
  'milestone_due_desc'
end

#sort_value_milestone_soonObject


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

def sort_value_milestone_soon
  'milestone_due_asc'
end

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

def sort_value_most_popular
  'popularity_desc'
end

#sort_value_nameObject


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

def sort_value_name
  'name_asc'
end

#sort_value_name_descObject


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

def sort_value_name_desc
  'name_desc'
end

#sort_value_oldest_activityObject


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

def sort_value_oldest_activity
  'latest_activity_asc'
end

#sort_value_oldest_createdObject


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

def sort_value_oldest_created
  'created_asc'
end

#sort_value_oldest_joinedObject


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

def sort_value_oldest_joined
  'oldest_joined'
end

#sort_value_oldest_last_activityObject


589
590
591
# File 'app/helpers/sorting_helper.rb', line 589

def sort_value_oldest_last_activity
  'last_activity_on_asc'
end

#sort_value_oldest_signinObject


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

def 
  'oldest_sign_in'
end

#sort_value_oldest_updatedObject


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

def sort_value_oldest_updated
  'updated_asc'
end

#sort_value_popularityObject


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

def sort_value_popularity
  'popularity'
end

#sort_value_priorityObject


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

def sort_value_priority
  'priority'
end

#sort_value_recently_createdObject


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

def sort_value_recently_created
  'created_desc'
end

#sort_value_recently_last_activityObject


593
594
595
# File 'app/helpers/sorting_helper.rb', line 593

def sort_value_recently_last_activity
  'last_activity_on_desc'
end

#sort_value_recently_signinObject


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

def 
  'recent_sign_in'
end

#sort_value_recently_updatedObject


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

def sort_value_recently_updated
  'updated_desc'
end

#sort_value_relative_positionObject


597
598
599
# File 'app/helpers/sorting_helper.rb', line 597

def sort_value_relative_position
  'relative_position'
end

#sort_value_relevantObject


609
610
611
# File 'app/helpers/sorting_helper.rb', line 609

def sort_value_relevant
  'relevant'
end

#sort_value_sizeObject


601
602
603
# File 'app/helpers/sorting_helper.rb', line 601

def sort_value_size
  'size_desc'
end

#sort_value_stars_ascObject


585
586
587
# File 'app/helpers/sorting_helper.rb', line 585

def sort_value_stars_asc
  'stars_asc'
end

#sort_value_stars_descObject


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

def sort_value_stars_desc
  'stars_desc'
end

#sort_value_start_date_laterObject


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

def sort_value_start_date_later
  'start_date_desc'
end

#sort_value_start_date_soonObject


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

def sort_value_start_date_soon
  'start_date_asc'
end

#sort_value_upvotesObject


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

def sort_value_upvotes
  'upvotes_desc'
end

#sortable_item(item, path, sorted_by) ⇒ Object


190
191
192
# File 'app/helpers/sorting_helper.rb', line 190

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

#starrers_sort_options_hashObject


181
182
183
184
185
186
187
188
# File 'app/helpers/sorting_helper.rb', line 181

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


104
105
106
107
108
# File 'app/helpers/sorting_helper.rb', line 104

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

#tags_sort_options_hashObject


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

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


167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'app/helpers/sorting_helper.rb', line 167

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